mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added 'export all card images' functionality
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@232 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -12,27 +12,31 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : CardSelectWindow
|
||||
|
||||
CardSelectWindow::CardSelectWindow(Window* parent, const SetP& set, const String& label)
|
||||
CardSelectWindow::CardSelectWindow(Window* parent, const SetP& set, const String& label, const String& title, bool sizer)
|
||||
: wxDialog(parent, wxID_ANY, _TITLE_("select cards"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
, set(set)
|
||||
{
|
||||
// init controls
|
||||
list = new SelectCardList(this, wxID_ANY);
|
||||
list->setSet(set);
|
||||
wxButton* sel_all = new wxButton(this, ID_SELECT_ALL, _BUTTON_("select all"));
|
||||
wxButton* sel_none = new wxButton(this, ID_SELECT_NONE, _BUTTON_("select none"));
|
||||
sel_all = new wxButton(this, ID_SELECT_ALL, _BUTTON_("select all"));
|
||||
sel_none = new wxButton(this, ID_SELECT_NONE, _BUTTON_("select none"));
|
||||
// init sizers
|
||||
wxSizer* s = new wxBoxSizer(wxVERTICAL);
|
||||
s->Add(new wxStaticText(this, wxID_ANY, label), 0, wxALL & ~wxBOTTOM, 8);
|
||||
s->Add(list, 1, wxEXPAND | wxALL, 8);
|
||||
wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
s2->Add(sel_all, 0, wxEXPAND | wxRIGHT, 8);
|
||||
s2->Add(sel_none, 0, wxEXPAND | wxRIGHT, 8);
|
||||
s2->Add(CreateButtonSizer(wxOK | wxCANCEL), 1, wxEXPAND, 8);
|
||||
s->Add(s2, 0, wxEXPAND | wxALL & ~wxTOP, 8);
|
||||
s->SetSizeHints(this);
|
||||
SetSizer(s);
|
||||
SetSize(500,500);
|
||||
if (sizer) {
|
||||
wxSizer* s = new wxBoxSizer(wxVERTICAL);
|
||||
if (!label.empty()) {
|
||||
s->Add(new wxStaticText(this, wxID_ANY, label), 0, wxALL & ~wxBOTTOM, 8);
|
||||
}
|
||||
s->Add(list, 1, wxEXPAND | wxALL, 8);
|
||||
wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
s2->Add(sel_all, 0, wxEXPAND | wxRIGHT, 8);
|
||||
s2->Add(sel_none, 0, wxEXPAND | wxRIGHT, 8);
|
||||
s2->Add(CreateButtonSizer(wxOK | wxCANCEL), 1, wxEXPAND, 8);
|
||||
s->Add(s2, 0, wxEXPAND | wxALL & ~wxTOP, 8);
|
||||
s->SetSizeHints(this);
|
||||
SetSizer(s);
|
||||
SetSize(500,500);
|
||||
}
|
||||
}
|
||||
|
||||
bool CardSelectWindow::isSelected(const CardP& card) const {
|
||||
@@ -46,7 +50,7 @@ void CardSelectWindow::onSelectNone(wxCommandEvent&) {
|
||||
list->selectNone();
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(CardSelectWindow,wxDialog)
|
||||
BEGIN_EVENT_TABLE(CardSelectWindow, wxDialog)
|
||||
EVT_BUTTON (ID_SELECT_ALL, CardSelectWindow::onSelectAll)
|
||||
EVT_BUTTON (ID_SELECT_NONE, CardSelectWindow::onSelectNone)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
Reference in New Issue
Block a user