diff --git a/src/gui/set/window.cpp b/src/gui/set/window.cpp index f92e0957..4d8e4bc1 100644 --- a/src/gui/set/window.cpp +++ b/src/gui/set/window.cpp @@ -129,17 +129,17 @@ SetWindow::SetWindow(Window* parent, const SetP& set) tb->Realize(); // tab bar, sizer - wxToolBar* tabBar = new wxToolBar(this, ID_TAB_BAR, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxNO_BORDER | wxTB_HORIZONTAL | wxTB_HORZ_TEXT | wxTB_NOICONS); + wxToolBar* tabBar = new wxToolBar(this, ID_TAB_BAR, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxNO_BORDER | wxTB_HORIZONTAL | wxTB_HORZ_TEXT); wxSizer* s = new wxBoxSizer(wxVERTICAL); s->Add(tabBar, 0, wxEXPAND | wxBOTTOM, 3); SetSizer(s); // panels - addPanel(menuWindow, tabBar, new CardsPanel (this, wxID_ANY), 0, _("cards tab")); - addPanel(menuWindow, tabBar, new SetInfoPanel (this, wxID_ANY), 1, _("set info tab")); - addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 2, _("style tab")); - addPanel(menuWindow, tabBar, new KeywordsPanel(this, wxID_ANY), 3, _("keywords tab")); - addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 4, _("stats tab")); + addPanel(menuWindow, tabBar, new CardsPanel (this, wxID_ANY), 0, _("window_cards"), _("cards tab")); + addPanel(menuWindow, tabBar, new SetInfoPanel (this, wxID_ANY), 1, _("window_set_info"), _("set info tab")); + addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 2, _("window_style"), _("style tab")); + addPanel(menuWindow, tabBar, new KeywordsPanel(this, wxID_ANY), 3, _("window_keywords"), _("keywords tab")); + addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 4, _("window_statistics"), _("stats tab")); // addPanel(*s, *menuWindow, *tabBar, new DraftPanel (&this, wxID_ANY), 5, _("F10")) selectPanel(ID_WINDOW_CARDS); // select cards panel @@ -178,7 +178,7 @@ SetWindow::~SetWindow() { // ----------------------------------------------------------------------------- : Panel managment -void SetWindow::addPanel(wxMenu* windowMenu, wxToolBar* tabBar, SetWindowPanel* panel, UInt pos, const String& name) { +void SetWindow::addPanel(IconMenu* windowMenu, wxToolBar* tabBar, SetWindowPanel* panel, UInt pos, const String& image_name, const String& name) { // insert in list if (panels.size() <= pos) panels.resize(pos + 1); panels[pos] = panel; @@ -189,9 +189,10 @@ void SetWindow::addPanel(wxMenu* windowMenu, wxToolBar* tabBar, SetWindowPanel* String tab_help = tr(LOCALE_CAT_TOOLTIP, name); // add to tab bar int id = ID_WINDOW_MIN + pos; - tabBar->AddTool(id, tab_name, wxNullBitmap, wxNullBitmap, wxITEM_CHECK, tab_help, description); + tabBar->AddTool(id, tab_name + _(" "), load_resource_tool_image(image_name), wxNullBitmap, wxITEM_CHECK, tab_help, description); + tabBar->AddSeparator(); // add to menu bar - windowMenu->AppendCheckItem(id, menu_name, description); + windowMenu->Append(id, image_name, menu_name, description, wxITEM_CHECK); // add to sizer GetSizer()->Add(panel, 1, wxEXPAND); } diff --git a/src/gui/set/window.hpp b/src/gui/set/window.hpp index fc479187..b5fab075 100644 --- a/src/gui/set/window.hpp +++ b/src/gui/set/window.hpp @@ -53,7 +53,7 @@ class SetWindow : public wxFrame, public SetView { /// Add a panel to the window, as well as to the menu and tab bar /** The position only determines the order in which events will be send. */ - void addPanel(wxMenu* windowMenu, wxToolBar* tabBar, SetWindowPanel* panel, UInt pos, const String& name); + void addPanel(IconMenu* windowMenu, wxToolBar* tabBar, SetWindowPanel* panel, UInt pos, const String& image_name, const String& name); /// Select a panel, based on a tab id void selectPanel(int id); diff --git a/src/gui/value/symbol.cpp b/src/gui/value/symbol.cpp index 29e58d32..411c2fbb 100644 --- a/src/gui/value/symbol.cpp +++ b/src/gui/value/symbol.cpp @@ -8,12 +8,15 @@ #include #include +#include // ----------------------------------------------------------------------------- : SymbolValueEditor IMPLEMENT_VALUE_EDITOR(Symbol) , button_down(-2) -{} +{ + button_images[0] = Bitmap(load_resource_image(_("edit_symbol"))); +} void SymbolValueEditor::draw(RotatedDC& dc) { SymbolValueViewer::draw(dc); @@ -27,8 +30,8 @@ void SymbolValueEditor::draw(RotatedDC& dc) { if (nativeLook()) { // draw editor buttons dc.SetFont(*wxNORMAL_FONT); - drawButton(dc, 0, _("Edit")); - drawButton(dc, 1, _("Gallery")); + drawButton(dc, 0, _BUTTON_("edit symbol")); + //drawButton(dc, 1, _BUTTON_("symbol gallery")); } } void SymbolValueEditor::drawButton(RotatedDC& dc, int button, const String& text) { @@ -49,6 +52,10 @@ void SymbolValueEditor::drawButton(RotatedDC& dc, int button, const String& text // draw text RealSize text_size = dc.GetTextExtent(text); dc.DrawText(text, align_in_rect((Alignment)(ALIGN_BOTTOM | ALIGN_CENTER), text_size, RealRect(x, y, size,size*0.9))); + // draw image + const Bitmap& bmp = button_images[button]; + RealSize image_size(bmp.GetWidth(), bmp.GetHeight()); + dc.DrawBitmap(bmp, align_in_rect(ALIGN_MIDDLE_CENTER, image_size, RealRect(x,y,size,size * 0.8))); } int SymbolValueEditor::findButton(const RealPoint& pos) { diff --git a/src/gui/value/symbol.hpp b/src/gui/value/symbol.hpp index fa3183ee..936e4f32 100644 --- a/src/gui/value/symbol.hpp +++ b/src/gui/value/symbol.hpp @@ -34,6 +34,7 @@ class SymbolValueEditor : public SymbolValueViewer, public ValueEditor { // button, or -1 for mouse down, but not on button, or -2 for mouse not down int button_down; + Bitmap button_images[1]; }; // ----------------------------------------------------------------------------- : EOF diff --git a/src/resource/common/edit_symbol.png b/src/resource/common/edit_symbol.png new file mode 100644 index 00000000..c81a03bf Binary files /dev/null and b/src/resource/common/edit_symbol.png differ diff --git a/src/resource/msw/mse.rc b/src/resource/msw/mse.rc index 0560e290..74b04c0f 100644 --- a/src/resource/msw/mse.rc +++ b/src/resource/msw/mse.rc @@ -54,6 +54,12 @@ tool/card_rotate_270 IMAGE "tool/card_rotate_270.png" tool/keyword_add IMAGE "tool/keyword_add.png" tool/keyword_del IMAGE "tool/keyword_del.png" +tool/window_cards IMAGE "tool/window_cards.png" +tool/window_set_info IMAGE "tool/window_set_info.png" +tool/window_style IMAGE "tool/window_style.png" +tool/window_keywords IMAGE "tool/window_keywords.png" +tool/window_statistics IMAGE "tool/window_statistics.png" + tool/help IMAGE "tool/help.png" // -------------------------------------------------------- : Symbol editor @@ -141,6 +147,8 @@ welcome_new IMAGE "../common/welcome_new.png" welcome_open IMAGE "../common/welcome_open.png" welcome_last IMAGE "../common/welcome_last.png" +edit_symbol IMAGE "../common/edit_symbol.png" + // -------------------------------------------------------- : WX wxBITMAP_STD_COLOURS BITMAP "wx/msw/colours.bmp" diff --git a/src/resource/msw/tool/print_preview.png b/src/resource/msw/tool/print_preview.png index a6bb5bc4..fb4e1af3 100644 Binary files a/src/resource/msw/tool/print_preview.png and b/src/resource/msw/tool/print_preview.png differ diff --git a/src/resource/msw/tool/window_cards.png b/src/resource/msw/tool/window_cards.png new file mode 100644 index 00000000..cbd1b395 Binary files /dev/null and b/src/resource/msw/tool/window_cards.png differ diff --git a/src/resource/msw/tool/window_keywords.png b/src/resource/msw/tool/window_keywords.png new file mode 100644 index 00000000..3dd13596 Binary files /dev/null and b/src/resource/msw/tool/window_keywords.png differ diff --git a/src/resource/msw/tool/window_set_info.png b/src/resource/msw/tool/window_set_info.png new file mode 100644 index 00000000..07fecdf7 Binary files /dev/null and b/src/resource/msw/tool/window_set_info.png differ diff --git a/src/resource/msw/tool/window_statistics.png b/src/resource/msw/tool/window_statistics.png new file mode 100644 index 00000000..8e38f538 Binary files /dev/null and b/src/resource/msw/tool/window_statistics.png differ diff --git a/src/resource/msw/tool/window_style.png b/src/resource/msw/tool/window_style.png new file mode 100644 index 00000000..9ad4d2c3 Binary files /dev/null and b/src/resource/msw/tool/window_style.png differ