]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/FlatNotebook.py
Another package name fix
[wxWidgets.git] / wxPython / demo / FlatNotebook.py
index c0fbfe54148995658d047c64dfc7207bbbbc4d89..18b5ee0d370e0035372cc5d6ac6606091ad52602 100644 (file)
@@ -58,6 +58,7 @@ MENU_DISABLE_TAB = wx.NewId()
 MENU_ENABLE_DRAG_N_DROP = wx.NewId()
 MENU_DCLICK_CLOSES_TAB = wx.NewId()
 MENU_USE_VC8_STYLE = wx.NewId()
 MENU_ENABLE_DRAG_N_DROP = wx.NewId()
 MENU_DCLICK_CLOSES_TAB = wx.NewId()
 MENU_USE_VC8_STYLE = wx.NewId()
+MENU_HIDE_ON_SINGLE_TAB = wx.NewId()
 
 MENU_SET_ACTIVE_TEXT_COLOR = wx.NewId()
 MENU_DRAW_TAB_X = wx.NewId()
 
 MENU_SET_ACTIVE_TEXT_COLOR = wx.NewId()
 MENU_DRAW_TAB_X = wx.NewId()
@@ -197,6 +198,11 @@ class FlatNotebookDemo(wx.Frame):
         self.Bind(wx.EVT_MENU_RANGE, self.OnSelectColor, id=MENU_SELECT_GRADIENT_COLOR_FROM,
                   id2=MENU_SELECT_GRADIENT_COLOR_BORDER)        
 
         self.Bind(wx.EVT_MENU_RANGE, self.OnSelectColor, id=MENU_SELECT_GRADIENT_COLOR_FROM,
                   id2=MENU_SELECT_GRADIENT_COLOR_BORDER)        
 
+        item = wx.MenuItem(self._editMenu, MENU_HIDE_ON_SINGLE_TAB, "Hide Page Container when only one Tab",
+                           "Hide Page Container when only one Tab", wx.ITEM_CHECK)
+        self.Bind(wx.EVT_MENU, self.OnStyle, item)
+        self._editMenu.AppendItem(item)
+
         item = wx.MenuItem(self._editMenu, MENU_HIDE_NAV_BUTTONS, "Hide Navigation Buttons",
                            "Hide Navigation Buttons", wx.ITEM_CHECK)
         self._editMenu.AppendItem(item)
         item = wx.MenuItem(self._editMenu, MENU_HIDE_NAV_BUTTONS, "Hide Navigation Buttons",
                            "Hide Navigation Buttons", wx.ITEM_CHECK)
         self._editMenu.AppendItem(item)
@@ -374,6 +380,15 @@ class FlatNotebookDemo(wx.Frame):
             
             self.book.SetWindowStyleFlag(style)
 
             
             self.book.SetWindowStyleFlag(style)
 
+        elif eventid == MENU_HIDE_ON_SINGLE_TAB:
+            if event.IsChecked():
+                # Hide the navigation buttons
+                style |= fnb.FNB_HIDE_ON_SINGLE_TAB
+            else:
+                style &= ~(fnb.FNB_HIDE_ON_SINGLE_TAB)
+
+            self.book.SetWindowStyleFlag(style)
+
         elif eventid == MENU_HIDE_X:
             if event.IsChecked():
                 # Hide the X button
         elif eventid == MENU_HIDE_X:
             if event.IsChecked():
                 # Hide the X button