mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
Icon for random cards panel
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1124 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -44,7 +44,7 @@ void ItemList::selectNext() {
|
|||||||
selectItemPos(selected_item_pos + 1, true, true);
|
selectItemPos(selected_item_pos + 1, true, true);
|
||||||
}
|
}
|
||||||
void ItemList::selectFirst() {
|
void ItemList::selectFirst() {
|
||||||
assert(0 < (long)sorted_list.size());
|
if (sorted_list.empty()) return;
|
||||||
selectItemPos(0, true);
|
selectItemPos(0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,10 +113,10 @@ void PackTotalsPanel::draw(DC& dc) {
|
|||||||
}
|
}
|
||||||
// draw total
|
// draw total
|
||||||
dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW));
|
dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW));
|
||||||
dc.DrawLine(0, y-4, size.x, y-4);
|
|
||||||
dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT));
|
|
||||||
dc.DrawLine(0, y-3, size.x, y-3);
|
dc.DrawLine(0, y-3, size.x, y-3);
|
||||||
y += 6;
|
dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT));
|
||||||
|
dc.DrawLine(0, y-2, size.x, y-2);
|
||||||
|
y += 7;
|
||||||
drawItem(dc, y, _LABEL_("total cards"), total);
|
drawItem(dc, y, _LABEL_("total cards"), total);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -334,6 +334,7 @@ void RandomPackPanel::generate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
card_list->rebuild();
|
card_list->rebuild();
|
||||||
|
card_list->selectFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Selection
|
// ----------------------------------------------------------------------------- : Selection
|
||||||
@@ -343,7 +344,12 @@ CardP RandomPackPanel::selectedCard() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RandomPackPanel::selectCard(const CardP& card) {
|
void RandomPackPanel::selectCard(const CardP& card) {
|
||||||
preview->setCard(card);
|
// Don't change the card based on other panels
|
||||||
|
//preview->setCard(card);
|
||||||
|
}
|
||||||
|
void RandomPackPanel::onCardSelect(CardSelectEvent& ev) {
|
||||||
|
preview->setCard(ev.getCard());
|
||||||
|
ev.Skip(); // but do change other panels' selection
|
||||||
}
|
}
|
||||||
|
|
||||||
void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) {
|
void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) {
|
||||||
@@ -353,6 +359,12 @@ void RandomPackPanel::selectionChoices(ExportCardSelectionChoices& out) {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(RandomPackPanel, wxPanel)
|
||||||
|
EVT_CARD_SELECT(wxID_ANY, RandomPackPanel::onCardSelect)
|
||||||
|
END_EVENT_TABLE ()
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Clipboard
|
// ----------------------------------------------------------------------------- : Clipboard
|
||||||
|
|
||||||
bool RandomPackPanel::canCopy() const { return card_list->canCopy(); }
|
bool RandomPackPanel::canCopy() const { return card_list->canCopy(); }
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
class CardViewer;
|
class CardViewer;
|
||||||
class RandomCardList;
|
class RandomCardList;
|
||||||
class PackTotalsPanel;
|
class PackTotalsPanel;
|
||||||
|
struct CardSelectEvent;
|
||||||
DECLARE_POINTER_TYPE(PackType);
|
DECLARE_POINTER_TYPE(PackType);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : RandomPackPanel
|
// ----------------------------------------------------------------------------- : RandomPackPanel
|
||||||
@@ -47,6 +48,8 @@ class RandomPackPanel : public SetWindowPanel {
|
|||||||
virtual void doCopy();
|
virtual void doCopy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
CardViewer* preview; ///< Card preview
|
CardViewer* preview; ///< Card preview
|
||||||
RandomCardList* card_list; ///< The list of cards
|
RandomCardList* card_list; ///< The list of cards
|
||||||
wxTextCtrl* seed; ///< Seed value
|
wxTextCtrl* seed; ///< Seed value
|
||||||
@@ -74,6 +77,8 @@ class RandomPackPanel : public SetWindowPanel {
|
|||||||
void generate();
|
void generate();
|
||||||
/// Store the settings
|
/// Store the settings
|
||||||
void storeSettings();
|
void storeSettings();
|
||||||
|
|
||||||
|
void onCardSelect(CardSelectEvent& ev);
|
||||||
public:
|
public:
|
||||||
typedef PackItem PackItem_for_typeof;
|
typedef PackItem PackItem_for_typeof;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
|
|||||||
addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 2, _("window_style"), _("style tab"));
|
addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 2, _("window_style"), _("style tab"));
|
||||||
addPanel(menuWindow, tabBar, new KeywordsPanel (this, wxID_ANY), 3, _("window_keywords"), _("keywords tab"));
|
addPanel(menuWindow, tabBar, new KeywordsPanel (this, wxID_ANY), 3, _("window_keywords"), _("keywords tab"));
|
||||||
addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 4, _("window_statistics"), _("stats tab"));
|
addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 4, _("window_statistics"), _("stats tab"));
|
||||||
addPanel(menuWindow, tabBar, new RandomPackPanel(this, wxID_ANY), 5, _("window_cards"), _("random pack tab")); // TODO: Get me an icon
|
addPanel(menuWindow, tabBar, new RandomPackPanel(this, wxID_ANY), 5, _("window_random_pack"),_("random pack tab"));
|
||||||
selectPanel(ID_WINDOW_CARDS); // select cards panel
|
selectPanel(ID_WINDOW_CARDS); // select cards panel
|
||||||
|
|
||||||
// loose ends
|
// loose ends
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ tool/window_set_info IMAGE "tool/window_set_info.png"
|
|||||||
tool/window_style IMAGE "tool/window_style.png"
|
tool/window_style IMAGE "tool/window_style.png"
|
||||||
tool/window_keywords IMAGE "tool/window_keywords.png"
|
tool/window_keywords IMAGE "tool/window_keywords.png"
|
||||||
tool/window_statistics IMAGE "tool/window_statistics.png"
|
tool/window_statistics IMAGE "tool/window_statistics.png"
|
||||||
|
tool/window_random_pack IMAGE "tool/window_random_pack.png"
|
||||||
|
|
||||||
tool/help IMAGE "tool/help.png"
|
tool/help IMAGE "tool/help.png"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 580 B |
Reference in New Issue
Block a user