mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
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
This commit is contained in:
@@ -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<ExportCardSelectionChoice> {
|
||||
public:
|
||||
ExportCardSelectionChoice();
|
||||
ExportCardSelectionChoice(const Set& set);
|
||||
ExportCardSelectionChoice(const String& label, const vector<CardP>& cards);
|
||||
ExportCardSelectionChoice(const String& label, const vector<CardP>* cards);
|
||||
|
||||
const String label;
|
||||
const ExportCardSelectionType type;
|
||||
const vector<CardP>* the_cards; ///< The cards
|
||||
vector<CardP> own_cards; ///< Maybe we own the cards, in that case the_cards = &own_cards
|
||||
};
|
||||
|
||||
typedef vector<ExportCardSelectionChoiceP> 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<CardP>& getSelection() const { return *cards; }
|
||||
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
SetP set; ///< Set to export
|
||||
const vector<CardP>* 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<CardP>& out) const;
|
||||
/// Change which cards are selected
|
||||
void setSelection(const vector<CardP>& cards);
|
||||
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
Reference in New Issue
Block a user