mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Card list sorting is now handled per window (closes #71)
This commit is contained in:
@@ -489,3 +489,7 @@ void CardsPanel::selectFirstCard() {
|
||||
if (!set) return; // we want onChangeSet first
|
||||
card_list->selectFirst();
|
||||
}
|
||||
|
||||
void CardsPanel::getCardLists(vector<CardListBase*>& out) {
|
||||
out.push_back(card_list);
|
||||
}
|
||||
@@ -75,6 +75,8 @@ public:
|
||||
void selectCard(const CardP& card) override;
|
||||
void selectFirstCard() override;
|
||||
|
||||
void getCardLists(vector<CardListBase*>& out) override;
|
||||
|
||||
private:
|
||||
// --------------------------------------------------- : Controls
|
||||
wxSizer* s_left;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <data/set.hpp>
|
||||
#include <gui/card_select_window.hpp>
|
||||
|
||||
class CardListBase;
|
||||
class wxFindReplaceData;
|
||||
|
||||
// ----------------------------------------------------------------------------- : SetWindowPanel
|
||||
@@ -77,7 +78,9 @@ public:
|
||||
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
|
||||
|
||||
|
||||
virtual void getCardLists(vector<CardListBase*>& out) {}
|
||||
|
||||
protected:
|
||||
/// Have any controls been created?
|
||||
bool isInitialized() const;
|
||||
|
||||
@@ -632,6 +632,9 @@ void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) {
|
||||
));
|
||||
}
|
||||
|
||||
void RandomPackPanel::getCardLists(vector<CardListBase*>& out) {
|
||||
if (isInitialized()) out.push_back(card_list);
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(RandomPackPanel, wxPanel)
|
||||
EVT_CARD_SELECT(wxID_ANY, RandomPackPanel::onCardSelect)
|
||||
|
||||
@@ -56,7 +56,8 @@ public:
|
||||
CardP selectedCard() const override;
|
||||
void selectCard(const CardP& card) override;
|
||||
void selectionChoices(ExportCardSelectionChoices& out) override;
|
||||
|
||||
void getCardLists(vector<CardListBase*>& out) override;
|
||||
|
||||
// --------------------------------------------------- : Clipboard
|
||||
|
||||
bool canCopy() const override;
|
||||
|
||||
@@ -566,3 +566,7 @@ void StatsPanel::selectCard(const CardP& card) {
|
||||
card_list->setCard(card);
|
||||
|
||||
}
|
||||
|
||||
void StatsPanel::getCardLists(vector<CardListBase*>& out) {
|
||||
if (isInitialized()) out.push_back(card_list);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
// --------------------------------------------------- : Selection
|
||||
CardP selectedCard() const override;
|
||||
void selectCard(const CardP& card) override;
|
||||
|
||||
void getCardLists(vector<CardListBase*>& out) override;
|
||||
|
||||
// --------------------------------------------------- : Data
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
@@ -388,6 +388,14 @@ void SetWindow::selectionChoices(ExportCardSelectionChoices& out) {
|
||||
out.push_back(make_intrusive<ExportCardSelectionChoice>()); // custom
|
||||
}
|
||||
|
||||
vector<CardListBase*> SetWindow::getCardLists() {
|
||||
vector<CardListBase*> out;
|
||||
FOR_EACH(p, panels) {
|
||||
p->getCardLists(out);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Window events - close
|
||||
|
||||
void SetWindow::onClose(wxCloseEvent& ev) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <gui/card_select_window.hpp>
|
||||
|
||||
class SetWindowPanel;
|
||||
class CardListBase;
|
||||
class wxFindDialogEvent;
|
||||
struct CardSelectEvent;
|
||||
|
||||
@@ -30,7 +31,10 @@ public:
|
||||
|
||||
/// Set the icon of one of the panels
|
||||
void setPanelIcon(SetWindowPanel* panel, wxBitmap const& icon);
|
||||
|
||||
|
||||
/// Get all card lists on all panels
|
||||
vector<CardListBase*> getCardLists();
|
||||
|
||||
// --------------------------------------------------- : Set actions
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user