Python wx 模块,SplitterWindow() 实例源码

我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用wx.SplitterWindow()

项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def _init_ctrls(self, parent):
        wx.SplitterWindow.__init__(self, parent,
                                   style=wx.SUNKEN_BORDER | wx.SP_3D)
        self.SetMinimumPaneSize(1)

        self._init_MenuItems()

        if self.VARIABLE_PANEL_TYPE is not None:
            self.VariableEditor = VariablePanel(self, self, self.Controler, self.VARIABLE_PANEL_TYPE, self.Debug)
            self.VariableEditor.SetTagName(self.TagName)
        else:
            self.VariableEditor = None

        self._init_Editor(self)

        if self.Editor is not None and self.VariableEditor is not None:
            self.SplitHorizontally(self.VariableEditor, self.Editor, 200)
        elif self.VariableEditor is not None:
            self.Initialize(self.VariableEditor)
        elif self.Editor is not None:
            self.Initialize(self.Editor)
项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def _create_CodePanel(self, prnt):
        self.CodeEditorPanel = wx.SplitterWindow(prnt)
        self.CodeEditorPanel.SetMinimumPaneSize(1)

        self.VariablesPanel = VariablesEditor(self.CodeEditorPanel,
                                              self.ParentWindow,
                                              self.Controler)

        if self.CODE_EDITOR is not None:
            self.CodeEditor = self.CODE_EDITOR(self.CodeEditorPanel,
                                               self.ParentWindow, self.Controler)

            self.CodeEditorPanel.SplitHorizontally(self.VariablesPanel,
                                                   self.CodeEditor, 150)
        else:
            self.CodeEditorPanel.Initialize(self.VariablesPanel)

        return self.CodeEditorPanel
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def __init__(self, *args, **kwds):
        # begin wxGlade: help_window.__init__
        kwds["style"] = wx.MAXIMIZE | wx.CLOSE_BOX | wx.THICK_FRAME|wx.CAPTION
        wx.Dialog.__init__(self, *args, **kwds)
        self.window_1 = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_3D | wx.SP_BORDER)
        self.window_1_pane_left = wx.Panel(self.window_1, wx.ID_ANY)
        self.html_left = html.HtmlWindow(self.window_1_pane_left, wx.ID_ANY, size=(1, 1))
        self.window_1_pane_right = wx.Panel(self.window_1, wx.ID_ANY)
        self.html_right = html.HtmlWindow(self.window_1_pane_right, wx.ID_ANY, size=(1, 1))

        #self.Bind(wx.EVT_COself.on_hyperlink,self.html_left)
        self.Bind(wx.html.EVT_HTML_LINK_CLICKED,self.on_hyperlink,self.html_left)
        #self.Bind(wx.EVT_SIZE,self.on_resize)

        self.__set_properties()
        self.__do_layout()
        #self.on_resize(None)
        self.load_htmlpage()
        # end wxGlade
项目:wxpythoncookbookcode    作者:driscollis    | 项目源码 | 文件源码
def __init__(self, parent):
        """Constructor"""
        wx.Panel.__init__(self, parent)


        split = wx.SplitterWindow(self)

        panelOne = GridPanel(split)
        panelTwo = GridPanel(split)
        ScrollSync(panelOne, panelTwo)

        split.SplitVertically(panelOne, panelTwo)
        split.SetSashGravity(0.5)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(split, 1, wx.EXPAND)
        self.SetSizer(sizer)
项目:JincinExamHelper    作者:Qinet    | 项目源码 | 文件源码
def __init__(self, parent, title):
        (self.display_length_, self.display_height_) = wx.GetDisplaySize()
        self.frame_width_ = self.display_length_ * 90 / 100
        self.frame_height_ = self.display_height_ * 90 / 100
        self.answer_panel_width_ = self.frame_width_ * 15 / 100
        super(MainFrame, self).__init__(parent=parent, title=title, size=(self.frame_width_, self.frame_height_))

        self.splitter = wx.SplitterWindow(parent=self, style=wx.SP_LIVE_UPDATE)
        self.splitter.SetMinimumPaneSize(min=100)

        self.web_panel = WebPanel(parent=self.splitter)
        self.answer_panel = wx.Panel(parent=self.splitter)
        self.answers_box = wx.BoxSizer(orient=wx.VERTICAL)
        self.answers_box.Add(item=self.answer_panel)

        self.splitter.SplitVertically(window1=self.answer_panel, window2=self.web_panel,
                                      sashPosition=self.answer_panel_width_)

        self.Sizer = wx.BoxSizer(orient=wx.VERTICAL)
        self.Sizer.Add(item=self.splitter, proportion=CAN_CHANGE, flag=wx.EXPAND)

        auto_answer_button = wx.Button(parent=self, label=u"????")
        self.Bind(event=wx.EVT_BUTTON, handler=self.click_search_answer, source=auto_answer_button)

        self.buttons_box = wx.BoxSizer(orient=wx.HORIZONTAL)
        self.buttons_box.Add(item=auto_answer_button, proportion=CAN_NOT_CHANGE, flag=wx.LEFT | wx.RIGHT, border=5)

        self.Sizer.Add(item=self.buttons_box, proportion=CAN_NOT_CHANGE, flag=wx.TOP | wx.BOTTOM, border=5)

        menu = wx.Menu()
        menu_about = menu.Append(id=wx.ID_ABOUT, text=u"&??", help=u" ?????")
        menu_feedback = menu.Append(id=wx.ID_OPEN, text=u"&??", help=u" ??")
        self.Bind(event=wx.EVT_MENU, handler=self.show_about, source=menu_about)
        self.Bind(event=wx.EVT_MENU, handler=self.show_feedback, source=menu_feedback)
        menu_bar = wx.MenuBar()
        menu_bar.Append(menu, u"&??")
        self.SetMenuBar(menu_bar)
        self.statusbar = self.CreateStatusBar()
        self.Centre()
项目:wxWize    作者:AndersMunch    | 项目源码 | 文件源码
def create_wxwindow(self):
        return self.initfn(wx.SplitterWindow)(self.parent, self.id, self.pos, self.size, self.style, self.name)
项目:wxWize    作者:AndersMunch    | 项目源码 | 文件源码
def create_postorder(self):
        if len(self.zchildren)!=2 or not all(isinstance(ch.w, wx.Window) for ch in self.zchildren):
            raise TypeError('SplitterWindow must have exactly 2 wx.Window children')
        if self.sashGravity is not None: self.w.SetSashGravity(self.sashGravity)
        if self.minimumPaneSize is not None: self.w.SetMinimumPaneSize(self.minimumPaneSize)
        if self.orient == wx.VERTICAL: # strange as it sounds, SplitHorizontally stacks subwindows vertically
            self.w.SplitHorizontally(self.zchildren[0].w, self.zchildren[1].w)
        else:
            self.w.SplitVertically(self.zchildren[0].w, self.zchildren[1].w)
        if self.sashPosition is not None: self.w.SetSashPosition(self.sashPosition)
项目:SameKeyProxy    作者:xzhou    | 项目源码 | 文件源码
def _build(self):
      """
      Building widgets and setting static widget data.      
      """
      parent = wx.Panel(self, -1)
      sizer0 = wx.BoxSizer(wx.VERTICAL)
      sizer0.Add(self._buildTopBar(parent), 0, wx.ALIGN_LEFT|wx.GROW, 5)

      splitter = wx.SplitterWindow(parent, -1)
      #- TOP PART --------------------------------------------------------#
      topParent = wx.Panel(splitter, -1)
      topSizer = wx.BoxSizer(wx.VERTICAL)
      self.treeCtrlItems = wx.TreeCtrl(topParent, -1,
                         style = wx.TR_TWIST_BUTTONS|wx.TR_LINES_AT_ROOT|wx.TR_HAS_BUTTONS|wx.TR_HIDE_ROOT|wx.TR_MULTIPLE)
      topSizer.Add(self.treeCtrlItems, 1, wx.EXPAND, 5)
      topParent.SetAutoLayout( True )
      topParent.SetSizer(topSizer )
      topSizer.Fit(topParent)
      topSizer.SetSizeHints(topParent)
      #-------------------------------------------------------------------#
      #- BOTTOM PART -----------------------------------------------------#
      bottomParent = wx.Panel(splitter,-1)
      bottomSizer = wx.BoxSizer(wx.VERTICAL)
      self.txtCtrlLog=wx_StdoutLog(bottomParent, -1, "",
                                  size= wx.Size(-1, 10),
                                  style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH)
      bottomSizer.Add(self.txtCtrlLog, 1, wx.EXPAND, 5)
      bottomParent.SetAutoLayout( True )
      bottomParent.SetSizer(bottomSizer )
      bottomSizer.Fit(bottomParent)
      bottomSizer.SetSizeHints(bottomParent)
      #-------------------------------------------------------------------#
      splitter.SplitHorizontally(topParent,bottomParent, -100)
      sizer0.Add(splitter, 1, wx.EXPAND|wx.ALIGN_CENTRE, 5)

      self.buttonClose = wx.Button(parent, -1, 'Close')         # buttonClose
      sizer0.Add(self.buttonClose, 0, wx.ALIGN_CENTRE|wx.ALL, 5)

      parent.SetAutoLayout( True )
      parent.SetSizer( sizer0 )
      sizer0.Fit( parent)
      sizer0.SetSizeHints( parent)
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self, parent, id, title):
        wx.Frame.__init__(self,parent,wx.ID_ANY, title, size=(600, 600), pos=(200, 200))

        self.splitter_window = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER)
        self.splitter_window.SetMinimumPaneSize(20)
        self.left_panel = wx.Panel(self.splitter_window, -1)
        self.right_panel = wx.Panel(self.splitter_window, -1)

        self.tree = CT.CustomTreeCtrl(self.left_panel, 1002, pos=(0, 0), 
            style=wx.TR_DEFAULT_STYLE | 
            wx.TR_HAS_VARIABLE_ROW_HEIGHT | 
            wx.TR_HAS_BUTTONS | 
            wx.TR_FULL_ROW_HIGHLIGHT | 
            wx.TR_MULTIPLE | 
            wx.TR_EDIT_LABELS)
        self.root = self.tree.AddRoot("Root Item")

        offset_lists = ["Clearance Reports", "Other Offsets"]
        offset_list_combo_box = wx.ComboBox(self.right_panel, -1, choices=offset_lists)

        #Sizers
        offset_sizer = wx.BoxSizer(wx.VERTICAL)
        offset_sizer.Add(offset_list_combo_box, 0, wx.EXPAND)
        vbox = wx.BoxSizer(wx.VERTICAL)
        vbox.Add(self.tree, 1, wx.EXPAND)
        self.left_panel.SetSizer(vbox)
        vbox2 = wx.BoxSizer(wx.VERTICAL)
        vbox2.Add(offset_sizer, 1, wx.EXPAND)
        self.right_panel.SetSizer(vbox2)
        main_sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.splitter_window.SplitVertically(self.left_panel, self.right_panel)
        main_sizer.Add(self.splitter_window, 1, wx.EXPAND)
        self.SetSizer(main_sizer)

        self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndLabelEdit)
        self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit)
        self.Bind(wx.EVT_KEY_DOWN, self.enterpressed)
        self.tree.Bind(wx.EVT_KEY_DOWN, self.enterpressed)
        self.Bind(wx.EVT_KEY_DOWN, self.enterpressed, self.tree)
        self.Bind(wx.EVT_COMMAND_ENTER, self.enterpressed)
        self.Bind(wx.EVT_TEXT_ENTER, self.enterpressed)

        self.Show(True)
项目:augment3D    作者:yulkang    | 项目源码 | 文件源码
def __init__(self, parent, title):
        """Create the pydicom image example's main frame window."""

        wx.Frame.__init__(self, parent, id=-1, title="", pos=wx.DefaultPosition,
                          size=wx.Size(w=1024, h=768),
                          style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN)

        # --------------------------------------------------------
        # Set up the menubar.
        # --------------------------------------------------------
        self.mainmenu = wx.MenuBar()

        # Make the 'File' menu.
        menu = wx.Menu()
        item = menu.Append(wx.ID_ANY, '&Open', 'Open file for editing')
        self.Bind(wx.EVT_MENU, self.OnFileOpen, item)
        item = menu.Append(wx.ID_ANY, 'E&xit', 'Exit Program')
        self.Bind(wx.EVT_MENU, self.OnFileExit, item)
        self.mainmenu.Append(menu, '&File')

        # Attach the menu bar to the window.
        self.SetMenuBar(self.mainmenu)

        # --------------------------------------------------------
        # Set up the main splitter window.
        # --------------------------------------------------------
        self.mainSplitter = wx.SplitterWindow(self, style=wx.NO_3D | wx.SP_3D)
        self.mainSplitter.SetMinimumPaneSize(1)

        # -------------------------------------------------------------
        # Create the folderTreeView on the left.
        # -------------------------------------------------------------
        self.dsTreeView = wx.TreeCtrl(self.mainSplitter, style=wx.TR_LINES_AT_ROOT | wx.TR_HAS_BUTTONS)

        # --------------------------------------------------------
        # Create the ImageView on the right pane.
        # --------------------------------------------------------
        self.imView = wx.Panel(self.mainSplitter, style=wx.VSCROLL | wx.HSCROLL | wx.CLIP_CHILDREN)
        self.imView.Bind(wx.EVT_PAINT, self.OnPaint)
        self.imView.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
        self.imView.Bind(wx.EVT_SIZE, self.OnSize)

        # --------------------------------------------------------
        # Install the splitter panes.
        # --------------------------------------------------------
        self.mainSplitter.SplitVertically(self.dsTreeView, self.imView)
        self.mainSplitter.SetSashPosition(300, True)

        # --------------------------------------------------------
        # Initialize some values
        # --------------------------------------------------------
        self.dcmdsRoot = False
        self.foldersRoot = False
        self.loadCentered = True
        self.bitmap = None
        self.Show(True)
项目:bids    作者:robertoostenveld    | 项目源码 | 文件源码
def __init__(self, parent, title):
        """Create the pydicom image example's main frame window."""

        wx.Frame.__init__(self, parent, id=-1, title="", pos=wx.DefaultPosition,
                          size=wx.Size(w=1024, h=768),
                          style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN)

        # --------------------------------------------------------
        # Set up the menubar.
        # --------------------------------------------------------
        self.mainmenu = wx.MenuBar()

        # Make the 'File' menu.
        menu = wx.Menu()
        item = menu.Append(wx.ID_ANY, '&Open', 'Open file for editing')
        self.Bind(wx.EVT_MENU, self.OnFileOpen, item)
        item = menu.Append(wx.ID_ANY, 'E&xit', 'Exit Program')
        self.Bind(wx.EVT_MENU, self.OnFileExit, item)
        self.mainmenu.Append(menu, '&File')

        # Attach the menu bar to the window.
        self.SetMenuBar(self.mainmenu)

        # --------------------------------------------------------
        # Set up the main splitter window.
        # --------------------------------------------------------
        self.mainSplitter = wx.SplitterWindow(self, style=wx.NO_3D | wx.SP_3D)
        self.mainSplitter.SetMinimumPaneSize(1)

        # -------------------------------------------------------------
        # Create the folderTreeView on the left.
        # -------------------------------------------------------------
        self.dsTreeView = wx.TreeCtrl(self.mainSplitter, style=wx.TR_LINES_AT_ROOT | wx.TR_HAS_BUTTONS)

        # --------------------------------------------------------
        # Create the ImageView on the right pane.
        # --------------------------------------------------------
        self.imView = wx.Panel(self.mainSplitter, style=wx.VSCROLL | wx.HSCROLL | wx.CLIP_CHILDREN)
        self.imView.Bind(wx.EVT_PAINT, self.OnPaint)
        self.imView.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
        self.imView.Bind(wx.EVT_SIZE, self.OnSize)

        # --------------------------------------------------------
        # Install the splitter panes.
        # --------------------------------------------------------
        self.mainSplitter.SplitVertically(self.dsTreeView, self.imView)
        self.mainSplitter.SetSashPosition(300, True)

        # --------------------------------------------------------
        # Initialize some values
        # --------------------------------------------------------
        self.dcmdsRoot = False
        self.foldersRoot = False
        self.loadCentered = True
        self.bitmap = None
        self.Show(True)
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def PostInit(self):
        self.splitter = wx.SplitterWindow(self, -1)
        self.dvc = self.create_data_view_ctrl()

        self.splitter.Initialize(self.dvc)
        self.splitter.SetSashPosition(400)

        self.splitter.Bind(wx.EVT_SPLITTER_DOUBLECLICKED, self._OnSplitterDclick)

        self.Sizer = wx.BoxSizer(wx.VERTICAL) 
        self.Sizer.Add(self.splitter, 1, wx.EXPAND|wx.ALL, border=10)

        button_add_track = wx.Button(self, label="Add Object")
        self.Bind(wx.EVT_BUTTON, self.on_add_track_object, button_add_track)
        button_delete_track = wx.Button(self, label="Delete Object")
        self.Bind(wx.EVT_BUTTON, self.on_delete_track_object, 
                                              button_delete_track
        )
        btnbox = wx.BoxSizer(wx.HORIZONTAL)
        btnbox.Add(button_add_track, 0, wx.LEFT|wx.RIGHT, 5)
        btnbox.Add(button_delete_track, 0, wx.LEFT|wx.RIGHT, 5)

        self.Sizer.Add(btnbox, 0, wx.TOP|wx.BOTTOM, 5)

        """
        UIM = UIManager()
        controller = UIM.get(self._controller_uid)
        model = controller._get_real_model()
        lpe_ctrl_uid = UIM._getparentuid(self._controller_uid) 
        logplot_ctrl_uid = UIM._getparentuid(lpe_ctrl_uid)
        all_tracks = UIM.list('track_controller', logplot_ctrl_uid)

        for track in all_tracks:     
            print 'expanding:', track.uid
            item = model.ObjectToItem(track)
            print item
            self.dvc.Expand(item)
            print self.dvc.IsExpanded(item)
            #model.Resort()
            #print self.dvc.IsExpanded(item)
        """
        #self.dvc.Bind(dv.EVT_DATAVIEW_ITEM_START_EDITING, self.OnItemStartEditing)        
        #self.dvc.Bind(dv.EVT_DATAVIEW_ITEM_EDITING_STARTED, self.OnItemEditingStart)
        #self.dvc.Bind(dv.EVT_DATAVIEW_ITEM_EDITING_DONE, self.OnItemEditingDone)
        self.dvc.Bind(dv.EVT_DATAVIEW_SELECTION_CHANGED, self.OnSelectionChanged)

        ###
        #sizer_grid_panel = wx.BoxSizer(wx.VERTICAL)
        #sizer_grid_panel.Add(self.splitter, 1, wx.EXPAND|wx.ALL, border=10)
        self.SetSizer(self.Sizer)
        self._get_lpeview_notebook().AddPage(self, "Objects", True)


        #self.dvc.Bind(wx.EVT_IDLE, self._dvc_idle)

    #def _dvc_idle(self, event):
    #    print 'DVC IDLE'