Some more data types; dynamic arguments

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@5 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-01 19:40:39 +00:00
parent 50b22e9478
commit 331423bd07
27 changed files with 431 additions and 95 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ SymbolControl::SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol
, SymbolViewer(symbol)
, parent(parent)
{
switchEditor(new_shared2<SymbolSelectEditor>(this, false));
onChangeSymbol();
}
void SymbolControl::switchEditor(const SymbolEditorBaseP& e) {
@@ -34,7 +34,7 @@ void SymbolControl::switchEditor(const SymbolEditorBaseP& e) {
Refresh(false);
}
void SymbolControl::onSymbolChange() {
void SymbolControl::onChangeSymbol() {
selectedParts.clear();
switchEditor(new_shared2<SymbolSelectEditor>(this, false));
Refresh(false);
+1 -1
View File
@@ -26,7 +26,7 @@ class SymbolControl : public wxControl, public SymbolViewer {
public:
SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol);
virtual void onSymbolChange();
virtual void onChangeSymbol();
virtual void onAction(const Action&);
+2 -2
View File
@@ -43,9 +43,9 @@ class SymbolEditorBase {
// --------------------------------------------------- : UI
/// Init extra toolbar items and menus needed for this panel
/// Init extra toolbar items and menus needed for this editor
virtual void initUI(wxToolBar* tb, wxMenuBar* mb) {}
/// Destroy the extra items added by initUI
/// Destroy the extra items added by initUI.
virtual void destroyUI(wxToolBar* tb, wxMenuBar* mb) {}
/// Update the UI by enabling/disabling items
virtual void onUpdateUI(wxUpdateUIEvent& ev) {}
+3 -3
View File
@@ -16,7 +16,6 @@
SymbolPartList::SymbolPartList(Window* parent, int id, SymbolP symbol)
: wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxLC_NO_HEADER | wxLC_VIRTUAL | wxLC_EDIT_LABELS)
, SymbolView(symbol)
{
// Create image list
wxImageList* images = new wxImageList(16,16);
@@ -30,12 +29,13 @@ SymbolPartList::SymbolPartList(Window* parent, int id, SymbolP symbol)
AssignImageList(images, wxIMAGE_LIST_SMALL);
// create columns
InsertColumn(0, _("Name"));
update();
// view symbol
setSymbol(symbol);
}
// ----------------------------------------------------------------------------- : View events
void SymbolPartList::onSymbolChange() {
void SymbolPartList::onChangeSymbol() {
update();
}
+1 -1
View File
@@ -36,7 +36,7 @@ class SymbolPartList : public wxListCtrl, public SymbolView {
void selectParts(const set<SymbolPartP>& sel);
/// Another symbol is being viewed
void onSymbolChange();
void onChangeSymbol();
/// Event handler for changes to the symbol
virtual void onAction(const Action& a);
+3 -2
View File
@@ -12,9 +12,10 @@
SymbolViewer::SymbolViewer(const SymbolP& symbol, double borderRadius)
: borderRadius(borderRadius)
, SymbolView(symbol)
, rotation(0, RealRect(0,0,500,500))
{}
{
setSymbol(symbol);
}
// ----------------------------------------------------------------------------- : Drawing
+3 -31
View File
@@ -15,34 +15,6 @@
#include <wx/filename.h>
#include <wx/wfstream.h>
// ----------------------------------------------------------------------------- : Window ids
enum SymIDs
{ idFileNew = wxID_NEW
, idFileOpen = wxID_OPEN
, idFileSave = wxID_SAVE
, idFileSaveAs = wxID_SAVEAS
, idFileStore = 0
, idFileExit = wxID_EXIT
, idExtraTools = 1000
, idExtraToolsMax = idExtraTools + 500
, idEditUndo = wxID_UNDO
, idEditRedo = wxID_REDO
, idEditDuplicate = 1100 // idExtraTools + 100
, idModeSelect = idFileStore + 1
, idModeRotate
, idModePoints
, idModeShapes
, idModePaint
, idModeMax
, idPartList
, idControl
};
// ------------------------------------------------------------------------------------------------ : Default symbol
// A default symbol part, a square, moved by d
@@ -218,17 +190,17 @@ void SymbolWindow::onExtraTool(wxCommandEvent& ev) {
void SymbolWindow::onUpdateUI(wxUpdateUIEvent& ev) {
switch(ev.GetId()) {
// file menu
case idFileStore: {
case ID_FILE_STORE: {
// ev.Enable(value);
break;
// undo/redo
} case idEditUndo: {
} case ID_EDIT_UNDO: {
ev.Enable(control->getSymbol()->actions.canUndo());
String label = control->getSymbol()->actions.undoName();
ev.SetText(label + _("\tCtrl+Z"));
GetToolBar()->SetToolShortHelp(ID_EDIT_UNDO, label);
break;
} case idEditRedo: {
} case ID_EDIT_REDO: {
ev.Enable(control->getSymbol()->actions.canRedo());
String label = control->getSymbol()->actions.redoName();
ev.SetText(label + _("\tF4"));