Added icons to window menu and to the tab bar

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@523 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-07 20:00:51 +00:00
parent d4e46e06d8
commit a0f7753933
12 changed files with 30 additions and 13 deletions
+10 -3
View File
@@ -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) {
+1
View File
@@ -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