Commit e6867623 authored by twanvl's avatar twanvl

Added icons to window menu and to the tab bar

parent 7f037a96
......@@ -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);
}
......
......@@ -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);
......
......@@ -8,12 +8,15 @@
#include <gui/value/symbol.hpp>
#include <gui/symbol/window.hpp>
#include <gui/util.hpp>
// ----------------------------------------------------------------------------- : 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) {
......
......@@ -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
......
......@@ -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"
......
src/resource/msw/tool/print_preview.png

336 Bytes | W: | H:

src/resource/msw/tool/print_preview.png

339 Bytes | W: | H:

src/resource/msw/tool/print_preview.png
src/resource/msw/tool/print_preview.png
src/resource/msw/tool/print_preview.png
src/resource/msw/tool/print_preview.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment