Added support for informational headings in native look editor.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@212 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-03-18 14:50:44 +00:00
parent 074ff12816
commit d30e0f7bc5
14 changed files with 395 additions and 15 deletions
+36
View File
@@ -0,0 +1,36 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <render/value/information.hpp>
#include <render/card/viewer.hpp>
// ----------------------------------------------------------------------------- : InfoValueViewer
void InfoValueViewer::draw(RotatedDC& dc) {
if (nativeLook()) {
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
dc.SetFont(wxFont(16, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, _("Arial")));
} else {
dc.SetTextForeground(style().font.color);
dc.SetBrush(style().background_color);
dc.SetFont(style().font.font, style().font.size);
}
// draw background
RealRect rect = style().getRect();
dc.DrawRectangle(rect.grow(2));
// draw text
rect = rect.move(
style().padding_left,
style().padding_top,
-style().padding_left - style().padding_right,
-style().padding_top - style().padding_bottom
);
RealSize size = dc.GetTextExtent(value().value);
dc.DrawText(value().value, align_in_rect(style().alignment, size, rect));
}
+29
View File
@@ -0,0 +1,29 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_RENDER_VALUE_INFORMATION
#define HEADER_RENDER_VALUE_INFORMATION
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <render/value/viewer.hpp>
#include <render/text/viewer.hpp>
#include <data/field/information.hpp>
// ----------------------------------------------------------------------------- : InfoValueViewer
/// Viewer that displays a text value
class InfoValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Info) : ValueViewer(parent,style) {}
virtual void draw(RotatedDC& dc);
};
// ----------------------------------------------------------------------------- : EOF
#endif
+2
View File
@@ -13,6 +13,7 @@
#include <render/value/image.hpp>
#include <render/value/symbol.hpp>
#include <render/value/color.hpp>
#include <render/value/information.hpp>
#include <render/card/viewer.hpp>
// ----------------------------------------------------------------------------- : ValueViewer
@@ -68,3 +69,4 @@ IMPLEMENT_MAKE_VIEWER(MultipleChoice);
IMPLEMENT_MAKE_VIEWER(Color);
IMPLEMENT_MAKE_VIEWER(Image);
IMPLEMENT_MAKE_VIEWER(Symbol);
IMPLEMENT_MAKE_VIEWER(Info);