]> git.saurik.com Git - wxWidgets.git/commitdiff
added notebooks support; added not_supported variable type
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 27 Jul 2000 18:52:12 +0000 (18:52 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 27 Jul 2000 18:52:12 +0000 (18:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/utils/wxrcedit/Makefile.in
contrib/utils/wxrcedit/nodehnd.cpp
contrib/utils/wxrcedit/nodehnd.h
contrib/utils/wxrcedit/prophnd.cpp
contrib/utils/wxrcedit/prophnd.h

index eee98d61566e6de7abd27566cff885ed0b4aa230..6301d766d5fc583c9c2f81775ed5e69069c410d2 100644 (file)
@@ -9,14 +9,45 @@ PROGRAM=wxrcedit
 OBJECTS=edapp.o editor.o nodehnd.o prophnd.o xmlhelpr.o
 
 DATADIRS = df
 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
 
 APPEXTRALIBS=$(top_builddir)/lib/libwxxml.@WX_TARGET_LIBRARY_TYPE@
 APPEXTRADEFS=-I$(top_srcdir)/contrib/include
index b8fc433f4cd9525495d01a7b8b09e2157e508c4e..6dbe037caac73589a2996fa0805dd090e740189e 100644 (file)
@@ -85,6 +85,8 @@ void NodeInfo::Read(const wxString& filename)
             if (s == "sizer") tp = HANDLER_SIZER;
             else if (s == "sizeritem") tp = HANDLER_SIZERITEM;
             else if (s == "panel") tp = HANDLER_PANEL;
             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 (s == "normal")*/ tp = HANDLER_NORMAL;
         }
         else if (s == "var")
@@ -98,7 +100,8 @@ void NodeInfo::Read(const wxString& filename)
             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 == "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;
             else /*if (typ == "text")*/ pi.Type = PROP_TEXT;
             
             bool fnd = FALSE;
@@ -153,6 +156,12 @@ NodeHandler *NodeHandler::CreateFromFile(const wxString& filename, EditorFrame *
         case HANDLER_SIZERITEM:
             hnd = new NodeHandlerSizerItem(frame, ni);
             break;
         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;
         default:
             hnd = new NodeHandler(frame, ni);
             break;
@@ -186,6 +195,7 @@ void NodeHandler::CreatePropHandlers()
     s_PropHandlers[PROP_BOOL] = new BoolPropertyHandler;
     s_PropHandlers[PROP_INTEGER] = new TextPropertyHandler;
     s_PropHandlers[PROP_COORD] = new CoordPropertyHandler;
     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;
 }
 
 
 }
 
 
@@ -373,8 +383,13 @@ void NodeHandlerSizer::InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode
 
 int NodeHandlerSizer::GetTreeIcon(wxXmlNode *node)
 {
 
 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;
 }
 
 
 }
 
 
@@ -435,3 +450,31 @@ wxXmlNode *NodeHandlerSizerItem::GetRealNode(wxXmlNode *node)
     }
     return NULL;
 }
     }
     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);
+}
index 661e360b052818147500f964baf833b094522f48..8001b5fece3b1c0f5859468a6188cde05779cd9f 100644 (file)
@@ -33,7 +33,9 @@ enum HandlerType
     HANDLER_PANEL = 1,
     HANDLER_NORMAL,
     HANDLER_SIZER,
     HANDLER_PANEL = 1,
     HANDLER_NORMAL,
     HANDLER_SIZER,
-    HANDLER_SIZERITEM
+    HANDLER_SIZERITEM,
+    HANDLER_NOTEBOOK,
+    HANDLER_NOTEBOOKPAGE
 };
 
 
 };
 
 
@@ -125,6 +127,26 @@ class NodeHandlerSizerItem : public NodeHandler
 
 
 
 
 
 
+// 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
 {
 // Generic handler which handles everything
 class NodeHandlerUnknown : public NodeHandler
 {
index d70ad658a2c7b9ebf63270c079719006e30b6343..6e7921d58b6ea855e46e230abd03a3bb9648992c 100644 (file)
@@ -331,3 +331,17 @@ wxPanel *FlagsPropertyHandler::CreateEditPanel(wxWindow *parent, PropsListInfo *
 {
     return new FlagsPropPanel(parent, this, pli);
 }
 {
     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;
+}
index b8c1b5665f23cdca55157b0c0d7f4b3378f1b6d1..fcc725eaf0cafd03954f799f94f7432b538719bd 100644 (file)
@@ -31,9 +31,10 @@ enum PropertyType
     PROP_COLOR = 2,
     PROP_BOOL = 3,
     PROP_INTEGER = 4,
     PROP_COLOR = 2,
     PROP_BOOL = 3,
     PROP_INTEGER = 4,
-    PROP_COORD = 5
+    PROP_COORD = 5,
+    PROP_NOT_IMPLEMENTED = 6,
 };
 };
-#define PROP_TYPES_CNT  6
+#define PROP_TYPES_CNT  7
 
 class PropertyInfo
 {
 
 class PropertyInfo
 {
@@ -113,4 +114,13 @@ class FlagsPropertyHandler : public PropertyHandler
 };
 
 
 };
 
 
+
+class NotImplPropertyHandler : public PropertyHandler
+{
+    public:
+        NotImplPropertyHandler() {}
+        virtual wxPanel *CreateEditPanel(wxWindow *parent, PropsListInfo *pli);
+};
+
+
 #endif 
 #endif