mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Added dummy CardEditor, implemented Stylesheet loading
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@50 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| 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 <gui/control/card_editor.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : DataEditor
|
||||
|
||||
DataEditor::DataEditor(Window* parent, int id, long style)
|
||||
: CardViewer(parent, id, style)
|
||||
{}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------- : Event table
|
||||
|
||||
BEGIN_EVENT_TABLE(DataEditor, CardViewer)
|
||||
END_EVENT_TABLE ()
|
||||
@@ -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_GUI_CONTROL_CARD_EDITOR
|
||||
#define HEADER_GUI_CONTROL_CARD_EDITOR
|
||||
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <gui/control/card_viewer.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : DataEditor
|
||||
|
||||
/// An editor for data values (usually a card)
|
||||
class DataEditor : public CardViewer {
|
||||
public:
|
||||
DataEditor(Window* parent, int id, long style = 0);
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
/// By default a DataEditor edits cards
|
||||
typedef DataEditor CardEditor;
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
@@ -12,13 +12,17 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : CardViewer
|
||||
|
||||
CardViewer::CardViewer(Window* parent, int id, int style)
|
||||
CardViewer::CardViewer(Window* parent, int id, long style)
|
||||
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, style)
|
||||
{}
|
||||
|
||||
wxSize CardViewer::DoGetBestSize() const {
|
||||
wxSize ws = GetSize(), cs = GetClientSize();
|
||||
return wxSize(set->stylesheet->card_width, set->stylesheet->card_height) + ws - cs;
|
||||
if (set && set->stylesheet) {
|
||||
return wxSize(set->stylesheet->card_width, set->stylesheet->card_height) + ws - cs;
|
||||
} else {
|
||||
return cs;
|
||||
}
|
||||
}
|
||||
|
||||
void CardViewer::onPaint(wxPaintEvent&) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/// A control to view a single card
|
||||
class CardViewer : public wxControl, public DataViewer {
|
||||
public:
|
||||
CardViewer(Window* parent, int id, int style);
|
||||
CardViewer(Window* parent, int id, long style = 0);
|
||||
|
||||
protected:
|
||||
/// Return the desired size of control
|
||||
|
||||
Reference in New Issue
Block a user