mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Eliminated most build errors (gcc,linux,wxGTK).
What is left is mostly:
- warning: converting double to int
-> add a cast/to_int or ignore
- wrong initialization order in ctor
-> just swap the order to match the class
- errors about wxCursors
-> add a function loadResourceCursor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@183 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+18
-9
@@ -47,15 +47,24 @@ Image generateDisabledImage(const Image& imgIn) {
|
||||
// ----------------------------------------------------------------------------- : IconMenu
|
||||
|
||||
void IconMenu::Append(int id, const String& resource, const String& text, const String& help, int style, wxMenu* submenu) {
|
||||
// load bitmap
|
||||
Bitmap bitmap(resource);
|
||||
bitmap = bitmap.GetSubBitmap(wxRect(0,0,16,16));
|
||||
Image disabledImage = generateDisabledImage(bitmap.ConvertToImage());
|
||||
// add menu item
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
|
||||
item->SetBitmaps(bitmap, bitmap);
|
||||
item->SetDisabledBitmap(disabledImage);
|
||||
wxMenu::Append(item);
|
||||
#ifdef __WXMSW__
|
||||
// load bitmap
|
||||
Bitmap bitmap(resource);
|
||||
bitmap = bitmap.GetSubBitmap(wxRect(0,0,16,16));
|
||||
Image disabledImage = generateDisabledImage(bitmap.ConvertToImage());
|
||||
// add menu item
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
|
||||
item->SetBitmaps(bitmap, bitmap);
|
||||
item->SetDisabledBitmap(disabledImage);
|
||||
wxMenu::Append(item);
|
||||
#else
|
||||
|
||||
// load bitmap
|
||||
|
||||
Bitmap bitmap = loadResourceImage(resource);
|
||||
// add menu
|
||||
wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu);
|
||||
item->SetBitmaps(bitmap);
|
||||
wxMenu::Append(item);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user