From 2d2c434bd8f6a59216f18dd592b4202d7370a148 Mon Sep 17 00:00:00 2001 From: twanvl Date: Fri, 8 Aug 2008 21:35:38 +0000 Subject: [PATCH] Generated packs can now be selected for printing. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1107 0fc631ac-6414-0410-93d0-97cfa31319b6 --- data/en.mse-locale/locale | 6 ++ src/gui/card_select_window.cpp | 117 ++++++++++++++++++++++- src/gui/card_select_window.hpp | 55 +++++++++++ src/gui/control/card_list.cpp | 43 +++++---- src/gui/control/card_list.hpp | 17 +++- src/gui/control/item_list.hpp | 1 + src/gui/control/select_card_list.cpp | 12 +++ src/gui/control/select_card_list.hpp | 5 + src/gui/images_export_window.cpp | 4 +- src/gui/print_window.cpp | 46 +++++---- src/gui/print_window.hpp | 5 +- src/gui/set/panel.hpp | 2 + src/gui/set/random_pack_panel.cpp | 8 ++ src/gui/set/random_pack_panel.hpp | 1 + src/gui/set/window.cpp | 38 +++++--- src/gui/set/window.hpp | 13 ++- src/resource/common/expected_locale_keys | 10 +- src/util/window_id.hpp | 3 + 18 files changed, 322 insertions(+), 64 deletions(-) diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale index 61493be6..c33ba4f6 100644 --- a/data/en.mse-locale/locale +++ b/data/en.mse-locale/locale @@ -462,6 +462,8 @@ label: columns: Columns: # Card select / images export + select cards: Cards to export + selected card count: %s cards will be exported. select cards print: Select the cards you want to print filename format: &Format: filename conflicts: &Handle duplicating filenames: @@ -564,6 +566,10 @@ button: hide: &Hide # Card select + export entire set: Entire set + export generated packs: Generated packs + export custom cards selection: Custom selection + select cards: &Select Cards... select all: Select &All select none: Select &None overwrite: Overwrite old files diff --git a/src/gui/card_select_window.cpp b/src/gui/card_select_window.cpp index 890bbe00..20466df5 100644 --- a/src/gui/card_select_window.cpp +++ b/src/gui/card_select_window.cpp @@ -10,6 +10,113 @@ #include #include #include +#include + +DECLARE_TYPEOF_COLLECTION(CardP); +DECLARE_TYPEOF_COLLECTION(ExportCardSelectionChoiceP); + +// ----------------------------------------------------------------------------- : ExportCardSelectionChoice + +ExportCardSelectionChoice::ExportCardSelectionChoice() + : label(_BUTTON_("export custom cards selection")) + , type(EXPORT_SEL_CUSTOM) + , the_cards(&own_cards) +{} +ExportCardSelectionChoice::ExportCardSelectionChoice(const Set& set) + : label(_BUTTON_("export entire set")) + , type(EXPORT_SEL_ENTIRE_SET) + , the_cards(&set.cards) +{} +ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const vector& cards) + : label(label) + , type(EXPORT_SEL_SUBSET) + , own_cards(cards) + , the_cards(&own_cards) +{} +ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const vector* cards) + : label(label) + , type(EXPORT_SEL_SUBSET) + , the_cards(cards) +{} + +// ----------------------------------------------------------------------------- : ExportWindowBase + + +ExportWindowBase::ExportWindowBase(const SetP& set, const ExportCardSelectionChoices& cards_choices) + : set(set), cards_choices(cards_choices) + , active_choice(0) + , select_cards(nullptr) +{} + +wxSizer* ExportWindowBase::Create() { + // create sizer + wxSizer* s = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("select cards")); + // create choice radio buttons + int i = 0; + bool any_custom = false; + FOR_EACH(choice, cards_choices) { + wxRadioButton* btn = new wxRadioButton(this, ID_SELECTION_CHOICE + i, choice->label); + btn->Enable(!choice->the_cards->empty() || choice->type == EXPORT_SEL_CUSTOM); + s->Add(btn, 0, wxALL, 6); + s->AddSpacer(-4); + any_custom |= choice->type == EXPORT_SEL_CUSTOM; + i++; + } + // custom selection button + if (any_custom) { + select_cards = new wxButton(this, ID_SELECT_CARDS, _BUTTON_("select cards")); + wxSizer* s2 = new wxBoxSizer(wxHORIZONTAL); + s2->Add(select_cards, 1, wxLEFT, 20); + s->AddSpacer(4); + s->Add(s2, 0, wxALL & ~wxTOP, 6); + } + // total count label + s->AddSpacer(4); + s->Add(new wxStaticLine(this), 0, wxALL | wxEXPAND, 4); + s->AddSpacer(4); + card_count = new wxStaticText(this, wxID_ANY, wxEmptyString); + s->Add(card_count, 0, wxALL & ~wxTOP, 6); + s->AddSpacer(4); + // done + update(); + return s; +} + +void ExportWindowBase::onChangeSelectionChoice(wxCommandEvent& ev) { + active_choice = ev.GetId() - ID_SELECTION_CHOICE; + update(); +} + +void ExportWindowBase::onSelectCards(wxCommandEvent&) { + CardSelectWindow wnd(this, set, _LABEL_("select cards"), _TITLE_("select cards")); + ExportCardSelectionChoice& choice = *cards_choices.at(active_choice); + wnd.setSelection(choice.own_cards); + if (wnd.ShowModal() != wxID_OK) { + return; // cancel + } + // store cards + choice.own_cards.clear(); + wnd.getSelection(choice.own_cards); + update(); + +} + +void ExportWindowBase::update() { + ExportCardSelectionChoice& choice = *cards_choices.at(active_choice); + cards = choice.the_cards; + if (select_cards) { + select_cards->Enable(choice.type == EXPORT_SEL_CUSTOM); + } + card_count->SetLabel(_LABEL_1_("selected card count", String::Format(_("%d"),cards->size()))); + wxWindow* ok_btn = FindWindow(wxID_OK); + if (ok_btn) ok_btn->Enable(!cards->empty()); +} + + +BEGIN_EVENT_TABLE(ExportWindowBase, wxDialog) + EVT_RADIOBUTTON(wxID_ANY, ExportWindowBase::onChangeSelectionChoice) + EVT_BUTTON (ID_SELECT_CARDS, ExportWindowBase::onSelectCards) +END_EVENT_TABLE () // ----------------------------------------------------------------------------- : CardSelectWindow @@ -36,7 +143,7 @@ CardSelectWindow::CardSelectWindow(Window* parent, const SetP& set, const String s->Add(s2, 0, wxEXPAND | wxALL & ~wxTOP, 8); s->SetSizeHints(this); SetSizer(s); - SetSize(500,500); + SetSize(600,500); } } @@ -44,6 +151,14 @@ bool CardSelectWindow::isSelected(const CardP& card) const { return list->isSelected(card); } +void CardSelectWindow::getSelection(vector& out) const { + list->getSelection(out); +} + +void CardSelectWindow::setSelection(const vector& cards) { + list->setSelection(cards); +} + void CardSelectWindow::onSelectAll(wxCommandEvent&) { list->selectAll(); } diff --git a/src/gui/card_select_window.hpp b/src/gui/card_select_window.hpp index 6cb7c1fb..e7028dba 100644 --- a/src/gui/card_select_window.hpp +++ b/src/gui/card_select_window.hpp @@ -13,8 +13,59 @@ DECLARE_POINTER_TYPE(Set); DECLARE_POINTER_TYPE(Card); +DECLARE_POINTER_TYPE(ExportCardSelectionChoice); class SelectCardList; +// ----------------------------------------------------------------------------- : ExportWindowBase + +enum ExportCardSelectionType +{ EXPORT_SEL_ENTIRE_SET +, EXPORT_SEL_SUBSET +, EXPORT_SEL_CUSTOM +}; + +class ExportCardSelectionChoice : public IntrusivePtrBase { + public: + ExportCardSelectionChoice(); + ExportCardSelectionChoice(const Set& set); + ExportCardSelectionChoice(const String& label, const vector& cards); + ExportCardSelectionChoice(const String& label, const vector* cards); + + const String label; + const ExportCardSelectionType type; + const vector* the_cards; ///< The cards + vector own_cards; ///< Maybe we own the cards, in that case the_cards = &own_cards +}; + +typedef vector ExportCardSelectionChoices; + +/// Base class for export windows, deals with card selection +class ExportWindowBase : public wxDialog { + public: + ExportWindowBase(const SetP& set, const ExportCardSelectionChoices& cards_choices); + /// Create the controls, return a sizer containing them + wxSizer* Create(); + + /// Get the selected cards + const vector& getSelection() const { return *cards; } + + protected: + DECLARE_EVENT_TABLE(); + + SetP set; ///< Set to export + const vector* cards; ///< Cards to export + + private: + ExportCardSelectionChoices cards_choices; ///< Ways to select cards + size_t active_choice; + wxStaticText* card_count; + wxButton* select_cards; + + void onChangeSelectionChoice(wxCommandEvent&); + void onSelectCards(wxCommandEvent&); + void update(); +}; + // ----------------------------------------------------------------------------- : CardSelectWindow /// A window for selecting a subset of the cards from a set. @@ -26,6 +77,10 @@ class CardSelectWindow : public wxDialog { /// Is the given card selected? bool isSelected(const CardP& card) const; + /// Get a list of all selected cards + void getSelection(vector& out) const; + /// Change which cards are selected + void setSelection(const vector& cards); protected: DECLARE_EVENT_TABLE(); diff --git a/src/gui/control/card_list.cpp b/src/gui/control/card_list.cpp index 84c7a3b0..041c9ccf 100644 --- a/src/gui/control/card_list.cpp +++ b/src/gui/control/card_list.cpp @@ -36,6 +36,18 @@ DECLARE_TYPEOF_COLLECTION(CardListBase*); DEFINE_EVENT_TYPE(EVENT_CARD_SELECT); DEFINE_EVENT_TYPE(EVENT_CARD_ACTIVATE); +CardP CardSelectEvent::getCard() const { + return getTheCardList()->getCard(); +} + +void CardSelectEvent::getSelection(vector& out) const { + getTheCardList()->getSelection(out); +} + +CardListBase* CardSelectEvent::getTheCardList() const { + return static_cast(GetEventObject()); +} + // ----------------------------------------------------------------------------- : CardListBase vector CardListBase::card_lists; @@ -116,11 +128,21 @@ void CardListBase::getItems(vector& out) const { out.push_back(c); } } -void CardListBase::sendEvent() { - CardSelectEvent ev(getCard()); +void CardListBase::sendEvent(int type) { + CardSelectEvent ev(type); + ev.SetEventObject(this); ProcessEvent(ev); } +void CardListBase::getSelection(vector& out) const { + long count = GetItemCount(); + for (long pos = 0 ; pos < count ; ++pos) { + if (const_cast(this)->IsSelected(pos)) { + out.push_back(getCard(pos)); + } + } +} + // ----------------------------------------------------------------------------- : CardListBase : Clipboard bool CardListBase::canCut() const { return canDelete(); } @@ -136,12 +158,7 @@ bool CardListBase::doCopy() { if (!canCopy()) return false; // cards to copy vector cards_to_copy; - long count = GetItemCount(); - for (long pos = 0 ; pos < count ; ++pos) { - if (IsSelected(pos)) { - cards_to_copy.push_back(getCard(pos)); - } - } + getSelection(cards_to_copy); if (cards_to_copy.empty()) return false; // put on clipboard if (!wxTheClipboard->Open()) return false; @@ -168,12 +185,7 @@ bool CardListBase::doPaste() { bool CardListBase::doDelete() { // cards to delete vector cards_to_delete; - long count = GetItemCount(); - for (long pos = 0 ; pos < count ; ++pos) { - if (IsSelected(pos)) { - cards_to_delete.push_back(getCard(pos)); - } - } + getSelection(cards_to_delete); if (cards_to_delete.empty()) return false; // delete cards set->actions.addAction(new AddCardAction(REMOVE, *set, cards_to_delete)); @@ -372,8 +384,7 @@ void CardListBase::onContextMenu(wxContextMenuEvent&) { void CardListBase::onItemActivate(wxListEvent& ev) { selectItemPos(ev.GetIndex(), false); - CardSelectEvent event(getCard(), EVENT_CARD_ACTIVATE); - ProcessEvent(event); + sendEvent(EVENT_CARD_ACTIVATE); } // ----------------------------------------------------------------------------- : CardListBase : Event table diff --git a/src/gui/control/card_list.hpp b/src/gui/control/card_list.hpp index 59e90b45..b71ee048 100644 --- a/src/gui/control/card_list.hpp +++ b/src/gui/control/card_list.hpp @@ -16,6 +16,7 @@ DECLARE_POINTER_TYPE(ChoiceField); DECLARE_POINTER_TYPE(Field); +class CardListBase; // ----------------------------------------------------------------------------- : Events @@ -36,11 +37,16 @@ DECLARE_EVENT_TYPE(EVENT_CARD_ACTIVATE, ) /// The event of selecting a card struct CardSelectEvent : public wxCommandEvent { - inline CardSelectEvent(const CardP& card, int type = EVENT_CARD_SELECT) - : wxCommandEvent(type), card(card) + inline CardSelectEvent(int type = EVENT_CARD_SELECT) + : wxCommandEvent(type) {} - CardP card; ///< The selected card + /// The selected card + CardP getCard() const; + /// All focused cards + void getSelection(vector& out) const; + private: + CardListBase* getTheCardList() const; }; // ----------------------------------------------------------------------------- : CardListBase @@ -83,6 +89,8 @@ class CardListBase : public ItemList, public SetView { public: /// Return the card at the given position in the sorted card list inline CardP getCard(long pos) const { return static_pointer_cast(getItem(pos)); } + /// Get a list of all focused cards + void getSelection(vector& out) const; protected: /// Get a list of all cards virtual void getItems(vector& out) const; @@ -97,7 +105,8 @@ class CardListBase : public ItemList, public SetView { virtual void sortBy(long column, bool ascending); /// Send an 'item selected' event for the currently selected item (selected_item) - virtual void sendEvent(); + virtual void sendEvent() { sendEvent(EVENT_CARD_SELECT); } + void sendEvent(int type = EVENT_CARD_SELECT); /// Compare cards virtual bool compareItems(void* a, void* b) const; diff --git a/src/gui/control/item_list.hpp b/src/gui/control/item_list.hpp index f80051a3..c0afca71 100644 --- a/src/gui/control/item_list.hpp +++ b/src/gui/control/item_list.hpp @@ -21,6 +21,7 @@ * Terminology: * selected item = a single item in the variable selected_item * focused items = items that are drawn as selected in the control + * TODO: This is reverse of normal */ class ItemList : public wxListView { public: diff --git a/src/gui/control/select_card_list.cpp b/src/gui/control/select_card_list.cpp index 1106cfc4..0f5ae8a7 100644 --- a/src/gui/control/select_card_list.cpp +++ b/src/gui/control/select_card_list.cpp @@ -43,6 +43,18 @@ bool SelectCardList::isSelected(const CardP& card) const { return selected.find(card) != selected.end(); } +void SelectCardList::getSelection(vector& out) const { + FOR_EACH_CONST(card, set->cards) { + if (isSelected(card)) out.push_back(card); + } +} + +void SelectCardList::setSelection(const vector& cards) { + selected.clear(); + copy(cards.begin(), cards.end(), inserter(selected, selected.begin())); +} + + void SelectCardList::onChangeSet() { CardListBase::onChangeSet(); // init selected list: select all diff --git a/src/gui/control/select_card_list.hpp b/src/gui/control/select_card_list.hpp index 0b2eceae..330476b8 100644 --- a/src/gui/control/select_card_list.hpp +++ b/src/gui/control/select_card_list.hpp @@ -26,6 +26,11 @@ class SelectCardList : public CardListBase { void selectNone(); /// Is the given card selected? bool isSelected(const CardP& card) const; + /// Get a list of all selected cards + void getSelection(vector& out) const; + /// Change which cards are selected + void setSelection(const vector& cards); + protected: virtual int OnGetItemImage(long pos) const; virtual void onChangeSet(); diff --git a/src/gui/images_export_window.cpp b/src/gui/images_export_window.cpp index 3626775d..4030a9d3 100644 --- a/src/gui/images_export_window.cpp +++ b/src/gui/images_export_window.cpp @@ -72,9 +72,7 @@ void ImagesExportWindow::onOk(wxCommandEvent&) { if (name.empty()) return; // Cards to export vector cards; - FOR_EACH(card, set->cards) { - if (isSelected(card)) cards.push_back(card); - } + getSelection(cards); // Export export_images(set, cards, name, gs.images_export_filename, gs.images_export_conflicts); // Done diff --git a/src/gui/print_window.cpp b/src/gui/print_window.cpp index 45f5d81e..fc9aebff 100644 --- a/src/gui/print_window.cpp +++ b/src/gui/print_window.cpp @@ -248,39 +248,45 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) { // ----------------------------------------------------------------------------- : PrintWindow -void print_preview(Window* parent, const SetP& set) { +const vector* cards_to_print(Window* parent, const SetP& set, const ExportCardSelectionChoices& choices) { // Let the user choose cards - CardSelectWindow wnd(parent, set, _LABEL_("select cards print"), _TITLE_("select cards")); + //CardSelectWindow wnd(parent, set, _LABEL_("select cards print"), _TITLE_("select cards")); + ExportWindowBase wnd(set, choices); + wnd.wxDialog::Create(parent, wxID_ANY, _TITLE_("select cards")); + wxSizer* s = new wxBoxSizer(wxVERTICAL); + wxSizer* s2 = wnd.Create(); + s->Add(s2, 1, wxEXPAND | wxALL, 8); + s->Add(wnd.CreateButtonSizer(wxOK | wxCANCEL) , 0, wxEXPAND | wxALL, 8); + s->SetSizeHints(&wnd); + wnd.SetSizer(s); + wnd.SetSize(300,-1); + // show window if (wnd.ShowModal() != wxID_OK) { - return; // cancel - } - vector selected; - FOR_EACH(c, set->cards) { - if (wnd.isSelected(c)) selected.push_back(c); + return nullptr; // cancel } + return &wnd.getSelection(); + +} + +void print_preview(Window* parent, const SetP& set, const ExportCardSelectionChoices& choices) { + const vector* cards = cards_to_print(parent, set, choices); + if (!cards) return; // Show the print preview wxPreviewFrame* frame = new wxPreviewFrame( new wxPrintPreview( - new CardsPrintout(set, selected), - new CardsPrintout(set, selected) + new CardsPrintout(set, *cards), + new CardsPrintout(set, *cards) ), parent, _TITLE_("print preview")); frame->Initialize(); frame->Maximize(true); frame->Show(); } -void print_set(Window* parent, const SetP& set) { - // Let the user choose cards - CardSelectWindow wnd(parent, set, _LABEL_("select cards print"), _TITLE_("select cards")); - if (wnd.ShowModal() != wxID_OK) { - return; // cancel - } - vector selected; - FOR_EACH(c, set->cards) { - if (wnd.isSelected(c)) selected.push_back(c); - } +void print_set(Window* parent, const SetP& set, const ExportCardSelectionChoices& choices) { + const vector* cards = cards_to_print(parent, set, choices); + if (!cards) return; // Print the cards wxPrinter p; - CardsPrintout pout(set, selected); + CardsPrintout pout(set, *cards); p.Print(parent, &pout, true); } diff --git a/src/gui/print_window.hpp b/src/gui/print_window.hpp index 2f25006f..51e8c910 100644 --- a/src/gui/print_window.hpp +++ b/src/gui/print_window.hpp @@ -12,6 +12,7 @@ #include #include #include +#include DECLARE_POINTER_TYPE(Set); class StyleSheet; @@ -19,10 +20,10 @@ class StyleSheet; // ----------------------------------------------------------------------------- : Printing /// Show a print preview for the given set -void print_preview(Window* parent, const SetP& set); +void print_preview(Window* parent, const SetP& set, const ExportCardSelectionChoices& choices); /// Print the given set -void print_set(Window* parent, const SetP& set); +void print_set(Window* parent, const SetP& set, const ExportCardSelectionChoices& choices); // ----------------------------------------------------------------------------- : Layout diff --git a/src/gui/set/panel.hpp b/src/gui/set/panel.hpp index 609ace6b..0386a5e7 100644 --- a/src/gui/set/panel.hpp +++ b/src/gui/set/panel.hpp @@ -11,6 +11,7 @@ #include #include +#include class wxFindReplaceData; @@ -69,6 +70,7 @@ class SetWindowPanel : public wxPanel, public SetView { virtual CardP selectedCard() const; ///< Return the currently selected card, or CardP() virtual void selectCard(const CardP& card) {} ///< Switch the view to another card, can be null virtual void selectFirstCard() {} ///< Switch the view to the first card + virtual void selectionChoices(ExportCardSelectionChoices& out) {} ///< Card subsets that can be exported from this panel }; // ----------------------------------------------------------------------------- : EOF diff --git a/src/gui/set/random_pack_panel.cpp b/src/gui/set/random_pack_panel.cpp index 6e4da64f..60c567d9 100644 --- a/src/gui/set/random_pack_panel.cpp +++ b/src/gui/set/random_pack_panel.cpp @@ -39,6 +39,8 @@ class RandomCardList : public CardListBase { using CardListBase::rebuild; + const vector* getCardsPtr() const { return &cards; } + protected: virtual void getItems(vector& out) const; virtual void onChangeSet(); @@ -328,6 +330,12 @@ void RandomPackPanel::selectCard(const CardP& card) { preview->setCard(card); } +void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) { + out.push_back(new_intrusive2( + _BUTTON_("export generated packs"), + card_list->getCardsPtr() + )); +} // ----------------------------------------------------------------------------- : Clipboard diff --git a/src/gui/set/random_pack_panel.hpp b/src/gui/set/random_pack_panel.hpp index dc648619..67ebb6ff 100644 --- a/src/gui/set/random_pack_panel.hpp +++ b/src/gui/set/random_pack_panel.hpp @@ -39,6 +39,7 @@ class RandomPackPanel : public SetWindowPanel { // --------------------------------------------------- : Selection virtual CardP selectedCard() const; virtual void selectCard(const CardP& card); + virtual void selectionChoices(ExportCardSelectionChoices& out); // --------------------------------------------------- : Clipboard diff --git a/src/gui/set/window.cpp b/src/gui/set/window.cpp index 587b85c7..2452e978 100644 --- a/src/gui/set/window.cpp +++ b/src/gui/set/window.cpp @@ -329,16 +329,6 @@ void SetWindow::updateTitle() { } } - -void SetWindow::onCardSelect(CardSelectEvent& ev) { - FOR_EACH(p, panels) { - p->selectCard(ev.card); - } -} -void SetWindow::onCardActivate(CardSelectEvent& ev) { - selectPanel(ID_WINDOW_CARDS); -} - void SetWindow::fixMinWindowSize() { current_panel->SetMinSize(current_panel->GetSizer()->GetMinSize()); Layout(); @@ -360,6 +350,26 @@ void SetWindow::onSizeChange(wxCommandEvent&) { fixMinWindowSize(); } + +// ----------------------------------------------------------------------------- : Cards + +void SetWindow::onCardSelect(CardSelectEvent& ev) { + FOR_EACH(p, panels) { + p->selectCard(ev.getCard()); + } +} +void SetWindow::onCardActivate(CardSelectEvent& ev) { + selectPanel(ID_WINDOW_CARDS); +} + +void SetWindow::selectionChoices(ExportCardSelectionChoices& out) { + out.push_back(new_intrusive1(*set)); // entire set + FOR_EACH(p, panels) { + p->selectionChoices(out); + } + out.push_back(new_intrusive()); // custom +} + // ----------------------------------------------------------------------------- : Window events - close void SetWindow::onClose(wxCloseEvent& ev) { @@ -594,11 +604,15 @@ void SetWindow::onFileCheckUpdates(wxCommandEvent&) { } void SetWindow::onFilePrint(wxCommandEvent&) { - print_set(this, set); + ExportCardSelectionChoices choices; + selectionChoices(choices); + print_set(this, set, choices); } void SetWindow::onFilePrintPreview(wxCommandEvent&) { - print_preview(this, set); + ExportCardSelectionChoices choices; + selectionChoices(choices); + print_preview(this, set, choices); } void SetWindow::onFileReload(wxCommandEvent&) { diff --git a/src/gui/set/window.hpp b/src/gui/set/window.hpp index 537f5565..f1f4c37a 100644 --- a/src/gui/set/window.hpp +++ b/src/gui/set/window.hpp @@ -12,6 +12,7 @@ #include #include #include +#include class IconMenu; class SetWindowPanel; @@ -86,16 +87,20 @@ class SetWindow : public wxFrame, public SetView { virtual void onAction(const Action&, bool undone); private: - /// A different card has been selected - void onCardSelect(CardSelectEvent&); - void onCardActivate(CardSelectEvent&); - // minSize = mainSizer->getMinWindowSize(this) // but wx made that private void fixMinWindowSize(); /// Update the window title based on the set name void updateTitle(); + // --------------------------------------------------- : Cards + + /// A different card has been selected + void onCardSelect(CardSelectEvent&); + void onCardActivate(CardSelectEvent&); + /// Card subsets that can be exported + void selectionChoices(ExportCardSelectionChoices& out); + // --------------------------------------------------- : Window events - close /// Ask the user to save the set diff --git a/src/resource/common/expected_locale_keys b/src/resource/common/expected_locale_keys index e320a4e3..141a64d0 100644 --- a/src/resource/common/expected_locale_keys +++ b/src/resource/common/expected_locale_keys @@ -1,6 +1,6 @@ # This file contains the keys expected to be in MSE locales # It was automatically generated by tools/locale/locale.pl -# Generated on Mon Aug 4 03:28:32 2008 +# Generated on Fri Aug 8 23:23:10 2008 action: add control point: 0 @@ -49,6 +49,9 @@ button: don't install package: 0 edit symbol: 0 enabled: 0 + export custom cards selection: 0 + export entire set: 0 + export generated packs: 0 fixed seed: 0 generate pack: 0 hide: 0 @@ -75,6 +78,7 @@ button: remove package: 0 select: optional, 0 select all: 0 + select cards: 0 select none: 0 show: 0 show editing hints: 0 @@ -310,8 +314,10 @@ label: rules: 0 save changes: 1 seed: 0 - select cards print: 0 + select cards: 0 + select cards print: optional, 0 select columns: 0 + selected card count: 1 selection: 0 selection height: 0 selection left: 0 diff --git a/src/util/window_id.hpp b/src/util/window_id.hpp index ea04d72f..997a80b4 100644 --- a/src/util/window_id.hpp +++ b/src/util/window_id.hpp @@ -232,6 +232,9 @@ enum ControlID { , ID_SHOW , ID_HIDE // Card select +, ID_SELECT_CARDS +, ID_SELECTION_CHOICE +, ID_SELECTION_CHOICE_MAX = ID_SELECTION_CHOICE + 10 , ID_SELECT_ALL , ID_SELECT_NONE // Settings