mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Added dummy keyword panel; fixed directory finding; added more controls to style panel
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@86 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
//+----------------------------------------------------------------------------+
|
||||
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <gui/set/keywords_panel.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : KeywordsList
|
||||
|
||||
// ----------------------------------------------------------------------------- : KeywordsPanel
|
||||
|
||||
KeywordsPanel::KeywordsPanel(Window* parent, int id)
|
||||
: SetWindowPanel(parent, id)
|
||||
{
|
||||
/*wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxSizer* s2 = new wxBoxSizer(wxVERTICAL);
|
||||
s2->Add(list_active, 1, wxEXPAND);
|
||||
s2->Add(list_inactive, 1, wxEXPAND);
|
||||
s->SetSizeHints(this);
|
||||
SetSizer(s);*/
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
//+----------------------------------------------------------------------------+
|
||||
|
||||
#ifndef HEADER_GUI_SET_KEYWORDS_PANEL
|
||||
#define HEADER_GUI_SET_KEYWORDS_PANEL
|
||||
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <gui/set/panel.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : KeywordsPanel
|
||||
|
||||
/// A panel for listing and editing the keywords in a set
|
||||
class KeywordsPanel : public SetWindowPanel {
|
||||
public:
|
||||
KeywordsPanel(Window* parent, int id);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
@@ -18,6 +18,7 @@ class FilteredCardList;
|
||||
|
||||
// ----------------------------------------------------------------------------- : StatsPanel
|
||||
|
||||
/// A panel for showing statistics on cards
|
||||
class StatsPanel : public SetWindowPanel {
|
||||
public:
|
||||
StatsPanel(Window* parent, int id);
|
||||
|
||||
@@ -8,17 +8,47 @@
|
||||
|
||||
#include <gui/set/style_panel.hpp>
|
||||
#include <gui/control/package_list.hpp>
|
||||
#include <gui/control/card_viewer.hpp>
|
||||
#include <gui/control/native_look_editor.hpp>
|
||||
#include <util/window_id.hpp>
|
||||
#include <data/set.hpp>
|
||||
#include <data/game.hpp>
|
||||
#include <data/stylesheet.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : StylePanel
|
||||
|
||||
StylePanel::StylePanel(Window* parent, int id)
|
||||
: SetWindowPanel(parent, id)
|
||||
{
|
||||
PackageList* list = new PackageList(this, wxID_ANY);
|
||||
list->showData<Game>();
|
||||
|
||||
// init controls
|
||||
preview = new CardViewer (this, wxID_ANY);
|
||||
editor = new StylingEditor(this, wxID_ANY, wxNO_BORDER);
|
||||
list = new PackageList (this, wxID_ANY);
|
||||
use_for_all = new wxButton (this, ID_STYLE_USE_FOR_ALL, _("Use for &all cards"));
|
||||
// init sizer
|
||||
wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
|
||||
s->Add(list, 1, wxEXPAND);
|
||||
s->Add(preview, 0, wxRIGHT, 2);
|
||||
wxSizer* s2 = new wxBoxSizer(wxVERTICAL);
|
||||
s2->Add(list, 0, wxEXPAND | wxBOTTOM, 4);
|
||||
s2->Add(use_for_all, 0, wxRIGHT | wxBOTTOM | wxALIGN_RIGHT, 4);
|
||||
wxSizer* s3 = new wxStaticBoxSizer(wxVERTICAL, this, _("Extra styling options"));
|
||||
s3->Add(editor, 2, wxEXPAND, 0);
|
||||
s2->Add(s3, 1, wxEXPAND | wxALL, 2);
|
||||
s->Add(s2, 1, wxEXPAND, 8);
|
||||
s->SetSizeHints(this);
|
||||
SetSizer(s);
|
||||
}
|
||||
|
||||
void StylePanel::onChangeSet() {
|
||||
list->showData<StyleSheet>(set->game->name() + _("-*"));
|
||||
list->select(set->stylesheet->name());
|
||||
editor->setSet(set);
|
||||
preview->setSet(set);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Selection
|
||||
|
||||
void StylePanel::selectCard(const CardP& card) {
|
||||
preview->setCard(card);
|
||||
list->select(set->stylesheetFor(card)->name());
|
||||
}
|
||||
|
||||
@@ -12,11 +12,27 @@
|
||||
#include <util/prec.hpp>
|
||||
#include <gui/set/panel.hpp>
|
||||
|
||||
class CardViewer;
|
||||
class PackageList;
|
||||
class StylingEditor;
|
||||
|
||||
// ----------------------------------------------------------------------------- : StylePanel
|
||||
|
||||
/// A panel showing a list of stylesheets, and an editor for styling
|
||||
class StylePanel : public SetWindowPanel {
|
||||
public:
|
||||
StylePanel(Window* parent, int id);
|
||||
|
||||
virtual void onChangeSet();
|
||||
|
||||
// --------------------------------------------------- : Selection
|
||||
virtual void selectCard(const CardP& card);
|
||||
|
||||
private:
|
||||
CardViewer* preview; ///< Card preview
|
||||
PackageList* list; ///< List of stylesheets
|
||||
StylingEditor* editor; ///< Editor for styling information
|
||||
wxButton* use_for_all;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <gui/set/cards_panel.hpp>
|
||||
#include <gui/set/set_info_panel.hpp>
|
||||
#include <gui/set/style_panel.hpp>
|
||||
#include <gui/set/keywords_panel.hpp>
|
||||
#include <gui/set/stats_panel.hpp>
|
||||
#include <gui/control/card_list.hpp>
|
||||
#include <gui/control/gallery_list.hpp>
|
||||
@@ -117,13 +118,13 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
|
||||
// NOTE: place the CardsPanel last in the panels list,
|
||||
// this way the card list is the last to be told of a set change
|
||||
// this way everyone else already uses the new set when it sends a CardSelectEvent
|
||||
addPanel(menuWindow, tabBar, new CardsPanel (this, wxID_ANY), 3, _("F5"), _("Cards"), _("Cards"), _("Edit the cards in the set"));
|
||||
addPanel(menuWindow, tabBar, new CardsPanel (this, wxID_ANY), 4, _("F5"), _("Cards"), _("Cards"), _("Edit the cards in the set"));
|
||||
addPanel(menuWindow, tabBar, new SetInfoPanel (this, wxID_ANY), 0, _("F6"), _("Set info"), _("&Set Information"), _("Edit information about the set, its creator, etc."));
|
||||
addPanel(menuWindow, tabBar, new StylePanel (this, wxID_ANY), 1, _("F7"), _("Style"), _("Style"), _("Change the style of cards"));
|
||||
// addPanel(menuWindow, tabBar, new KeywordsPanel(this, wxID_ANY), 2, _("F8"));
|
||||
addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 2, _("F9"), _("Stats"), _("Statistics"), _("Show statistics about the cards in the set"));
|
||||
addPanel(menuWindow, tabBar, new KeywordsPanel(this, wxID_ANY), 2, _("F8"), _("Keywords"), _("Keywords"), _("Define extra keywords for this set"));
|
||||
addPanel(menuWindow, tabBar, new StatsPanel (this, wxID_ANY), 3, _("F9"), _("Stats"), _("Statistics"), _("Show statistics about the cards in the set"));
|
||||
// addPanel(*s, *menuWindow, *tabBar, new DraftPanel (&this, wxID_ANY), 4, _("F10"))
|
||||
selectPanel(ID_WINDOW_MIN + 3); // select cards panel
|
||||
selectPanel(ID_WINDOW_MIN + 0); // select cards panel
|
||||
|
||||
// loose ends
|
||||
tabBar->Realize();
|
||||
@@ -256,7 +257,6 @@ void SetWindow::onRenderSettingsChange() {
|
||||
}
|
||||
|
||||
void SetWindow::fixMinWindowSize() {
|
||||
current_panel->Layout();
|
||||
current_panel->SetMinSize(current_panel->GetSizer()->GetMinSize());
|
||||
Layout();
|
||||
wxSize s = GetSizer()->GetMinSize();
|
||||
|
||||
Reference in New Issue
Block a user