]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/tools.py
implemented locating objects in gridbag sizer,
[wxWidgets.git] / wxPython / wx / tools / XRCed / tools.py
index 7d852d0ef682c0410881044fabc1b61f9f5735e3..f13a9cbb57dc1d31e0184759800838d5f0bd37a7 100644 (file)
@@ -15,7 +15,7 @@ GROUPNUM = 4
 GROUP_WINDOWS, GROUP_MENUS, GROUP_SIZERS, GROUP_CONTROLS = range(GROUPNUM)
 
 # States depending on current selection and Control/Shift keys
 GROUP_WINDOWS, GROUP_MENUS, GROUP_SIZERS, GROUP_CONTROLS = range(GROUPNUM)
 
 # States depending on current selection and Control/Shift keys
-STATE_ROOT, STATE_MENUBAR, STATE_TOOLBAR, STATE_MENU, STATE_ELSE = range(5)
+STATE_ROOT, STATE_MENUBAR, STATE_TOOLBAR, STATE_MENU, STATE_STDDLGBTN, STATE_ELSE = range(6)
 
 # Left toolbar for GUI elements
 class Tools(wxPanel):
 
 # Left toolbar for GUI elements
 class Tools(wxPanel):
@@ -83,6 +83,7 @@ class Tools(wxPanel):
              (ID_NEW.LIST_CTRL, images.getToolListCtrlBitmap()),
              
              (ID_NEW.NOTEBOOK, images.getToolNotebookBitmap()),
              (ID_NEW.LIST_CTRL, images.getToolListCtrlBitmap()),
              
              (ID_NEW.NOTEBOOK, images.getToolNotebookBitmap()),
+             (ID_NEW.SPLITTER_WINDOW, images.getToolSplitterWindowBitmap()),
 
              (ID_NEW.UNKNOWN, images.getToolUnknownBitmap())]
             ]
 
              (ID_NEW.UNKNOWN, images.getToolUnknownBitmap())]
             ]
@@ -209,6 +210,8 @@ class Tools(wxPanel):
                 state = STATE_TOOLBAR
             elif xxx.__class__ in [xxxMenu, xxxMenuItem]:
                 state = STATE_MENU
                 state = STATE_TOOLBAR
             elif xxx.__class__ in [xxxMenu, xxxMenuItem]:
                 state = STATE_MENU
+            elif xxx.__class__ == xxxStdDialogButtonSizer:
+                state = STATE_STDDLGBTN
             else:
                 state = STATE_ELSE
 
             else:
                 state = STATE_ELSE
 
@@ -227,6 +230,8 @@ class Tools(wxPanel):
                                         ID_NEW.MENU_ITEM,
                                         ID_NEW.SEPARATOR ],
                                       False)
                                         ID_NEW.MENU_ITEM,
                                         ID_NEW.SEPARATOR ],
                                       False)
+            elif state == STATE_STDDLGBTN:
+                pass                    # nothing can be added from toolbar
             elif state == STATE_MENUBAR:
                 self.EnableGroup(GROUP_MENUS)
                 self.EnableGroupItems(GROUP_MENUS,
             elif state == STATE_MENUBAR:
                 self.EnableGroup(GROUP_MENUS)
                 self.EnableGroupItems(GROUP_MENUS,
@@ -245,7 +250,8 @@ class Tools(wxPanel):
                 self.EnableGroup(GROUP_CONTROLS)
                 self.EnableGroupItems(GROUP_CONTROLS,
                                       [ ID_NEW.TREE_CTRL,
                 self.EnableGroup(GROUP_CONTROLS)
                 self.EnableGroupItems(GROUP_CONTROLS,
                                       [ ID_NEW.TREE_CTRL,
-                                        ID_NEW.NOTEBOOK ],
+                                        ID_NEW.NOTEBOOK,
+                                        ID_NEW.SPLITTER_WINDOW ],
                                       False)
             elif state == STATE_MENU:
                 self.EnableGroup(GROUP_MENUS)
                                       False)
             elif state == STATE_MENU:
                 self.EnableGroup(GROUP_MENUS)
@@ -271,13 +277,15 @@ class Tools(wxPanel):
                                       False)
                 self.EnableGroup(GROUP_SIZERS)
                 self.EnableGroup(GROUP_CONTROLS)
                                       False)
                 self.EnableGroup(GROUP_SIZERS)
                 self.EnableGroup(GROUP_CONTROLS)
-        # Special case for notebook (always executed)
+        # Special case for *book (always executed)
         if state == STATE_ELSE:
         if state == STATE_ELSE:
-            if xxx.__class__ == xxxNotebook:
+            if xxx.__class__ in [xxxNotebook, xxxChoicebook, xxxListbook]:
                 self.EnableGroup(GROUP_SIZERS, False)
             else:
                 self.EnableGroup(GROUP_SIZERS)
                 if not (xxx.isSizer or xxx.parent and xxx.parent.isSizer):
                     self.EnableGroupItem(GROUP_SIZERS, ID_NEW.SPACER, False)
                 self.EnableGroup(GROUP_SIZERS, False)
             else:
                 self.EnableGroup(GROUP_SIZERS)
                 if not (xxx.isSizer or xxx.parent and xxx.parent.isSizer):
                     self.EnableGroupItem(GROUP_SIZERS, ID_NEW.SPACER, False)
+            if xxx.__class__ == xxxFrame:
+                self.EnableGroupItem(GROUP_MENUS, ID_NEW.MENU_BAR)
         # Save state
         self.state = state
         # Save state
         self.state = state