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:
twanvl
2008-08-09 18:32:48 +00:00
parent a10ca59cef
commit 4d674712d1
6 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ void ItemList::selectNext() {
selectItemPos(selected_item_pos + 1, true, true);
}
void ItemList::selectFirst() {
assert(0 < (long)sorted_list.size());
if (sorted_list.empty()) return;
selectItemPos(0, true);
}
+16 -4
View File
@@ -113,10 +113,10 @@ void PackTotalsPanel::draw(DC& dc) {
}
// draw total
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);
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);
}
@@ -334,6 +334,7 @@ void RandomPackPanel::generate() {
}
}
card_list->rebuild();
card_list->selectFirst();
}
// ----------------------------------------------------------------------------- : Selection
@@ -343,7 +344,12 @@ CardP RandomPackPanel::selectedCard() const {
}
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) {
@@ -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
bool RandomPackPanel::canCopy() const { return card_list->canCopy(); }
+5
View File
@@ -16,6 +16,7 @@
class CardViewer;
class RandomCardList;
class PackTotalsPanel;
struct CardSelectEvent;
DECLARE_POINTER_TYPE(PackType);
// ----------------------------------------------------------------------------- : RandomPackPanel
@@ -47,6 +48,8 @@ class RandomPackPanel : public SetWindowPanel {
virtual void doCopy();
private:
DECLARE_EVENT_TABLE();
CardViewer* preview; ///< Card preview
RandomCardList* card_list; ///< The list of cards
wxTextCtrl* seed; ///< Seed value
@@ -74,6 +77,8 @@ class RandomPackPanel : public SetWindowPanel {
void generate();
/// Store the settings
void storeSettings();
void onCardSelect(CardSelectEvent& ev);
public:
typedef PackItem PackItem_for_typeof;
};
+1 -1
View File
@@ -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 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 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
// loose ends
+1
View File
@@ -65,6 +65,7 @@ tool/window_set_info IMAGE "tool/window_set_info.png"
tool/window_style IMAGE "tool/window_style.png"
tool/window_keywords IMAGE "tool/window_keywords.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"
Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B