OBJECTS=edapp.o editor.o nodehnd.o prophnd.o xmlhelpr.o
DATADIRS = df
-DATAFILES = df/boxsizer.df df/break.df df/button.df df/checkbox.df \
- df/control.df df/dialog.df df/gauge.df df/htmlwindow.df \
- df/menu.df df/menu_item.df df/menubar.df df/menuitem.df \
- df/panel.df df/panel_item.df df/panelbase.df df/radiobutton.df \
- df/separator.df df/sizer_item.df df/sizeritem.df df/slider.df \
- df/spacer.df df/staticbitmap.df df/staticboxsizer.df \
- df/statictext.df df/textctrl.df df/toolbar_item.df df/window.df \
- df/gridsizer.df df/flexgridsizer.df
+DATAFILES = \
+ df/boxsizer.df \
+ df/break.df \
+ df/button.df \
+ df/checkbox.df \
+ df/checklist.df \
+ df/choice.df \
+ df/combobox.df \
+ df/control.df \
+ df/dialog.df \
+ df/flexgridsizer.df \
+ df/gauge.df \
+ df/gridsizer.df \
+ df/htmlwindow.df \
+ df/menu.df \
+ df/menu_item.df \
+ df/menubar.df \
+ df/menuitem.df \
+ df/notebook.df \
+ df/notebookpage.df \
+ df/panel.df \
+ df/panel_item.df \
+ df/panelbase.df \
+ df/radiobox.df \
+ df/radiobutton.df \
+ df/separator.df \
+ df/sizer_item.df \
+ df/sizeritem.df \
+ df/slider.df \
+ df/spacer.df \
+ df/spinbutton.df \
+ df/spinctrl.df \
+ df/staticbitmap.df \
+ df/staticboxsizer.df \
+ df/statictext.df \
+ df/textctrl.df \
+ df/toolbar_item.df \
+ df/window.df
+
APPEXTRALIBS=$(top_builddir)/lib/libwxxml.@WX_TARGET_LIBRARY_TYPE@
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
if (s == "sizer") tp = HANDLER_SIZER;
else if (s == "sizeritem") tp = HANDLER_SIZERITEM;
else if (s == "panel") tp = HANDLER_PANEL;
+ else if (s == "notebook") tp = HANDLER_NOTEBOOK;
+ else if (s == "notebookpage") tp = HANDLER_NOTEBOOKPAGE;
else /*if (s == "normal")*/ tp = HANDLER_NORMAL;
}
else if (s == "var")
else if (typ == "flags") pi.Type = PROP_FLAGS;
else if (typ == "bool") pi.Type = PROP_BOOL;
else if (typ == "integer") pi.Type = PROP_INTEGER;
- else if (typ == "coord") pi.Type = PROP_COORD;
+ else if (typ == "coord") pi.Type = PROP_COORD;
+ else if (typ == "not_implemented") pi.Type = PROP_NOT_IMPLEMENTED;
else /*if (typ == "text")*/ pi.Type = PROP_TEXT;
bool fnd = FALSE;
case HANDLER_SIZERITEM:
hnd = new NodeHandlerSizerItem(frame, ni);
break;
+ case HANDLER_NOTEBOOK:
+ hnd = new NodeHandlerNotebook(frame, ni);
+ break;
+ case HANDLER_NOTEBOOKPAGE:
+ hnd = new NodeHandlerNotebookPage(frame, ni);
+ break;
default:
hnd = new NodeHandler(frame, ni);
break;
s_PropHandlers[PROP_BOOL] = new BoolPropertyHandler;
s_PropHandlers[PROP_INTEGER] = new TextPropertyHandler;
s_PropHandlers[PROP_COORD] = new CoordPropertyHandler;
+ s_PropHandlers[PROP_NOT_IMPLEMENTED] = new NotImplPropertyHandler;
}
int NodeHandlerSizer::GetTreeIcon(wxXmlNode *node)
{
- if (XmlReadValue(node, "orient") == "wxVERTICAL") return 2;
- else return 3;
+ int orig = NodeHandler::GetTreeIcon(node);
+ if (orig == 0)
+ {
+ if (XmlReadValue(node, "orient") == "wxVERTICAL") return 2;
+ else return 3;
+ }
+ else return orig;
}
}
return NULL;
}
+
+
+
+
+
+
+void NodeHandlerNotebook::InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before)
+{
+ wxXmlNode *cnd = XmlFindNode(parent, "children");
+ if (cnd == NULL)
+ {
+ cnd = new wxXmlNode(wxXML_ELEMENT_NODE, "children");
+ parent->AddChild(cnd);
+ }
+
+ {
+ wxXmlNode *itemnode = new wxXmlNode(wxXML_ELEMENT_NODE, "notebookpage");
+ wxXmlNode *winnode = new wxXmlNode(wxXML_ELEMENT_NODE, "window");
+ itemnode->AddChild(winnode);
+ winnode->AddChild(node);
+
+ if (insert_before)
+ cnd->InsertChild(itemnode, insert_before);
+ else
+ cnd->AddChild(itemnode);
+ }
+ EditorFrame::Get()->NotifyChanged(CHANGED_TREE);
+}
HANDLER_PANEL = 1,
HANDLER_NORMAL,
HANDLER_SIZER,
- HANDLER_SIZERITEM
+ HANDLER_SIZERITEM,
+ HANDLER_NOTEBOOK,
+ HANDLER_NOTEBOOKPAGE
};
+// wxNotebook handler
+class NodeHandlerNotebook : public NodeHandlerPanel
+{
+ public:
+ NodeHandlerNotebook(EditorFrame *frame, NodeInfo *ni) : NodeHandlerPanel(frame, ni) {}
+
+ virtual void InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before = NULL);
+};
+
+
+// notebook page handler
+class NodeHandlerNotebookPage : public NodeHandlerSizerItem
+{
+ public:
+ NodeHandlerNotebookPage(EditorFrame *frame, NodeInfo *ni) :
+ NodeHandlerSizerItem(frame, ni) {}
+};
+
+
+
// Generic handler which handles everything
class NodeHandlerUnknown : public NodeHandler
{
{
return new FlagsPropPanel(parent, this, pli);
}
+
+
+
+
+wxPanel *NotImplPropertyHandler::CreateEditPanel(wxWindow *parent, PropsListInfo *pli)
+{
+ wxPanel *p = new wxPanel(parent);
+ wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+ sizer->Add(new wxStaticText(p, -1, _("Sorry, this is not supported.\nYou have to edit XML code directly.")), 1, wxEXPAND|wxALL, 5);
+ p->SetAutoLayout(TRUE);
+ p->SetSizer(sizer);
+ p->Layout();
+ return p;
+}