Added new_card function;

Added parameter to ScriptValue::next to recieve the key of the item.
Finished Add Multiple Cards behaviour.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1147 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-11 20:52:33 +00:00
parent ca63496ade
commit f1fe40b4ef
11 changed files with 139 additions and 33 deletions
+14 -8
View File
@@ -45,14 +45,11 @@ Image generateDisabledImage(const Image& imgIn) {
return imgOut;
}
// ----------------------------------------------------------------------------- : set_menu_item_image
// ----------------------------------------------------------------------------- : IconMenu
void IconMenu::Append(int id, const String& resource, const String& text, const String& help, int style, wxMenu* submenu) {
// create menu, load icon
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
Bitmap bitmap = load_resource_tool_image(resource);
void set_menu_item_image(wxMenuItem* item, const String& resource) {
// load bitmap
Bitmap bitmap = load_resource_tool_image(resource);
#ifdef __WXMSW__
// make greyed bitmap
bitmap = bitmap.GetSubBitmap(wxRect(0,0,16,16));
@@ -61,10 +58,19 @@ void IconMenu::Append(int id, const String& resource, const String& text, const
item->SetDisabledBitmap(disabledImage);
#else
// Check items can't have bitmaps :(
if (item->GetKind() == wxITEM_NORMAL)
if (item->GetKind() == wxITEM_NORMAL) {
item->SetBitmap(bitmap);
}
#endif
// add menu
}
// ----------------------------------------------------------------------------- : IconMenu
void IconMenu::Append(int id, const String& resource, const String& text, const String& help, int style, wxMenu* submenu) {
// create menu, load icon
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
set_menu_item_image(item, resource);
// add to menu
wxMenu::Append(item);
}