예제 #1
0
파일: demo.py 프로젝트: wangdyna/wxPython
    def __init__(self, title=u""):
        super(EclibDemoFrame, self).__init__(None,
                                             title=title,
                                             size=(850, 550))

        # Attributes
        self.mgr = aui.AuiManager(self, aui.AUI_MGR_ALLOW_ACTIVE_PANE)
        self.tree = EclibDemoTree(self)
        self.pane = EclibDemoBook(self)
        path = os.path.dirname(__file__)
        self._loader = ModuleLoader(FindDemoModules(os.path.abspath(path)))

        # Setup
        self.mgr.AddPane(self.tree,
                         aui.AuiPaneInfo().Left().Layer(0).\
                             Caption("Test Modules").CloseButton(False).\
                             MinSize((220,-1)))
        self.mgr.AddPane(self.pane,
                         aui.AuiPaneInfo().CenterPane().\
                             Layer(1).CloseButton(False).MinSize((450,400)))
        self.mgr.Update()

        self.CenterOnParent()

        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeSel)
예제 #2
0
    def __init__( self, parent ):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'ImagePy', 
                            size = wx.Size(-1,-1), pos = wx.DefaultPosition, 
                            style = wx.RESIZE_BORDER|wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

        self.auimgr = aui.AuiManager()
        self.auimgr.SetManagedWindow( self )
        self.auimgr.SetFlags(aui.AUI_MGR_DEFAULT)

        logopath = os.path.join(root_dir, 'data/logo.ico')
        #self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
        self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
        IPy.curapp = self
        self.SetSizeHints( wx.Size(900,700) if IPy.uimode() == 'ipy' else wx.Size( 600,-1 ))
        

        self.menubar = pluginloader.buildMenuBarByPath(self, 'menus', 'plugins', None, True)
        self.SetMenuBar( self.menubar )
        self.shortcut = pluginloader.buildShortcut(self)
        self.SetAcceleratorTable(self.shortcut)
        #sizer = wx.BoxSizer(wx.VERTICAL)
        self.toolbar = toolsloader.build_tools(self, 'tools', 'plugins', None, True)

        
        print(IPy.uimode())
        if IPy.uimode()=='ipy': self.load_aui()
        else: self.load_ijui()
        self.Fit()


        self.stapanel = stapanel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
        sizersta = wx.BoxSizer( wx.HORIZONTAL )
        self.txt_info = wx.StaticText( stapanel, wx.ID_ANY, "ImagePy  v0.2", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.txt_info.Wrap( -1 )
        #self.txt_info.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )
        sizersta.Add( self.txt_info, 1, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 )
        self.pro_bar = wx.Gauge( stapanel, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 100,15 ), wx.GA_HORIZONTAL )
        sizersta.Add( self.pro_bar, 0, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 )
        stapanel.SetSizer(sizersta)
        stapanel.SetDropTarget(FileDrop())
        self.auimgr.AddPane( stapanel,  wx.aui.AuiPaneInfo() .Bottom() .CaptionVisible( False ).PinButton( True )
            .PaneBorder( False ).Dock().Resizable().FloatingSize( wx.DefaultSize ).DockFixed( True )
            . MinSize(wx.Size(-1, 20)). MaxSize(wx.Size(-1, 20)).Layer( 10 ) )


        self.Centre( wx.BOTH )
        self.Layout()
        self.auimgr.Update()
        self.Fit()
        self.Centre( wx.BOTH )
        if(IPy.uimode()=='ij'):
            self.SetMaxSize((-1, self.GetSize()[1]))
            self.SetMinSize(self.GetSize())
        self.update = False

        self.Bind(wx.EVT_CLOSE, self.on_close)
        self.Bind(aui.EVT_AUI_PANE_CLOSE, self.on_pan_close)
        thread = threading.Thread(None, self.hold, ())
        thread.setDaemon(True)
        thread.start()
예제 #3
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 title="",
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER,
                 log=None):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self.mgr = aui.AuiManager()
        # tell AuiManager to manage this frame
        self.mgr.SetManagedWindow(self)
        self.mgr.SetFlags(self.mgr.GetFlags() ^ aui.AUI_MGR_ALLOW_ACTIVE_PANE)
        self.perspectives = []
        # self.perspectives.append(IPPoolPerspective(self, self.mgr))
        self.perspectives.append(SpiderPerspective(self, self.mgr))
        self.tb = None

        self.create_menubar()
        self.create_toolbar()
        self.create_statusbar()
        self.create_panes()
        self.bind_events()
        self.post_init()
        self.SetIcon(images.zhao.GetIcon())
        LOG.info('MainFrame actual size: %s' % self.GetSize())
예제 #4
0
    def InitUI(self):

        panel = wx.Panel(self)

        self.mgr = aui.AuiManager()
        self.mgr.SetManagedWindow(panel)

        notebook = wx.Notebook(panel, -1, style=wx.CLIP_CHILDREN)
        stockRegisterPanel = StockRegisterPanel(notebook)
        stockReportPanel = StockReportPanel(notebook)
        notebook.AddPage(stockRegisterPanel, '物品登记')
        notebook.AddPage(stockReportPanel, '出入库报表')
        notebook.SetSelection(0)

        goodsTreeCtrlPanel = GoodsTreeCtrlPanel(panel)

        self.mgr.AddPane(notebook,
                         aui.AuiPaneInfo().CenterPane().Name("Notebook"))
        self.mgr.AddPane(
            goodsTreeCtrlPanel,
            aui.AuiPaneInfo().Left().Layer(2).BestSize((240, -1)).MinSize(
                (240, -1)).Floatable(self.allowAuiFloating).FloatingSize(
                    (240,
                     700)).Caption("").CloseButton(False).Name("GoodsTree"))

        self.mgr.Update()
        bSizer = wx.BoxSizer(wx.VERTICAL)
        bSizer.Add(panel, 1, wx.ALL | wx.EXPAND, 0)
        self.SetSizer(bSizer)

        self.Layout()
예제 #5
0
        def __init__(self, parent=None, title="Cuttlebug"):
            super(Frame, self).__init__(parent, -1, title, size=(1024,768), style=wx.DEFAULT_FRAME_STYLE & ~wx.TAB_TRAVERSAL)
            self.SetIcon(wx.Icon('icons/cuttlebug.png', wx.BITMAP_TYPE_PNG))
            self.controller = app.Controller(self)            
            self.editor_maximized = False
            self.saved_perspective = ''
            self.Bind(wx.EVT_CLOSE, self.on_close)

            # Create frame UI (menus, status, etc)
            self.create_menu_bar()
            self.create_status_bar()
            
            # Create views
            self.manager = aui.AuiManager(self)

            self.create_views()
            
            self.controller.setup_logs()
            self.controller.load_session()
            self.controller.setup_gdb()
            
            self.manager.Update()

           
            print "Welcome to Cuttlebug!"
예제 #6
0
    def setup(self):
        self.aui_mgr = aui.AuiManager(
            self, aui.AUI_MGR_ALLOW_FLOATING | aui.AUI_MGR_ALLOW_ACTIVE_PANE
            | aui.AUI_MGR_NO_VENETIAN_BLINDS_FADE
            | aui.AUI_MGR_TRANSPARENT_HINT)

        self.on_close += self.aui_mgr.UnInit

        self.aui_uses_provider = False
        self.maximized_pane_direction = None

        self.needs_showing_event = {}
        self.on_render = ObserverList()

        try:
            self.dockart = DockArt(self)

            self.aui_mgr.Bind(aui.EVT_AUI_RENDER, self.on_aui_render)

            self.aui_mgr.SetArtProvider(self.dockart)
            self.aui_uses_provider = True
        except AttributeError:
            # no constructor defined previous to wx 2.8.4.0, so can't override
            pass

        # now set the inactive caption colour
        # wxAUI arguably should do this itself
        # on high contrast black, you couldn't see the inactive captions at
        # all
        prov = self.aui_mgr.GetArtProvider()

        # wxAUI darkens the gripper colour if it is too light. However, this
        # looks ugly next to a toolbar.
        prov.SetColour(wx.aui.AUI_DOCKART_GRIPPER_COLOUR,
                       wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE))

        if not config.use_system_inactive_caption_colour:
            return

        prov.SetMetric(aui.AUI_DOCKART_GRADIENT_TYPE,
                       aui.AUI_GRADIENT_HORIZONTAL)

        inactive_caption_colour = wx.SystemSettings.GetColour(
            wx.SYS_COLOUR_INACTIVECAPTION)

        inactive_caption_gradient_colour = wxAuiLightContrastColour(
            inactive_caption_colour)

        inactive_caption_text_colour = wx.SystemSettings.GetColour(
            wx.SYS_COLOUR_INACTIVECAPTIONTEXT)

        for setting, colour in (
            (aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR, inactive_caption_colour),
            (aui.AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR,
             inactive_caption_gradient_colour),
            (aui.AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR,
             inactive_caption_text_colour)):

            prov.SetColour(setting, colour)
예제 #7
0
 def __set_properties(self):
     # tell FrameManager to manage this frame
     # self._mgr = wx.lib.agw.aui.framemanager.AuiManager_DCP()
     self._mgr = aui.AuiManager(flags=wx.aui.AUI_MGR_LIVE_RESIZE
                                | wx.aui.AUI_MGR_DEFAULT)
     self._mgr.SetManagedWindow(self)
     # begin wxGlade: SpectrumFrame.__set_properties
     self.SetTitle("Spectrum Viewer")
예제 #8
0
파일: gui2.py 프로젝트: dfyz85/shipmon
    def __init__(self, id=-1, title='ADD VESSEL'):
        wx.Frame.__init__(self, None, title=title, size=(300, 230))
        #Vessels LIST frame manager
        self.x = 0
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)
        self._mgr.Update()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        #Vessels LIST frame manager END
        self.panel = wx.Panel(self)
        addVessel = wx.Button(self.panel, -1, "ADD Vessel")
        showVessels = wx.Button(self.panel, -1, "Show Vessels")
        self.Bind(wx.EVT_BUTTON, self.AddVesselButton, addVessel)
        self.Bind(wx.EVT_BUTTON, self.ShowVesselsButton, showVessels)
        sizer = wx.BoxSizer(wx.VERTICAL)

        labelText1 = wx.BoxSizer(wx.HORIZONTAL)
        label1 = wx.StaticText(self.panel, -1, "Vessel name:")
        text1 = wx.TextCtrl(self.panel, -1, "")
        self.vessel = text1
        labelText1.Add(label1, 0, wx.ALL, 5)
        labelText1.Add(text1, 1, wx.ALL, 5)

        labelText2 = wx.BoxSizer(wx.HORIZONTAL)
        label2 = wx.StaticText(self.panel, -1, "IMO:")
        text2 = wx.TextCtrl(self.panel, -1, "")
        self.imo = text2
        labelText2.Add(label2, 0, wx.ALL, 5)
        labelText2.Add(text2, 1, wx.ALL, 5)

        labelText3 = wx.BoxSizer(wx.HORIZONTAL)
        sampleList = ['', '1', '2', '3', '4', '5', '7', '8', '9']
        label3 = wx.StaticText(self.panel, -1, "Group number:")
        comboBox3 = wx.ComboBox(self.panel,
                                value='',
                                size=wx.DefaultSize,
                                choices=sampleList,
                                style=wx.CB_DROPDOWN)
        self.groupNumber = comboBox3
        labelText3.Add(label3, 0, wx.ALL, 5)
        labelText3.Add(comboBox3, 1, wx.ALL, 5)

        buttonGroup = wx.BoxSizer(wx.HORIZONTAL)
        buttonGroup.Add(addVessel, 0, wx.ALL, 5)
        buttonGroup.Add(showVessels, 0, wx.ALL, 5)

        sizer.Add(labelText1, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
                  5)
        sizer.Add(labelText2, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
                  5)
        sizer.Add(labelText3, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
                  5)
        sizer.Add(buttonGroup, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
                  5)

        self.panel.SetSizer(sizer)
        self.panel.SetAutoLayout(True)
예제 #9
0
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, wx.ID_ANY, size=(500, 500))

        # Attributes
        self._paneNavi = None
        self.mgr = aui.AuiManager(
            self, aui.AUI_MGR_ALLOW_ACTIVE_PANE | aui.AUI_MGR_TRANSPARENT_HINT)
        self.log = log

        # Setup
        panes = list()
        for pane in range(4):
            tmp = wx.Panel(self, size=(100, 100))
            panes.append(tmp)

        if wx.Platform != '__WXMAC__':
            txt = wx.StaticText(panes[0],
                                label="Ctrl+Tab to activate navigator")
        else:
            txt = wx.StaticText(panes[0],
                                label="Alt+Tab to activate navigator")
        sizer = wx.BoxSizer()
        sizer.Add(txt, 0, wx.ALIGN_CENTER | wx.ALL, 20)
        panes[0].SetSizer(sizer)

        # Populate aui manager
        name = "Panel%s"
        pos = ['Center', 'Left', 'Top', 'Right']
        for idx, pane in enumerate(panes):
            tmp = name % idx
            if idx > 0:
                txt = wx.TextCtrl(pane)
                s = wx.BoxSizer()
                s.Add(txt, 1, wx.EXPAND)
                pane.SetSizer(s)

            ai = aui.AuiPaneInfo().Caption(tmp).MinSize((100, 100)).Name(tmp)
            ai = getattr(ai, pos[idx])()
            self.mgr.AddPane(pane, ai)
        self.mgr.Update()

        tlw = self.GetTopLevelParent()
        if wx.Platform != '__WXMAC__':
            tbl = wx.AcceleratorTable([(wx.ACCEL_CTRL, wx.WXK_TAB, ID_NAVI)])
        else:
            tbl = wx.AcceleratorTable([(wx.ACCEL_ALT, wx.WXK_TAB, ID_NAVI)])
        tlw.SetAcceleratorTable(tbl)
        tlw.Bind(wx.EVT_MENU, self.OnNavigate, id=ID_NAVI)

        self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
예제 #10
0
파일: auiframe.py 프로젝트: simon0729/Test
    def __init__(self, *args, **kwargs):
        super(AuiBaseFrame, self).__init__(*args, **kwargs)

        # Attributes
        auiFlags = aui.AUI_MGR_DEFAULT
        if wx.Platform == '__WXGTK__' and \
           aui.AUI_MGR_DEFAUL & aui.AUI_MGR_TRANSPARENT_HINT:
            # Use venetian blinds style as transparent can
            # cause crashes on Linux when desktop compositing
            # is used. (wxAUI bug in 2.8)
            auiFlags -= aui.AUI_MGR_TRANSPARENT_HINT
            auiFlags |= aui.AUI_MGR_VENETIAN_BLINDS_HINT
        self._mgr = aui.AuiManager(self, flags=auiFlags)

        # Event Handlers
        self.Bind(wx.EVT_CLOSE, self.OnAuiBaseClose)
예제 #11
0
    def __init__(self):
        super().__init__(None,
                         title=config.get("APP.window_title"),
                         size=(800, 600))
        self.aui_manager = aui.AuiManager(self,
                                          wx.aui.AUI_MGR_TRANSPARENT_HINT)

        self.nav_panel = NavPanel(self)
        self.list_panel = ListPanel(self)
        self.detail_panel = TextEditor(self)
        self.todo_panel = TodoPanel(self)

        self.status_bar = StatusBar(self)
        self.SetStatusBar(self.status_bar)

        self.aui_manager.AddPane(
            self.nav_panel,
            self.get_default_pane_info().Left().Row(0).BestSize(300, -1))
        self.aui_manager.AddPane(
            self.list_panel,
            self.get_default_pane_info().Left().Row(1).BestSize(250,
                                                                -1).MinSize(
                                                                    150, -1))
        self.aui_manager.AddPane(
            self.detail_panel,
            self.get_default_pane_info().CenterPane().Position(0).BestSize(
                400, -1).MinSize(500, -1))
        self.aui_manager.AddPane(
            self.todo_panel,
            self.get_default_pane_info().CenterPane().Position(1).BestSize(
                400, -1).MinSize(500, -1))

        self.aui_manager.GetPane(self.todo_panel).Hide()
        self.aui_manager.GetArtProvider().SetMetric(
            wx.aui.AUI_DOCKART_SASH_SIZE, 1)
        self.aui_manager.Update()

        self.Maximize(True)
        self.register_listeners()

        self.build_menu_bar()

        self.current_note = None
        self.note_searcher = NoteSearchService()
        # tree root node is selected by default
        wx.CallAfter(self.detail_panel.Hide)
예제 #12
0
    def _set_properties(self):
        # tell FrameManager to manage this frame
        self._mgr = aui.AuiManager(flags=wx.aui.AUI_MGR_LIVE_RESIZE
                                   | wx.aui.AUI_MGR_DEFAULT)
        self._mgr.SetManagedWindow(self)

        self.GunShotMatch_statusbar.SetStatusWidths([-2, -3])

        # statusbar fields
        GunShotMatch_statusbar_fields = ["Ready", "Welcome to GunShotMatch"]
        for i in range(len(GunShotMatch_statusbar_fields)):
            self.GunShotMatch_statusbar.SetStatusText(
                GunShotMatch_statusbar_fields[i], i)

        _icon = wx.NullIcon
        _icon.CopyFromBitmap(get_icon("logo-v2", 256))
        self.SetIcon(_icon)
예제 #13
0
    def __init__(self, controller_uid):
        #
        super().__init__(controller_uid)
        #
        self._mgr = aui.AuiManager(self)   
        #
        self._mgr.GetArtProvider().SetColour(aui.AUI_DOCKART_BACKGROUND_COLOUR, 
               wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE))
        self._mgr.GetArtProvider().SetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR,
               wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)) 
        #
        self.main_area_panel = wx.Panel(self)
        
        bmp_filename = "gripy_logo.jpg"
        bmp = GripyBitmap(bmp_filename)
        self._static_bmp = wx.StaticBitmap(self.main_area_panel, wx.ID_ANY, 
                                    bmp, wx.Point(0, 0), 
                                    bmp.GetSize()
        )  
        self.main_area_panel.SetBackgroundColour('white')
        
        self._mgr.AddPane(self.main_area_panel, 
                        aui.AuiPaneInfo().Name("main_area_panel").CenterPane())    
        #
        self._notebook = aui.AuiNotebook(self.main_area_panel)
        #
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self._notebook, 1, flag=wx.EXPAND)
        sizer.Add(self._static_bmp, 1, flag=wx.EXPAND)
        #
        self._notebook.Show(False)
        #
        sizer.Layout()
        #
        self.main_area_panel.SetSizerAndFit(sizer)
        #
        self.Bind(aui.EVT_AUINOTEBOOK_TAB_RIGHT_DOWN, 
                  self.on_page_right_down)     
        #    
        self._mgr.Update()    
        #
#        self.Bind(wx.EVT_CLOSE, self.on_close)     
        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, 
                  self.on_page_close, self._notebook)
        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CHANGED, 
                  self.on_page_changed)
예제 #14
0
    def __init__(self):
        super().__init__(None, wx.ID_ANY, "Final Project", wx.DefaultPosition,
                         (850, 700), wx.DEFAULT_FRAME_STYLE)

        icon = wx.Icon(
            r"C:\Users\Cristian\PycharmProjects\final_project\bitmaps\horse.png"
        )
        self.SetIcon(icon)

        self._aui_manager = aui.AuiManager()
        self._aui_manager.SetManagedWindow(self)

        self.logger = None
        self.create_log_bar()
        self.workset_controller = WorksetController(view=self,
                                                    logger=self.logger)
        self.create_menu_bar()
        self.notebook = self.create_notebook()

        self._aui_manager.Update()

        self.bind_events()
예제 #15
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self,
                          id=wxID_ODMTOOLS,
                          name=u'ODMTools',
                          parent=prnt,
                          pos=wx.Point(150, 150),
                          size=wx.Size(1190, 812),
                          style=wx.DEFAULT_FRAME_STYLE,
                          title=u'ODM Tools')
        self.SetFont(
            wx.Font(9, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Tahoma'))
        # Publisher.subscribe(self.addPlot, ("add.NewPlot"))
        # Publisher.subscribe(self.addEdit, ("edit.NewPlot"))
        Publisher.subscribe(self.onDocking, ("adjust.Docking"))

        Publisher.subscribe(self.onDocking, ("adjust.Docking"))
        Publisher.subscribe(self.onPlotSelection, ("select.Plot"))
        Publisher.subscribe(self.onExecuteScript, ("execute.script"))

        Publisher.subscribe(self.onExecuteScript, ("execute.script"))
        Publisher.subscribe(self.onChangeDBConn, ("change.dbConfig"))
        Publisher.subscribe(self.onSetScriptTitle, ("script.title"))
        Publisher.subscribe(self.OnClose, ("onClose"))

        ############### Ribbon ###################
        self._ribbon = mnuRibbon.mnuRibbon(parent=self,
                                           id=wx.ID_ANY,
                                           name='ribbon')

        ################ Docking Tools##############
        self.pnlDocking = wx.Panel(id=wxID_ODMTOOLSPANEL1,
                                   name='pnlDocking',
                                   parent=self,
                                   pos=wx.Point(0, 0),
                                   size=wx.Size(605, 458),
                                   style=wx.TAB_TRAVERSAL)

        ################ Series Selection Panel ##################
        self.pnlSelector = pnlSeriesSelector.pnlSeriesSelector(
            id=wxID_PNLSELECTOR,
            name=u'pnlSelector',
            parent=self.pnlDocking,
            pos=wx.Point(0, 0),
            size=wx.Size(770, 388),
            style=wx.TAB_TRAVERSAL,
            dbservice=self.sc)

        ####################grid##################
        self.dataTable = pnlDataTable.pnlDataTable(id=wxID_ODMTOOLSGRID1,
                                                   name='dataTable',
                                                   parent=self.pnlDocking,
                                                   pos=wx.Point(64, 160),
                                                   size=wx.Size(376, 280),
                                                   style=0)

        ############# Graph ###############
        self.pnlPlot = pnlPlot.pnlPlot(id=wxID_ODMTOOLSPANEL1,
                                       name='pnlPlot',
                                       parent=self.pnlDocking,
                                       pos=wx.Point(0, 0),
                                       size=wx.Size(605, 458),
                                       style=wx.TAB_TRAVERSAL)

        ############# Script & Console ###############

        self.txtPythonConsole = wx.py.crust.CrustFrame(
            id=wxID_TXTPYTHONCONSOLE,
            name=u'txtPython',
            parent=self,
            rootObject=self,
            rootLabel="Main Window",
            pos=wx.Point(72, 24),
            size=wx.Size(500, 800),
            style=0)

        # Console tools object for usability
        self.console_tools = ConsoleTools(self._ribbon)
        self.txtPythonConsole.shell.run("Tools = app.TopWindow.console_tools",
                                        prompt=False,
                                        verbose=False)

        self.txtPythonScript = pnlScript(id=wxID_TXTPYTHONSCRIPT,
                                         name=u'txtPython',
                                         parent=self,
                                         pos=wx.Point(72, 24),
                                         size=wx.Size(200, 200))

        # print self.txtPythonConsole.fileMenu.MenuItems
        # for menu in self.txtPythonConsole.fileMenu.MenuItems:
        #     print menu.Label, menu.Kind
        # print self.txtPythonConsole.fileMenu.MenuItems[11].IsEnabled()
        # self.txtPythonConsole.fileMenu.MenuItems[11].Enable=False
        # print self.txtPythonConsole.fileMenu.MenuItems[11].IsEnabled()

        ############ Docking ###################

        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self.pnlDocking)
        self._mgr.AddPane(
            self.dataTable,
            aui.AuiPaneInfo().Right().Name("Table").Show(
                show=False).Caption('Table View').MinSize(wx.Size(200, 200)))
        # DestroyOnClose(b=False)
        self._mgr.AddPane(
            self.pnlSelector,
            aui.AuiPaneInfo().Bottom().Name("Selector").Layer(0).Caption(
                'Series Selector').MinSize(wx.Size(100, 200)))
        self._mgr.AddPane(
            self.txtPythonScript,
            aui.AuiPaneInfo().Caption('Script').Name("Script").Show(
                show=False).Layer(0).Float().MinSize(wx.Size(200, 200)))
        # self._mgr.CreateFloatingFrame(self.txtPythonScript,  aui.AuiPaneInfo().Caption('Script').
        #         Name("Script").MinSize(wx.Size(500,800)))
        self._mgr.AddPane(
            self.txtPythonConsole,
            aui.AuiPaneInfo().Caption('Python Console').Name("Console").Layer(
                1).Show(show=False).Float())
        # self.txtPythonConsole.ToggleTools()

        self._mgr.AddPane(
            self.pnlPlot,
            aui.AuiPaneInfo().CenterPane().Name("Plot").Caption("Plot"))

        self.loadDockingSettings()

        self._mgr.Update()

        self.Bind(wx.EVT_CLOSE, self.OnClose)

        self._init_sizers()
        self._ribbon.Realize()
예제 #16
0
   def __init__(self, parent, id, title):
      global shell
      wx.Frame.__init__(
         self, parent, id, title, (100, 100),
         # Win32 change
         [600, 550],
         style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE)
      compat_wx.handle_event_0(self, wx.EVT_CLOSE, self._OnCloseWindow)

      self.known_modules = {}
      self.menu = self.make_menu()
      self.SetMenuBar(self.menu)

      if aui:
         self._aui = aui.AuiManager(self)
         nb_style = (aui.AUI_NB_TAB_SPLIT|aui.AUI_NB_TAB_MOVE|
                     aui.AUI_NB_TAB_EXTERNAL_MOVE|aui.AUI_NB_SCROLL_BUTTONS)
         nb = aui.AuiNotebook(self, style=nb_style)
         control_parent = self
      else:
         splitter = wx.SplitterWindow(
            self, -1,
            style=wx.SP_3DSASH|wx.CLIP_CHILDREN|
            wx.NO_FULL_REPAINT_ON_RESIZE|wx.SP_LIVE_UPDATE)
         control_parent = splitter

      self.icon_display = icon_display.IconDisplay(control_parent, self)
      if aui:
         self.shell = PyShellGameraShell(parent=self)
         rootObject = self.shell.interp.locals
         self.filling = wx.py.filling.Filling(parent=nb, 
                                              rootObject=rootObject, 
                                              rootIsNamespace=True)
         # Add 'filling' to the interpreter's locals.
         self.calltip = Calltip(parent=nb)
         self.sessionlisting = wx.py.crust.SessionListing(parent=nb)
      else:
         crust = PyCrustGameraShell(control_parent, -1)
         self.shell = crust.shell
      self.shell.main_win = self
      self.shell.update = self.Update
      image_menu.set_shell(self.shell)
      image_menu.set_shell_frame(self)
      self.shell.push("from gamera.gui import gui")
      self.shell.push("from gamera.gui.matplotlib_support import *")
      self.shell.push("from gamera.core import *")
      self.shell.push("init_gamera()")

      self.shell.update = self.Update
      self.icon_display.shell = self.shell
      self.icon_display.main = self
      self.Update()
      self.shell.SetFocus()

      if aui:
         self._aui.AddPane(
            self.icon_display,
            aui.AuiPaneInfo()
            .Name("icon_display")
            .CenterPane()
            .MinSize(wx.Size(96, 96))
            .CloseButton(False)
            .CaptionVisible(True)
            .Caption("Objects")
            .Dockable(True))
         self._aui.AddPane(
            self.shell,
            aui.AuiPaneInfo()
            .Name("shell")
            .CenterPane()
            .MinSize(wx.Size(200,200))
            .CloseButton(False)
            .CaptionVisible(True)
            .MaximizeButton(True)
            .Caption("Interactive Python Shell")
            .Dockable(True))
         nb.AddPage(self.calltip, "Documentation")
         nb.AddPage(self.filling, "Namespace")
         nb.AddPage(self.sessionlisting, "History")
         self._aui.AddPane(
            nb,
            aui.AuiPaneInfo()
            .Name("notebook")
            .CenterPane()
            .MinSize(wx.Size(200, 100))
            .MaximizeButton(True))
         
         self._aui.GetPane("notebook").Show().Bottom()
         self._aui.GetPane("icon_display").Show().Left()
         self._aui.Update()
      else:
         splitter.SetMinimumPaneSize(20)
         splitter.SplitVertically(self.icon_display, crust, 120)
         splitter.SetSashPosition(120)

      self.status = StatusBar(self)
      self.SetStatusBar(self.status)
      from gamera.gui import gamera_icons
      icon = compat_wx.create_icon_from_bitmap(gamera_icons.getIconBitmap())
      self.SetIcon(icon)
      self.Move(wx.Point(int(30), int(30)))
      wx.Yield()
예제 #17
0
    def __init__(self, parent, id):
        """
        Creates application window.
        """
        wx.Frame.__init__(self, parent, id, "EI07", size=(300,200))
        self.SetMinSize((300, 200))

        # Load resource file
        self.xRes = wx.xrc.XmlResource("Application.xrc")

        self.SetIcons(self.PrepareApplicationIcons())

        self.modified = False
        self.path = None

        self.UpdateTitle()

        self.CreateMenu()
        self.ribbon = ui.ribbon.RibbonPanel(self)
        
        # Ribbon need panel wich can be managed by AUIManager
        self.main_content_panel = wx.Panel(self,wx.ID_ANY)

        # creating and setting sizer for ribbon and content
        main_sizer = wx.BoxSizer(wx.VERTICAL)
        main_sizer.Add(self.ribbon, 0, wx.EXPAND)
        main_sizer.Add(self.main_content_panel,1,wx.EXPAND)
        self.SetSizer(main_sizer)
        
        # Prepare pane manager
        self._paneManager = AUI.AuiManager(self.main_content_panel)


        self.CreateStatusBar()
        self.CreateContent()
        self.CreatePalette()
        #self.RestorePerspective()


        config = wx.FileConfig.Get()

        maximised = config.ReadInt("/EIFrame/maximised", 0)	
        posX = config.ReadInt("/EIFrame/x", 14)
        posY = config.ReadInt("/EIFrame/y", 14)
        width = config.ReadInt("/EIFrame/width", 680)
        height = config.ReadInt("/EIFrame/height", 420)
        self.workingDirectory = config.Read("/EIAPP/workingDirectory", \
            wx.GetHomeDir())
        self.exportDirectory = config.Read("/EIApp/exportDirectory")

        self.Move((posX, posY))
        self.SetSize((width, height))
        self.Maximize(maximised)

        self.Bind(wx.EVT_CLOSE, self.OnExit)
        self.Bind(wx.EVT_MAXIMIZE, self.OnMaximise)
        self.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheel)

        self.Layout()
        (x, y) = self.editor.ModelToView()
        self.editor.CenterViewAt(x, y)
        self.Show(True)
예제 #18
0
    def __init__(self, parent, id, title, pos=wx.DefaultPosition):
        wx.Frame.__init__(self, parent, id, title, pos)

        self.info = Info(self)
        self.SetTitle(self.info.GetName())
        self.SetIcon(wx.Icon(LOGO_ICON, wx.BITMAP_TYPE_PNG))

        self.apiUrl = 'http://' + CONF['server']['host'] + ':' + str(
            CONF['server']['port'])

        self.interface = SqlmapInterface(self.apiUrl,
                                         CONF['server']['headers'])
        self.addOptions = None

        self.taskID = None

        self.saved = True
        self.scanThread = None
        self.options = dict()

        self.auiMgr = aui.AuiManager()
        self.auiMgr.SetManagedWindow(self)
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

        #====================#
        # menus and menu bar #
        #====================#

        self.menuFile = wx.Menu()
        self.menuFile.Append(ID_MENU_SAVE, '&Save\tCtrl-S',
                             'Save scan results')
        self.menuFile.AppendSeparator()
        self.menuFile.Append(ID_MENU_EXIT, 'E&xit', 'Exit the Application')
        self.menuFile.Enable(ID_MENU_SAVE, False)

        self.menuScan = wx.Menu()
        self.menuScan.Append(ID_MENU_NEW_SCAN, '&New Scan\tCtrl-N',
                             'Start a new scan.')
        self.menuScan.AppendSeparator()
        self.menuScan.Append(ID_MENU_OPTIONS, '&Options\tCtrl-O',
                             'Set scan options')
        self.menuScan.Enable(ID_MENU_OPTIONS, False)

        menuHelp = wx.Menu()
        menuHelp.Append(ID_MENU_ABOUT, '&About...')

        self.Bind(wx.EVT_MENU, self.OnSave, id=ID_MENU_SAVE)
        self.Bind(wx.EVT_MENU, self.OnExit, id=ID_MENU_EXIT)
        self.Bind(wx.EVT_MENU, self.OnNewScan, id=ID_MENU_NEW_SCAN)
        self.Bind(wx.EVT_MENU, self.OnOptions, id=ID_MENU_OPTIONS)
        self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_MENU_ABOUT)

        menuBar = wx.MenuBar()
        menuBar.Append(self.menuFile, "&File")
        menuBar.Append(self.menuScan, "&Scan")
        menuBar.Append(menuHelp, "&Help")
        self.SetMenuBar(menuBar)

        #============================#
        # panel top : target, inputs #
        #============================#

        sizerPnlTop = wx.BoxSizer(wx.VERTICAL)
        pnlTop = wx.Panel(self, -1)

        self.sizerPnlTarget = wx.BoxSizer(wx.HORIZONTAL)
        pnlTarget = wx.Panel(pnlTop, -1)

        self.lTarget = wx.StaticText(pnlTarget, -1, label='target-url: ')
        self.tcTarget = wx.TextCtrl(pnlTarget, -1)
        self.tcTarget.Enable(False)
        self.tcTarget.Bind(wx.EVT_TEXT, self.set_tree_target)

        self.sizerPnlTarget.Add(self.lTarget, flag=wx.ALIGN_CENTRE_VERTICAL)
        self.sizerPnlTarget.Add(self.tcTarget, 1, wx.EXPAND)
        pnlTarget.SetSizerAndFit(self.sizerPnlTarget)

        # self.tcTarget.SetValue('http://www.beispiel.com/?id=1')

        #========================================================#
        # panel top: button panel: create buttons bind functions #
        #========================================================#

        sizerPnlButtons = wx.BoxSizer(wx.HORIZONTAL)
        pnlButtons = wx.Panel(pnlTop, -1)

        self.btnPanel = bp.ButtonPanel(pnlButtons,
                                       -1,
                                       agwStyle=bp.BP_DEFAULT_STYLE)
        self.btnPanel.GetBPArt().SetMetric(bp.BP_PADDING_SIZE, wx.Size(4, 4))
        self.btnPanel.GetBPArt().SetMetric(bp.BP_MARGINS_SIZE, wx.Size(4, 4))
        self.btnPanel.GetBPArt().GetFont(bp.BP_BUTTONTEXT_FONT)\
                                .SetPointSize(8)

        self.btnStop = bp.ButtonInfo(self.btnPanel,
                                     -1,
                                     self.get_icon('stop'),
                                     text='Stop',
                                     shortHelp='Stop the current scan')
        self.btnStop.Enable(False)

        self.btnStart = bp.ButtonInfo(self.btnPanel,
                                      -1,
                                      self.get_icon('target'),
                                      text='Start',
                                      shortHelp='Start the customized scan')

        self.btnSetOptions = bp.ButtonInfo(self.btnPanel,
                                           -1,
                                           self.get_icon('options'),
                                           text='Options',
                                           shortHelp='Set scan options')

        self.btnGetDBs = bp.ButtonInfo(self.btnPanel,
                                       -1,
                                       self.get_icon('db'),
                                       text='Get DBs',
                                       shortHelp='Enumerate DBMS databases')

        self.btnGetTbls = bp.ButtonInfo(
            self.btnPanel,
            -1,
            self.get_icon('tbl'),
            text='Get Tables',
            shortHelp='Enumerate DBMS database tables')

        self.btnGetCols = bp.ButtonInfo(
            self.btnPanel,
            -1,
            self.get_icon('col'),
            text='Get Columns',
            shortHelp='Enumerate DBMS database table columns')

        self.btnGetData = bp.ButtonInfo(
            self.btnPanel,
            -1,
            self.get_icon('tblDump'),
            text='Get Data',
            shortHelp='Dump DBMS database table entries')

        self.btnOutput = bp.ButtonInfo(self.btnPanel,
                                       -1,
                                       self.get_icon('view'),
                                       text='View Output',
                                       shortHelp='View data output')

        self.btnSave = bp.ButtonInfo(self.btnPanel,
                                     -1,
                                     self.get_icon('save'),
                                     text=' Save ',
                                     shortHelp='save scan results')
        self.btnCloseAll = bp.ButtonInfo(self.btnPanel,
                                         -1,
                                         self.get_icon('closeTab'),
                                         text='Close Tabs',
                                         shortHelp='Close all tabs')
        self.btnCloseAll.Enable(False)

        self.Bind(wx.EVT_BUTTON, self.stop_scan, self.btnStop)
        self.Bind(wx.EVT_BUTTON, self.run_custom, self.btnStart)
        self.Bind(wx.EVT_BUTTON, self.OnOptions, self.btnSetOptions)
        self.Bind(wx.EVT_BUTTON, self.run_get_dbs, self.btnGetDBs)
        self.Bind(wx.EVT_BUTTON, self.run_get_tables, self.btnGetTbls)
        self.Bind(wx.EVT_BUTTON, self.run_get_columns, self.btnGetCols)
        self.Bind(wx.EVT_BUTTON, self.run_get_data, self.btnGetData)
        self.Bind(wx.EVT_BUTTON, self.OnShowOutput, self.btnOutput)
        self.Bind(wx.EVT_BUTTON, self.OnSave, self.btnSave)
        self.Bind(wx.EVT_BUTTON, self.OnDeletePages, self.btnCloseAll)

        self.btnPanel.AddButton(self.btnStop)
        self.btnPanel.AddSeparator()
        self.btnPanel.AddButton(self.btnStart)
        self.btnPanel.AddSeparator()
        self.btnPanel.AddButton(self.btnSetOptions)
        self.btnPanel.AddSeparator()
        self.btnPanel.AddButton(self.btnGetDBs)
        self.btnPanel.AddButton(self.btnGetTbls)
        self.btnPanel.AddButton(self.btnGetCols)
        self.btnPanel.AddButton(self.btnGetData)
        self.btnPanel.AddSeparator()
        self.btnPanel.AddButton(self.btnOutput)
        self.btnPanel.AddSeparator()
        self.btnPanel.AddButton(self.btnSave)
        self.btnPanel.AddSeparator()
        self.btnPanel.AddButton(self.btnCloseAll)
        self.btnPanel.DoLayout()

        self.scanBtns = [
            self.btnStart, self.btnGetDBs, self.btnGetTbls, self.btnGetCols,
            self.btnGetData, self.btnOutput, self.btnSave, self.btnSetOptions
        ]

        sizerPnlButtons.Add(self.btnPanel, 1, wx.EXPAND)
        pnlButtons.SetSizerAndFit(sizerPnlButtons)

        self.enable_scan_inputs(False)

        sizerPnlTop.Add(pnlTarget, 0, wx.EXPAND | wx.LEFT | wx.TOP, 2)
        sizerPnlTop.Add(pnlButtons, 0, wx.EXPAND)
        pnlTop.SetSizerAndFit(sizerPnlTop)

        #==============================================#
        # panel center: aui notebook, grid data output #
        #==============================================#

        sizerPnlCenter = wx.BoxSizer(wx.VERTICAL)
        self.pnlCenter = wx.Panel(self, -1)

        self.nb = aui.AuiNotebook(
            self.pnlCenter,
            -1,
            style=aui.AUI_NB_CLOSE_ON_ALL_TABS | aui.AUI_NB_WINDOWLIST_BUTTON
            | aui.AUI_NB_TAB_SPLIT | aui.AUI_NB_TAB_MOVE
            | aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_SCROLL_BUTTONS)

        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSED, self.OnPageClosed, self.nb)

        sizerPnlCenter.Add(self.nb, 1, wx.EXPAND)
        self.pnlCenter.SetSizerAndFit(sizerPnlCenter)

        #==========================#
        # panel left: tree control #
        #==========================#

        self.sizerPnlTree = wx.BoxSizer(wx.HORIZONTAL)
        pnlTree = wx.Panel(self, -1)

        self.tree = ct.CustomTreeCtrl(
            pnlTree,
            -1,
            agwStyle=ct.TR_HAS_BUTTONS | ct.TR_AUTO_CHECK_PARENT
            | ct.TR_AUTO_CHECK_CHILD | ct.TR_HAS_VARIABLE_ROW_HEIGHT)
        self.Bind(ct.EVT_TREE_ITEM_CHECKED, self.OnCheckTree, self.tree)
        self.sizerPnlTree.Add(self.tree, 1, wx.EXPAND)

        # creating image list and assigning list to tree
        # (target, db, table and column icon)
        il = wx.ImageList(16, 16)

        for k in TREE_ICONS.keys():
            TREE_ICONS[k] = il.Add(TREE_ICONS[k].Scale(16,
                                                       16).ConvertToBitmap())

        self.tree.AssignImageList(il)

        self.treeRoot = self.tree.AddRoot('', image=TREE_ICONS['target'])
        self.treeDBs = None
        self.treeTbls = None
        self.treeData = dict()
        self.set_tree_target(None)
        self.tree.Layout()
        pnlTree.SetSizerAndFit(self.sizerPnlTree)

        #========================#
        # pane bottom: scan logs #
        #========================#

        self.tcLog = wx.TextCtrl(self,
                                 -1,
                                 style=wx.TE_MULTILINE | wx.TE_READONLY)

        #=================================================#
        # adding panels and components to the aui manager #
        #=================================================#

        self.auiMgr.AddPane(
            pnlTop,
            aui.AuiPaneInfo().Name('inputs').Top().DockFixed().CaptionVisible(
                False).PaneBorder(False).CloseButton(False))

        self.auiMgr.AddPane(
            pnlTree,
            aui.AuiPaneInfo().Name('tree').Caption(
                'Target Schema').Left().BestSize(wx.Size(160, 500)).PaneBorder(
                    False).MaximizeButton(True).CloseButton(False))

        self.auiMgr.AddPane(
            self.pnlCenter,
            aui.AuiPaneInfo().Name('center').Caption('Table Dumps').Center().
            PaneBorder(False).MaximizeButton(True).CloseButton(False))

        self.auiMgr.AddPane(
            self.tcLog,
            aui.AuiPaneInfo().Name('log').Caption(
                'Scan Log').Bottom().BestSize(wx.Size(600, 140)).PaneBorder(
                    False).MaximizeButton(True).CloseButton(False))

        self.CreateStatusBar()
        self.SetStatusText(self.info.GetName())
예제 #19
0
    def __init__(self, parent, id=-1, title="线性代数小专家",style=wx.DEFAULT_FRAME_STYLE |
                                            wx.SUNKEN_BORDER |wx.MAXIMIZE|
                                            wx.CLIP_CHILDREN):

        wx.Frame.__init__(self,parent,id=id,title=title,pos=wx.DefaultPosition,
                 size=wx.Size(900,650),style=style)

        # tell FrameManager to manage this frame
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)

        self._perspectives = []
        self.n = 0
        self.x = 0
        self._matTree=[]
        self.font = wx.Font(wx.FontInfo(10).FaceName("新宋体"))
        xit_G.G_fontandcolour=G_fontcolour()

        #生成菜单
        self._menudict={}
        mb = wx.MenuBar()
        menuctrl=MyMenuControl(self,"mainframe")
        #文件菜单       
        file_menu = wx.Menu()
        tmp=file_menu.Append(wx.ID_ANY,"新建(&N)")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, menuctrl.Control, id=tmp.GetId())
        tmp=file_menu.Append(wx.ID_ANY,"打开...")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, menuctrl.Control, id=tmp.GetId())
        tmp=file_menu.Append(wx.ID_ANY,"合并打开...")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, menuctrl.Control, id=tmp.GetId())
        tmp=file_menu.Append(wx.ID_ANY,"保存")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, menuctrl.Control, id=tmp.GetId())
        tmp=file_menu.Append(wx.ID_ANY,"另存为...")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, menuctrl.Control, id=tmp.GetId())
        tmp=file_menu.Append(wx.ID_ANY,"退出")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, menuctrl.Control, id=tmp.GetId())
        #视图菜单--视图菜单的方法在这里更方便
        view_menu = wx.Menu()
        tmp=view_menu.Append(wx.ID_ANY,"显示左侧矩阵树")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, self.ViewControl, id=tmp.GetId())
        tmp=view_menu.Append(wx.ID_ANY,"显示矩阵网格")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, self.ViewControl, id=tmp.GetId())
        tmp=view_menu.Append(wx.ID_ANY,"显示下侧面板")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, self.ViewControl, id=tmp.GetId())
        tmp=view_menu.Append(wx.ID_ANY,"显示控制台")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, self.ViewControl, id=tmp.GetId())
        tmp=view_menu.Append(wx.ID_ANY,"恢复默认设置")
        self._menudict[tmp.GetId()]=tmp
        self.Bind(wx.EVT_MENU, self.ViewControl, id=tmp.GetId())

        #self.Bind(wx.EVT_CONTEXT_MENU, MyMenuControl(self).OnContextMenu)

        mb.Append(file_menu, "文件(&F)")
        mb.Append(view_menu, "视图(&V)")
       
        self.SetMenuBar(mb)
        #生成子面板
       
        self._mymattree=self.CreateTreeCtrl()
        self._mygrid=xit_MyGrid(self)
        self._mycentertextnotebook=xit_MyCenterTextNotebook(self)
        self._myshell=self.CreateShell()
        self._mynotebook=xit_MyNotebookPanel(self)

        
        xit_G.G_myOP=xit_MyOP(myCenterTextNotebook=self._mycentertextnotebook,cur="ZERO",grid=self._mygrid,tree=self._mymattree,treedict=self.treedict,menudict=self._menudict,mainwindow=self)
        
       
        self.SetIcon(GetMondrianIcon())
        self.SetMinSize(wx.Size(800, 600))

        self._mymattree.SetFont(self.font)
        self._myshell.SetFont(self.font)
        self._mynotebook.SetFont(self.font)
        # add a bunch of panes
        self._mgr.AddPane(self._mymattree, aui.AuiPaneInfo().Name("练习题集合").Caption("练习题集合").BestSize(wx.Size(250,600)).Left())
        self._mgr.AddPane(self._myshell, aui.AuiPaneInfo().Name("控制台").Caption("控制台").BestSize(wx.Size(600,800)).Right())
        self._mgr.AddPane(self._mynotebook, aui.AuiPaneInfo().Name("选项卡").Caption("选项卡").BestSize(wx.Size(650,350)).Bottom())
        self._mgr.AddPane(self._mygrid, aui.AuiPaneInfo().Name("矩阵网格").Caption("矩阵网格").BestSize(wx.Size(250,200)).Left().Position(1))
        # create some center panes
        
        self._mgr.AddPane(self._mycentertextnotebook, aui.AuiPaneInfo().Name("结果").CenterPane())

        # make some default perspectives

        self._mgr.GetPane("练习题集合").Show()
        self._mgr.GetPane("选项卡").Show()
        self._mgr.GetPane("控制台").Show()
        self._mgr.GetPane("结果").Show()
        self._mgr.GetPane("矩阵网格").Show()
        #self._mgr.GetPane("测试框").Hide()
        self.perspective_default = self._mgr.SavePerspective()

        # "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)
예제 #20
0
    def Main_Frame_Adapter(self):

        # dictionary of arrays to plot on maxplot.
        self._dict = dict()
        self._dict1 = dict()

        self.canvas_dict = dict()

        self.tab_reference = dict()
        self.dt_dictionary = dict()
        self.io_dictionary = dict()

        # create frame
        self.main_frame = CtrlFrame(None)

        # create aui manager
        self.main_frame.__auiManager = aui.AuiManager()
        self.main_frame.__auiManager.SetManagedWindow(self.main_frame)

        # create menubar
        self.main_frame.menubar = wx.MenuBar()
        self.main_frame.fileMenu = wx.Menu()
        self.main_frame.submenu = wx.MenuItem()

        self.main_frame.PlotMenu = wx.Menu()

        Functions = []

        content = package_contents("percolate/Functions")

        for file in content:

            if re.search(".py", file):

                Functions.append(file)
            # break

        # look in functions directory to fill menu with functions create a dict of functions
        """if os.path.exists(os.path.join(os.getcwd(), 'Functions')):
        
            
            
            for (dirpath, dirnames, filenames) in walk(os.path.join(os.getcwd(), 'Functions')):
                Functions.extend(filenames)
                break"""

        # self.main_frame.open_file = []
        # self.main_frame.open_file = Functions

        for file in Functions:

            self.main_frame.fileMenu.Append(wx.ID_ANY, file)

        self.main_frame.PlotMenu.Append(wx.ID_ANY, "Canvas")
        # create menu hierarchy

        # self.main_frame.open_file = self.main_frame.fileMenu.Append(wx.ID_ANY, 'Select function...')
        self.main_frame.menubar.Append(self.main_frame.fileMenu,
                                       "&Load Function")
        self.main_frame.menubar.Append(self.main_frame.PlotMenu, "Plot")

        self.main_frame.SetMenuBar(self.main_frame.menubar)

        # create tree ctrl
        #self.main_frame.tree_ctrl = wx.TreeCtrl(self.main_frame)

        #create function ctrl tree
        #self.main_frame.function_control_tree["initial function control"] = wx.TreeCtrl(self.main_frame)

        #create a notebook for the func ctrl trees to sit
        self.main_frame.function_notebooks["Function Ctrl"] = aui.AuiNotebook(
            self.main_frame)
        self.main_frame.function_notebooks[
            "Function Ctrl"].SetAGWWindowStyleFlag(
                aui.AUI_NB_SCROLL_BUTTONS
                | aui.AUI_NB_TAB_MOVE
                | aui.AUI_NB_TAB_EXTERNAL_MOVE)
        # create aui notebook
        self.main_frame.function_notebooks["Function view"] = aui.AuiNotebook(
            self.main_frame)
        self.main_frame.function_notebooks[
            "Function view"].SetAGWWindowStyleFlag(
                aui.AUI_NB_WINDOWLIST_BUTTON
                | aui.AUI_NB_SCROLL_BUTTONS
                | aui.AUI_NB_TAB_EXTERNAL_MOVE
                | aui.AUI_NB_TAB_MOVE
                | aui.AUI_NB_TAB_SPLIT
                | aui.AUI_NB_TAB_EXTERNAL_MOVE)

        self.main_frame.__auiManager.AddPane(
            self.main_frame.function_notebooks["Function Ctrl"],
            aui.AuiPaneInfo().Name("Function Ctrl").Caption(
                "Function Ctrl").Left().CloseButton(False).MinSize(180, 180),
        )

        # add panes to the manager to sort out display
        self.main_frame.__auiManager.AddPane(
            self.main_frame.function_notebooks["Function view"],
            aui.AuiPaneInfo().Name("Function view").Caption(
                "Function view").Center().CloseButton(False).MinSize(400, 400),
        )

        # just update to let the manager know
        self.main_frame.__auiManager.Update()

        # Bind handlers to controls
        self.main_frame.Bind(wx.EVT_CLOSE, self.WindowOnClose)

        # for function in self.main_frame.fileMenu:

        self.Bind(wx.EVT_MENU, self.on_func_select)

        self.main_frame.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_clicked)

        self.main_frame.PlotMenu.Bind(wx.EVT_MENU, self.On_Create_MaxPlot)
        # uncomment for shortcut
        # self.on_file_select(None)
        # self.main_frame.Bind(aui.EVT_AUI_PANE_CLOSE, self.on_pane_close)
        self.main_frame.__auiManager.Bind(aui.EVT_AUI_PANE_CLOSE,
                                          self.on_pane_close)
        self.main_frame.function_notebooks["Function view"].Bind(
            aui.EVT_AUINOTEBOOK_PAGE_CLOSED, self.on_tab_close)

        # self.main_frame.__auiManager.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.on__close)
        self.func = None
        self.count = 0
        self.addedtabs = dict()
예제 #21
0
    def __init__(self):
        super(MyFrame, self).__init__(None, wx.ID_ANY)

        auiFlags = aui.AUI_MGR_DEFAULT
        if wx.Platform == '__WXGTK__' and aui.AUI_MGR_DEFAULT & aui.AUI_MGR_TRANSPARENT_HINT:
            auiFlags = aui.AUI_MGR_TRANSPARENT_HINT
            auiFlags = aui.AUI_MGR_VENETIAN_BLINDS_HINT

        self._mgr = aui.AuiManager(flags=auiFlags)

        #self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)
        #top = wx.Panel(self, wx.ID_ANY)
        self.center = MainPane(self)
        # left = PartitionBrowserPanel(self)
        #left = ExplorerPane(self)
        #right = wx.Panel(self, wx.ID_ANY)
        #topInfo = aui.AuiPaneInfo().Name("Top Pane").Caption("The Center Pane").Bottom()
        centerInfo = aui.AuiPaneInfo().Name("Center Pane").Caption(
            "Image View").Center()
        #rightInfo = aui.AuiPaneInfo().Name("Right Pane").Caption("Image Details").Right()
        #leftInfo = aui.AuiPaneInfo().Name("Left Pane").Caption("Explorer").Left()
        #self._mgr.AddPane(top, topInfo)
        self._mgr.AddPane(self.center, centerInfo)
        #self._mgr.AddPane(right, rightInfo)
        #self._mgr.AddPane(left, leftInfo)
        self.statusBar = self.CreateStatusBar(5)
        self.statusBar.SetStatusText("Test text")
        #floatingInfo = aui.AuiPaneInfo().Name("Center Pane").Caption("The Center Pane").Centre()
        #floating = wx.Panel(self, wx.ID_ANY)

        # Create application icon
        self._mgr.Update()
        self.Show()
        self.Bind(wx.EVT_CLOSE, self.OnAuiBaseClose)

        img_path = os.path.abspath("./success_36x36.png")
        icon = wx.Icon(img_path, wx.BITMAP_TYPE_PNG)
        self.SetIcon(icon)
        #self.SetBackgroundColour(wx.CYAN)
        self.SetLabel("test")
        #self.SetTitle("Image Archive Client")
        self.SetTitle("Podiatry Management system")
        #create main menu

        self.mainmenu_bar = MainMenu()
        self.SetMenuBar(self.mainmenu_bar)

        self.Bind(wx.EVT_MENU, self.OnMenu)

        # toolbar
        #toolb = EasyToolBar(self)
        #toolb.AddEasyToolBar(wx.ID_CUT)
        #toolb.AddEasyToolBar(wx.ID_COPY)
        #toolb.AddEasyToolBar(wx.ID_PASTE)
        #toolb.Realize()
        #self.SetToolBar(toolb)

        #test1 = wx.TextCtrl(self, -1, 'Pane 1 - simple text', wx.DefaultPosition, wx.Size(150, 150),
        #                    wx.NO_BORDER | wx.TE_MULTILINE)
        # test2 = wx.TextCtrl(self, -1, 'Pane 1 - simple text', wx.DefaultPosition, wx.Size(20, 150),
        #                    wx.NO_BORDER | wx.TE_MULTILINE)
        # test3 = wx.TextCtrl(self, -1, 'Pane 1 - simple text', wx.DefaultPosition, wx.Size(20, 150),
        #                    wx.NO_BORDER | wx.TE_MULTILINE)

        #self.Bind(wx.EVT_TOOL, self.OnToolBar)
        #self._mgr.AddPane(IAPanal(self), wx.LEFT, "Pane 1")
        #self._mgr.AddPane(test2, wx.BOTTOM, "Pane 2")
        #self._mgr.AddPane(test3, wx.CENTER, "Pane 3")

        self._mgr.Update()
예제 #22
0
    def createAuiManager(self):
        logger.debug('createAuiManager')
        # tell FrameManager to manage this frame
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)
        # set up default notebook style
        self._notebook_style = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER
        self._notebook_theme = 0
        path = os.path.abspath(__file__)
        tail = None
        #         head, tail = os.path.split(path)
        #         logger.debug('createAuiManager',head, tail )
        try:
            while tail != 'src':
                path = os.path.abspath(os.path.join(
                    path,
                    '..',
                ))
                head, tail = os.path.split(path)
        except Exception as e:
            logger.error(e, exc_info=True)
        path = os.path.abspath(os.path.join(path, "images"))
        # 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))
        self._perspectives = []

        # add a bunch of panes
        #         self._mgr.AddPane(self.CreateSizeReportCtrl(), wx.aui.AuiPaneInfo().Name("test1").Caption("Pane Caption").Top().CloseButton(True).MaximizeButton(True))
        # add the toolbars to the manager

        self._mgr.AddPane(
            self.constructToolBar(),
            aui.AuiPaneInfo().Name("tb1").Caption("Big Toolbar").ToolbarPane().
            Top().CloseButton(True).LeftDockable(False).RightDockable(
                False).Gripper(True))

        self._mgr.AddPane(
            self.creatingBasicPanel(),
            aui.AuiPaneInfo().Icon(
                wx.Bitmap(os.path.join(
                    path, "folder_database.png"))).Name("databaseNaviagor").
            Caption("Database Navigator").Dockable(True).Movable(True).MinSize(
                wx.Size(300, 100)).Left().Layer(1).Position(1).CloseButton(
                    False).MaximizeButton(True).MinimizeButton(True))

        self._mgr.AddPane(
            self.constructSqlPane(),
            aui.AuiPaneInfo().Icon(wx.Bitmap(os.path.join(
                path, "script.png"))).Name("centerPane").Caption(
                    "Center Pane").LeftDockable(True).Center().CloseButton(
                        True).MaximizeButton(True).MinimizeButton(True))

        #         self._mgr.AddPane(self.constructSchemaViewerPane(), aui.AuiPaneInfo().Icon(wx.Bitmap(os.path.join(path, "script.png"))).
        #                           Name("schemaViewer").Caption("Schema Viewer").LeftDockable(True).
        #                           Center().CloseButton(True).MaximizeButton(True).MinimizeButton(True))
        #         self._mgr.AddPane(self.constructSchemaViewerPane(), 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.constructHistoryPane(), aui.AuiPaneInfo().Icon(wx.Bitmap(os.path.join(path, "sql.png"))).
        #                           Name("test1").Caption("Client Size Reporter").Dockable(True).Movable(True).LeftDockable(True).
        #                           Bottom().Layer(0).Position(1).CloseButton(True).MaximizeButton(visible=True).MinimizeButton(visible=True).PinButton(visible=True).GripperTop())

        #         self._mgr.AddPane(self.constructHistoryPane(), aui.AuiPaneInfo().Icon(wx.Bitmap(os.path.join(path, "sql.png"))).
        #                           Name("sqlLog").Caption("SQL Log").Dockable(True).BestSize(wx.Size(200, 200)).
        #                           Bottom().Layer(0).Row(1).CloseButton(True).MaximizeButton(visible=True).MinimizeButton(visible=True))

        self._mgr.GetPane("tb1").Show()
        self.perspective_default = self._mgr.SavePerspective()
        perspective_all = self._mgr.SavePerspective()
        all_panes = self._mgr.GetAllPanes()
        # "commit" all changes made to FrameManager
        self._mgr.Update()
예제 #23
0
    def __init__(self, parent, id, title):
        wx.Frame.__init__( self, parent, id, title, \
                pos = wx.DefaultPosition,\
                size = (1024,768),\
                style = wx.DEFAULT_FRAME_STYLE,\
                name = 'frame' )
        Frame.mainFrame = self
        self.__InitXRC()
        self.SetMinSize((800, 600))

        self.haveFocus = False

        # pnl = wx.Panel(self)
        # self.pnl = pnl
        self.mgr = aui.AuiManager()
        self.mgr.SetManagedWindow(self)

        icon = wx.Icon(name='res/Python.ico', type=wx.BITMAP_TYPE_ICO)
        self.SetIcon(icon)

        if sys.version_info.major == 2:
            self.statusBar = self.CreateStatusBar(2, wx.ST_SIZEGRIP)
        elif sys.version_info.major == 3:
            self.statusBar = self.CreateStatusBar(2, wx.STB_SIZEGRIP)
        self.statusBar.SetStatusWidths([-2, -1])

        statusText = u'MicroChat use wxPython %s' % wx.version()
        self.statusBar.SetStatusText(statusText, 0)

        if platform.system() == 'Windows':
            ctrl_style = wx.TE_RICH | wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL | wx.NO_BORDER
        else:
            ctrl_style = wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL | wx.NO_BORDER

        # self.log = rt.RichTextCtrl( self, style=wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER|rt.RE_READONLY )
        self.log = wx.TextCtrl(self, wx.ID_ANY, style=ctrl_style)
        if sys.version_info.major == 2:
            wx.Log_SetActiveTarget(MyLog(self.log))
        elif sys.version_info.major == 3:
            wx.Log.SetActiveTarget(MyLog(self.log))

        # self.mgr.AddPane( ConfigurePanel(self, style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN, log=self.log),
        #         aui.AuiPaneInfo().
        #         Centre().Layer(2).BestSize((240,-1)).
        #         MinSize((160,-1)).
        #         Floatable(ALLOW_AUI_FLOATING).FloatingSize((240,700)).
        #         Caption(u'Configure').
        #         CloseButton(False).
        #         Name(u'A2'))

        s = aui.AUI_NB_SCROLL_BUTTONS | aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_TAB_FIXED_WIDTH | aui.AUI_NB_TAB_SPLIT | aui.AUI_NB_TOP | aui.AUI_NB_WINDOWLIST_BUTTON
        # | aui.AUI_NB_LEFT
        # | aui.AUI_NB_RIGHT
        # | aui.AUI_NB_TAB_MOVE
        # | aui.AUI_NB_BOTTOM
        self.nb = aui.AuiNotebook(self, style=s)

        page = MicroChatPanel(self,
                              style=wx.TAB_TRAVERSAL | wx.CLIP_CHILDREN,
                              log=self.log)
        stockPanel = page
        # DataMngr().ob_ui.panels.append( page )
        # page.draw()
        self.nb.AddPage(page, u'MicroChat')

        self.mgr.AddPane(
            self.nb,
            aui.AuiPaneInfo().Centre().Layer(2).BestSize((240, -1)).MinSize(
                (160, -1)).Floatable(ALLOW_AUI_FLOATING).FloatingSize(
                    (240, 700)).Caption(u'Configure').CloseButton(
                        False).MaximizeButton(True).Name(u'A2'))

        self.mgr.AddPane(
            self.log,
            aui.AuiPaneInfo().Caption(u'Log Messages').Right().Layer(1).
            Position(1).BestSize((-1, 80)).Dockable(False).MinSize(
                (-1, 80)).Floatable(ALLOW_AUI_FLOATING).FloatingSize(
                    (500,
                     160)).CloseButton(True).MaximizeButton(True).Name(u'A3'))
        self.mgr.Update()
        if sys.version_info.major == 2:
            self.mgr.SetFlags(self.mgr.GetFlags()
                              ^ aui.AUI_MGR_TRANSPARENT_DRAG)

        # 绑定事件处理
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
        self.Bind(EVT_TASK_FINISH, self.OnTaskFinish)
        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CHANGING, self.OnPageChangeine)

        self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        # self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)

        self.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouse)
        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
        self.Bind(wx.EVT_KEY_UP, self.OnKeyUp)
        self.Bind(wx.EVT_CHAR, self.OnChar)
        self.Bind(wx.EVT_MOVE, self.OnMove)

        # LOG
        self.Bind(EVT_WX_LOG_EVENT, self.OnLogEvent)
        self.uilog = wxLogHandler(self)
        if g_log is not None:
            g_log.AddHandler(self.uilog)

        self.SetFocus()

        # self.searchDlg = wx.Dialog(self, -1, 'test dlg')
        self.nb.SetSelection(0)

        # self.nb.ChangeSelection(1)

        # wx.LogError('test log error')
        # wx.LogWarning('test log warning')
        # wx.LogDebug('test log debug')
        # stockPanel.LoadDataFromHDF5( 'sz002487' )
        # stockPanel.LoadDataFromHDF5( 'sh000001' )
        # stockPanel.LoadDataFromHDF5( 'sz000666' )
        # stockPanel.LoadDataFromHDF5( Config.stock, Config.kType )
        # stockPanel.LoadDataFromHDF5( 'sz300315' )

        # Start Work Thread
        def RunOtherThread(*args):
            pass
            # print( 'RunOtherThread', *args )
            # start = -1
            # end = -1
            # pipeline, code, ktype, rtype = args
            # df = DataMngr.GetKBarDF( code, ktype, start, end, rtype=rtype )
            # if df is not None:
            #     wx.CallAfter( stockPanel.OnDFLoaded, df )

        # core.taskMng.SubmitTask( core.tid, None, RunOtherThread, 1 )
        # Test new thread task pipline.
        task = Task()
        task.phase = 0
        task.process = RunOtherThread
        # task.params = (Config.stock, Config.kType, Config.rtype)
        task.params = ()
        core.taskMng.SubmitTask(task)
예제 #24
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: GladeMainWindow.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)

        self._mgr = wxaui.AuiManager(self)
        self.ContextPane = BetterContextPanel(self, -1)

        # self.TabPane = NBPanel(self)
        # self.TabBook = self.TabPane.nb
        self.TabBook = wxauip.AuiNotebook(self, -1)
        if PIE_CONFIG.get('Internal', 'tab_art') == 'simple':
            self.TabBook.SetArtProvider(wxauip.AuiSimpleTabArt())
        # self.TabBook.SetMinSize((500,500))
        # self.TabBook = fnb.FlatNotebook(self, -1)
        self.StatusBar = wx.StatusBar(self, -1)
        if sys.platform != 'win32':
            self.StatusBar.SetStatusStyles([1, wx.SB_FLAT])

        # Menu Bar
        menuBar = wx.MenuBar()
        fileMenu = wx.Menu()
        toolMenu = wx.Menu()
        locateMenu = wx.Menu()
        gatherMenu = wx.Menu()
        viewMenu = wx.Menu()
        helpMenu = wx.Menu()
        atomMenu = wx.Menu()
        debugMenu = wx.Menu()
        self.menu_savebibs = wx.MenuItem(
            fileMenu, -1, 
            _('&Export Bibliography\tCtrl-shift-b'),
            _('Export all starred items with bibliographic data to a BibTeX file'))
        self.menu_savebibs.SetBitmap(
            wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_MENU, (16, 16)))
        self.menu_print = wx.MenuItem(
            fileMenu, -1, _('&Print\tCtrl-p'), _('Print notes or report'))
        self.menu_print.SetBitmap(
            wx.ArtProvider.GetBitmap(wx.ART_PRINT, wx.ART_MENU))
        self.menu_pagesetup = wx.MenuItem(
            fileMenu, -1, _('P&age setup'), _('Set up printer page layout'))
        self.menu_quit = wx.MenuItem(
            fileMenu, -1, _('&Quit\tCtrl-q'), _('Quit'))
        self.menu_quit.SetBitmap(
            wx.ArtProvider.GetBitmap(wx.ART_QUIT, wx.ART_MENU))
        self.menu_rescan = wx.MenuItem(
            fileMenu, -1, _('&Index folders now'), 
            _('Make Pieberry scan and index files and folders in your Pieberry directory'))
        self.menu_config = wx.MenuItem(fileMenu, -1, _('S&ettings'), _('Configure Pieberry'))
        self.menu_about = wx.MenuItem(helpMenu, -1, _('&About'), _('About Pieberry'))
        # self.menu_pageref = wx.MenuItem(
        #     toolMenu, 
        #     -1, 
        #     _('Create &reference for top-level page'), 
        #     _('Reference'))
        self.menu_emptyref = wx.MenuItem(
            toolMenu, 
            -1, 
            _('&Create new (empty) bibliography entry\tCtrl-n'), 
            _('Bring up a dialog to allow you to enter bibliographic data'))
        self.menu_emptyref.SetBitmap(
            wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_MENU))
        self.menu_manual = wx.MenuItem(helpMenu, -1, _('&Manual'))
        self.menu_atom_process = wx.MenuItem(
            atomMenu, -1, _('&Process files from desktop\tCtrl-m'), _('Get documents off your desktop and sort them into folders'))
        self.menu_atom_process.SetBitmap(
            wx.Bitmap(os.path.join(IMGDIR, 'ic_broom16.png')))
        # self.menu_atom_settings = wx.MenuItem(
        #     atomMenu, -1, _('Desktop cleaner settings'), 'Settings')
        self.menu_find = wx.MenuItem(
            toolMenu, -1, _('&Find items in bibliography\tCtrl-f'), _('Search Pieberry\'s internal database'))
        self.menu_find.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_FIND, wx.ART_MENU))
        self.menu_find_in_folders = wx.MenuItem(
            toolMenu, -1, _('F&ind your files\tCtrl-shift-f'), _('Search database by file name'))
        self.menu_find_in_folders.SetBitmap(
            wx.ArtProvider.GetBitmap(wx.ART_FIND, wx.ART_MENU))
        self.menu_scan_web_page = wx.MenuItem(
            gatherMenu, -1, _('Scan &web page for documents\tCtrl-w'), _('Read and find links to documents on a given web page'))
        self.menu_scan_web_page.SetBitmap(
            wx.Bitmap(os.path.join(IMGDIR, 'ic_globe16.png')))
        self.menu_google_books = wx.MenuItem(
            gatherMenu, -1, _('Search &Google Books\tCtrl-g'), _('Search Google Books for relevant references'))
        self.menu_google_books.SetBitmap(
            wx.Bitmap(os.path.join(IMGDIR, 'ic_google16.png')))
        if ZBAR:
            self.menu_scan_barcode = wx.MenuItem(
                gatherMenu, -1, _('Scan ISBN &barcode\tCtrl-shift-o'), _('Scan a book\'s barcode containing its ISBN and look it up in Google Books'))
        self.menu_import_pieslice = wx.MenuItem(
            gatherMenu, -1, _('Import from pieslice file'), _("Import bundled information in Pieberry's own 'pieslice' file format"))
        self.menu_import_bibtex = wx.MenuItem(
            gatherMenu, -1, _('&Import from BibTeX file'), _('Import biblographic items from a BibTeX file'))
        self.menu_paste_bibtex = wx.MenuItem(
            gatherMenu, -1, _('&Paste in BibTeX entries\tCtrl-shift-p'), _('Paste BibTeX format citations from a source like JStor'))
        self.menu_import_bibtex.SetBitmap(
            wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_MENU))
        self.menu_filter = wx.MenuItem(
            locateMenu, -1, _('Fil&ter\tCtrl-t'), _('Filter the items in the current view'))
        self.menu_toggle_context = wx.MenuItem(
            viewMenu, -1, _('&Toggle context panel'))
        self.menu_toggle_context.SetCheckable(True)
        self.menu_view_starred = wx.MenuItem(
            viewMenu, -1, _('View &important documents\tCtrl-1'))
        self.menu_view_flagged = wx.MenuItem(
            viewMenu, -1, _('View documents &flagged for review/follow-up\tCtrl-2'))
        self.menu_view_recentact = wx.MenuItem(
            viewMenu, -1, _('View most r&ecently used documents\tCtrl-3'))
        self.menu_view_recent = wx.MenuItem(
            viewMenu, -1, _('View most &recently added documents\tCtrl-4'))
        self.menu_view_project_folders = wx.MenuItem(
            viewMenu, -1, _('&Navigate project folders\tCtrl-7'))
        self.menu_view_library_folders = wx.MenuItem(
            viewMenu, -1, _('N&avigate library folders\tCtrl-8'))
        self.menu_view_meetingpaper_folders = wx.MenuItem(
            viewMenu, -1, _('Na&vigate meeting paper folders\tCtrl-9'))
        self.menu_view_tags = wx.MenuItem(
            viewMenu, -1, _('View Tags\tCtrl-0'))

        # BEGIN debug menu
        if PIE_CONFIG.getboolean('Internal', 'show_debug_ui'):
            self.menu_debug_addwebpane = wx.MenuItem(
                debugMenu, -1, _('Add Web Pane'))
            self.menu_debug_addbibpane = wx.MenuItem(
                debugMenu, -1, _('Add Bib Pane'))
            self.menu_debug_adddlpane = wx.MenuItem(
                debugMenu, -1, _('Add Pane with dld items'))
            self.menu_debug_addatompane = wx.MenuItem(
                debugMenu, -1, _('Add Pane with desktop items'))
            self.menu_debug_forcescan = wx.MenuItem(
                debugMenu, -1, _('Force scan of folders'))
            self.menu_debug_notespane = wx.MenuItem(
                debugMenu, -1, 'Add notes pane')
            self.menu_debug_rectifyobjectrels = wx.MenuItem(
                debugMenu, -1, 'Rectify object relationships'
                )
            debugMenu.AppendItem(self.menu_debug_addatompane)
            debugMenu.AppendItem(self.menu_debug_adddlpane)
            debugMenu.AppendItem(self.menu_debug_addwebpane)
            debugMenu.AppendItem(self.menu_debug_addbibpane)
            debugMenu.AppendItem(self.menu_debug_forcescan)
            debugMenu.AppendItem(self.menu_debug_notespane)
            debugMenu.AppendItem(self.menu_debug_rectifyobjectrels)
            self.Bind(wx.EVT_MENU, self.DebugAddNotesPane, self.menu_debug_notespane)
            self.Bind(wx.EVT_MENU, self.DebugAddAtomisePane, 
                      self.menu_debug_addatompane)
            self.Bind(wx.EVT_MENU, self.DebugAddDownloadedPane, 
                      self.menu_debug_adddlpane)
            self.Bind(wx.EVT_MENU, self.DebugAddWebPane, self.menu_debug_addwebpane)
            self.Bind(wx.EVT_MENU, self.DebugAddBibPane, self.menu_debug_addbibpane)
            self.Bind(wx.EVT_MENU, self.DebugForceScan, self.menu_debug_forcescan)
            self.Bind(wx.EVT_MENU, self.DebugRectifyObjectRels, self.menu_debug_rectifyobjectrels)
            # END debug menu

        fileMenu.AppendItem(self.menu_savebibs)
        fileMenu.AppendItem(self.menu_print)
        fileMenu.AppendItem(self.menu_pagesetup)
        fileMenu.AppendItem(self.menu_config)
        fileMenu.AppendItem(self.menu_rescan)
        fileMenu.AppendSeparator()
        fileMenu.AppendItem(self.menu_quit)
        helpMenu.AppendItem(self.menu_manual)
        helpMenu.AppendItem(self.menu_about)
        locateMenu.AppendItem(self.menu_find)
        locateMenu.AppendItem(self.menu_find_in_folders)
        locateMenu.AppendItem(self.menu_filter)
        gatherMenu.AppendItem(self.menu_scan_web_page)
        gatherMenu.AppendItem(self.menu_google_books)
        if ZBAR:
            gatherMenu.AppendItem(self.menu_scan_barcode)
        gatherMenu.AppendSeparator()
        gatherMenu.AppendItem(self.menu_emptyref)
        gatherMenu.AppendItem(self.menu_import_pieslice)
        gatherMenu.AppendItem(self.menu_import_bibtex)
        gatherMenu.AppendItem(self.menu_paste_bibtex)
        gatherMenu.AppendSeparator()
        gatherMenu.AppendItem(self.menu_atom_process)
        viewMenu.AppendItem(self.menu_toggle_context)
        viewMenu.AppendSeparator()
        viewMenu.AppendItem(self.menu_view_starred)
        viewMenu.AppendItem(self.menu_view_flagged)
        viewMenu.AppendItem(self.menu_view_recentact)
        viewMenu.AppendItem(self.menu_view_recent)
        viewMenu.AppendSeparator()
        viewMenu.AppendItem(self.menu_view_project_folders)
        viewMenu.AppendItem(self.menu_view_library_folders)
        viewMenu.AppendItem(self.menu_view_meetingpaper_folders)
        viewMenu.AppendSeparator()
        viewMenu.AppendItem(self.menu_view_tags)
        menuBar.Append(fileMenu, _('&File'))
        menuBar.Append(gatherMenu, _('&Gather'))
        menuBar.Append(locateMenu, _('&Locate'))
        menuBar.Append(viewMenu, _('&View'))
        menuBar.Append(helpMenu, _('&Help'))
        if PIE_CONFIG.getboolean('Internal', 'show_debug_ui'): menuBar.Append(debugMenu, _('&Debug'))
        self.SetMenuBar(menuBar)
        self.SetAutoLayout(True)

        self.Bind(wx.EVT_MENU, self.OnPrint, self.menu_print)
        self.Bind(wx.EVT_MENU, self.OnPageSetup, self.menu_pagesetup)
        self.Bind(wx.EVT_MENU, self.onFind, self.menu_find)
        self.Bind(wx.EVT_MENU, self.onFindInFolders, self.menu_find_in_folders)
        self.Bind(wx.EVT_MENU, self.OnDesktopProcessGen, self.menu_atom_process)
        self.Bind(wx.EVT_MENU, self.onSaveBibs, self.menu_savebibs)
        self.Bind(wx.EVT_MENU, self.onClose, self.menu_quit)
        wx.EVT_CLOSE(self, self.onClose)
        self.Bind(wx.EVT_MENU, self.onConfig, self.menu_config)
        self.Bind(wx.EVT_MENU, self.onAbout, self.menu_about)
        self.Bind(wx.EVT_MENU, self.OnCreateNewBibObj, self.menu_emptyref)
        self.Bind(wx.EVT_MENU, self.onShowManual, self.menu_manual)
        self.Bind(wx.EVT_MENU, self.ToggleWebPanel, self.menu_scan_web_page)
        self.Bind(wx.EVT_MENU, self.ToggleFilterPanel, self.menu_filter)
        self.Bind(wx.EVT_MENU, self.ToggleContextPanel, self.menu_toggle_context)
        self.Bind(wx.EVT_MENU, self.OnImportPieSlice, self.menu_import_pieslice)
        self.Bind(wx.EVT_MENU, self.OnImportBibtex, self.menu_import_bibtex)
        self.Bind(wx.EVT_MENU, self.OnPasteBibtex, self.menu_paste_bibtex)
        self.Bind(wx.EVT_MENU, self.OnViewMostRecent, self.menu_view_recent)
        self.Bind(wx.EVT_MENU, self.OnViewFlagged, self.menu_view_flagged)
        self.Bind(wx.EVT_MENU, self.OnViewRecentlyInteracted, self.menu_view_recentact)
        self.Bind(wx.EVT_MENU, self.OnViewStarred, self.menu_view_starred)
        self.Bind(wx.EVT_MENU, self.OnViewProjectFolders, self.menu_view_project_folders)
        self.Bind(wx.EVT_MENU, self.OnViewLibraryFolders, self.menu_view_library_folders)
        self.Bind(wx.EVT_MENU, self.OnViewMeetingPaperFolders, self.menu_view_meetingpaper_folders)
        self.Bind(wx.EVT_MENU, self.OnViewTags, self.menu_view_tags)
        self.Bind(wx.EVT_MENU, self.OnStartIndexer, self.menu_rescan)
        self.Bind(wx.EVT_MENU, self.ToggleGoogleSearchPanel, self.menu_google_books)
        if ZBAR:
            self.Bind(wx.EVT_MENU, self.OnScanBarcode, self.menu_scan_barcode)
        # self.menu_savebibs.Enable(False)
        # self.menu_discard.Enable(False)

        # Menu Bar end

        # Printing
        self.printer = wx.richtext.RichTextPrinting()

        self.__set_properties()
        self.__do_layout()
        self._do_bindings()
예제 #25
0
    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.AddTool(101, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_ERROR))
        tb1.AddSeparator()
        tb1.AddTool(102, "Test",
                    wx.ArtProvider.GetBitmapBundle(wx.ART_QUESTION))
        tb1.AddTool(103, "Test",
                    wx.ArtProvider.GetBitmapBundle(wx.ART_INFORMATION))
        tb1.AddTool(103, "Test",
                    wx.ArtProvider.GetBitmapBundle(wx.ART_WARNING))
        tb1.AddTool(103, "Test",
                    wx.ArtProvider.GetBitmapBundle(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.GetBitmapBundle(wx.ART_QUESTION,
                                                  wx.ART_OTHER,
                                                  wx.Size(16, 16))
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddSeparator()
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddSeparator()
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(101, "Test", tb2_bmp1)
        tb2.AddTool(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.GetBitmapBundle(wx.ART_FOLDER, wx.ART_OTHER,
                                                  wx.Size(16, 16))
        tb3.AddTool(101, "Test", tb3_bmp1)
        tb3.AddTool(101, "Test", tb3_bmp1)
        tb3.AddTool(101, "Test", tb3_bmp1)
        tb3.AddTool(101, "Test", tb3_bmp1)
        tb3.AddSeparator()
        tb3.AddTool(101, "Test", tb3_bmp1)
        tb3.AddTool(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.GetBitmapBundle(wx.ART_NORMAL_FILE,
                                                  wx.ART_OTHER,
                                                  wx.Size(16, 16))
        tb4.AddTool(101, "Item 1", tb4_bmp1)
        tb4.AddTool(101, "Item 2", tb4_bmp1)
        tb4.AddTool(101, "Item 3", tb4_bmp1)
        tb4.AddTool(101, "Item 4", tb4_bmp1)
        tb4.AddSeparator()
        tb4.AddTool(101, "Item 5", tb4_bmp1)
        tb4.AddTool(101, "Item 6", tb4_bmp1)
        tb4.AddTool(101, "Item 7", tb4_bmp1)
        tb4.AddTool(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.AddTool(101, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_ERROR))
        tb5.AddSeparator()
        tb5.AddTool(102, "Test",
                    wx.ArtProvider.GetBitmapBundle(wx.ART_QUESTION))
        tb5.AddTool(103, "Test",
                    wx.ArtProvider.GetBitmapBundle(wx.ART_INFORMATION))
        tb5.AddTool(103, "Test",
                    wx.ArtProvider.GetBitmapBundle(wx.ART_WARNING))
        tb5.AddTool(103, "Test",
                    wx.ArtProvider.GetBitmapBundle(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[0],
                  id2=ID_FirstPerspective[-1])
예제 #26
0
    def __init__(self, parent, log, title):

        wx.Frame.__init__(self, None, title=title)

        self.log = log

        self.Maximize(True)

        self._mgr = aui.AuiManager()

        self._mgr.SetManagedWindow(self)

        self.notebookCtrl = aui.AuiNotebook(self)

        self.shellPage = ShellListCtrl.ShellList(self, self.log)
        self.notebookCtrl.AddPage(
            self.shellPage, 'Shell', True,
            wx.ArtProvider.GetBitmap(wx.ART_GO_HOME, client=wx.ART_FRAME_ICON))

        self._mgr.AddPane(self.notebookCtrl,
                          aui.AuiPaneInfo().Name("mainWindow").CenterPane())

        self.treeCtrlHttpStatus = wx.TreeCtrl(
            self,
            id=wx.ID_ANY,
            pos=wx.DefaultPosition,
            size=(-1, 150),
            style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT | wx.TR_NO_LINES
            | wx.TR_HAS_BUTTONS | wx.TR_HAS_VARIABLE_ROW_HEIGHT)
        self.treeCtrlHttpStatusRoot = self.treeCtrlHttpStatus.AddRoot(
            'hideRoot')

        self._mgr.AddPane(
            self.treeCtrlHttpStatus,
            aui.AuiPaneInfo().Name("HttpStatusWindow").Caption(
                "请求状态信息").Bottom().Layer(1).Position(1).CloseButton(
                    True).MaximizeButton(True).MinimizeButton(True))

        self.treeCtrlTunnelStatus = wx.TreeCtrl(
            self,
            id=wx.ID_ANY,
            pos=wx.DefaultPosition,
            size=(300, -1),
            style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT | wx.TR_NO_LINES
            | wx.TR_HAS_BUTTONS | wx.TR_HAS_VARIABLE_ROW_HEIGHT)
        self.treeCtrlTunnelStatusRoot = self.treeCtrlTunnelStatus.AddRoot(
            'hideRoot')

        self._mgr.AddPane(
            self.treeCtrlTunnelStatus,
            aui.AuiPaneInfo().Name("TunnelStatusWindow").Caption(
                "隧道状态信息").Right().Layer(1).Position(1).CloseButton(
                    True).MaximizeButton(True).MinimizeButton(True).Hide())

        self._mgr.Update()

        self.notebookCtrl.Bind(wx.aui.EVT_AUINOTEBOOK_TAB_RIGHT_UP,
                               self.OnTabRightClick)

        self.Bind(wx.EVT_CLOSE, self.OnClose)

        self.taskStatusList = {}
        self.sessionBelongList = {}

        self.OnInitMenu()
예제 #27
0
    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)

        font_text = wx.Font(11,
                            wx.FONTFAMILY_SWISS,
                            wx.FONTSTYLE_NORMAL,
                            wx.FONTWEIGHT_BOLD,
                            faceName="consolas")
        self.SetFont(font_text)

        #set the icon of the frame
        frame_icon = wx.Icon()
        frame_icon.CopyFromBitmap(wx.Bitmap(wx.Image("../icon/dipl.png")))
        self.SetIcon(frame_icon)

        # tell FrameManager to manage this frame
        self.manager = aui.AuiManager()
        self.manager.SetManagedWindow(self)
        self.manager.GetArtProvider().SetMetric(aui.AUI_DOCKART_CAPTION_SIZE,
                                                24)
        font_caption = wx.Font(14,
                               wx.FONTFAMILY_SWISS,
                               wx.FONTSTYLE_NORMAL,
                               wx.FONTWEIGHT_BOLD,
                               faceName="consolas")
        self.manager.GetArtProvider().SetFont(aui.AUI_DOCKART_CAPTION_FONT,
                                              font_caption)

        #create a menu bar
        self.menubar = wx.MenuBar()
        self.SetMenuBar(self.menubar)
        menu_file = wx.Menu()
        self.menubar.Append(menu_file, "&File")
        menu_edit = wx.Menu()
        self.menubar.Append(menu_edit, "&Edit")
        menu_window = wx.Menu()
        self.menubar.Append(menu_window, "&Window")
        menu_help = wx.Menu()
        self.menubar.Append(menu_help, "&Help")

        #add items to menu_file
        menu_new = wx.MenuItem(menu_file,
                               id=wx.NewId(),
                               text="&New File\tCtrl-N")
        self.Bind(wx.EVT_MENU, self.on_new, id=menu_new.GetId())
        menu_file.Append(menu_new)
        menu_open = wx.MenuItem(menu_file,
                                id=wx.NewId(),
                                text="&Open File\tCtrl-O")
        self.Bind(wx.EVT_MENU, self.on_open, id=menu_open.GetId())
        menu_file.Append(menu_open)
        menu_save = wx.MenuItem(menu_file,
                                id=wx.NewId(),
                                text="&Save File\tCtrl-S")
        self.Bind(wx.EVT_MENU, self.on_save, id=menu_save.GetId())
        menu_file.Append(menu_save)
        menu_script = wx.MenuItem(menu_file,
                                  id=wx.NewId(),
                                  text="&Load Script\tCtrl-R")
        self.Bind(wx.EVT_MENU, self.on_script, id=menu_script.GetId())
        menu_file.Append(menu_script)
        menu_quit = wx.MenuItem(menu_file, id=wx.NewId(), text="&Quit\tAlt-F4")
        self.Bind(wx.EVT_MENU, self.on_quit, id=menu_quit.GetId())
        menu_file.Append(menu_quit)

        #add items to menu_edit
        menu_undo = wx.MenuItem(menu_edit, id=wx.NewId(), text="&Undo\tCtrl-Z")
        self.Bind(wx.EVT_MENU, self.on_undo, id=menu_undo.GetId())
        menu_edit.Append(menu_undo)
        menu_redo = wx.MenuItem(menu_edit, id=wx.NewId(), text="&Redo\tCtrl-Y")
        self.Bind(wx.EVT_MENU, self.on_redo, id=menu_redo.GetId())
        menu_edit.Append(menu_redo)

        #add items to menu_window
        str_menu_window = [
            "&Mouse Toolbar", "&Transform Toolbar", "&Drawing Toolbar",
            "&Style Panel", "Ter&minal Panel"
        ]
        self.list_menu_window = []
        for item in str_menu_window:
            menu = wx.MenuItem(menu_window, id=wx.NewId(), text=item)
            self.Bind(wx.EVT_MENU, self.on_menu_window, id=menu.GetId())
            menu_window.Append(menu)
            self.list_menu_window.append(menu)

        #add items to menu_help
        menu_about = wx.MenuItem(menu_help, id=wx.NewId(), text="&About\tF1")
        self.Bind(wx.EVT_MENU, self.on_about, id=menu_about.GetId())
        menu_help.Append(menu_about)

        #create a toolbar
        self.tool_transform = wx.ToolBar(self,
                                         style=wx.TB_FLAT | wx.TB_NODIVIDER)
        self.tool_transform.SetToolBitmapSize(wx.Size(40, 40))

        self.choice_transform = wx.Choice(
            self.tool_transform,
            wx.NewId(),
            choices=[
                "Resize Image (Nearest Point)", "Resize Image (Bilinear)",
                "Histogram Equalization", "Power Law", "Blur Image",
                "Sharpen Image", "Laplacian", "Guassian Noise",
                "Salt-and-pepper Noise", "Median Filter",
                "MNIST CNN classification", "CIFAR-10 classification",
                "SIGNS hand guesture classification"
            ],
        )
        self.choice_transform.SetSelection(0)
        self.choice_transform.Bind(wx.EVT_CHOICE, self.on_choice_transform)
        self.tool_transform.AddControl(self.choice_transform)

        self.text_input_info1 = wx.StaticText(self.tool_transform,
                                              label=" height:")
        self.tool_transform.AddControl(self.text_input_info1)
        self.text_input1 = wx.TextCtrl(self.tool_transform, value="300")
        self.tool_transform.AddControl(self.text_input1)
        self.text_input_info2 = wx.StaticText(self.tool_transform,
                                              label=" width:")
        self.tool_transform.AddControl(self.text_input_info2)
        self.text_input2 = wx.TextCtrl(self.tool_transform, value="400")
        self.tool_transform.AddControl(self.text_input2)
        self.text_input_info3 = wx.StaticText(self.tool_transform)
        self.tool_transform.AddControl(self.text_input_info3)
        self.text_input3 = wx.TextCtrl(self.tool_transform)
        self.tool_transform.AddControl(self.text_input3)

        self.id_tool_run = wx.NewId()
        self.tool_transform.AddTool(self.id_tool_run,
                                    "transform",
                                    wx.Bitmap("../icon/right_arrow.png"),
                                    shortHelp="transform")
        self.Bind(wx.EVT_TOOL, self.on_transform, id=self.id_tool_run)

        self.tool_transform.Realize()
        self.manager.AddPane(
            self.tool_transform,
            aui.AuiPaneInfo().Name("tool_transform").Caption("tool transform").
            ToolbarPane().Top().Row(1).Position(2).LeftDockable(False).
            RightDockable(False).TopDockable(True).BottomDockable(False))

        self.text_input_info3.Hide()
        self.text_input3.Hide()

        #create a toolbar
        self.tool_mouse = wx.ToolBar(self,
                                     size=wx.DefaultSize,
                                     style=wx.TB_FLAT | wx.TB_NODIVIDER)
        self.tool_mouse.SetToolBitmapSize(wx.Size(40, 40))

        self.id_tool_normal = wx.NewId()
        self.icon_normal = wx.Image("../icon/default.png")
        self.icon_normal.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6)
        self.icon_normal.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 2)
        self.tool_mouse.AddTool(self.id_tool_normal,
                                "normal",
                                self.icon_normal.ConvertToBitmap(),
                                shortHelp="normal")
        self.icon_normal = wx.Cursor(self.icon_normal)
        self.Bind(wx.EVT_TOOL, self.on_normal, id=self.id_tool_normal)

        self.id_tool_grab = wx.NewId()
        self.icon_grab = wx.Image("../icon/grab.png")
        self.icon_grab.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 12)
        self.icon_grab.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 14)
        self.icon_grabbing = wx.Image("../icon/grabbing.png")
        self.icon_grabbing.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 12)
        self.icon_grabbing.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 14)
        self.tool_mouse.AddTool(self.id_tool_grab,
                                "grab",
                                self.icon_grab.ConvertToBitmap(),
                                shortHelp="grab")
        self.icon_grab = wx.Cursor(self.icon_grab)
        self.icon_grabbing = wx.Cursor(self.icon_grabbing)
        self.Bind(wx.EVT_TOOL, self.on_grab, id=self.id_tool_grab)

        self.id_zoom_in = wx.NewId()
        self.icon_zoom_in = wx.Image("../icon/zoom-in.png")
        self.icon_zoom_in.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 10)
        self.icon_zoom_in.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 9)
        self.tool_mouse.AddTool(self.id_zoom_in,
                                "zoom_in",
                                self.icon_zoom_in.ConvertToBitmap(),
                                shortHelp="zoom in")
        self.icon_zoom_in = wx.Cursor(self.icon_zoom_in)
        self.Bind(wx.EVT_TOOL, self.on_zoom_in, id=self.id_zoom_in)

        self.id_zoom_out = wx.NewId()
        self.icon_zoom_out = wx.Image("../icon/zoom-out.png")
        self.icon_zoom_out.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 10)
        self.icon_zoom_out.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 9)
        self.tool_mouse.AddTool(self.id_zoom_out,
                                "zoom_out",
                                self.icon_zoom_out.ConvertToBitmap(),
                                shortHelp="zoom out")
        self.icon_zoom_out = wx.Cursor(self.icon_zoom_out)
        self.Bind(wx.EVT_TOOL, self.on_zoom_out, id=self.id_zoom_out)

        self.id_zoom_fit = wx.NewId()
        self.tool_mouse.AddTool(self.id_zoom_fit,
                                "zoom_fit",
                                wx.Bitmap("../icon/square_box.png"),
                                shortHelp="zoom fit")
        self.Bind(wx.EVT_TOOL, self.on_zoom_fit, id=self.id_zoom_fit)

        self.tool_mouse.Realize()
        self.manager.AddPane(
            self.tool_mouse,
            aui.AuiPaneInfo().Name("tool_mouse").Caption("tool mouse").
            ToolbarPane().Top().Row(1).Position(1).LeftDockable(False).
            RightDockable(False).TopDockable(True).BottomDockable(False))

        #create a toolbar
        tool_draw = wx.ToolBar(self,
                               size=wx.DefaultSize,
                               style=wx.TB_FLAT | wx.TB_NODIVIDER
                               | wx.TB_VERTICAL)
        tool_draw.SetToolBitmapSize(wx.Size(40, 40))

        self.id_tool_pencil = wx.NewId()
        self.icon_pencil = wx.Image("../icon/pencil.png")
        self.icon_pencil.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6)
        self.icon_pencil.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 22)
        tool_draw.AddTool(self.id_tool_pencil,
                          "pencil",
                          self.icon_pencil.ConvertToBitmap(),
                          shortHelp="pencil")
        self.icon_pencil = wx.Cursor(self.icon_pencil)
        self.Bind(wx.EVT_TOOL, self.on_pencil, id=self.id_tool_pencil)

        self.id_draw_smooth = wx.NewId()
        self.icon_smooth = wx.Image("../icon/draw_smooth.png")
        tool_draw.AddTool(self.id_draw_smooth,
                          "smooth",
                          self.icon_smooth.ConvertToBitmap(),
                          shortHelp="draw smooth curves")
        self.Bind(wx.EVT_TOOL, self.on_smooth, id=self.id_draw_smooth)

        self.id_tool_eraser = wx.NewId()
        self.icon_eraser = wx.Image("../icon/eraser.png")
        self.icon_eraser.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 3)
        self.icon_eraser.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 18)
        tool_draw.AddTool(self.id_tool_eraser,
                          "eraser",
                          self.icon_eraser.ConvertToBitmap(),
                          shortHelp="eraser")
        self.icon_eraser = wx.Cursor(self.icon_eraser)
        self.Bind(wx.EVT_TOOL, self.on_eraser, id=self.id_tool_eraser)

        self.id_tool_picker = wx.NewId()
        self.icon_picker = wx.Image("../icon/picker.png")
        self.icon_picker.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 5)
        self.icon_picker.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 19)
        tool_draw.AddTool(self.id_tool_picker,
                          "picker",
                          self.icon_picker.ConvertToBitmap(),
                          shortHelp="picker")
        self.icon_picker = wx.Cursor(self.icon_picker)
        self.Bind(wx.EVT_TOOL, self.on_picker, id=self.id_tool_picker)

        self.id_tool_bucket = wx.NewId()
        self.icon_bucket = wx.Image("../icon/bucket.png")
        self.icon_bucket.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 2)
        self.icon_bucket.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 17)
        tool_draw.AddTool(self.id_tool_bucket,
                          "bucket",
                          self.icon_bucket.ConvertToBitmap(),
                          shortHelp="bucket")
        self.icon_bucket = wx.Cursor(self.icon_bucket)
        self.Bind(wx.EVT_TOOL, self.on_bucket, id=self.id_tool_bucket)

        self.id_tool_selector = wx.NewId()
        self.icon_selector = wx.Image("../icon/select.png")
        tool_draw.AddTool(self.id_tool_selector,
                          "selector",
                          self.icon_selector.ConvertToBitmap(),
                          shortHelp="selector")
        self.icon_selector = wx.Image("../icon/cross.png")
        self.icon_selector.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 11)
        self.icon_selector.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 11)
        self.icon_selector = wx.Cursor(self.icon_selector)
        self.Bind(wx.EVT_TOOL, self.on_selector, id=self.id_tool_selector)

        self.id_trim = wx.NewId()
        self.icon_trim = wx.Image("../icon/trim.png")
        tool_draw.AddTool(self.id_trim,
                          "trim",
                          self.icon_trim.ConvertToBitmap(),
                          shortHelp="trim")
        self.icon_trim = wx.Cursor(self.icon_trim)
        self.Bind(wx.EVT_TOOL, self.on_trim, id=self.id_trim)

        self.id_draw_line = wx.NewId()
        self.icon_line = wx.Image("../icon/draw_line.png")
        tool_draw.AddTool(self.id_draw_line,
                          "line",
                          self.icon_line.ConvertToBitmap(),
                          shortHelp="draw lines")
        self.Bind(wx.EVT_TOOL, self.on_draw, id=self.id_draw_line)

        self.id_draw_circle = wx.NewId()
        self.icon_circle = wx.Image("../icon/draw_circle.png")
        tool_draw.AddTool(self.id_draw_circle,
                          "circle",
                          self.icon_circle.ConvertToBitmap(),
                          shortHelp="draw circles")
        self.Bind(wx.EVT_TOOL, self.on_draw, id=self.id_draw_circle)

        self.id_draw_rect = wx.NewId()
        self.icon_rect = wx.Image("../icon/draw_rect.png")
        tool_draw.AddTool(self.id_draw_rect,
                          "rectangle",
                          self.icon_rect.ConvertToBitmap(),
                          shortHelp="draw rectangles")
        self.Bind(wx.EVT_TOOL, self.on_draw, id=self.id_draw_rect)

        self.id_draw_curve = wx.NewId()
        self.icon_curve = wx.Image("../icon/draw_curve.png")
        tool_draw.AddTool(self.id_draw_curve,
                          "curve",
                          self.icon_curve.ConvertToBitmap(),
                          shortHelp="draw bezier curves")
        self.Bind(wx.EVT_TOOL, self.on_draw, id=self.id_draw_curve)

        self.id_draw_text = wx.NewId()
        self.icon_text = wx.Image("../icon/draw_text.png")
        tool_draw.AddTool(self.id_draw_text,
                          "text",
                          self.icon_text.ConvertToBitmap(),
                          shortHelp="draw text")
        self.Bind(wx.EVT_TOOL, self.on_draw_text, id=self.id_draw_text)

        tool_draw.Realize()
        self.manager.AddPane(
            tool_draw,
            aui.AuiPaneInfo().Name("tool_draw").Caption("tool draw").
            ToolbarPane().Left().LeftDockable(True).RightDockable(
                False).TopDockable(False).BottomDockable(False))

        #create a panel to draw pictures
        self.panel_draw = panel_draw(self, size=(1000, 600))
        self.manager.AddPane(self.panel_draw,
                             aui.AuiPaneInfo().Name("panel draw").CenterPane())

        #create a panel to set styles
        self.panel_style = panel_style(self)
        self.manager.AddPane(
            self.panel_style,
            aui.AuiPaneInfo().Name("panel_style").Caption(
                "style").Right().Position(0).FloatingSize(
                    self.panel_style.GetBestSize()).CloseButton(True).MinSize(
                        (300, 100)))

        #create a panel to show terminal
        self.panel_term = panel_term(self)
        self.manager.AddPane(
            self.panel_term,
            aui.AuiPaneInfo().Name("panel_term").Caption(
                "terminal").Right().Position(1).FloatingSize(
                    self.panel_term.GetBestSize()).CloseButton(True).MinSize(
                        (300, 100)))

        #add a status bar
        self.status_bar = wx.StatusBar(self, wx.NewId())
        self.status_bar.SetFieldsCount(3)
        self.status_bar.SetStatusWidths([-1, -1, -1])
        self.SetStatusBar(self.status_bar)

        #show the frame
        self.manager.Update()
        self.Show(True)

        #declare some variables
        self.button_pick = self.panel_style.button_color_pen

        #redirect io stream
        class redirect:
            frame = self

            def write(self, buf):
                self.frame.print_term(buf)

        stdout_save = sys.stdout
        stderr_save = sys.stderr
        sys.stdout = redirect()
        sys.stderr = redirect()

        #load models
        self.net_mnist = net_mnist()
        self.net_mnist.load_state_dict(torch.load("model_mnist.pt"))
        self.net_mnist.eval()

        self.net_cifar = WideResNet(depth=28, num_classes=10)
        self.net_cifar.load_state_dict(torch.load("model_cifar10.pt"))
        self.net_cifar.eval()

        class empty:
            pass

        param = empty()
        param.learning_rate = 1e-3
        param.batch_size = 64
        param.num_epochs = 100
        param.dropout_rate = 0.8
        param.num_channels = 32
        param.save_summary_steps = 100
        param.num_workers = 8
        self.net_signs = net_signs(param)
        self.net_signs.load_state_dict(
            torch.load("model_signs.pt")["state_dict"])
        self.net_signs.eval()
예제 #28
0
    def __init__(self, id=-1, title="", pos=wx.DefaultPosition,
                 size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE |
                                            wx.SUNKEN_BORDER |
                                            wx.CLIP_CHILDREN):

        wx.Frame.__init__(self, None, id, title, pos, size, style)
        self.newfilelist = []
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)
        self.SetIcon(icon.GetIcon())
        self.CreateMenuBar()
        tb_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, wx.Size(16, 16))
        tb_bmp2 = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, wx.Size(16, 16))
        tb_bmp3 = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, wx.Size(16, 16))
        tb_bmp4 = wx.ArtProvider.GetBitmap(wx.ART_HELP_SIDE_PANEL, wx.ART_TOOLBAR, wx.Size(16, 16))
        tb_bmp5 = wx.ArtProvider.GetBitmap(wx.ART_REPORT_VIEW, wx.ART_TOOLBAR, wx.Size(16, 16))
        
        tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,wx.TB_FLAT | wx.TB_NODIVIDER )
        tb1.SetToolBitmapSize(wx.Size(16, 16))
        tb1.AddTool(ID_ToolbarNew,  tb_bmp1)
        tb1.AddTool(ID_ToolbarOpen,  tb_bmp2)
        tb1.AddTool(ID_ToolbarSave,  tb_bmp3)
        tb1.Realize()
        
        tb2 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT)
        tb2.SetToolBitmapSize(wx.Size(16, 16))
        tb2.AddLabelTool(ID_ToolbarRefresh, "Refresh", tb_bmp4)
        tb2.Realize()
        
        self.tb3 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT)
        self.tb3.SetToolBitmapSize(wx.Size(16, 16))
        self.tb3.AddCheckLabelTool(ID_ToolbarAuto, "Auto-Refresh", tb_bmp5)
        self.tb3.Realize()
        
        self._mgr.AddPane(self.CreateImageView(), aui.AuiPaneInfo().
                          Name("pic_content").Caption("Screen capturer").CaptionVisible(False).MinSize(wx.Size(360,640)).Resizable(False).
                          Left().CloseButton(False).MaximizeButton(False))
        self._mgr.AddPane(self.CreateNotebook(), aui.AuiPaneInfo().
                          Name("text_content").Caption("Text Editor").CaptionVisible(False).BestSize(wx.Size(500,640)).
                          Right().CloseButton(False).MaximizeButton(False))
        self._mgr.AddPane(tb1, aui.AuiPaneInfo().Name("tb1").ToolbarPane().Top().Fixed().Floatable(False))
        self._mgr.AddPane(tb2, aui.AuiPaneInfo().Name("tb2").ToolbarPane().Top().Fixed().Floatable(False))
        self._mgr.AddPane(self.tb3, aui.AuiPaneInfo().Name("tb3").ToolbarPane().Top().Fixed().Floatable(False))      
        
        self._mgr.AddPane(SettingsPanel(self, self), aui.AuiPaneInfo().
                          Name("settings").Caption("Settings").Resizable(False).
                          Dockable(False).Float().Hide().CloseButton(True).MaximizeButton(True))
        
        self._mgr.GetPane("pic_content").Show().Left().Layer(1).Row(0).Position(0)
        self._mgr.GetPane("text_content").Show().Center().Layer(0).Row(0).Position(0)
        self.statusbar = self.CreateStatusBar(2, wx.ST_SIZEGRIP)
        self.statusbar.SetStatusWidths([-2, -3])
        self.statusbar.SetStatusText("Ready", 0)
        self.statusbar.SetStatusText("Welcome To use Monkey Master 2.0!", 1)
        self.screenshot.Bind(wx.EVT_MOTION,self.OnEnterImage)
        self.screenshot.Bind(wx.EVT_LEAVE_WINDOW,self.OnLeaveImage)
        self.screenshot.Bind(wx.EVT_RIGHT_UP,self.OnRightClickImage)
        
        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnPageClose)
        self.Bind(wx.EVT_MENU, self.OnRefreshImage, id=ID_ToolbarRefresh)
        self.Bind(wx.EVT_MENU, self.OnNewFile, id=ID_ToolbarNew)
        self.Bind(wx.EVT_MENU, self.OnNewFile, id=ID_NEW)
        self.Bind(wx.EVT_MENU, self.OnOpenFile, id=ID_ToolbarOpen)
        self.Bind(wx.EVT_MENU, self.OnOpenFile, id=ID_OPEN)
        self.Bind(wx.EVT_MENU, self.OnSaveAsFile, id=ID_SAVEAS)
        self.Bind(wx.EVT_MENU, self.OnSave, id=ID_SAVE)
        self.Bind(wx.EVT_MENU, self.OnSave, id=ID_ToolbarSave)
        self.Bind(wx.EVT_MENU, self.OnClose, id = ID_CLOSE)
        self.Bind(wx.EVT_MENU, self.updateDeviceMenu, id=ID_REFRESH)
        self.Bind(wx.EVT_MENU, self.OnSettings ,id = ID_SETTINGS)
        self.Bind(wx.EVT_MENU, self.OnRunning, id = ID_RUN)
        self.Bind(wx.EVT_MENU, self.OnAbout, id = ID_ABOUT)
        self.Bind(wx.EVT_MENU, self.OnExit, id = ID_EXIT)
        self.Bind(wx.EVT_MENU_RANGE, self.OnSelectDevice, id=ID_FirstDevice, id2=ID_FirstDevice+10)
        
        self._mgr.Update()
예제 #29
0
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self,
                          parent,
                          id,
                          title,
                          size=(800, 600),
                          style=wx.MINIMIZE_BOX | wx.CAPTION | wx.CLOSE_BOX)
        self.Maximize(False)
        appimg = wx.Bitmap('img/app.ico', wx.BITMAP_TYPE_ICO)
        icon = wx.EmptyIcon()
        icon.CopyFromBitmap(appimg)
        self.SetIcon(icon)

        self.process = 0

        self.update = 0

        self.users = {}

        self.speed = 0
        self.speedCheck = 0
        self.tim = 0

        self.mgr = aui.AuiManager()
        self.mgr.SetManagedWindow(self)

        self.tb = wx.ToolBar(self, style=TBFLAGS)

        self.tb.SetToolBitmapSize(wx.Size(48, 48))
        self.status = self.CreateStatusBar()
        self.status.SetFieldsCount(3)
        make = self.status.GetField(1)
        self.status.SetStatusWidths([250, -2, -1])
        rect2 = self.status.GetFieldRect(2)
        rect1 = self.status.GetFieldRect(1)
        self.sendtext = wx.StaticText(self.status, -1, "")
        self.sendtext.SetPosition((rect1.x + 2, rect1.y + 2))
        self.sendtext.SetSize((rect1.width - 4, rect1.height - 4))
        self.g1 = wx.Gauge(self.status, -1, 50, (110, 95), (250, 25))
        self.g1.SetPosition((rect2.x + 2, rect2.y + 2))
        self.g1.SetSize((rect2.width - 4, rect2.height - 4))

        tsize = (50, 50)
        create_bmp = wx.Bitmap('img/create_small.png')
        join_bmp = wx.Bitmap('img/join_small.png')
        send_bmp = wx.Bitmap('img/send_small.png')
        stop_bmp = wx.Bitmap('img/cancel_small.png')
        profile_bmp = wx.Bitmap('img/settings_small.png')
        disc_bmp = wx.Bitmap('img/discon_small.png')
        recon_bmp = wx.Bitmap('img/recon_small.png')
        info_bmp = wx.Bitmap('img/info_small.png')
        self.tbox = wx.BoxSizer(wx.HORIZONTAL)
        Lpeers = wx.StaticText(self.tb, -1, 'Peers:\t')
        self.peers = wx.CheckListBox(self.tb, -1, size=((-1, 68)))

        self.tbox.Add(Lpeers)
        self.tbox.Add(self.peers)

        self.tb.SetToolBitmapSize(tsize)

        #Toolbars
        self.tb.AddLabelTool(11,
                             "Create Network",
                             create_bmp,
                             shortHelp="Create Network",
                             longHelp="Create Network")
        self.tb.AddLabelTool(12,
                             "Join Network",
                             join_bmp,
                             shortHelp="Join Network",
                             longHelp="Join a created Network")
        self.tb.AddLabelTool(16,
                             "Reconnect",
                             recon_bmp,
                             shortHelp="Reconnect",
                             longHelp="Reconnect to same Network")
        self.tb.AddLabelTool(17,
                             "Disconnect",
                             disc_bmp,
                             shortHelp="Disconnect",
                             longHelp="Disconnect Network")
        self.tb.AddLabelTool(13,
                             "Send",
                             send_bmp,
                             shortHelp="Send",
                             longHelp="Send Files/Folders")
        self.tb.AddLabelTool(14,
                             "Cancel",
                             stop_bmp,
                             shortHelp="Cancel",
                             longHelp="Cancel File(s)")
        self.tb.AddLabelTool(15,
                             "Preference ",
                             profile_bmp,
                             shortHelp="Preference",
                             longHelp="Preference")
        self.tb.AddLabelTool(18,
                             "Info ",
                             info_bmp,
                             shortHelp="About",
                             longHelp="About")
        self.tb.AddSeparator()
        self.tb.AddSeparator()
        self.tb.AddControl(Lpeers)
        self.tb.AddControl(self.peers)
        self.tb.AddStretchableSpace()
        self.tb.Realize()

        self.tb.EnableTool(13, False)
        self.tb.EnableTool(14, False)

        #ToolBar Bindings
        self.Bind(wx.EVT_TOOL, self.CreateNet, id=11)
        self.Bind(wx.EVT_TOOL, self.JoinNet, id=12)
        self.Bind(wx.EVT_TOOL, self.OnSend, id=13)
        self.Bind(wx.EVT_TOOL, self.OnPreference, id=15)
        self.Bind(wx.EVT_TOOL, self.OnCancel, id=14)
        self.Bind(wx.EVT_TOOL, self.OnReconnect, id=16)
        self.Bind(wx.EVT_TOOL, self.OnDisconncet, id=17)
        self.Bind(wx.EVT_TOOL, self.aboutDialog, id=18)

        self.dir = wx.GenericDirCtrl(self, -1)

        tree = self.dir.GetTreeCtrl()

        #self.Bind(wx.EVT_TREE_SEL_CHANGED,self.tellMe,tree)

        self.nb = aui.AuiNotebook(self, style=aui.AUI_NB_TOP)
        self.panel1 = wx.Panel(self)
        self.panel1.SetBackgroundColour("WHITE")
        self.panel2 = scrolled.ScrolledPanel(self,
                                             -1,
                                             size=(140, 300),
                                             style=wx.TAB_TRAVERSAL
                                             | wx.SUNKEN_BORDER,
                                             name="panel1")

        self.panel2.SetupScrolling()

        self.queues = wx.ListBox(self, -1)

        self.probox = wx.BoxSizer(wx.VERTICAL)
        self.hisbox = wx.BoxSizer(wx.VERTICAL)

        self.listhis = wx.ListCtrl(self.panel2, -1, style=wx.LC_REPORT)
        self.listhis.InsertColumn(0, "Filename")
        self.listhis.InsertColumn(1, "Size")
        self.listhis.InsertColumn(2, "Date Created")

        self.listhis.SetColumnWidth(0, 300)
        self.listhis.SetColumnWidth(1, 90)
        self.listhis.SetColumnWidth(2, 180)

        self.real = wx.Menu()
        openfile = self.real.Append(-1, "Open File")
        openfolder = self.real.Append(-1, "Open Folder")
        delete = self.real.Append(-1, "Delete File history")

        self.realqueue = wx.Menu()
        deletequeue = self.realqueue.Append(-1, "Delete Queue")

        self.Bind(wx.EVT_MENU, self.deleteQueue, deletequeue)

        self.Bind(wx.EVT_MENU, self.openFile, openfile)
        self.Bind(wx.EVT_MENU, self.openFolder, openfolder)
        self.Bind(wx.EVT_MENU, self.deleteFile, delete)

        self.listhis.Bind(wx.EVT_CONTEXT_MENU, self.listMenu)

        self.queues.Bind(wx.EVT_CONTEXT_MENU, self.queueMenu)

        self.panel1.SetSizer(self.probox)
        self.panel2.SetSizer(self.hisbox)

        self.hisbox.Add(self.listhis, 0, wx.GROW)

        self.perc = wx.BoxSizer(wx.HORIZONTAL)
        self.detail1 = wx.BoxSizer(wx.HORIZONTAL)
        self.detail2 = wx.BoxSizer(wx.HORIZONTAL)
        self.probox.Clear()
        self.g1 = wx.Gauge(self.panel1, -1, 50, (110, 40), (250, 25))
        self.filename = wx.StaticText(self.panel1, -1, "Filename: ")
        self.filenamereal = wx.StaticText(self.panel1, -1)
        self.start = gz.LEDNumberCtrl(self.panel1, -1, size=(75, 30))
        self.start.SetValue("--")
        self.end = gz.LEDNumberCtrl(self.panel1, -1, size=(75, 30))
        self.end.SetValue("--")
        self.filesize = wx.StaticText(self.panel1, -1, "Filesize: ")
        self.size = wx.StaticText(self.panel1, -1)
        self.make = wx.StaticText(self.panel1, -1)

        #self.start.Hide()
        #self.end.Hide()

        self.perc.Add(self.start)
        self.perc.Add(self.end)
        self.detail1.Add(self.filename)
        self.detail1.Add(self.filenamereal)
        self.detail2.Add(self.filesize)
        self.detail2.Add(self.size)
        self.probox.Add(self.perc, 0, wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, 2)
        self.probox.Add(self.g1, 0, wx.GROW | wx.ALL, 5)
        self.probox.Add(self.detail1, 0, wx.LEFT | wx.RIGHT, 5)
        self.probox.Add(self.detail2, 0, wx.LEFT | wx.RIGHT, 5)
        self.probox.Add(self.make, 0, wx.LEFT | wx.RIGHT, 5)
        self.probox.Layout()
        self.probox.RecalcSizes()
        self.panel1.Layout()

        self.populateHistory()

        self.nb.AddPage(self.panel1, "Downloading")
        self.nb.AddPage(self.panel2, "History")

        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

        self.nb.SetSelection(1)

        self.mgr.AddPane(self.tb,
                         aui.AuiPaneInfo().ToolbarPane().Top().Dockable(False))
        self.mgr.AddPane(self.dir, aui.AuiPaneInfo().Name('main').CenterPane())
        self.mgr.AddPane(
            self.queues,
            aui.AuiPaneInfo().Name('side').Right().Caption(
                "Process Queue").CloseButton(False).BestSize((150, -1)))
        self.mgr.AddPane(
            self.nb,
            aui.AuiPaneInfo().Caption("Thread").Bottom().CloseButton(
                False).BestSize((-1, 500)))

        self.mgr.Update()

        self.Center()

        pub.subscribe(self.peerListener, "peers")
        pub.subscribe(self.lostListener, "lost")
        pub.subscribe(self.processListener, "process")
        pub.subscribe(self.updateListener, "update")
        pub.subscribe(self.clearListener, "done")
        pub.subscribe(self.sendingListener, "analysing")
        pub.subscribe(self.stopListener, "stopanalysing")
        pub.subscribe(self.sentListener, "donereceived")
        pub.subscribe(self.fileQueue, "filequeue")
        pub.subscribe(self.deleteFileQueue, "deletefile")
        pub.subscribe(self.folderQueue, "folderqueue")
        pub.subscribe(self.deleteFileQueue, "deletefolder")
        pub.subscribe(self.folderFile, "updatefolder")
예제 #30
0
    def __init__(self, parent, id=wx.ID_ANY, title="Rfc Viewer", pos=wx.DefaultPosition,
                 size=(800, 600), style=wx.DEFAULT_FRAME_STYLE, name='RfcViewer'):
        """
        Initialize - inherits from wx.Frame. Instantiates all widgets and variables for application

        :param parent: (wx.Window) The window parent. This may be, and often is, None. If it is not None, the frame
                       will be minimized when its parent is minimized and restored when it is restored (although it
                       will still be possible to minimize and restore just this frame itself).

        :param id:     (wx.WindowID) The window identifier. It may take a value of -1 to indicate a default value.

        :param title:  (string)  The caption to be displayed on the frame’s title bar.

        :param pos:    (wx.point) The window position. The value DefaultPosition indicates a default position,
                       chosen by either the windowing system or wxWidgets, depending on platform.

        :param size:   (wx.Size) – The window size. The value DefaultSize indicates a default size, chosen by either
                       the windowing system or wxWidgets, depending on platform.

        :param style:  (long) – The window style. See wx.Frame class description.

        :param name:   (string) The name of the window. This parameter is used to associate a name with the item,
                       allowing the application user to set Motif resource values for individual windows.
        """
        wx.Frame.__init__(self,
                          parent,
                          id,
                          title,
                          pos,
                          size,
                          style)
        print(f'PyMuPDF version: {fitz.__doc__}')
        self.rpath = RfcPaths.RfcPaths()
        self.rfc_document_data = None

        with self.rpath.rfc_index_json.open() as f:
            self.rfc_index = json.load(f)

        self.pnl = pnl = MainPanel(self)
        self._mgr = aui.AuiManager(pnl)

        # notify AUI which frame to use
        self._mgr.SetManagedWindow(self)

        # First pane is Rfc Selection window located top left
        # ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
        self.rfc_selector = wx.ListCtrl(self,
                                        id=wx.ID_ANY,
                                        pos=wx.DefaultPosition,
                                        size=wx.Size(200, 150),
                                        style=wx.NO_BORDER | wx.TE_MULTILINE,
                                        name='RfcSelector')

        self.rfc_selector.InsertColumn(0, 'RFC Id', width=60)
        self.rfc_selector.InsertColumn(1, 'Title', width=200)

        self.rfc_selector.SetMinSize(wx.Size(500, 300))
        self.rfc_selector.SetMaxSize(wx.Size(1000, 800))

        # Need to distinguish between single and double click so
        self.rfc_id = None

        self.dbl_clk_delay = 250
        self.rfc_selector.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.run_summary)
        self.rfc_selector.Bind(wx.EVT_LEFT_DCLICK, self.display_detail)

        self.rfc_selector_load()

        # Second pane is Rfc Summary window Data displayed in this window on single click in
        # selection window.
        # ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
        self.summary = wx.TextCtrl(self,
                                   id=wx.ID_ANY,
                                   value="Pane 2 - Summary Text Here",
                                   pos=wx.DefaultPosition,
                                   size=wx.Size(200, 150),
                                   style=wx.NO_BORDER | wx.TE_MULTILINE,
                                   name='RfcSummary')

        # Third pane (left top)  is a two tab notebook, one for text files and one for pdf files. One
        # or both may be populated for any given RFC document.
        # ----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
        self.nb = aui.AuiNotebook(self,
                                  id=wx.ID_ANY,
                                  pos=wx.DefaultPosition,
                                  size=wx.DefaultSize,
                                  style=0,
                                  agwStyle=wx.lib.agw.aui.AUI_NB_DEFAULT_STYLE,
                                  name="RfcDocumentNotebook")

        self.text_page = wx.TextCtrl(self.nb,
                                     id=wx.ID_ANY,
                                     pos=wx.DefaultPosition,
                                     size=wx.DefaultSize,
                                     style=wx.NO_BORDER | wx.TE_MULTILINE,
                                     name='DetailNotebookTabs')

        self.pdf_page = wx.Panel(self.nb,
                                 id=wx.ID_ANY,
                                 pos=wx.DefaultPosition,
                                 size=wx.DefaultSize,
                                 style=wx.TAB_TRAVERSAL,
                                 name='pdfpage')

        # hsizer = wx.BoxSizer(wx.HORIZONTAL)
        # vsizer = wx.BoxSizer(wx.VERTICAL)
        #
        # self.btnpanl = pdfButtonPanel(self.pdf_page,
        #                               nid=wx.ID_ANY,
        #                               pos=wx.DefaultPosition,
        #                               size=wx.DefaultSize,
        #                               style=None)
        #
        # vsizer.Add(self.btnpanl, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT | wx.TOP, 5)
        #
        # self.viewer = pdfViewer(self.pdf_page,
        #                         nid=wx.ID_ANY,
        #                         pos=wx.DefaultPosition,
        #                         size=wx.DefaultSize,
        #                         style=wx.HSCROLL | wx.VSCROLL | wx.VSCROLL | wx.SUNKEN_BORDER)
        #
        # vsizer.Add(self.viewer, 1, wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
        # hsizer.Add(vsizer, 1, wx.GROW | wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
        #
        # self.SetSizer(hsizer)
        # self.SetAutoLayout(True)
        #
        # self.btnpanl.viewer = self.viewer
        # self.viewer.buttonpanel = self.btnpanl

        self.nb.AddPage(self.text_page, "Text Document")
        self.nb.AddPage(self.pdf_page, "PDF Document")

        self._mgr.AddPane(self.rfc_selector, aui.AuiPaneInfo().Left().Caption("RFC Selection"))
        self._mgr.AddPane(self.summary, aui.AuiPaneInfo().Bottom().Caption("RFC Summary"))
        self._mgr.AddPane(self.nb, aui.AuiPaneInfo().CenterPane().Name('RFC Detail'))

        # tell the manager to "commit" all the changes just made
        self._mgr.Update()

        self.Bind(wx.EVT_CLOSE, self.OnClose)