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):
(ID_NEW.STATIC_BOX_SIZER, images.getToolStaticBoxSizerBitmap()),
(ID_NEW.GRID_SIZER, images.getToolGridSizerBitmap()),
(ID_NEW.FLEX_GRID_SIZER, images.getToolFlexGridSizerBitmap()),
+ (ID_NEW.GRID_BAG_SIZER, images.getToolGridBagSizerBitmap()),
(ID_NEW.SPACER, images.getToolSpacerBitmap())],
["Controls",
(ID_NEW.STATIC_TEXT, images.getToolStaticTextBitmap()),
(ID_NEW.LIST_CTRL, images.getToolListCtrlBitmap()),
(ID_NEW.NOTEBOOK, images.getToolNotebookBitmap()),
+ (ID_NEW.SPLITTER_WINDOW, images.getToolSplitterWindowBitmap()),
(ID_NEW.UNKNOWN, images.getToolUnknownBitmap())]
]
EVT_KEY_UP(self, self.OnKeyUp)
def AddButton(self, id, image, text):
- button = wxBitmapButton(self, id, image, size=self.TOOL_SIZE,
- style=wxBU_AUTODRAW|wxNO_BORDER|wxWANTS_CHARS)
+ from wxPython.lib import buttons
+ button = buttons.wxGenBitmapButton(self, id, image, size=self.TOOL_SIZE,
+ style=wxNO_BORDER|wxWANTS_CHARS)
+ button.SetBezelWidth(0)
EVT_KEY_DOWN(button, self.OnKeyDown)
EVT_KEY_UP(button, self.OnKeyUp)
button.SetToolTipString(text)
def AddGroup(self, name):
# Each group is inside box
box = wxStaticBox(self, -1, name, style=wxWANTS_CHARS)
- box.SetFont(smallerFont)
+ box.SetFont(g.smallerFont())
boxSizer = wxStaticBoxSizer(box, wxVERTICAL)
boxSizer.Add((0, 4))
self.curSizer = wxGridSizer(0, 3)
state = STATE_TOOLBAR
elif xxx.__class__ in [xxxMenu, xxxMenuItem]:
state = STATE_MENU
+ elif xxx.__class__ == xxxStdDialogButtonSizer:
+ state = STATE_STDDLGBTN
else:
state = STATE_ELSE
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,
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)
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 xxx.__class__ == xxxNotebook:
+ if xxx.__class__ in [xxxNotebook, xxxChoicebook, xxxListbook]:
self.EnableGroup(GROUP_SIZERS, False)
else:
self.EnableGroup(GROUP_SIZERS)