diff --git a/src/gui/about_window.cpp b/src/gui/about_window.cpp index c156a088..265a7e3b 100644 --- a/src/gui/about_window.cpp +++ b/src/gui/about_window.cpp @@ -15,11 +15,11 @@ AboutWindow::AboutWindow(Window* parent) : wxDialog(parent, wxID_ANY, _TITLE_("about"), wxDefaultPosition, wxSize(510,340), wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE) - , logo (load_resource_image(_("ABOUT"))) - , logo2(load_resource_image(_("TWO"))) + , logo (load_resource_image(_("about"))) + , logo2(load_resource_image(_("two"))) { // init controls - wxButton* ok_button = new HoverButton(this, wxID_OK, _("BTN_OK")); + wxButton* ok_button = new HoverButton(this, wxID_OK, _("btn_ok")); wxSize bs = ok_button->GetSize(), ws = GetClientSize(); ok_button->Move(ws.GetWidth() - bs.GetWidth(), ws.GetHeight() - bs.GetHeight()); // align bottom right } diff --git a/src/gui/control/card_editor.cpp b/src/gui/control/card_editor.cpp index ed4105a0..d0c8045f 100644 --- a/src/gui/control/card_editor.cpp +++ b/src/gui/control/card_editor.cpp @@ -261,9 +261,9 @@ void DataEditor::onChar(wxKeyEvent& ev) { void DataEditor::onContextMenu(wxContextMenuEvent& ev) { if (current_editor) { IconMenu m; - m.Append(wxID_CUT, _("TOOL_CUT"), _("Cu&t"), _("Move the selected text to the clipboard")); - m.Append(wxID_COPY, _("TOOL_COPY"), _("&Copy"), _("Place the selected text on the clipboard")); - m.Append(wxID_PASTE, _("TOOL_PASTE"), _("&Paste"), _("Inserts the text from the clipboard")); + m.Append(wxID_CUT, _("cut"), _("Cu&t"), _("Move the selected text to the clipboard")); + m.Append(wxID_COPY, _("copy"), _("&Copy"), _("Place the selected text on the clipboard")); + m.Append(wxID_PASTE, _("paste"), _("&Paste"), _("Inserts the text from the clipboard")); m.Enable(wxID_CUT, canCut()); m.Enable(wxID_COPY, canCopy()); m.Enable(wxID_PASTE, canPaste()); diff --git a/src/gui/control/card_list.cpp b/src/gui/control/card_list.cpp index b591f4fc..2339b6a2 100644 --- a/src/gui/control/card_list.cpp +++ b/src/gui/control/card_list.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -41,8 +42,8 @@ CardListBase::CardListBase(Window* parent, int id, long additional_style) { // create image list wxImageList* il = new wxImageList(18,14); - il->Add(Bitmap(_("SORT_ASC")), Color(255,0,255)); - il->Add(Bitmap(_("SORT_DESC")), Color(255,0,255)); + il->Add(load_resource_image(_("sort_asc")), Color(255,0,255)); + il->Add(load_resource_image(_("sort_desc")), Color(255,0,255)); AssignImageList(il, wxIMAGE_LIST_SMALL); } @@ -455,12 +456,12 @@ void CardListBase::onDrag(wxMouseEvent& ev) { void CardListBase::onContextMenu(wxContextMenuEvent&) { if (allowModify()) { IconMenu m; - m.Append(wxID_CUT, _("TOOL_CUT"), _("Cu&t"), _("Move the selected card to the clipboard")); - m.Append(wxID_COPY, _("TOOL_COPY"), _("&Copy"), _("Place the selected card on the clipboard")); - m.Append(wxID_PASTE, _("TOOL_PASTE"), _("&Paste"), _("Inserts the card from the clipboard")); + m.Append(wxID_CUT, _("cut"), _("Cu&t"), _("Move the selected card to the clipboard")); + m.Append(wxID_COPY, _("copy"), _("&Copy"), _("Place the selected card on the clipboard")); + m.Append(wxID_PASTE, _("paste"), _("&Paste"), _("Inserts the card from the clipboard")); m.AppendSeparator(); - m.Append(ID_CARD_ADD, _("TOOL_CARD_ADD"), _("&Add Card"), _("Add a new, blank, card to this set")); - m.Append(ID_CARD_REMOVE,_("TOOL_CARD_DEL"), _("&Remove Select Card"), _("Delete the selected card from this set")); + m.Append(ID_CARD_ADD, _("card_add"), _("&Add Card"), _("Add a new, blank, card to this set")); + m.Append(ID_CARD_REMOVE,_("card_del"), _("&Remove Select Card"), _("Delete the selected card from this set")); PopupMenu(&m); } } diff --git a/src/gui/control/select_card_list.cpp b/src/gui/control/select_card_list.cpp index 2c5b350a..466a9cd8 100644 --- a/src/gui/control/select_card_list.cpp +++ b/src/gui/control/select_card_list.cpp @@ -18,10 +18,10 @@ SelectCardList::SelectCardList(Window* parent, int id, long additional_style) { // create image list wxImageList* il = new wxImageList(15,15); - il->Add(Bitmap(_("SORT_ASC")), Color(255,0,255)); - il->Add(Bitmap(_("SORT_DESC")), Color(255,0,255)); - il->Add(load_resource_image(_("DESELECTED"))); - il->Add(load_resource_image(_("SELECTED"))); + il->Add(load_resource_image(_("sort_asc")), Color(255,0,255)); + il->Add(load_resource_image(_("sort_desc")), Color(255,0,255)); + il->Add(load_resource_image(_("deselected"))); + il->Add(load_resource_image(_("selected"))); AssignImageList(il, wxIMAGE_LIST_SMALL); } diff --git a/src/gui/icon_menu.cpp b/src/gui/icon_menu.cpp index 411d517f..629a99b1 100644 --- a/src/gui/icon_menu.cpp +++ b/src/gui/icon_menu.cpp @@ -48,26 +48,21 @@ Image generateDisabledImage(const Image& imgIn) { // ----------------------------------------------------------------------------- : 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); + // load bitmap #ifdef __WXMSW__ - // load bitmap - Bitmap bitmap(resource); + // make greyed bitmap 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 = load_resource_image(resource); - // add menu - wxMenuItem* item = new wxMenuItem(this, id, text, help, style, submenu); item->SetBitmap(bitmap); - wxMenu::Append(item); #endif + // add menu + wxMenu::Append(item); } void IconMenu::Append(int id, const String& text, const String& help) { diff --git a/src/gui/set/cards_panel.cpp b/src/gui/set/cards_panel.cpp index 15000bca..aea41d07 100644 --- a/src/gui/set/cards_panel.cpp +++ b/src/gui/set/cards_panel.cpp @@ -67,43 +67,43 @@ void CardsPanel::onChangeSet() { void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) { // Toolbar - tb->AddTool(ID_FORMAT_BOLD, _(""), Bitmap(_("TOOL_BOLD")), wxNullBitmap, wxITEM_CHECK, _TOOL_("bold")); - tb->AddTool(ID_FORMAT_ITALIC, _(""), Bitmap(_("TOOL_ITALIC")), wxNullBitmap, wxITEM_CHECK, _TOOL_("italic")); - tb->AddTool(ID_FORMAT_SYMBOL, _(""), Bitmap(_("TOOL_SYMBOL")), wxNullBitmap, wxITEM_CHECK, _TOOL_("symbols")); - tb->AddTool(ID_FORMAT_REMINDER, _(""), Bitmap(_("TOOL_REMINDER")), wxNullBitmap, wxITEM_CHECK, _TOOL_("reminder text")); + tb->AddTool(ID_FORMAT_BOLD, _(""), load_resource_tool_image(_("bold")), wxNullBitmap, wxITEM_CHECK, _TOOL_("bold")); + tb->AddTool(ID_FORMAT_ITALIC, _(""), load_resource_tool_image(_("italic")), wxNullBitmap, wxITEM_CHECK, _TOOL_("italic")); + tb->AddTool(ID_FORMAT_SYMBOL, _(""), load_resource_tool_image(_("symbol")), wxNullBitmap, wxITEM_CHECK, _TOOL_("symbols")); + tb->AddTool(ID_FORMAT_REMINDER, _(""), load_resource_tool_image(_("reminder")), wxNullBitmap, wxITEM_CHECK, _TOOL_("reminder text")); tb->AddSeparator(); - tb->AddTool(ID_CARD_ADD, _(""), Bitmap(_("TOOL_CARD_ADD")), wxNullBitmap, wxITEM_NORMAL,_TOOL_("add card")); - tb->AddTool(ID_CARD_REMOVE, _(""), Bitmap(_("TOOL_CARD_DEl")), wxNullBitmap, wxITEM_NORMAL,_TOOL_("remove card")); + tb->AddTool(ID_CARD_ADD, _(""), load_resource_tool_image(_("card_add")), wxNullBitmap, wxITEM_NORMAL,_TOOL_("add card")); + tb->AddTool(ID_CARD_REMOVE, _(""), load_resource_tool_image(_("card_del")), wxNullBitmap, wxITEM_NORMAL,_TOOL_("remove card")); tb->AddSeparator(); - tb->AddTool(ID_CARD_ROTATE, _(""), Bitmap(_("TOOL_CARD_ROTATE")),wxNullBitmap,wxITEM_NORMAL,_TOOL_("rotate card")); + tb->AddTool(ID_CARD_ROTATE, _(""), load_resource_tool_image(_("card_rotate")), wxNullBitmap,wxITEM_NORMAL,_TOOL_("rotate card")); tb->Realize(); // Menus IconMenu* menuCard = new IconMenu(); menuCard->Append(ID_CARD_PREV, _("Select &Previous Card\tPgUp"), _("Selects the previous card in the list")); menuCard->Append(ID_CARD_NEXT, _("Select &Next Card\tPgDn"), _("Selects the next card in the list")); menuCard->AppendSeparator(); - menuCard->Append(ID_CARD_ADD, _("TOOL_CARD_ADD"), _("&Add Card\tCtrl++"), _("Add a new, blank, card to this set")); - menuCard->Append(ID_CARD_ADD_MULT, _("TOOL_CARD_ADD_M"), _("Add &Multiple Cards..."), _("Add multiple cards to the set")); + menuCard->Append(ID_CARD_ADD, _("card_add"), _("&Add Card\tCtrl++"), _("Add a new, blank, card to this set")); + menuCard->Append(ID_CARD_ADD_MULT, _("card_add_multiple"), _("Add &Multiple Cards..."), _("Add multiple cards to the set")); // NOTE: space after "Del" prevents wx from making del an accellerator // otherwise we delete a card when delete is pressed inside the editor - menuCard->Append(ID_CARD_REMOVE, _("TOOL_CARD_DEL"), _("&Remove Select Card\tDel "), _("Delete the selected card from this set")); + menuCard->Append(ID_CARD_REMOVE, _("card_del"), _("&Remove Select Card\tDel "), _("Delete the selected card from this set")); menuCard->AppendSeparator(); IconMenu* menuRotate = new IconMenu(); - menuRotate->Append(ID_CARD_ROTATE_0, _("TOOL_CARD_ROTATE_0"), _("&Normal"), _("Display the card with the right side up"), wxITEM_CHECK); - menuRotate->Append(ID_CARD_ROTATE_270, _("TOOL_CARD_ROTATE_270"), _("Rotated 90 &Clockwise"), _("Display the card rotated clockwise"), wxITEM_CHECK); - menuRotate->Append(ID_CARD_ROTATE_90, _("TOOL_CARD_ROTATE_90"), _("Rotated 90 C&ounter Clockwise"), _("Display the card rotated counter-clockwise (anti-clockwise for the British)"), wxITEM_CHECK); - menuRotate->Append(ID_CARD_ROTATE_180, _("TOOL_CARD_ROTATE_180"), _("Rotated 180, &Up Side Down"), _("Display the card up side down"), wxITEM_CHECK); - menuCard->Append(wxID_ANY, _("TOOL_CARD_ROTATE"), _("&Orientation"), _("Orientation of the card display"), wxITEM_NORMAL, menuRotate); + menuRotate->Append(ID_CARD_ROTATE_0, _("card_rotate_0"), _("&Normal"), _("Display the card with the right side up"), wxITEM_CHECK); + menuRotate->Append(ID_CARD_ROTATE_270, _("card_rotate_270"), _("Rotated 90 &Clockwise"), _("Display the card rotated clockwise"), wxITEM_CHECK); + menuRotate->Append(ID_CARD_ROTATE_90, _("card_rotate_90"), _("Rotated 90 C&ounter Clockwise"), _("Display the card rotated counter-clockwise (anti-clockwise for the British)"), wxITEM_CHECK); + menuRotate->Append(ID_CARD_ROTATE_180, _("card_rotate_180"), _("Rotated 180, &Up Side Down"), _("Display the card up side down"), wxITEM_CHECK); + menuCard->Append(wxID_ANY, _("card_rotate"), _("&Orientation"), _("Orientation of the card display"), wxITEM_NORMAL, menuRotate); menuCard->AppendSeparator(); // This probably belongs in the window menu, but there we can't remove the separator once it is added - menuCard->Append(ID_SELECT_COLUMNS, _("C&ard List Columns..."), _("Select what columns should be shown and in what order.")); + menuCard->Append(ID_SELECT_COLUMNS, _("C&ard List Columns..."), _("Select what columns should be shown and in what order.")); mb->Insert(2, menuCard, _("&Cards")); IconMenu* menuFormat = new IconMenu(); - menuFormat->Append(ID_FORMAT_BOLD, _("TOOL_BOLD"), _("Bold\tCtrl+B"), _("Makes the selected text bold"), wxITEM_CHECK); - menuFormat->Append(ID_FORMAT_ITALIC, _("TOOL_ITALIC"), _("Italic\tCtrl+I"), _("Makes the selected text italic"), wxITEM_CHECK); - menuFormat->Append(ID_FORMAT_SYMBOL, _("TOOL_SYMBOL"), _("Symbols\tCtrl+M"), _("Draws the selected text with symbols"), wxITEM_CHECK); - menuFormat->Append(ID_FORMAT_REMINDER, _("TOOL_REMINDER"), _("Reminder Text\tCtrl+R"), _("Show reminder text for the selected keyword"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_BOLD, _("bold"), _("Bold\tCtrl+B"), _("Makes the selected text bold"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_ITALIC, _("italic"), _("Italic\tCtrl+I"), _("Makes the selected text italic"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_SYMBOL, _("symbol"), _("Symbols\tCtrl+M"), _("Draws the selected text with symbols"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_REMINDER, _("reminder"), _("Reminder Text\tCtrl+R"), _("Show reminder text for the selected keyword"), wxITEM_CHECK); mb->Insert(3, menuFormat, _("&Format")); } diff --git a/src/gui/set/set_info_panel.cpp b/src/gui/set/set_info_panel.cpp index 0c7ba057..5a4096c3 100644 --- a/src/gui/set/set_info_panel.cpp +++ b/src/gui/set/set_info_panel.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include // ----------------------------------------------------------------------------- : SetInfoPanel @@ -33,16 +34,16 @@ void SetInfoPanel::onChangeSet() { void SetInfoPanel::initUI(wxToolBar* tb, wxMenuBar* mb) { // Toolbar - tb->AddTool(ID_FORMAT_BOLD, _(""), Bitmap(_("TOOL_BOLD")), wxNullBitmap, wxITEM_CHECK, _("Bold")); - tb->AddTool(ID_FORMAT_ITALIC, _(""), Bitmap(_("TOOL_ITALIC")), wxNullBitmap, wxITEM_CHECK, _("Italic")); - tb->AddTool(ID_FORMAT_SYMBOL, _(""), Bitmap(_("TOOL_SYMBOL")), wxNullBitmap, wxITEM_CHECK, _("Symbols")); + tb->AddTool(ID_FORMAT_BOLD, _(""), load_resource_tool_image(_("bold")), wxNullBitmap, wxITEM_CHECK, _("Bold")); + tb->AddTool(ID_FORMAT_ITALIC, _(""), load_resource_tool_image(_("italic")), wxNullBitmap, wxITEM_CHECK, _("Italic")); + tb->AddTool(ID_FORMAT_SYMBOL, _(""), load_resource_tool_image(_("symbol")), wxNullBitmap, wxITEM_CHECK, _("Symbols")); tb->Realize(); // Menus IconMenu* menuFormat = new IconMenu(); - menuFormat->Append(ID_FORMAT_BOLD, _("TOOL_BOLD"), _("Bold\tCtrl+B"), _("Makes the selected text bold"), wxITEM_CHECK); - menuFormat->Append(ID_FORMAT_ITALIC, _("TOOL_ITALIC"), _("Italic\tCtrl+I"), _("Makes the selected text italic"), wxITEM_CHECK); - menuFormat->Append(ID_FORMAT_SYMBOL, _("TOOL_SYMBOL"), _("Symbols\tCtrl+M"), _("Draws the selected text with symbols"), wxITEM_CHECK); - menuFormat->Append(ID_FORMAT_REMINDER, _("TOOL_REMINDER"), _("Reminder Text\tCtrl+R"), _("Show reminder text for the selected keyword"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_BOLD, _("bold"), _("Bold\tCtrl+B"), _("Makes the selected text bold"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_ITALIC, _("italic"), _("Italic\tCtrl+I"), _("Makes the selected text italic"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_SYMBOL, _("symbol"), _("Symbols\tCtrl+M"), _("Draws the selected text with symbols"), wxITEM_CHECK); + menuFormat->Append(ID_FORMAT_REMINDER, _("reminder"), _("Reminder Text\tCtrl+R"), _("Show reminder text for the selected keyword"), wxITEM_CHECK); mb->Insert(2, menuFormat, _("&Format")); } diff --git a/src/gui/set/window.cpp b/src/gui/set/window.cpp index 34c7de37..d38eea9b 100644 --- a/src/gui/set/window.cpp +++ b/src/gui/set/window.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -42,57 +43,57 @@ SetWindow::SetWindow(Window* parent, const SetP& set) , find_dialog(nullptr) , number_of_recent_sets(0) { - SetIcon(wxIcon(_("ICON_APP"))); + SetIcon(load_resource_icon(_("app"))); // initialize menu bar wxMenuBar* menuBar = new wxMenuBar(); IconMenu* menuFile = new IconMenu(); - menuFile->Append(ID_FILE_NEW, _("TOOL_NEW"), _MENU_("new set"), _HELP_("new set")); - menuFile->Append(ID_FILE_OPEN, _("TOOL_OPEN"), _MENU_("open set"), _HELP_("open set")); - menuFile->Append(ID_FILE_SAVE, _("TOOL_SAVE"), _MENU_("save set"), _HELP_("save set")); - menuFile->Append(ID_FILE_SAVE_AS, _MENU_("save set as"), _HELP_("save set as")); + menuFile->Append(ID_FILE_NEW, _("new"), _MENU_("new set"), _HELP_("new set")); + menuFile->Append(ID_FILE_OPEN, _("open"), _MENU_("open set"), _HELP_("open set")); + menuFile->Append(ID_FILE_SAVE, _("save"), _MENU_("save set"), _HELP_("save set")); + menuFile->Append(ID_FILE_SAVE_AS, _MENU_("save set as"), _HELP_("save set as")); IconMenu* menuExport = new IconMenu(); - menuExport->Append(ID_FILE_EXPORT_HTML, _("&HTML..."), _("Export the set to a HTML file")); - menuExport->Append(ID_FILE_EXPORT_IMAGE, _("Card &Image..."), _("Export the selected card to an image file")); - menuExport->Append(ID_FILE_EXPORT_IMAGES, _("All Card I&mages..."), _("Export images for all cards")); - menuExport->Append(ID_FILE_EXPORT_APPR, _("&Apprentice..."), _("Export the set so it can be played with in Apprentice")); - menuExport->Append(ID_FILE_EXPORT_MWS, _("Magic &Workstation..."), _("Export the set so it can be played with in Magic Workstation")); - menuFile->Append(ID_FILE_EXPORT, _MENU_("export"), _("Export the set..."), menuExport); + menuExport->Append(ID_FILE_EXPORT_HTML, _("&HTML..."), _("Export the set to a HTML file")); + menuExport->Append(ID_FILE_EXPORT_IMAGE, _("Card &Image..."), _("Export the selected card to an image file")); + menuExport->Append(ID_FILE_EXPORT_IMAGES, _("All Card I&mages..."), _("Export images for all cards")); + menuExport->Append(ID_FILE_EXPORT_APPR, _("&Apprentice..."), _("Export the set so it can be played with in Apprentice")); + menuExport->Append(ID_FILE_EXPORT_MWS, _("Magic &Workstation..."), _("Export the set so it can be played with in Magic Workstation")); + menuFile->Append(ID_FILE_EXPORT, _MENU_("export"), _("Export the set..."), menuExport); menuFile->AppendSeparator(); - menuFile->Append(ID_FILE_INSPECT, _("Inspect Internal Data..."), _("Shows a the data in the set using a tree structure")); + menuFile->Append(ID_FILE_INSPECT, _("Inspect Internal Data..."), _("Shows a the data in the set using a tree structure")); menuFile->AppendSeparator(); - menuFile->Append(ID_FILE_PRINT_PREVIEW, _MENU_("print preview"), _HELP_("print preview")); - menuFile->Append(ID_FILE_PRINT, _MENU_("print"), _HELP_("print")); + menuFile->Append(ID_FILE_PRINT_PREVIEW, _MENU_("print preview"), _HELP_("print preview")); + menuFile->Append(ID_FILE_PRINT, _MENU_("print"), _HELP_("print")); menuFile->AppendSeparator(); // recent files go here menuFile->AppendSeparator(); - menuFile->Append(ID_FILE_EXIT, _MENU_("exit"), _HELP_("exit")); + menuFile->Append(ID_FILE_EXIT, _MENU_("exit"), _HELP_("exit")); menuBar->Append(menuFile, _MENU_("file")); IconMenu* menuEdit = new IconMenu(); - menuEdit->Append(ID_EDIT_UNDO, _("TOOL_UNDO"), _MENU_1_("undo",wxEmptyString), _HELP_("undo")); - menuEdit->Append(ID_EDIT_REDO, _("TOOL_REDO"), _MENU_1_("redo",wxEmptyString), _HELP_("redo")); + menuEdit->Append(ID_EDIT_UNDO, _("undo"), _MENU_1_("undo",wxEmptyString), _HELP_("undo")); + menuEdit->Append(ID_EDIT_REDO, _("redo"), _MENU_1_("redo",wxEmptyString), _HELP_("redo")); menuEdit->AppendSeparator(); - menuEdit->Append(ID_EDIT_CUT, _("TOOL_CUT"), _MENU_("cut"), _HELP_("cut")); - menuEdit->Append(ID_EDIT_COPY, _("TOOL_COPY"), _MENU_("copy"), _HELP_("copy")); - menuEdit->Append(ID_EDIT_PASTE, _("TOOL_PASTE"), _MENU_("paste"), _HELP_("paste")); + menuEdit->Append(ID_EDIT_CUT, _("cut"), _MENU_("cut"), _HELP_("cut")); + menuEdit->Append(ID_EDIT_COPY, _("copy"), _MENU_("copy"), _HELP_("copy")); + menuEdit->Append(ID_EDIT_PASTE, _("paste"), _MENU_("paste"), _HELP_("paste")); menuEdit->AppendSeparator(); - menuEdit->Append(ID_EDIT_FIND, _("TOOL_FIND"), _MENU_("find"), _("")); - menuEdit->Append(ID_EDIT_FIND_NEXT, _MENU_("find next"), _("")); - menuEdit->Append(ID_EDIT_REPLACE, _MENU_("replace"), _("")); + menuEdit->Append(ID_EDIT_FIND, _("find"), _MENU_("find"), _("")); + menuEdit->Append(ID_EDIT_FIND_NEXT, _MENU_("find next"), _("")); + menuEdit->Append(ID_EDIT_REPLACE, _MENU_("replace"), _("")); menuEdit->AppendSeparator(); - menuEdit->Append(ID_EDIT_PREFERENCES, _MENU_("preferences"), _HELP_("preferences")); + menuEdit->Append(ID_EDIT_PREFERENCES, _MENU_("preferences"), _HELP_("preferences")); menuBar->Append(menuEdit, _MENU_("edit")); IconMenu* menuWindow = new IconMenu(); - menuWindow->Append(ID_WINDOW_NEW, _MENU_("new window"), _HELP_("new window")); + menuWindow->Append(ID_WINDOW_NEW, _MENU_("new window"), _HELP_("new window")); menuWindow->AppendSeparator(); menuBar->Append(menuWindow, _MENU_("window")); IconMenu* menuHelp = new IconMenu(); - menuHelp->Append(ID_HELP_INDEX, _("TOOL_HELP"), _("&Index..\tF1"), _("")); + menuHelp->Append(ID_HELP_INDEX, _("help"), _("&Index..\tF1"), _("")); menuHelp->AppendSeparator(); - menuHelp->Append(ID_HELP_ABOUT, _MENU_("about"), _("")); + menuHelp->Append(ID_HELP_ABOUT, _MENU_("about"), _("")); menuBar->Append(menuHelp, _MENU_("help")); SetMenuBar(menuBar); @@ -104,16 +105,16 @@ SetWindow::SetWindow(Window* parent, const SetP& set) // tool bar wxToolBar* tb = CreateToolBar(wxTB_FLAT | wxNO_BORDER | wxTB_HORIZONTAL); tb->SetToolBitmapSize(wxSize(18,18)); - tb->AddTool(ID_FILE_NEW, _(""), Bitmap(_("TOOL_NEW")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("new set"), _HELP_("new set")); - tb->AddTool(ID_FILE_OPEN, _(""), Bitmap(_("TOOL_OPEN")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("open set"), _HELP_("open set")); - tb->AddTool(ID_FILE_SAVE, _(""), Bitmap(_("TOOL_SAVE")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("save set"), _HELP_("save set")); + tb->AddTool(ID_FILE_NEW, _(""), load_resource_tool_image(_("new")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("new set"), _HELP_("new set")); + tb->AddTool(ID_FILE_OPEN, _(""), load_resource_tool_image(_("open")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("open set"), _HELP_("open set")); + tb->AddTool(ID_FILE_SAVE, _(""), load_resource_tool_image(_("save")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("save set"), _HELP_("save set")); tb->AddSeparator(); - tb->AddTool(ID_EDIT_CUT, _(""), Bitmap(_("TOOL_CUT")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("cut")); - tb->AddTool(ID_EDIT_COPY, _(""), Bitmap(_("TOOL_COPY")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("copy")); - tb->AddTool(ID_EDIT_PASTE, _(""), Bitmap(_("TOOL_PASTE")),wxNullBitmap, wxITEM_NORMAL, _TOOL_("paste")); + tb->AddTool(ID_EDIT_CUT, _(""), load_resource_tool_image(_("cut")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("cut")); + tb->AddTool(ID_EDIT_COPY, _(""), load_resource_tool_image(_("copy")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("copy")); + tb->AddTool(ID_EDIT_PASTE, _(""), load_resource_tool_image(_("paste")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("paste")); tb->AddSeparator(); - tb->AddTool(ID_EDIT_UNDO, _(""), Bitmap(_("TOOL_UNDO")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("undo",wxEmptyString)); - tb->AddTool(ID_EDIT_REDO, _(""), Bitmap(_("TOOL_REDO")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("redo",wxEmptyString)); + tb->AddTool(ID_EDIT_UNDO, _(""), load_resource_tool_image(_("undo")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("undo",wxEmptyString)); + tb->AddTool(ID_EDIT_REDO, _(""), load_resource_tool_image(_("redo")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("redo",wxEmptyString)); tb->AddSeparator(); tb->Realize(); diff --git a/src/gui/symbol/basic_shape_editor.cpp b/src/gui/symbol/basic_shape_editor.cpp index 3cd47554..09d73481 100644 --- a/src/gui/symbol/basic_shape_editor.cpp +++ b/src/gui/symbol/basic_shape_editor.cpp @@ -7,6 +7,7 @@ // ----------------------------------------------------------------------------- : Includes #include +#include #include #include #include @@ -37,10 +38,10 @@ void SymbolBasicShapeEditor::initUI(wxToolBar* tb, wxMenuBar* mb) { sidesL = new wxStaticText(tb, ID_SIDES, _(" sides: ")); sides->SetSize(50, -1); tb->AddSeparator(); - tb->AddTool(ID_SHAPE_CIRCLE, _("Ellipse"), Bitmap(_("TOOL_CIRCLE")), wxNullBitmap, wxITEM_CHECK, _("Circle / Ellipse"), _("Draw circles and ellipses")); - tb->AddTool(ID_SHAPE_RECTANGLE, _("Rectangle"), Bitmap(_("TOOL_RECTANGLE")), wxNullBitmap, wxITEM_CHECK, _("Square / Rectangle"), _("Draw squares and rectangles")); - tb->AddTool(ID_SHAPE_POLYGON, _("Polygon"), Bitmap(_("TOOL_TRIANGLE")), wxNullBitmap, wxITEM_CHECK, _("Polygon"), _("Draw triangles, pentagons and other regular polygons")); - tb->AddTool(ID_SHAPE_STAR, _("Star"), Bitmap(_("TOOL_STAR")), wxNullBitmap, wxITEM_CHECK, _("Star"), _("Draw stars")); + tb->AddTool(ID_SHAPE_CIRCLE, _("Ellipse"), load_resource_tool_image(_("circle")), wxNullBitmap, wxITEM_CHECK, _("Circle / Ellipse"), _("Draw circles and ellipses")); + tb->AddTool(ID_SHAPE_RECTANGLE, _("Rectangle"), load_resource_tool_image(_("rectangle")), wxNullBitmap, wxITEM_CHECK, _("Square / Rectangle"), _("Draw squares and rectangles")); + tb->AddTool(ID_SHAPE_POLYGON, _("Polygon"), load_resource_tool_image(_("triangle")), wxNullBitmap, wxITEM_CHECK, _("Polygon"), _("Draw triangles, pentagons and other regular polygons")); + tb->AddTool(ID_SHAPE_STAR, _("Star"), load_resource_tool_image(_("star")), wxNullBitmap, wxITEM_CHECK, _("Star"), _("Draw stars")); tb->AddControl(sidesL); tb->AddControl(sides); tb->Realize(); diff --git a/src/gui/symbol/part_list.cpp b/src/gui/symbol/part_list.cpp index d4b471fb..e19e602f 100644 --- a/src/gui/symbol/part_list.cpp +++ b/src/gui/symbol/part_list.cpp @@ -20,12 +20,12 @@ SymbolPartList::SymbolPartList(Window* parent, int id, SymbolP symbol) // Create image list wxImageList* images = new wxImageList(16,16); // NOTE: this is based on the order of the SymbolPartCombine enum! - images->Add(load_resource_image(_("COMBINE_OR"))); - images->Add(load_resource_image(_("COMBINE_SUB"))); - images->Add(load_resource_image(_("COMBINE_AND"))); - images->Add(load_resource_image(_("COMBINE_XOR"))); - images->Add(load_resource_image(_("COMBINE_OVER"))); - images->Add(load_resource_image(_("COMBINE_BORDER"))); + images->Add(load_resource_image(_("combine_or"))); + images->Add(load_resource_image(_("combine_sub"))); + images->Add(load_resource_image(_("combine_and"))); + images->Add(load_resource_image(_("combine_xor"))); + images->Add(load_resource_image(_("combine_over"))); + images->Add(load_resource_image(_("combine_border"))); AssignImageList(images, wxIMAGE_LIST_SMALL); // create columns InsertColumn(0, _("Name")); diff --git a/src/gui/symbol/point_editor.cpp b/src/gui/symbol/point_editor.cpp index 1713265e..a860f3d7 100644 --- a/src/gui/symbol/point_editor.cpp +++ b/src/gui/symbol/point_editor.cpp @@ -154,12 +154,12 @@ wxPen SymbolPointEditor::handlePen(WhichPen p, LockMode lock) { void SymbolPointEditor::initUI(wxToolBar* tb, wxMenuBar* mb) { // Initialize toolbar tb->AddSeparator(); - tb->AddTool(ID_SEGMENT_LINE, _("Line"), Bitmap(_("TOOL_LINE")), wxNullBitmap, wxITEM_CHECK, _("To straigt line"), _("Makes the selected line straight")); - tb->AddTool(ID_SEGMENT_CURVE, _("Curve"), Bitmap(_("TOOL_CURVE")), wxNullBitmap, wxITEM_CHECK, _("To curve"), _("Makes the selected line curved")); + tb->AddTool(ID_SEGMENT_LINE, _("Line"), load_resource_tool_image(_("line")), wxNullBitmap, wxITEM_CHECK, _("To straigt line"), _("Makes the selected line straight")); + tb->AddTool(ID_SEGMENT_CURVE, _("Curve"), load_resource_tool_image(_("curve")), wxNullBitmap, wxITEM_CHECK, _("To curve"), _("Makes the selected line curved")); tb->AddSeparator(); - tb->AddTool(ID_LOCK_FREE, _("Free"), Bitmap(_("TOOL_LOCK_FREE")), wxNullBitmap, wxITEM_CHECK, _("Unlock node"), _("Allows the two control points on the node to be moved freely")); - tb->AddTool(ID_LOCK_DIR, _("Smooth"), Bitmap(_("TOOL_LOCK_DIR")), wxNullBitmap, wxITEM_CHECK, _("Make node smooth"), _("Makes the selected node smooth by placing the two control points opposite each other")); - tb->AddTool(ID_LOCK_SIZE, _("Symmetric"), Bitmap(_("TOOL_LOCK_SIZE")), wxNullBitmap, wxITEM_CHECK, _("Make node symmetric"), _("Makes the selected node symetric")); + tb->AddTool(ID_LOCK_FREE, _("Free"), load_resource_tool_image(_("lock_free")), wxNullBitmap, wxITEM_CHECK, _("Unlock node"), _("Allows the two control points on the node to be moved freely")); + tb->AddTool(ID_LOCK_DIR, _("Smooth"), load_resource_tool_image(_("lock_dir")), wxNullBitmap, wxITEM_CHECK, _("Make node smooth"), _("Makes the selected node smooth by placing the two control points opposite each other")); + tb->AddTool(ID_LOCK_SIZE, _("Symmetric"), load_resource_tool_image(_("lock_size")), wxNullBitmap, wxITEM_CHECK, _("Make node symmetric"), _("Makes the selected node symetric")); tb->Realize(); // TODO : menu bar //mb->Insert(2, curveMenu, _("&Curve")) diff --git a/src/gui/symbol/select_editor.cpp b/src/gui/symbol/select_editor.cpp index 836e19b1..da37578c 100644 --- a/src/gui/symbol/select_editor.cpp +++ b/src/gui/symbol/select_editor.cpp @@ -25,15 +25,15 @@ SymbolSelectEditor::SymbolSelectEditor(SymbolControl* control, bool rotate) , cursorShearY(load_resource_cursor(_("shear_y"))) { // Load resource images - Image rot = load_resource_image(_("HANDLE_ROTATE")); + Image rot = load_resource_image(_("handle_rotate")); handleRotateTL = wxBitmap(rot); handleRotateTR = wxBitmap(rotate_image(rot,90)); handleRotateBR = wxBitmap(rotate_image(rot,180)); handleRotateBL = wxBitmap(rotate_image(rot,270)); - Image shear = load_resource_image(_("HANDLE_SHEAR_X")); + Image shear = load_resource_image(_("handle_shear_x")); handleShearX = wxBitmap(shear); handleShearY = wxBitmap(rotate_image(shear,90)); - handleCenter = wxBitmap(load_resource_image(_("HANDLE_CENTER"))); + handleCenter = wxBitmap(load_resource_image(_("handle_center"))); // Make sure all parts have updated bounds FOR_EACH(p, getSymbol()->parts) { p->calculateBounds(); @@ -107,12 +107,12 @@ void SymbolSelectEditor::drawRotationCenter(DC& dc, const Vector2D& pos) { void SymbolSelectEditor::initUI(wxToolBar* tb, wxMenuBar* mb) { tb->AddSeparator(); - tb->AddTool(ID_PART_MERGE, _("Merge"), load_resource_image(_("COMBINE_OR")), wxNullBitmap, wxITEM_CHECK, _("Merge with shapes below"), _("Merges this shape with those below it")); - tb->AddTool(ID_PART_SUBTRACT, _("Subtract"), load_resource_image(_("COMBINE_SUB_DARK")), wxNullBitmap, wxITEM_CHECK, _("Subtract from shapes below"), _("Subtracts this shape from shapes below it, leaves only the area in that shape that is not in this shape")); - tb->AddTool(ID_PART_INTERSECTION, _("Intersect"), load_resource_image(_("COMBINE_AND_DARK")), wxNullBitmap, wxITEM_CHECK, _("Intersect with shapes below"), _("Intersects this shape with shapes below it, leaves only the area in both shapes")); + tb->AddTool(ID_PART_MERGE, _("Merge"), load_resource_image(_("combine_or")), wxNullBitmap, wxITEM_CHECK, _("Merge with shapes below"), _("Merges this shape with those below it")); + tb->AddTool(ID_PART_SUBTRACT, _("Subtract"), load_resource_image(_("combine_sub_dark")), wxNullBitmap, wxITEM_CHECK, _("Subtract from shapes below"), _("Subtracts this shape from shapes below it, leaves only the area in that shape that is not in this shape")); + tb->AddTool(ID_PART_INTERSECTION, _("Intersect"), load_resource_image(_("combine_and_dark")), wxNullBitmap, wxITEM_CHECK, _("Intersect with shapes below"), _("Intersects this shape with shapes below it, leaves only the area in both shapes")); // note: difference doesn't work (yet) - tb->AddTool(ID_PART_OVERLAP, _("Overlap"), load_resource_image(_("COMBINE_OVER")), wxNullBitmap, wxITEM_CHECK, _("Place above other shapes"), _("Place this shape, and its border above shapes below it")); - tb->AddTool(ID_PART_BORDER, _("Border"), load_resource_image(_("COMBINE_BORDER")), wxNullBitmap, wxITEM_CHECK, _("Draw as a border"), _("Draws this shape as a border")); + tb->AddTool(ID_PART_OVERLAP, _("Overlap"), load_resource_image(_("combine_over")), wxNullBitmap, wxITEM_CHECK, _("Place above other shapes"), _("Place this shape, and its border above shapes below it")); + tb->AddTool(ID_PART_BORDER, _("Border"), load_resource_image(_("combine_border")), wxNullBitmap, wxITEM_CHECK, _("Draw as a border"), _("Draws this shape as a border")); tb->Realize(); } void SymbolSelectEditor::destroyUI(wxToolBar* tb, wxMenuBar* mb) { diff --git a/src/gui/symbol/window.cpp b/src/gui/symbol/window.cpp index 93436c6a..dc7d86d2 100644 --- a/src/gui/symbol/window.cpp +++ b/src/gui/symbol/window.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -57,29 +58,29 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) { // Menu bar wxMenuBar* menuBar = new wxMenuBar(); IconMenu* menuFile = new IconMenu(); - menuFile->Append(ID_FILE_NEW, _("TOOL_NEW"), _MENU_("new symbol"), _HELP_("new symbol")); - menuFile->Append(ID_FILE_OPEN, _("TOOL_OPEN"), _MENU_("open symbol"), _HELP_("open symbol")); - menuFile->Append(ID_FILE_SAVE, _("TOOL_SAVE"), _MENU_("save symbol"), _HELP_("save symbol")); - menuFile->Append(ID_FILE_SAVE_AS, _MENU_("save symbol as"), _HELP_("save symbol as")); + menuFile->Append(ID_FILE_NEW, _("new"), _MENU_("new symbol"), _HELP_("new symbol")); + menuFile->Append(ID_FILE_OPEN, _("open"), _MENU_("open symbol"), _HELP_("open symbol")); + menuFile->Append(ID_FILE_SAVE, _("save"), _MENU_("save symbol"), _HELP_("save symbol")); + menuFile->Append(ID_FILE_SAVE_AS, _MENU_("save symbol as"), _HELP_("save symbol as")); menuFile->AppendSeparator(); - menuFile->Append(ID_FILE_STORE, _("TOOL_APPLY"), _MENU_("store symbol"), _HELP_("store symbol")); + menuFile->Append(ID_FILE_STORE, _("apply"), _MENU_("store symbol"), _HELP_("store symbol")); menuFile->AppendSeparator(); - menuFile->Append(ID_FILE_EXIT, _MENU_("close symbol editor"), _HELP_("close symbol editor")); + menuFile->Append(ID_FILE_EXIT, _MENU_("close symbol editor"), _HELP_("close symbol editor")); menuBar->Append(menuFile, _MENU_("file")); IconMenu* menuEdit = new IconMenu(); - menuEdit->Append(ID_EDIT_UNDO, _("TOOL_UNDO"), _MENU_1_("undo",wxEmptyString), _HELP_("undo")); - menuEdit->Append(ID_EDIT_REDO, _("TOOL_REDO"), _MENU_1_("redo",wxEmptyString), _HELP_("redo")); + menuEdit->Append(ID_EDIT_UNDO, _("undo"), _MENU_1_("undo",wxEmptyString), _HELP_("undo")); + menuEdit->Append(ID_EDIT_REDO, _("redo"), _MENU_1_("redo",wxEmptyString), _HELP_("redo")); menuEdit->AppendSeparator(); - menuEdit->Append(ID_EDIT_DUPLICATE, _("TOOL_DUPLICATE"), _MENU_("duplicate"), _HELP_("duplicate")); + menuEdit->Append(ID_EDIT_DUPLICATE, _("duplicate"), _MENU_("duplicate"), _HELP_("duplicate")); menuBar->Append(menuEdit, _MENU_("edit")); IconMenu* menuTool = new IconMenu(); - menuTool->Append(ID_MODE_SELECT, _("TOOL_MODE_SELECT"), _MENU_("select"), _HELP_("select"), wxITEM_CHECK); - menuTool->Append(ID_MODE_ROTATE, _("TOOL_MODE_ROTATE"), _MENU_("rotate"), _HELP_("rotate"), wxITEM_CHECK); - menuTool->Append(ID_MODE_POINTS, _("TOOL_MODE_CURVE"), _MENU_("points"), _HELP_("points"), wxITEM_CHECK); - menuTool->Append(ID_MODE_SHAPES, _("TOOL_CIRCLE"), _MENU_("basic shapes"), _HELP_("basic shapes"), wxITEM_CHECK); - menuTool->Append(ID_MODE_PAINT, _("TOOL_MODE_PAINT"), _MENU_("paint"), _HELP_("paint"), wxITEM_CHECK); + menuTool->Append(ID_MODE_SELECT, _("mode_select"), _MENU_("select"), _HELP_("select"), wxITEM_CHECK); + menuTool->Append(ID_MODE_ROTATE, _("mode_rotate"), _MENU_("rotate"), _HELP_("rotate"), wxITEM_CHECK); + menuTool->Append(ID_MODE_POINTS, _("mode_curve"), _MENU_("points"), _HELP_("points"), wxITEM_CHECK); + menuTool->Append(ID_MODE_SHAPES, _("circle"), _MENU_("basic shapes"), _HELP_("basic shapes"), wxITEM_CHECK); + menuTool->Append(ID_MODE_PAINT, _("mode_paint"), _MENU_("paint"), _HELP_("paint"), wxITEM_CHECK); menuBar->Append(menuTool, _MENU_("tool")); SetMenuBar(menuBar); @@ -90,23 +91,23 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) { // Toolbar wxToolBar* tb = CreateToolBar(wxTB_FLAT | wxNO_BORDER | wxTB_HORIZONTAL | wxTB_TEXT); - tb->AddTool(ID_FILE_STORE, _("Store"), Bitmap(_("TOOL_APPLY")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("store symbol"), _HELP_("store symbol")); + tb->AddTool(ID_FILE_STORE, _("Store"), load_resource_tool_image(_("apply")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("store symbol"), _HELP_("store symbol")); tb->AddSeparator(); - tb->AddTool(ID_EDIT_UNDO, _("Undo"), Bitmap(_("TOOL_UNDO")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("undo",wxEmptyString)); - tb->AddTool(ID_EDIT_REDO, _("Redo"), Bitmap(_("TOOL_REDO")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("redo",wxEmptyString)); + tb->AddTool(ID_EDIT_UNDO, _("Undo"), load_resource_tool_image(_("undo")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("undo",wxEmptyString)); + tb->AddTool(ID_EDIT_REDO, _("Redo"), load_resource_tool_image(_("redo")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("redo",wxEmptyString)); tb->Realize(); // Edit mode toolbar wxPanel* emp = new wxPanel(this, wxID_ANY); wxToolBar* em = new wxToolBar(emp, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_VERTICAL | wxTB_TEXT | wxTB_HORZ_LAYOUT); - em->AddTool(ID_MODE_SELECT,_("Select"), Bitmap(_("TOOL_MODE_SELECT")), wxNullBitmap, wxITEM_CHECK, _TOOL_("select"), _HELP_("select")); - em->AddTool(ID_MODE_ROTATE,_("Rotate"), Bitmap(_("TOOL_MODE_ROTATE")), wxNullBitmap, wxITEM_CHECK, _TOOL_("rotate"), _HELP_("rotate")); + em->AddTool(ID_MODE_SELECT,_("Select"), load_resource_tool_image(_("mode_select")), wxNullBitmap, wxITEM_CHECK, _TOOL_("select"), _HELP_("select")); + em->AddTool(ID_MODE_ROTATE,_("Rotate"), load_resource_tool_image(_("mode_rotate")), wxNullBitmap, wxITEM_CHECK, _TOOL_("rotate"), _HELP_("rotate")); em->AddSeparator(); - em->AddTool(ID_MODE_POINTS,_("Points"), Bitmap(_("TOOL_MODE_CURVE")), wxNullBitmap, wxITEM_CHECK, _TOOL_("points"), _HELP_("points")); + em->AddTool(ID_MODE_POINTS,_("Points"), load_resource_tool_image(_("mode_curve")), wxNullBitmap, wxITEM_CHECK, _TOOL_("points"), _HELP_("points")); em->AddSeparator(); - em->AddTool(ID_MODE_SHAPES,_("Basic Shapes"), Bitmap(_("TOOL_CIRCLE")), wxNullBitmap, wxITEM_CHECK, _TOOL_("basic shapes"), _HELP_("basic shapes")); + em->AddTool(ID_MODE_SHAPES,_("Basic Shapes"), load_resource_tool_image(_("circle")), wxNullBitmap, wxITEM_CHECK, _TOOL_("basic shapes"), _HELP_("basic shapes")); em->AddSeparator(); - em->AddTool(ID_MODE_PAINT, _("Paint"), Bitmap(_("TOOL_MODE_PAINT")), wxNullBitmap, wxITEM_CHECK, _TOOL_("paint"), _HELP_("paint")); + em->AddTool(ID_MODE_PAINT, _("Paint"), load_resource_tool_image(_("mode_paint")), wxNullBitmap, wxITEM_CHECK, _TOOL_("paint"), _HELP_("paint")); em->AddSeparator(); em->Realize(); diff --git a/src/gui/util.cpp b/src/gui/util.cpp index 01d1aa06..64ce7e62 100644 --- a/src/gui/util.cpp +++ b/src/gui/util.cpp @@ -110,6 +110,22 @@ wxCursor load_resource_cursor(const String& name) { #endif } +wxIcon load_resource_icon(const String& name) { + #if defined(__WXMSW__) + return wxIcon(_("icon/") + name); + #else + return wxIcon(load_resource_image(_("icon/") + name)); + #endif +} + +wxBitmap load_resource_tool_image(const String& name) { + #if defined(__WXMSW__) + return wxBitmap(_("tool/") + name); + #else + return load_resource_image(_("tool/") + name); + #endif +} + // ----------------------------------------------------------------------------- : Platform look // Draw a basic 3D border diff --git a/src/gui/util.hpp b/src/gui/util.hpp index cf460f74..8174c3e2 100644 --- a/src/gui/util.hpp +++ b/src/gui/util.hpp @@ -42,6 +42,12 @@ Image load_resource_image(const String& name); /// Load a cursor from a resource wxCursor load_resource_cursor(const String& name); +/// Load an icon from a resource +wxIcon load_resource_icon(const String& name); + +/// Load an image for use in a toolbar (filename: tool/...) from a resource +wxBitmap load_resource_tool_image(const String& name); + // ----------------------------------------------------------------------------- : Platform look /// Draws a border for a control *around* a rect diff --git a/src/gui/welcome_window.cpp b/src/gui/welcome_window.cpp index c9e8e179..72646b9e 100644 --- a/src/gui/welcome_window.cpp +++ b/src/gui/welcome_window.cpp @@ -20,18 +20,18 @@ WelcomeWindow::WelcomeWindow() : Frame(nullptr, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxSize(480,340), wxDEFAULT_DIALOG_STYLE) - , logo (load_resource_image(_("ABOUT"))) - , logo2(load_resource_image(_("TWO"))) + , logo (load_resource_image(_("about"))) + , logo2(load_resource_image(_("two"))) { - SetIcon(wxIcon(_("ICON_APP"))); + SetIcon(load_resource_icon(_("app"))); // init controls - wxButton* new_set = new HoverButtonExt(this, ID_FILE_NEW, load_resource_image(_("WELCOME_NEW")), _BUTTON_("new set"), _HELP_("new set")); - wxButton* open_set = new HoverButtonExt(this, ID_FILE_OPEN, load_resource_image(_("WELCOME_OPEN")), _BUTTON_("open set"), _HELP_("open set")); + wxButton* new_set = new HoverButtonExt(this, ID_FILE_NEW, load_resource_image(_("welcome_new")), _BUTTON_("new set"), _HELP_("new set")); + wxButton* open_set = new HoverButtonExt(this, ID_FILE_OPEN, load_resource_image(_("welcome_open")), _BUTTON_("open set"), _HELP_("open set")); wxButton* open_last = 0; if (!settings.recent_sets.empty()) { wxFileName n(settings.recent_sets.front()); - open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("WELCOME_LAST")), _BUTTON_("last opened set"), _("Open '") + n.GetName() + _("'")); + open_last = new HoverButtonExt(this, ID_FILE_RECENT, load_resource_image(_("welcome_last")), _BUTTON_("last opened set"), _("Open '") + n.GetName() + _("'")); } wxSizer* s1 = new wxBoxSizer(wxHORIZONTAL); diff --git a/src/resource/msw/mse.rc b/src/resource/msw/mse.rc index df2e61c0..4eb2da6b 100644 --- a/src/resource/msw/mse.rc +++ b/src/resource/msw/mse.rc @@ -8,47 +8,47 @@ // -------------------------------------------------------- : Icons -ICON_APP ICON "icon/mse.ico" // has to come first in alphabet!! -ICON_EXPORT ICON "icon/set.ico" //todo -ICON_GAME ICON "icon/set.ico" //todo -ICON_SET ICON "icon/set.ico" -ICON_STYLE ICON "icon/set.ico" //todo -ICON_SYMBOL ICON "icon/symbol.ico" +icon/app ICON "icon/mse.ico" // has to come first in alphabet!! +icon/export ICON "icon/set.ico" //todo +icon/game ICON "icon/set.ico" //todo +icon/set ICON "icon/set.ico" +icon/style ICON "icon/set.ico" //todo +icon/symbol ICON "icon/symbol.ico" // -------------------------------------------------------- : Toolbar cursor/rot_text CURSOR "cursor/rot_text.cur" -TOOL_NEW BITMAP "tool/file_new.bmp" -TOOL_OPEN BITMAP "tool/file_open.bmp" -TOOL_SAVE BITMAP "tool/file_save.bmp" +tool/new BITMAP "tool/file_new.bmp" +tool/open BITMAP "tool/file_open.bmp" +tool/save BITMAP "tool/file_save.bmp" -TOOL_UNDO BITMAP "tool/edit_undo.bmp" -TOOL_REDO BITMAP "tool/edit_redo.bmp" -TOOL_CUT BITMAP "tool/edit_cut.bmp" -TOOL_COPY BITMAP "tool/edit_copy.bmp" -TOOL_PASTE BITMAP "tool/edit_paste.bmp" -TOOL_FIND BITMAP "tool/edit_find.bmp" +tool/undo BITMAP "tool/edit_undo.bmp" +tool/redo BITMAP "tool/edit_redo.bmp" +tool/cut BITMAP "tool/edit_cut.bmp" +tool/copy BITMAP "tool/edit_copy.bmp" +tool/paste BITMAP "tool/edit_paste.bmp" +tool/find BITMAP "tool/edit_find.bmp" -TOOL_BOLD BITMAP "tool/format_bold.bmp" -TOOL_ITALIC BITMAP "tool/format_italic.bmp" -TOOL_SYMBOL BITMAP "tool/format_symbol.bmp" -TOOL_REMINDER BITMAP "tool/format_reminder.bmp" -TOOL_NO_AUTO BITMAP "tool/format_no_auto.bmp" +tool/bold BITMAP "tool/format_bold.bmp" +tool/italic BITMAP "tool/format_italic.bmp" +tool/symbol BITMAP "tool/format_symbol.bmp" +tool/reminder BITMAP "tool/format_reminder.bmp" +tool/no_auto BITMAP "tool/format_no_auto.bmp" -TOOL_CARD_ADD BITMAP "tool/card_add.bmp" -TOOL_CARD_ADD_M BITMAP "tool/card_add_multiple.bmp" -TOOL_CARD_DEL BITMAP "tool/card_del.bmp" -TOOL_CARD_ROTATE BITMAP "tool/card_rotate.bmp" -TOOL_CARD_ROTATE_0 BITMAP "tool/card_rotate_0.bmp" -TOOL_CARD_ROTATE_90 BITMAP "tool/card_rotate_90.bmp" -TOOL_CARD_ROTATE_180 BITMAP "tool/card_rotate_180.bmp" -TOOL_CARD_ROTATE_270 BITMAP "tool/card_rotate_270.bmp" +tool/card_add BITMAP "tool/card_add.bmp" +tool/card_add_multiple BITMAP "tool/card_add_multiple.bmp" +tool/card_del BITMAP "tool/card_del.bmp" +tool/card_rotate BITMAP "tool/card_rotate.bmp" +tool/card_rotate_0 BITMAP "tool/card_rotate_0.bmp" +tool/card_rotate_90 BITMAP "tool/card_rotate_90.bmp" +tool/card_rotate_180 BITMAP "tool/card_rotate_180.bmp" +tool/card_rotate_270 BITMAP "tool/card_rotate_270.bmp" -TOOL_KEYWORD_ADD BITMAP "tool/keyword_add.bmp" -TOOL_KEYWORD_DEL BITMAP "tool/keyword_del.bmp" +tool/keyword_add BITMAP "tool/keyword_add.bmp" +tool/keyword_del BITMAP "tool/keyword_del.bmp" -TOOL_HELP BITMAP "tool/help.bmp" +tool/help BITMAP "tool/help.bmp" // -------------------------------------------------------- : Symbol editor @@ -60,66 +60,66 @@ cursor/rotate CURSOR "cursor/rotate.cur" cursor/shear_x CURSOR "cursor/shear_x.cur" cursor/shear_y CURSOR "cursor/shear_y.cur" -TOOL_LINE BITMAP "tool/line.bmp" -TOOL_CURVE BITMAP "tool/curve.bmp" -TOOL_LOCK_FREE BITMAP "tool/lock_free.bmp" -TOOL_LOCK_DIR BITMAP "tool/lock_dir.bmp" -TOOL_LOCK_SIZE BITMAP "tool/lock_size.bmp" +tool/line BITMAP "tool/line.bmp" +tool/curve BITMAP "tool/curve.bmp" +tool/lock_free BITMAP "tool/lock_free.bmp" +tool/lock_dir BITMAP "tool/lock_dir.bmp" +tool/lock_size BITMAP "tool/lock_size.bmp" -TOOL_CIRCLE BITMAP "tool/circle.bmp" -TOOL_RECTANGLE BITMAP "tool/rectangle.bmp" -TOOL_TRIANGLE BITMAP "tool/triangle.bmp" -TOOL_STAR BITMAP "tool/star.bmp" +tool/circle BITMAP "tool/circle.bmp" +tool/rectangle BITMAP "tool/rectangle.bmp" +tool/triangle BITMAP "tool/triangle.bmp" +tool/star BITMAP "tool/star.bmp" -TOOL_MODE_SELECT BITMAP "tool/mode_select.bmp" -TOOL_MODE_ROTATE BITMAP "tool/mode_rotate.bmp" -TOOL_MODE_CURVE BITMAP "tool/mode_curve.bmp" -TOOL_MODE_PAINT BITMAP "tool/mode_paint.bmp" -TOOL_APPLY BITMAP "tool/apply.bmp" -TOOL_DUPLICATE BITMAP "tool/duplicate.bmp" +tool/mode_select BITMAP "tool/mode_select.bmp" +tool/mode_rotate BITMAP "tool/mode_rotate.bmp" +tool/mode_curve BITMAP "tool/mode_curve.bmp" +tool/mode_paint BITMAP "tool/mode_paint.bmp" +tool/apply BITMAP "tool/apply.bmp" +tool/duplicate BITMAP "tool/duplicate.bmp" -COMBINE_OR IMAGE "tool/combine_or.png" -COMBINE_SUB IMAGE "tool/combine_sub.png" -COMBINE_SUB_DARK IMAGE "tool/combine_sub_dark.png" -COMBINE_AND IMAGE "tool/combine_and.png" -COMBINE_AND_DARK IMAGE "tool/combine_and_dark.png" -COMBINE_XOR IMAGE "tool/combine_xor.png" -COMBINE_OVER IMAGE "tool/combine_over.png" -COMBINE_BORDER IMAGE "tool/combine_border.png" +combine_or IMAGE "tool/combine_or.png" +combine_sub IMAGE "tool/combine_sub.png" +combine_sub_dark IMAGE "tool/combine_sub_dark.png" +combine_and IMAGE "tool/combine_and.png" +combine_and_dark IMAGE "tool/combine_and_dark.png" +combine_xor IMAGE "tool/combine_xor.png" +combine_over IMAGE "tool/combine_over.png" +combine_border IMAGE "tool/combine_border.png" -HANDLE_ROTATE IMAGE "../common/handle_rotate_tl.png" -HANDLE_SHEAR_X IMAGE "../common/handle_shear_x.png" -HANDLE_CENTER IMAGE "../common/handle_center.png" +handle_rotate IMAGE "../common/handle_rotate_tl.png" +handle_shear_x IMAGE "../common/handle_shear_x.png" +handle_center IMAGE "../common/handle_center.png" // -------------------------------------------------------- : Other -SORT_ASC BITMAP "other/sort_asc.bmp" -SORT_DESC BITMAP "other/sort_desc.bmp" -PLUS BITMAP "other/plus.bmp" -MINUS BITMAP "other/minus.bmp" -SELECTED IMAGE "other/selected_yes.png" -DESELECTED IMAGE "other/selected_no.png" +sort_asc IMAGE "other/sort_asc.bmp" +sort_desc IMAGE "other/sort_desc.bmp" +plus IMAGE "other/plus.bmp" +minus IMAGE "other/minus.bmp" +selected IMAGE "other/selected_yes.png" +deselected IMAGE "other/selected_no.png" -BOOL_YES IMAGE "../common/bool_yes.png" -BOOL_NO IMAGE "../common/bool_no.png" +bool_yes IMAGE "../common/bool_yes.png" +bool_no IMAGE "../common/bool_no.png" -//HELP_BOOK BITMAP "help_book.bmp" -//HELP_BOOK_OPEN BITMAP "help_book_open.bmp" -//HELP_PAGE BITMAP "help_page.bmp" +//help_book BITMAP "help_book.bmp" +//help_book_open BITMAP "help_book_open.bmp" +//help_page BITMAP "help_page.bmp" -ABOUT IMAGE "../common/about.png" -TWO IMAGE "../common/two_beta.png" -BTN_NORMAL IMAGE "../common/btn_normal.png" -BTN_HOVER IMAGE "../common/btn_hover.png" -BTN_OK_NORMAL IMAGE "../common/btn_ok_normal.png" -BTN_OK_HOVER IMAGE "../common/btn_ok_hover.png" +about IMAGE "../common/about.png" +two IMAGE "../common/two_beta.png" +btn_normal IMAGE "../common/btn_normal.png" +btn_hover IMAGE "../common/btn_hover.png" +btn_ok_normal IMAGE "../common/btn_ok_normal.png" +btn_ok_hover IMAGE "../common/btn_ok_hover.png" -//ABOUT_XMAS IMAGE "about-xmas.png" -//TWO_XMAS IMAGE "two_beta-xmas.png" +//about_xmas IMAGE "about-xmas.png" +//two_xmas IMAGE "two_beta-xmas.png" -WELCOME_NEW IMAGE "../common/welcome_new.png" -WELCOME_OPEN IMAGE "../common/welcome_open.png" -WELCOME_LAST IMAGE "../common/welcome_last.png" +welcome_new IMAGE "../common/welcome_new.png" +welcome_open IMAGE "../common/welcome_open.png" +welcome_last IMAGE "../common/welcome_last.png" // -------------------------------------------------------- : WX