mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
26562e03e3
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@837 0fc631ac-6414-0410-93d0-97cfa31319b6
41 lines
1.6 KiB
C++
41 lines
1.6 KiB
C++
//+----------------------------------------------------------------------------+
|
|
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
|
//| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
|
|
//| License: GNU General Public License 2 or later (see file COPYING) |
|
|
//+----------------------------------------------------------------------------+
|
|
|
|
// ----------------------------------------------------------------------------- : Includes
|
|
|
|
#include <util/prec.hpp>
|
|
#include <render/value/information.hpp>
|
|
#include <render/card/viewer.hpp>
|
|
|
|
// ----------------------------------------------------------------------------- : InfoValueViewer
|
|
|
|
IMPLEMENT_VALUE_VIEWER(Info);
|
|
|
|
void InfoValueViewer::draw(RotatedDC& dc) {
|
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
|
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, 1.0);
|
|
}
|
|
// draw background
|
|
RealRect rect = style().getInternalRect();
|
|
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));
|
|
}
|