Added GraphControl; FilteredCardList; ValueEditor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@74 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-19 18:59:33 +00:00
parent ce6a83e34b
commit ed336dea06
31 changed files with 705 additions and 82 deletions
+1
View File
@@ -41,6 +41,7 @@ CardsPanel::CardsPanel(Window* parent, int id)
wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
s->Add(editor, 0, wxRIGHT, 2);
s->Add(card_list, 1, wxEXPAND);
s->SetSizeHints(this);
SetSizer(s);
}
-2
View File
@@ -38,8 +38,6 @@ class CardsPanel : public SetWindowPanel {
virtual bool wantsToHandle(const Action&, bool undone) const;
virtual void onAction(const Action&, bool undone);
virtual void onRenderSettingsChange();
private:
void updateSize();
public:
// --------------------------------------------------- : Clipboard
+6 -1
View File
@@ -8,4 +8,9 @@
#include <gui/set/set_info_panel.hpp>
// ----------------------------------------------------------------------------- :
// ----------------------------------------------------------------------------- : SetInfoPanel
SetInfoPanel::SetInfoPanel(Window* parent, int id)
: SetWindowPanel(parent, id)
{
}
+46 -1
View File
@@ -7,9 +7,54 @@
// ----------------------------------------------------------------------------- : Includes
#include <gui/set/stats_panel.hpp>
#include <gui/control/graph.hpp>
#include <gui/control/gallery_list.hpp>
#include <gui/control/filtered_card_list.hpp>
#include <wx/splitter.h>
// ----------------------------------------------------------------------------- : StatFieldList
/// A list of fields of which the statistics can be shown
class StatFieldList : public GalleryList {
public:
StatFieldList(Window* parent, int id)
: GalleryList(parent, id, wxVERTICAL)
{
item_size = wxSize(100, 30);
}
protected:
virtual size_t itemCount() const;
virtual void drawItem(DC& dc, int x, int y, size_t item, bool selected);
};
size_t StatFieldList::itemCount() const {
return 0; // TODO
}
void StatFieldList::drawItem(DC& dc, int x, int y, size_t item, bool selected) {
// TODO
}
// ----------------------------------------------------------------------------- : StatsPanel
StatsPanel::StatsPanel(Window* parent, int id)
: SetWindowPanel(parent, id)
{}
{
// init controls
wxSplitterWindow* splitter;
fields = new StatFieldList (this, wxID_ANY);
splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
graph = new GraphControl (splitter, wxID_ANY);
card_list = new FilteredCardList(splitter, wxID_ANY);
// init splitter
splitter->SetMinimumPaneSize(100);
splitter->SetSashGravity(1.0);
splitter->SplitHorizontally(graph, card_list, -100);
// init sizer
wxSizer* s = new wxBoxSizer(wxHORIZONTAL);
s->Add(fields, 0, wxEXPAND | wxRIGHT, 2);
s->Add(splitter, 1, wxEXPAND);
s->SetSizeHints(this);
SetSizer(s);
}
+10
View File
@@ -12,13 +12,23 @@
#include <util/prec.hpp>
#include <gui/set/panel.hpp>
class StatFieldList;
class GraphControl;
class FilteredCardList;
// ----------------------------------------------------------------------------- : StatsPanel
class StatsPanel : public SetWindowPanel {
public:
StatsPanel(Window* parent, int id);
// virtual void onUpdateUI(wxUpdateUIEvent& e);
// virtual void onCommand(int id);
private:
StatFieldList* fields;
GraphControl* graph;
FilteredCardList* card_list;
};
// ----------------------------------------------------------------------------- : EOF
+4 -2
View File
@@ -199,7 +199,6 @@ void SetWindow::selectPanel(int id) {
++wid;
}
// fix sizer stuff
Layout();
fixMinWindowSize();
}
@@ -257,11 +256,13 @@ void SetWindow::onRenderSettingsChange() {
FOR_EACH(p, panels) {
p->onRenderSettingsChange();
}
Layout();
fixMinWindowSize();
}
void SetWindow::fixMinWindowSize() {
current_panel->Layout();
current_panel->SetMinSize(current_panel->GetSizer()->GetMinSize());
Layout();
wxSize s = GetSizer()->GetMinSize();
wxSize ws = GetSize();
wxSize cs = GetClientSize();
@@ -269,6 +270,7 @@ void SetWindow::fixMinWindowSize() {
if (ws.x < minSize.x) ws.x = minSize.x;
if (ws.y < minSize.y) ws.y = minSize.y;
SetSize(ws);
SetMinSize(minSize);
}