Reduce coupling between ValueEditors/Viewers and Set and StyleSheet.

- Adding of actions is done with an addAction function
 - Files are read from
     - getStylePackage for styling stuff (this is stylesheet)
     - getLocalPackage for symbol and image values (this was the set)


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@970 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-06-04 00:21:06 +00:00
parent 6b0a0fd098
commit ae14784fd6
50 changed files with 413 additions and 184 deletions
+58
View File
@@ -0,0 +1,58 @@
//+----------------------------------------------------------------------------+
//| 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 <gui/set/random_pack_panel.hpp>
#include <gui/control/card_viewer.hpp>
#include <gui/control/filtered_card_list.hpp>
// ----------------------------------------------------------------------------- : RandomPackPanel
RandomPackPanel::RandomPackPanel(Window* parent, int id)
: SetWindowPanel(parent, id)
{
// init controls
preview = new CardViewer(this, wxID_ANY);
card_list = new FilteredCardList(this, wxID_ANY);
// init sizer
wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
s->Add(preview, 0, wxRIGHT, 2);
wxSizer* s2 = new wxBoxSizer(wxVERTICAL);
s2->Add(card_list, 1, wxEXPAND | wxTOP, 4);
s->Add(s2, 1, wxEXPAND, 8);
s->SetSizeHints(this);
SetSizer(s);
}
void RandomPackPanel::onChangeSet() {
preview ->setSet(set);
card_list->setSet(set);
}
// ----------------------------------------------------------------------------- : UI
void RandomPackPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
// ?
}
void RandomPackPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
// ?
}
void RandomPackPanel::onUpdateUI(wxUpdateUIEvent& ev) {
// ?
}
void RandomPackPanel::onCommand(int id) {
// ?
}
// ----------------------------------------------------------------------------- : Clipboard
bool RandomPackPanel::canCopy() const { return card_list->canCopy(); }
void RandomPackPanel::doCopy() { card_list->doCopy(); }