def BuildPanes(self): self.SetMinSize(wx.Size(700, 440)) # add a bunch of panes self._mgr.AddPane( self.createPreferenceTree(), aui.AuiPaneInfo().Name("left").Caption("Pane Caption").BestSize( wx.Size(200, 100)).CaptionVisible( False, left=False).Left().MinimizeButton(True)) # .MinSize(wx.Size(200,100)) self._mgr.AddPane( self.rightPanel(), aui.AuiPaneInfo().Name("center").Caption("Client Size Reporter"). Center().Position(1).CloseButton(True).MaximizeButton( True).MinimizeButton(True).CaptionVisible(False, left=False)) self._mgr.AddPane( self.bottomPanel(), aui.AuiPaneInfo().Name("bottom").Caption("Client Size Reporter"). BestSize(wx.Size(200, 40)).MinSize(wx.Size(200, 40)).MaxSize( wx.Size( 200, 40)).Bottom().Position(0).CloseButton(True).MaximizeButton( True).MinimizeButton(True).CaptionVisible(False, left=False)) self._mgr.Update()
def BuildPanes(self): # min size for the frame itself isn't completely done. # see the end up AuiManager.Update() for the test # code. For now, just hard code a frame minimum size self.SetMinSize(wx.Size(400, 300)) # create some toolbars # tb1 = aui.AuiToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, # agwStyle=aui.AUI_TB_DEFAULT_STYLE | aui.AUI_TB_OVERFLOW) # tb1.SetToolBitmapSize(wx.Size(16, 16)) # tb1.AddSimpleTool(wx.NewIdRef(), "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) # tb1.Realize() # # # self.creatingTable = CreatingTablePanel(splitter, connectionName, newTableName) # self._mgr.AddPane(tb1, aui.AuiPaneInfo().Name("tb1").Caption("Big Toolbar"). # ToolbarPane().Top()) # add a bunch of panes self.buttonPanel = CreateButtonPanel(self) self.editPanel = CreatingEditorPanel(self) self._mgr.AddPane(self.creatingTablePanel(), aui.AuiPaneInfo(). Name("table").Caption("Table").BestSize(wx.Size(200, 100)) .Layer(1).Center().CaptionVisible(True, left=True) .MinimizeButton(True).CloseButton(False)) self._mgr.AddPane(self.editPanel, aui.AuiPaneInfo(). Name("sql").Caption("SQL").BestSize(wx.Size(100, 100)) .Layer(1).Center().CaptionVisible(True, left=True) .MinimizeButton(True).CloseButton(False)) self._mgr.AddPane(self.buttonPanel, aui.AuiPaneInfo(). Name("button").Caption("Button") .Layer(1).Bottom().CaptionVisible(False, left=True) .MinimizeButton(True).CloseButton(False)) self._mgr.Update()
def initFrameManager_(self): ''' init the AUI-Manager and some default window targets ''' self.auiMgr = aui.AuiManager() self.auiMgr.SetManagedWindow(self) self.auiMgr.AddPane( self.createRendererSlot_(self), aui.AuiPaneInfo().Name("RenderWindow") # .BestSize(wx.Size(250, 200)).MinSize(wx.Size(250, 200)) .CenterPane()) self.auiMgr.AddPane( self.createResourceView_(self), aui.AuiPaneInfo().Name("Resources").Caption("Resources").BestSize( wx.Size(300, 200)).MinSize(wx.Size(300, 200)).CloseButton( True).MaximizeButton(True).Left().Layer(1).Position(0)) self.auiMgr.AddPane( self.createPropertyInspectorSlot_(self), aui.AuiPaneInfo().Name("Properties").Caption( "Properties").BestSize(wx.Size(300, 200)).MinSize( wx.Size(300, 200)).CloseButton(True).MaximizeButton( True).Left().Layer(1).Position(1)) self.auiMgr.AddPane( self.createLogPane_(self), aui.AuiPaneInfo().Name("Log and More").Caption("Log and More"). BestSize(wx.Size(800, 150)).MinSize(wx.Size( 500, 100)).CloseButton(True).MaximizeButton(True).Bottom().Hide())
def BuildPanes(self): # self.SetMinSize(wx.Size(400, 300)) # this is to set tab on top self._mgr.SetAutoNotebookStyle(aui.AUI_NB_DEFAULT_STYLE | wx.BORDER_NONE) self.buttonPanel = CreateButtonPanel(self) self.fileSearchPanel = CreateFileSearchPanel(self) fileSearchPaneInfo = aui.AuiPaneInfo().Name("fileSearch").Icon(self.fileOperations.getImageBitmap(imageName="search_history.png")).Caption("File Search")\ .Direction(wx.TOP).Row(0).Center().Layer(0).Position(0).Dockable(True)\ .CaptionVisible(False).MinimizeButton(False).CloseButton(False) self._mgr.AddPane(self.fileSearchPanel, fileSearchPaneInfo) self.fileSearchPanel1 = CreateFileSearchPanel(self) self._mgr.AddPane( self.fileSearchPanel1, aui.AuiPaneInfo().Icon( self.fileOperations.getImageBitmap( imageName="search_history.png") ).Name(f"taskSearch").Caption(f"Task Search").Dockable( False).Center().Layer(0).Position(1).CaptionVisible( False).MinimizeButton(False).CloseButton(False), target=fileSearchPaneInfo) self._mgr.AddPane( self.buttonPanel, aui.AuiPaneInfo().Name("button").Caption("Button").Layer(0).Bottom( ).CaptionVisible(False).MinimizeButton(True).CloseButton(False)) self._mgr.Update()
def NewScatterPlot(self, scatt_id, transpose): # TODO needs to be resolved (should be in this class) scatt = ScatterPlotWidget(parent=self.mainPanel, scatt_mgr=self.scatt_mgr, scatt_id=scatt_id, transpose=transpose) scatt.plotClosed.connect(self.ScatterPlotClosed) self.transpose[scatt_id] = transpose caption = self._creteCaption(scatt_id) self._mgr.AddPane( scatt, aui.AuiPaneInfo().Dockable(True).Floatable(True).Name( self._newScatterPlotName(scatt_id)).MinSize( (-1, 300)).Caption(caption).Center().Position(1). MaximizeButton(True).MinimizeButton(True).CaptionVisible( True).CloseButton(True).Layer(0)) self._mgr.Update() self.SetVirtualSize(self.GetBestVirtualSize()) self.Layout() self.scatts[scatt_id] = scatt return scatt
def MakeSymbolTreePane(self): paneinfo = aui.AuiPaneInfo().Name("symboltree").Caption("Symbol Tree") paneinfo.Bottom().CloseButton(False).MaximizeButton( True).MinimizeButton(True).Hide() imglist = wx.ImageList(16, 16, initialCount=4) imglist.Add( wx.ArtProvider.GetBitmap(wx.ART_EXECUTABLE_FILE, wx.ART_OTHER, wx.Size(16, 16))) imglist.Add( wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16))) imglist.Add( wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16))) imglist.Add( wx.ArtProvider.GetBitmap(wx.ART_FIND, wx.ART_OTHER, wx.Size(16, 16))) self.TREE_ART_ROOT_SYMBOL = 0 # root symbol, SymTagExe self.TREE_ART_ATTRIBUTE_SYMBOL = 1 # attribute symbol self.TREE_ART_CHILD_SYMBOL = 2 # child symbol self.TREE_ART_SEARCH_FILTER = 3 # search filter tree = wx.TreeCtrl(self) tree.AssignImageList(imglist) self.mgr.AddPane(tree, paneinfo)
def MakeSymbolBook(self): paneinfo = aui.AuiPaneInfo().Name("book").CenterPane().PaneBorder( False) ctrl = aui.AuiNotebook(self, agwStyle=aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER) self.mgr.AddPane(ctrl, paneinfo)
def OnCreateText(self, event): self._mgr.AddPane( self.CreateTextCtrl(), aui.AuiPaneInfo().Caption("Text Control").Float().FloatingPosition( self.GetStartPosition()).CloseButton(True).MaximizeButton( True)) self._mgr.Update()
def OnCreateHTML(self, event): self._mgr.AddPane( self.CreateHTMLCtrl(), aui.AuiPaneInfo().Caption("HTML Content").Float().FloatingPosition( self.GetStartPosition()).FloatingSize(wx.Size( 300, 200)).CloseButton(True).MaximizeButton(True)) self._mgr.Update()
def OnCreateSizeReport(self, event): self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Caption( "Client Size Reporter").Float().FloatingPosition( self.GetStartPosition()).CloseButton(True).MaximizeButton( True)) self._mgr.Update()
def __init__(self): wx.Frame.__init__(self, None, title="neural") self.aui = aui.AuiManager(self) self.aui.SetAGWFlags(self.aui.GetAGWFlags() ^ aui.AUI_MGR_LIVE_RESIZE) self.editor = editor = NeuralEditPanel(self) self.props = props = NeuralPropertiesPanel(self) self.tools = tools = NeuralToolsPanel(self) editor.Bind(EVT_SELECTION_CHANGED, props.on_edit_selection_changed) editor.Bind(EVT_ELEMENT_ADDED, self.on_element_added) editor.Bind(EVT_ELEMENT_REMOVED, self.on_element_removed) editor.Bind(EVT_NET_STATE_CHANGED, props.on_state_changed) props.Bind(EVT_ELEMENT_RENAMED, editor.on_neuron_renamed) props.Bind(EVT_REMOVE_LINK, editor.on_remove_link) props.Bind(EVT_REMOVE_LINKS, editor.on_remove_links) tools.Bind(EVT_FILE_NEW, editor.on_file_new) tools.Bind(EVT_FILE_OPEN, editor.on_file_open) tools.Bind(EVT_FILE_SAVE, editor.on_file_save) tools.Bind(EVT_SIM_START, editor.on_sim_start) tools.Bind(EVT_SIM_STOP, editor.on_sim_stop) tools.Bind(EVT_NEURON_TYPE_CHANGED, editor.set_neuron_type) tools.Bind(EVT_FILE_NEW, self.on_file_new) tools.Bind(EVT_FILE_OPEN, self.on_file_open) tools.Bind(EVT_FILE_SAVE, self.on_file_save) self.Bind(wx.EVT_CLOSE, self.on_close) self.aui.AddPane( tools, aui.AuiPaneInfo().Top().CaptionVisible(False).Resizable(False)) self.aui.AddPane( props, aui.AuiPaneInfo().Left().CloseButton(False).Caption( 'properties').CaptionVisible(True).MinSize(props.Size)) self.aui.AddPane(editor, aui.AuiPaneInfo().CenterPane().MinSize(editor.Size)) self.aui.Update() self.Fit() self.Show()
def MakeShellPane(self): return ## TODO figure out why it's hanging the app sometimes during load paneinfo = aui.AuiPaneInfo().Name("shell").Caption("Python Shell") paneinfo.Center().CloseButton(False).MaximizeButton( True).MinimizeButton(True).Hide() intro = 'Welcome To PyCrust %s' % wx.py.version.VERSION shell = wx.py.crust.Crust(self, intro=intro) #shell = wx.py.shell.Shell(self, intro = intro) self.mgr.AddPane(shell, paneinfo)
def initToolBar_(self): """Initilize some default toolbar entries.""" self.toolBar_ = aui.AuiToolBar( self, -1, wx.DefaultPosition, wx.DefaultSize, aui.AUI_TB_DEFAULT_STYLE | aui.AUI_TB_PLAIN_BACKGROUND) #| aui.AUI_TB_OVERFLOW) self.toolBar_.SetToolBitmapSize(wx.Size(22, 22)) tbquit = self.toolBar_.AddSimpleTool( wx.NewId(), "Quit", loadIcon("application-exit-16.png"), "Quit application") wx.EVT_TOOL(self, tbquit.GetId(), self.onMainQuit) # self.toolBar_.Realize() self.auiMgr.AddPane( self.toolBar_, aui.AuiPaneInfo().Name("Main Toolbar").Caption( "Main Toolbar").ToolbarPane().Top().Row(0).Position( 0).LeftDockable(True).RightDockable(True))
def _create_display_panel(self): self.__display_panel = DisplayPanel(self) self.__mgr.AddPane( self.__display_panel, aui.AuiPaneInfo().Name('Display').Caption( 'Display').CenterPane().Center().Dockable(False))
def _create_toolbar(self): self.__toolbar = wx.ToolBar(self, style=wx.HORIZONTAL) self.img_start = wx.Image(get_image_path("start.png")) self.img_start.Rescale(width=self.img_start.GetWidth() / 4, height=self.img_start.GetHeight() / 4) self.img_stop = wx.Image(get_image_path("stop.png")) self.img_stop.Rescale(width=self.img_stop.GetWidth() / 4, height=self.img_stop.GetHeight() / 4) btn_start = self.__toolbar.AddTool(ID_START, label='Start', bitmap=wx.Bitmap(self.img_start)) self.__toolbar.EnableTool(ID_START, False) self.Bind(wx.EVT_TOOL, self.on_button_start, btn_start) self.img_next = wx.Image(get_image_path("next.png")) self.img_next.Rescale(width=self.img_next.GetWidth() / 4, height=self.img_next.GetHeight() / 4) self.img_replay = wx.Image(get_image_path("replay.png")) self.img_replay.Rescale(width=self.img_replay.GetWidth() / 4, height=self.img_replay.GetHeight() / 4) btn_next = self.__toolbar.AddTool(ID_NEXT, label='Next', bitmap=wx.Bitmap(self.img_next)) self.__toolbar.EnableTool(ID_NEXT, False) self.Bind(wx.EVT_TOOL, self.on_button_next, btn_next) self.__toolbar.AddSeparator() image = wx.Image(get_image_path("enable.png")) image.Rescale(width=image.GetWidth() / 4, height=image.GetHeight() / 4) cb_enable = self.__toolbar.AddCheckTool(ID_ENABLE, 'Enable', wx.Bitmap(image)) self.__toolbar.EnableTool(ID_ENABLE, True) self.Bind(wx.EVT_TOOL, self.on_button_enable, cb_enable) self.__toolbar.AddSeparator() image = wx.Image(get_image_path("save.png")) image.Rescale(width=image.GetWidth() / 4, height=image.GetHeight() / 4) cb_save = self.__toolbar.AddCheckTool(ID_SAVE, 'Save', wx.Bitmap(image)) self.__toolbar.EnableTool(ID_SAVE, True) self.Bind(wx.EVT_TOOL, self.on_button_save, cb_save) self.__toolbar.AddSeparator() image = wx.Image(get_image_path("image.png")) image.Rescale(width=image.GetWidth() / 4, height=image.GetHeight() / 4) rb_image = self.__toolbar.AddRadioTool(ID_IMAGE, 'Image', wx.Bitmap(image)) self.__toolbar.EnableTool(ID_IMAGE, True) self.Bind(wx.EVT_TOOL, self.on_button_image, rb_image) image = wx.Image(get_image_path("video.png")) image.Rescale(width=image.GetWidth() / 4, height=image.GetHeight() / 4) rb_video = self.__toolbar.AddRadioTool(ID_VIDEO, 'Video', wx.Bitmap(image)) self.__toolbar.EnableTool(ID_VIDEO, True) self.Bind(wx.EVT_TOOL, self.on_button_video, rb_video) image = wx.Image(get_image_path("camera.png")) image.Rescale(width=image.GetWidth() / 4, height=image.GetHeight() / 4) rb_camera = self.__toolbar.AddRadioTool(ID_CAMERA, 'Camera', wx.Bitmap(image)) self.__toolbar.EnableTool(ID_CAMERA, True) self.Bind(wx.EVT_TOOL, self.on_button_camera, rb_camera) self.__resource_id = ID_IMAGE self.__toolbar.AddSeparator() image = wx.Image(get_image_path("select.png")) image.Rescale(width=image.GetWidth() / 4, height=image.GetHeight() / 4) btn_select = self.__toolbar.AddTool(ID_SELECT, label='Select', bitmap=wx.Bitmap(image)) self.__toolbar.EnableTool(ID_SELECT, True) self.Bind(wx.EVT_TOOL, self.on_button_select, btn_select) self.__toolbar.Realize() self.__mgr.AddPane( self.__toolbar, aui.AuiPaneInfo().Name('Toolbar').Caption( 'Settings').ToolbarPane().Top().Dockable(False))
def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN): wx.Frame.__init__(self, parent, id, title, pos, size, style) # tell FrameManager to manage this frame self._mgr = aui.AuiManager() self._mgr.SetManagedWindow(self) self._perspectives = [] self.n = 0 self.x = 0 self.SetIcon(GetMondrianIcon()) # create menu mb = wx.MenuBar() file_menu = wx.Menu() file_menu.Append(wx.ID_EXIT, "Exit") view_menu = wx.Menu() view_menu.Append(ID_CreateText, "Create Text Control") view_menu.Append(ID_CreateHTML, "Create HTML Control") view_menu.Append(ID_CreateTree, "Create Tree") view_menu.Append(ID_CreateGrid, "Create Grid") view_menu.Append(ID_CreateSizeReport, "Create Size Reporter") view_menu.AppendSeparator() view_menu.Append(ID_GridContent, "Use a Grid for the Content Pane") view_menu.Append(ID_TextContent, "Use a Text Control for the Content Pane") view_menu.Append(ID_HTMLContent, "Use an HTML Control for the Content Pane") view_menu.Append(ID_TreeContent, "Use a Tree Control for the Content Pane") view_menu.Append(ID_SizeReportContent, "Use a Size Reporter for the Content Pane") options_menu = wx.Menu() options_menu.AppendRadioItem(ID_TransparentHint, "Transparent Hint") options_menu.AppendRadioItem(ID_VenetianBlindsHint, "Venetian Blinds Hint") options_menu.AppendRadioItem(ID_RectangleHint, "Rectangle Hint") options_menu.AppendRadioItem(ID_NoHint, "No Hint") options_menu.AppendSeparator() options_menu.AppendCheckItem(ID_HintFade, "Hint Fade-in") options_menu.AppendCheckItem(ID_AllowFloating, "Allow Floating") options_menu.AppendCheckItem(ID_NoVenetianFade, "Disable Venetian Blinds Hint Fade-in") options_menu.AppendCheckItem(ID_TransparentDrag, "Transparent Drag") options_menu.AppendCheckItem(ID_AllowActivePane, "Allow Active Pane") options_menu.AppendSeparator() options_menu.AppendRadioItem(ID_NoGradient, "No Caption Gradient") options_menu.AppendRadioItem(ID_VerticalGradient, "Vertical Caption Gradient") options_menu.AppendRadioItem(ID_HorizontalGradient, "Horizontal Caption Gradient") options_menu.AppendSeparator() options_menu.Append(ID_Settings, "Settings Pane") self._perspectives_menu = wx.Menu() self._perspectives_menu.Append(ID_CreatePerspective, "Create Perspective") self._perspectives_menu.Append(ID_CopyPerspective, "Copy Perspective Data To Clipboard") self._perspectives_menu.AppendSeparator() self._perspectives_menu.Append(ID_FirstPerspective + 0, "Default Startup") self._perspectives_menu.Append(ID_FirstPerspective + 1, "All Panes") self._perspectives_menu.Append(ID_FirstPerspective + 2, "Vertical Toolbar") help_menu = wx.Menu() help_menu.Append(ID_About, "About...") mb.Append(file_menu, "File") mb.Append(view_menu, "View") mb.Append(self._perspectives_menu, "Perspectives") mb.Append(options_menu, "Options") mb.Append(help_menu, "Help") self.SetMenuBar(mb) self.statusbar = self.CreateStatusBar(2, wx.STB_SIZEGRIP) self.statusbar.SetStatusWidths([-2, -3]) self.statusbar.SetStatusText("Ready", 0) self.statusbar.SetStatusText("Welcome To wxPython!", 1) # min size for the frame itself isn't completely done. # see the end up FrameManager::Update() for the test # code. For now, just hard code a frame minimum size self.SetMinSize(wx.Size(400, 300)) # create some toolbars tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb1.SetToolBitmapSize(wx.Size(48, 48)) tb1.AddLabelTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) tb1.AddSeparator() tb1.AddLabelTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) tb1.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) tb1.Realize() tb2 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb2.SetToolBitmapSize(wx.Size(16, 16)) tb2_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_QUESTION, wx.ART_OTHER, wx.Size(16, 16)) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddSeparator() tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddSeparator() tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.AddLabelTool(101, "Test", tb2_bmp1) tb2.Realize() tb3 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb3.SetToolBitmapSize(wx.Size(16, 16)) tb3_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16)) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddSeparator() tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.AddLabelTool(101, "Test", tb3_bmp1) tb3.Realize() tb4 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) tb4.SetToolBitmapSize(wx.Size(16, 16)) tb4_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16)) tb4.AddLabelTool(101, "Item 1", tb4_bmp1) tb4.AddLabelTool(101, "Item 2", tb4_bmp1) tb4.AddLabelTool(101, "Item 3", tb4_bmp1) tb4.AddLabelTool(101, "Item 4", tb4_bmp1) tb4.AddSeparator() tb4.AddLabelTool(101, "Item 5", tb4_bmp1) tb4.AddLabelTool(101, "Item 6", tb4_bmp1) tb4.AddLabelTool(101, "Item 7", tb4_bmp1) tb4.AddLabelTool(101, "Item 8", tb4_bmp1) tb4.Realize() tb5 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_VERTICAL) tb5.SetToolBitmapSize(wx.Size(48, 48)) tb5.AddLabelTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) tb5.AddSeparator() tb5.AddLabelTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) tb5.AddLabelTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) tb5.Realize() # add a bunch of panes self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test1").Caption( "Pane Caption").Top().CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test2").Caption("Client Size Reporter"). Bottom().Position(1).CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test3").Caption("Client Size Reporter"). Bottom().CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test4").Caption( "Pane Caption").Left().CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test5").Caption( "Pane Caption").Right().CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test6").Caption("Client Size Reporter"). Right().Row(1).CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test7").Caption("Client Size Reporter"). Left().Layer(1).CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateTreeCtrl(), aui.AuiPaneInfo().Name("test8").Caption("Tree Pane").Left().Layer( 1).Position(1).CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test9").Caption("Min Size 200x100"). BestSize(wx.Size(200, 100)).MinSize(wx.Size( 200, 100)).Bottom().Layer(1).CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateTextCtrl(), aui.AuiPaneInfo().Name("test10").Caption("Text Pane").Bottom(). Layer(1).Position(1).CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("test11").Caption( "Fixed Pane").Bottom().Layer(1).Position( 2).Fixed().CloseButton(True).MaximizeButton(True)) self._mgr.AddPane( SettingsPanel(self, self), aui.AuiPaneInfo().Name("settings").Caption( "Dock Manager Settings").Dockable(False).Float().Hide(). CloseButton(True).MaximizeButton(True)) # create some center panes self._mgr.AddPane( self.CreateGrid(), aui.AuiPaneInfo().Name("grid_content").CenterPane().Hide()) self._mgr.AddPane( self.CreateTreeCtrl(), aui.AuiPaneInfo().Name("tree_content").CenterPane().Hide()) self._mgr.AddPane( self.CreateSizeReportCtrl(), aui.AuiPaneInfo().Name("sizereport_content").CenterPane().Hide()) self._mgr.AddPane( self.CreateTextCtrl(), aui.AuiPaneInfo().Name("text_content").CenterPane().Hide()) self._mgr.AddPane(self.CreateHTMLCtrl(), aui.AuiPaneInfo().Name("html_content").CenterPane()) # add the toolbars to the manager self._mgr.AddPane( tb1, aui.AuiPaneInfo().Name("tb1").Caption("Big Toolbar").ToolbarPane(). Top().LeftDockable(False).RightDockable(False)) self._mgr.AddPane( tb2, aui.AuiPaneInfo().Name("tb2").Caption("Toolbar 2").ToolbarPane(). Top().Row(1).LeftDockable(False).RightDockable(False)) self._mgr.AddPane( tb3, aui.AuiPaneInfo().Name("tb3").Caption("Toolbar 3").ToolbarPane(). Top().Row(1).Position(1).LeftDockable(False).RightDockable(False)) self._mgr.AddPane( tb4, aui.AuiPaneInfo().Name("tb4").Caption( "Sample Bookmark Toolbar").ToolbarPane().Top().Row( 2).LeftDockable(False).RightDockable(False)) self._mgr.AddPane( tb5, aui.AuiPaneInfo().Name("tbvert").Caption( "Sample Vertical Toolbar").ToolbarPane().Left().GripperTop(). TopDockable(False).BottomDockable(False)) self._mgr.AddPane( wx.Button(self, -1, "Test Button"), aui.AuiPaneInfo().Name("tb5").ToolbarPane().Top().Row(2).Position( 1).LeftDockable(False).RightDockable(False)) # make some default perspectives self._mgr.GetPane("tbvert").Hide() perspective_all = self._mgr.SavePerspective() all_panes = self._mgr.GetAllPanes() for ii in range(len(all_panes)): if not all_panes[ii].IsToolbar(): all_panes[ii].Hide() self._mgr.GetPane("tb1").Hide() self._mgr.GetPane("tb5").Hide() self._mgr.GetPane("test8").Show().Left().Layer(0).Row(0).Position(0) self._mgr.GetPane("test10").Show().Bottom().Layer(0).Row(0).Position(0) self._mgr.GetPane("html_content").Show() perspective_default = self._mgr.SavePerspective() for ii in range(len(all_panes)): if not all_panes[ii].IsToolbar(): all_panes[ii].Hide() self._mgr.GetPane("tb1").Hide() self._mgr.GetPane("tb5").Hide() self._mgr.GetPane("tbvert").Show() self._mgr.GetPane("grid_content").Show() self._mgr.GetPane("test8").Show().Left().Layer(0).Row(0).Position(0) self._mgr.GetPane("test10").Show().Bottom().Layer(0).Row(0).Position(0) self._mgr.GetPane("html_content").Show() perspective_vert = self._mgr.SavePerspective() self._perspectives.append(perspective_default) self._perspectives.append(perspective_all) self._perspectives.append(perspective_vert) self._mgr.GetPane("tbvert").Hide() self._mgr.GetPane("grid_content").Hide() # "commit" all changes made to FrameManager self._mgr.Update() self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_CLOSE, self.OnClose) # Show How To Use The Closing Panes Event self.Bind(aui.EVT_AUI_PANE_CLOSE, self.OnPaneClose) self.Bind(wx.EVT_MENU, self.OnCreateTree, id=ID_CreateTree) self.Bind(wx.EVT_MENU, self.OnCreateGrid, id=ID_CreateGrid) self.Bind(wx.EVT_MENU, self.OnCreateText, id=ID_CreateText) self.Bind(wx.EVT_MENU, self.OnCreateHTML, id=ID_CreateHTML) self.Bind(wx.EVT_MENU, self.OnCreateSizeReport, id=ID_CreateSizeReport) self.Bind(wx.EVT_MENU, self.OnCreatePerspective, id=ID_CreatePerspective) self.Bind(wx.EVT_MENU, self.OnCopyPerspective, id=ID_CopyPerspective) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_AllowFloating) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_TransparentHint) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_VenetianBlindsHint) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_RectangleHint) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_NoHint) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_HintFade) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_NoVenetianFade) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_TransparentDrag) self.Bind(wx.EVT_MENU, self.OnManagerFlag, id=ID_AllowActivePane) self.Bind(wx.EVT_MENU, self.OnGradient, id=ID_NoGradient) self.Bind(wx.EVT_MENU, self.OnGradient, id=ID_VerticalGradient) self.Bind(wx.EVT_MENU, self.OnGradient, id=ID_HorizontalGradient) self.Bind(wx.EVT_MENU, self.OnSettings, id=ID_Settings) self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_GridContent) self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_TreeContent) self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_TextContent) self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_SizeReportContent) self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_HTMLContent) self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_TransparentHint) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_VenetianBlindsHint) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_RectangleHint) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_NoHint) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_HintFade) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_AllowFloating) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_NoVenetianFade) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_TransparentDrag) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_AllowActivePane) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_NoGradient) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_VerticalGradient) self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_HorizontalGradient) self.Bind(wx.EVT_MENU_RANGE, self.OnRestorePerspective, id=ID_FirstPerspective, id2=ID_FirstPerspective + 1000)