Example #1
0
 def setUp(self):
     self.frame = wx.Frame(parent=None, id=wx.ID_ANY)
     self.testControl = wx.Frame(parent=self.frame)
     self.texts = ["one", "two", "three", "four", "five"]
     self.menubar = wx.MenuBar()
     self.menubar2 = wx.MenuBar()
     self.statusbar = wx.StatusBar(parent=self.testControl, id=wx.ID_ANY)
     self.statusbar2 = wx.StatusBar(parent=self.testControl, id=wx.ID_ANY)
     self.toolbar = wx.ToolBar(self.testControl)
     self.toolbar2 = wx.ToolBar(self.testControl)
Example #2
0
    def OnInit(self):
        """
        Run automatically when the wxPython application starts.
        """
        self.frame = wx.Frame(None, title="PyUpdater wxPython Demo")
        self.frame.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
        self.frame.SetSize(wx.Size(400, 100))
        self.statusBar = wx.StatusBar(self.frame)
        self.statusBar.SetStatusText(self.status)
        self.frame.SetStatusBar(self.statusBar)
        self.panel = wx.Panel(self.frame)
        self.sizer = wx.BoxSizer()
        self.sizer.Add(
            wx.StaticText(self.frame, label="Version %s" % __version__))
        self.panel.SetSizerAndFit(self.sizer)

        self.frame.Show()

        if hasattr(sys, "frozen") and \
                not os.environ.get('PYUPDATER_FILESERVER_DIR'):
            dlg = wx.MessageDialog(
                self.frame,
                "The PYUPDATER_FILESERVER_DIR environment variable "
                "is not set!", "PyUpdaterWxDemo File Server Error",
                wx.OK | wx.ICON_ERROR)
            dlg.ShowModal()

        return True
Example #3
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs, style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)

        self.SetTitle('Pressure Logger')
        self.SetIcon(wx.Icon('Icons/Logo.ico'))

        self.status_bar = wx.StatusBar(parent=self)
        self.SetStatusBar(statusBar=self.status_bar)

        self.clear_timer = wx.Timer(self)
        self.clear_timer.Bind(event=wx.EVT_TIMER, handler=self.clear_status_bar)
        subscribe(listener=self.update_status_bar, topicName='engine.status')

        self.menu_bar = Menubar()
        self.SetMenuBar(self.menu_bar)
        self.Bind(event=wx.EVT_MENU, handler=self.on_quit, id=wx.ID_CLOSE)
        self.Bind(event=wx.EVT_MENU, handler=self.save_image, id=wx.ID_SAVEAS)

        self.Bind(wx.EVT_MENU_RANGE, handler=self.set_interval, id=self.menu_bar.plotmenu.inter.GetMenuItems()[0].GetId(),
                  id2=self.menu_bar.plotmenu.inter.GetMenuItems()[-1].GetId())
        self.Bind(wx.EVT_MENU_RANGE, handler=self.change_style, id=self.menu_bar.stylmenu.GetMenuItems()[0].GetId(),
                  id2=self.menu_bar.stylmenu.GetMenuItems()[-1].GetId())
        self.Bind(wx.EVT_MENU_RANGE, handler=self.set_active_channels,
                  id=self.menu_bar.channelmenu.GetMenuItems()[0].GetId(),
                  id2=self.menu_bar.channelmenu.GetMenuItems()[-1].GetId())

        self.matplot = MatplotWX(parent=self)
        self.Fit()

        self.Bind(wx.EVT_MENU, source=self.menu_bar.plotmenu.start, handler=self.matplot.start_plotting)
        self.Bind(wx.EVT_MENU, source=self.menu_bar.plotmenu.stop, handler=self.matplot.stop_plotting)
        self.Bind(wx.EVT_MENU, source=self.menu_bar.plotmenu.clear, handler=self.matplot.clear_plot)
        self.Bind(wx.EVT_MENU, source=self.menu_bar.plotmenu.resume, handler=self.matplot.cont_plotting)

        self.Show(True)
Example #4
0
    def _init_ctrls(self, prnt):
        wx.Frame.__init__(self,
                          id=ID_NETWORKEDIT,
                          name='networkedit',
                          parent=prnt,
                          pos=wx.Point(149, 178),
                          size=wx.Size(1000, 700),
                          style=wx.DEFAULT_FRAME_STYLE,
                          title=_('Networkedit'))
        self._init_utils()
        self.SetClientSize(wx.Size(1000, 700))
        self.SetMenuBar(self.MenuBar)
        self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
        if not self.ModeSolo:
            self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE)
            accel = wx.AcceleratorTable(
                [wx.AcceleratorEntry(wx.ACCEL_CTRL, 83, wx.ID_SAVE)])
            self.SetAcceleratorTable(accel)

        NetworkEditorTemplate._init_ctrls(self, self)

        self.HelpBar = wx.StatusBar(id=ID_NETWORKEDITHELPBAR,
                                    name='HelpBar',
                                    parent=self,
                                    style=wx.ST_SIZEGRIP)
        self._init_coll_HelpBar_Fields(self.HelpBar)
        self.SetStatusBar(self.HelpBar)
Example #5
0
    def _create_menu(self):     
        #self._menus = {}
        #self.menubar = wx.MenuBar()
        
        ##############
        #Create the menus
        
        #File menu
        self.AddMenuItem('File', '&Open Stack', self.OnFileOpenStack)
        self.AddMenuItem('File', itemType='separator')        
        self.AddMenuItem('File', 'Exit', self.OnFileExit, id = wx.ID_EXIT)
        
        #Camera menu
        self.AddMenuItem('Camera', 'Toggle ROI\tF8', self.OnMCamRoi)
        self.miCamBin = self.AddMenuItem('Camera', 'Turn binning on', self.OnMCamBin, itemType='check')
        self.AddMenuItem('Camera', 'Set pixel size', self.OnMCamSetPixelSize)
        
        #Acquire menu
        self.AddMenuItem('Acquire', 'Snapshot\tF5', self.OnMAquireOnePic)
              
        #self._init_utils()
        #self.SetMenuBar(self.menubar)
        #######################
        
        self.SetClientSize(wx.Size(1020, 800))
        

        self.statusBar1 = wx.StatusBar(id=wx.ID_ANY,
              name='statusBar1', parent=self, style=wx.STB_SIZEGRIP)
        self.SetStatusBar(self.statusBar1)
Example #6
0
    def _init_ctrls(self, prnt):
        wx.Frame.__init__(self,
                          id=wx.ID_ANY,
                          name='objdictedit',
                          parent=prnt,
                          pos=wx.Point(149, 178),
                          size=wx.Size(1000, 700),
                          style=wx.DEFAULT_FRAME_STYLE,
                          title=_('Objdictedit'))
        self._init_utils()
        self.SetClientSize(wx.Size(1000, 700))
        self.SetMenuBar(self.MenuBar)
        self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
        if not self.ModeSolo:
            self.Bind(wx.EVT_MENU, self.OnSaveMenu, id=wx.ID_SAVE)
            accel = wx.AcceleratorTable(
                [wx.AcceleratorEntry(wx.ACCEL_CTRL, 83, wx.ID_SAVE)])
            self.SetAcceleratorTable(accel)

        self.FileOpened = wx.Notebook(id=wx.ID_ANY,
                                      name='FileOpened',
                                      parent=self,
                                      pos=wx.Point(0, 0),
                                      size=wx.Size(0, 0),
                                      style=0)
        self.FileOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED,
                             self.OnFileSelectedChanged)

        self.HelpBar = wx.StatusBar(id=wx.ID_ANY,
                                    name='HelpBar',
                                    parent=self,
                                    style=wx.STB_SIZEGRIP)
        self._init_coll_HelpBar_Fields(self.HelpBar)
        self.SetStatusBar(self.HelpBar)
Example #7
0
    def add_statusbar(self):
        """ Adds a status bar to the dialog.
        """
        ui = self.ui
        statusbar = ui.view.statusbar
        context = ui.context
        if statusbar is not None:
            widths = []
            listeners = []
            control = wx.StatusBar(self.control)
            control.SetFieldsCount(len(statusbar))
            for i, item in enumerate(statusbar):
                width = abs(item.width)
                if width <= 1.0:
                    widths.append(-max(1, int(1000 * width)))
                else:
                    widths.append(int(width))

                set_text = self._set_status_text(control, i)
                name = item.name
                set_text(ui.get_extended_value(name))
                col = name.find('.')
                object = 'object'
                if col >= 0:
                    object = name[:col]
                    name = name[col + 1:]
                object = context[object]
                object.on_trait_change(set_text, name, dispatch='ui')
                listeners.append((object, set_text, name))

            control.SetStatusWidths(widths)
            self.control.SetStatusBar(control)
            ui._statusbar = listeners
    def __init__(self, parent=None, *args, **kw):
        wx.Panel.__init__(self,
                          parent,
                          id=-1,
                          style=wx.CLIP_CHILDREN | wx.BORDER_NONE)
        self.parent = parent
        self.data = list()
        self.pin = False
        vBox = wx.BoxSizer(wx.VERTICAL)
        self.fileOperations = FileOperations()
        ####################################################################
        self.topResultToolbar = self.constructTopResultToolBar()
        self.bottomResultToolbar = wx.StatusBar(self)
        self.bottomResultToolbar.SetStatusText('Count: {}'.format(
            len(self.getData())))
        #         self.bottomResultToolbar = self.constructBottomResultToolBar()
        #         self.resultPanel = ResultPanel(self, data=self.getData())
        self.resultPanel = ResultDataGrid(self, data=self.getData())
        #         bottomResultToolbar = self.constructBottomResultToolBar()

        ####################################################################
        vBox.Add(self.topResultToolbar, 0, wx.EXPAND | wx.ALL, 0)
        vBox.Add(self.resultPanel, 1, wx.EXPAND | wx.ALL, 0)
        vBox.Add(self.bottomResultToolbar, 0, wx.EXPAND | wx.ALL, 0)
        #         vBox.Add(bottomResultToolbar , 0, wx.EXPAND | wx.ALL, 0)
        #         vBox.Add(resultPanel , 1, wx.EXPAND | wx.ALL)
        sizer = wx.BoxSizer(wx.VERTICAL)
        #         sizer.Add(worksheetToolbar ,.9, wx.EXPAND | wx.ALL, 0)
        sizer.Add(vBox, 1, wx.EXPAND, 0)
        self.SetSizer(sizer)
Example #9
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_EDITORFRAME, name=u'EditorFrame',
              parent=prnt, pos=wx.Point(117, 109), size=wx.Size(437, 296),
              style=wx.DEFAULT_FRAME_STYLE, title=u'crontab.txt Editor')
        self._init_utils()
        self.SetClientSize(wx.Size(429, 269))
        self.SetMenuBar(self.mainMenuBar)
        wx.EVT_CLOSE(self, self.OnEditorFrameClose)

        self.cronItemList = wx.ListCtrl(id=wxID_EDITORFRAMECRONITEMLIST,
              name=u'cronItemList', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(429, 230), style=wx.LC_REPORT,
              validator=wx.DefaultValidator)
        self.cronItemList.SetToolTipString(u'double-click on an entry to edit')
        wx.EVT_LEFT_DCLICK(self.cronItemList, self.OnCronitemlistLeftDclick)
        wx.EVT_LIST_ITEM_SELECTED(self.cronItemList, wxID_EDITORFRAMECRONITEMLIST,
              self.OnCronitemlistListItemSelected)

        self.statusBar = wx.StatusBar(id=wxID_EDITORFRAMESTATUSBAR,
              name=u'statusBar', parent=self, style=0)
        self.statusBar.SetPosition(wx.Point(0, 230))
        self.statusBar.SetSize(wx.Size(429, 20))
        self._init_coll_statusBar_Fields(self.statusBar)
        self.SetStatusBar(self.statusBar)
Example #10
0
    def CreateWidgets(self):
        self.icon = wx.EmptyIcon()
        self.icon.CopyFromBitmap(wx.Bitmap(resource_path(settings.ICON_RELATIVE_PATH), wx.BITMAP_TYPE_ANY))
        self.SetIcon(self.icon)

        self.box_sizer = wx.BoxSizer(wx.VERTICAL)
        self.box_sizer_horizontal = wx.BoxSizer(wx.HORIZONTAL)

        self.SetBackgroundColour(wx.NullColour) # for a nice gray window background color
        self.Center()

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

        self.nb = MainNotebook(self)
        self.box_sizer.Add(self.box_sizer_horizontal, proportion=1, flag=wx.EXPAND|wx.ALL, border=3)
        self.box_sizer_horizontal.Add(self.nb, proportion=1, flag=wx.EXPAND)

        filemenu = wx.Menu()
        item_new = filemenu.Append(wx.ID_NEW, "&New")
        item_open = filemenu.Append(wx.ID_OPEN, "&Open")
        item_save = filemenu.Append(wx.ID_SAVE, "&Save")
        item_save_as = filemenu.Append(wx.ID_SAVEAS, "Save &As")
        filemenu.AppendSeparator()
        item_close = filemenu.Append(wx.ID_EXIT, "Exit")

        settingsmenu = wx.Menu()
        self.item_search_foxes_start = settingsmenu.Append(settings.ID_SETTINGS_SEARCH_FOXES_START, "Search Connected Foxes at Start", kind=wx.ITEM_CHECK)

        helpmenu = wx.Menu()
        item_user_manual = helpmenu.Append(settings.ID_HELP_USER_MANUAL, "User Manual (German)")
        item_about = helpmenu.Append(settings.ID_HELP_ABOUT, "About")

        self.Bind(wx.EVT_MENU, self.OnClose, item_close)
        self.Bind(wx.EVT_MENU, self.Save, item_save)
        self.Bind(wx.EVT_MENU, self.SaveAs, item_save_as)
        self.Bind(wx.EVT_MENU, self.Open, item_open)
        self.Bind(wx.EVT_MENU, self.New, item_new)
        self.Bind(wx.EVT_MENU, self.SearchFoxesAtStart, self.item_search_foxes_start)
        self.Bind(wx.EVT_MENU, self.HelpAbout, item_about)
        self.Bind(wx.EVT_MENU, self.HelpUserManual, item_user_manual)

        menuBar = wx.MenuBar()
        menuBar.Append(filemenu, "&File")
        menuBar.Append(settingsmenu, "&Settings")
        menuBar.Append(helpmenu, "&Help")
        self.SetMenuBar(menuBar)

        self.SetSizerAndFit(self.box_sizer)

        self.status_bar = wx.StatusBar(self, style=wx.SB_RAISED)
        self.status_bar.PushStatusText("Software ready")
        self.SetStatusBar(self.status_bar)

        self.file_config = wx.FileConfig(settings.APP_NAME, style=wx.CONFIG_USE_LOCAL_FILE)

        self.last_save_string =  ""

        self.ReadSettings()

        self.last_save_string = self.Saving(with_saving_to_file=False)
Example #11
0
        def __init__(self, parent=None, id=-1, Fun_SwFrame=None):
            # hack to help on dual-screen, need something better XXX - idfah
            displaySize = wx.DisplaySize() # (1920, 1080)
            displaySize = 0.85 * displaySize[0], 0.75 * displaySize[1]

            # call base class constructor
            wx.Frame.__init__(self, parent = None, title = u'量化软件', size=displaySize,
                          style=wx.DEFAULT_FRAME_STYLE^wx.MAXIMIZE_BOX) # size=(1000,600)

            self.fun_swframe = Fun_SwFrame # 用于回测功能集成到整体系统中

            # 创建并初始化 treeListCtrl--策略树
            self.init_tree()

            # 创建并初始化 wxGrid--回测结果表
            self.init_grid()

            # 创建并初始化 TextCtrl--日志框
            self.log_tx = wx.TextCtrl(self, style=wx.TE_MULTILINE, size=(260, 320))

            # 创建并初始化 ListBox--股票组合列表
            self.listBox = wx.ListBox(self, -1, size=(260, 200), choices=self.stock_list, style=wx.LB_EXTENDED)
            self.listBox.Bind(wx.EVT_LISTBOX_DCLICK, self.event_listCtrlSelect)

            vboxnetA = wx.BoxSizer(wx.VERTICAL)  # 纵向box
            vboxnetA.Add(self.treeListCtrl, proportion=0, flag=wx.EXPAND | wx.BOTTOM, border=2)  # proportion参数控制容器尺寸比例
            vboxnetA.Add(self.listBox, proportion=0, flag=wx.EXPAND | wx.BOTTOM, border=2)
            vboxnetA.Add(self.grid, proportion=0, flag=wx.EXPAND | wx.BOTTOM, border=2)
            vboxnetA.Add(self.log_tx, proportion=0, flag=wx.EXPAND | wx.BOTTOM, border=2)

            # 创建参数区面板
            self.ParaPanel = wx.Panel(self,-1)

            # 创建显示区面板
            self.DispPanel = BacktdPanel(self)  # 自定义
            # Note that event is a MplEvent
            self.DispPanel.FigureCanvas.mpl_connect('motion_notify_event', self.event_UpdateStatusBar)
            self.DispPanel.FigureCanvas.Bind(wx.EVT_ENTER_WINDOW, self.event_ChangeCursor)
            self.statusBar = wx.StatusBar(self, -1)
            self.SetStatusBar(self.statusBar)
            # print(self.DispPanel2.GetSize()) # 默认是(20,20)

            # matplotlib显示的子图
            self.graph_trade = self.DispPanel.graph_trade
            self.graph_profit = self.DispPanel.graph_profit

            # 第二层布局
            self.add_stock_para_lay()
            vbox_sizer_a = wx.BoxSizer(wx.VERTICAL) # 纵向box
            vbox_sizer_a.Add(self.ParaPanel, proportion=1, flag=wx.EXPAND|wx.BOTTOM, border=2)  # 添加行情参数布局
            vbox_sizer_a.Add(self.DispPanel, proportion=10, flag=wx.EXPAND|wx.BOTTOM, border=2)
            vbox_sizer_a.Add(self.statusBar, proportion=0, flag=wx.EXPAND|wx.BOTTOM, border=2)

            # 第一层布局
            self.HBoxPanelSizer = wx.BoxSizer(wx.HORIZONTAL)
            self.HBoxPanelSizer.Add(vboxnetA, proportion=1, border=2, flag=wx.EXPAND | wx.ALL)
            self.HBoxPanelSizer.Add(vbox_sizer_a, proportion=10, border=2, flag=wx.EXPAND | wx.ALL)
            self.SetSizer(self.HBoxPanelSizer)  # 使布局有效

            self.function = ''
Example #12
0
    def __init__(self):
        wx.Frame.__init__(self, None, title="Grid Table", size=(400, 400))

        self.icon = wx.Icon('icon/dog4.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(self.icon)

        self.s = "准备就绪"
        self.statusBar = wx.StatusBar(self, -1)
        self.statusBar.SetFieldsCount(1)
        self.statusBar.SetStatusText(self.s)
        self.SetStatusBar(self.statusBar)

        panel1 = wx.Panel(self, -1)
        panel2 = wx.Panel(self, -1)
        panel3 = wx.Panel(self, -1)
        hbox1 = wx.BoxSizer(wx.VERTICAL)

        hbox1.Add(panel1, 1, wx.EXPAND | wx.ALL, 10)
        hbox1.Add(panel2, 1, wx.EXPAND | wx.ALL, 10)
        hbox1.Add(panel3, 0, wx.EXPAND | wx.ALL, 10)

        table = CustTableGrid(panel2)
        tblSizer = wx.BoxSizer(wx.VERTICAL)
        tblSizer.Add(table, 1, wx.ALL, 5)
        panel2.SetSizer(tblSizer)
        text = wx.StaticText(panel3, -1, "stests")
        self.SetSizer(hbox1)
Example #13
0
    def __init__(self, parent):
        WizardPage.__init__(self, parent)
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(sizer)

        title = wx.StaticText(self, -1, '%s configuration' % (self.title))
        title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD))
        sizer.Add(title, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
        sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 5)

        prev_selection_button = wx.Button(self, -1, 'Show previous selections')
        sizer.Add(prev_selection_button, 0, wx.EXPAND, 5)
        self.Bind(wx.EVT_BUTTON, self.OnShowSelections, prev_selection_button)

        select_title = wx.StaticText(
            self, -1, 'Select %s resource option' % (self.title))
        sizer.Add(select_title, 0, wx.ALIGN_LEFT | wx.ALL, 5)
        self.select_list = wx.ListBox(self,
                                      -1,
                                      style=wx.LB_SINGLE,
                                      name='Select %s' % (self.title))
        sizer.Add(self.select_list, 1, wx.EXPAND, 5)

        self.status = wx.StatusBar(self, -1)

        sizer.Add(self.status, 0, wx.EXPAND, 5)

        self.sizes = sizer
        self.stop_apply_selection()
Example #14
0
    def _init_ctrls(self, prnt):
        wx.Frame.__init__(self,
                          id=wxID_IAT_VIEWER,
                          name='iat_viewer',
                          parent=prnt,
                          pos=wx.Point(439, 269),
                          size=wx.Size(548, 352),
                          style=wx.FRAME_NO_TASKBAR | wx.FRAME_FLOAT_ON_PARENT
                          | wx.DEFAULT_FRAME_STYLE,
                          title='Import Table Viewer')

        self.Centre()

        self._init_utils()

        self.SetClientSize(wx.Size(600, 400))
        self.SetMinSize(wx.Size(500, 250))

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

        self.dllList = wx.ListCtrl(id=wxDLL_LIST,
                                   name='dllList',
                                   parent=self,
                                   pos=wx.Point(0, 144),
                                   size=wx.Size(600, 200),
                                   style=wx.LC_SINGLE_SEL | wx.LC_REPORT
                                   | wx.LC_SORT_ASCENDING)

        self.dllList.SetConstraints(
            LayoutAnchors(self.dllList, True, True, True, True))

        self._init_coll_dllList_Columns(self.dllList)

        self.dllList.Bind(wx.EVT_LIST_ITEM_SELECTED,
                          self.OndllListItemSelected,
                          id=wxDLL_LIST)

        self.dllList.Bind(wx.EVT_RIGHT_DOWN, self.OnDllListRightDown)

        self.taskStatus = wx.StatusBar(id=wxID_IMPORT_VIEWERTASKSTATUS,
                                       name='taskStatus',
                                       parent=self,
                                       style=0)

        self._init_coll_taskStatus_Fields(self.taskStatus)

        self.SetStatusBar(self.taskStatus)

        self.functionList = wx.ListCtrl(id=wxFUNCTION_LIST,
                                        name='importList',
                                        parent=self,
                                        pos=wx.Point(0, 0),
                                        size=wx.Size(600, 200),
                                        style=wx.LC_SINGLE_SEL | wx.LC_REPORT)

        self._init_coll_functionList_Columns(self.functionList)

        self.functionList.Bind(wx.EVT_RIGHT_DOWN, self.OnImportsListRightDown)

        self._init_sizers()
Example #15
0
    def __init__(self, plugin_tools=()):
        wx.Frame.__init__(self, None, wx.ID_ANY, 'Logic Sniffer')
        self.traces = None
        self.plugins = []
        self.capture_serial = 0

        self.timescale_auto = True
        self.timescale_tick = 1000
        self.timescale_unit = 1000000

        self.tracebook = wx.Notebook(self, wx.ID_ANY)
        self._new_capture_page()

        self.SetMenuBar(self._main_menu())
        self.tracebook.Bind(wx.EVT_RIGHT_DOWN, self.OnBookRClick)

        if verbose_flag: print 'Plugins:', repr(plugin_tools)
        self._load_plugins(plugin_tools)

        statusbar = wx.StatusBar(self)
        statusbar.SetFieldsCount(4)
        self.SetStatusBar(statusbar)

        top_sizer = wx.BoxSizer(wx.VERTICAL)
        top_sizer.Add(self.tracebook, 1, wx.EXPAND)

        self.SetAutoLayout(True)
        self.SetSizer(top_sizer)
        top_sizer.Fit(self)
        top_sizer.SetSizeHints(self)
Example #16
0
    def __init__(self, swarm_title, payment_url, swarm_id, node_id):
        kwds = {"style": wx.DEFAULT_DIALOG_STYLE}
        wx.Dialog.__init__(self, None)

        self.payment_url = payment_url
        self.swarm_id = swarm_id
        self.node_id = node_id
        self.phone_number = None
        self.poa = None

        self.label_0 = wx.StaticText(
            self, -1,
            "\nRegister your phone number (with country code) to get \nhigh speed access to the resource '"
            + swarm_title + "'\n")

        self.label_1 = wx.StaticText(self, -1, "Phone number")
        self.txt_phone_number = wx.TextCtrl(self, -1, "")
        self.btn_request_code = wx.Button(self, -1, "Request code")

        self.label_2 = wx.StaticText(self, -1, "Code")
        self.txt_code = wx.TextCtrl(self, -1, "")
        self.btn_send_code = wx.Button(self, -1, "Send code")

        self.status = wx.StatusBar(self, -1)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self._request_code, self.btn_request_code)
        self.Bind(wx.EVT_BUTTON, self._request_token, self.btn_send_code)

        self.status.SetStatusText("Please enter your phone number")

        self._payment_service = PaymentSystem(node_id, swarm_id)
Example #17
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_MAINFRAME, name=u'MainFrame',
              parent=prnt, pos=wx.Point(304, 125), size=wx.Size(615, 556),
              style=wx.DEFAULT_FRAME_STYLE, title=u'STDF Explorer')
        self._init_utils()
        self.SetClientSize(wx.Size(607, 527))
        self.SetMenuBar(self.mainMenuBar)
        self.SetExtraStyle(0)
        self.SetStatusBarPane(0)

        self.statusBar = wx.StatusBar(id=wxID_MAINFRAMESTATUSBAR,
              name=u'statusBar', parent=self, style=0)
        self._init_coll_statusBar_Fields(self.statusBar)
        self.SetStatusBar(self.statusBar)

        self.recordPositionList = RecordPositionListCtrl(id=wxID_MAINFRAMERECORDPOSITIONLIST,
              name=u'recordPositionList', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(202, 487),
              style=wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_HRULES | wx.LC_VRULES)
        self._init_coll_recordPositionList_Columns(self.recordPositionList)
        self.recordPositionList.Bind(wx.EVT_LIST_ITEM_SELECTED,
              self.OnRecordPositionListListItemSelected,
              id=wxID_MAINFRAMERECORDPOSITIONLIST)

        self.recordViewList = RecordViewListCtrl(id=wxID_MAINFRAMERECORDVIEWLIST,
              name=u'recordViewList', parent=self, pos=wx.Point(202, 0),
              size=wx.Size(404, 487),
              style=wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_HRULES | wx.LC_VRULES)
        self.recordViewList.SetAutoLayout(False)
        self.recordViewList.SetMinSize(wx.Size(404, 487))
        self._init_coll_recordViewList_Columns(self.recordViewList)

        self._init_sizers()
Example #18
0
    def __init__(self, parent):
        super(MyFrame, self).__init__(parent, title=TITLE, size=(1280, 768))

        icon_path = 'Assets/Microsoft-logo_rgb_c-gray.png'
        self.SetIcon(wx.Icon(icon_path))

        sizer = wx.BoxSizer(wx.VERTICAL)

        self.title = MyTitle(self)
        sizer.Add(self.title, flag=wx.EXPAND)

        self.book = MyLabelBook(self)
        sizer.Add(self.book, 1, flag=wx.EXPAND)

        status_text = (
            'Microsoft will receive the images you upload and may use them to '
            'improve Face API and related services. By submitting an image, '
            'you confirm you have consent from everyone in it.'
        )
        self.status = wx.StatusBar(self)
        self.status.SetStatusText(status_text)
        sizer.Add(self.status, flag=wx.EXPAND)

        self.SetSizer(sizer)
        self.Layout()
    def __init__(self, device_manager):
        super().__init__(parent=None, title='Location Tracker')

        self.SetSize((WINDOW_WIDTH, WINDOW_HEIGHT))
        self.SetTitle('DWM1001 Location Tracker Demo')
        self.Centre()

        img = wx.Image(FLOOR_PLAN_IMAGE, wx.BITMAP_TYPE_ANY)
        self.bitmap_img = img.ConvertToBitmap()

        self.floor_plan_img = wx.StaticBitmap(
            self, -1, self.bitmap_img, (10, 5),
            (self.bitmap_img.GetWidth(), self.bitmap_img.GetHeight()))
        self.floor_plan_img.Bind(wx.EVT_MOTION, self.imgctrl_on_mousemove)

        self.status_bar = wx.StatusBar(self, -1, wx.STB_ELLIPSIZE_END,
                                       "defaultstatusbar")
        self.status_bar.SetStatusText("X={0}, Y={1}".format(0, 0))
        self.SetStatusBar(self.status_bar)

        self.anchors = dict()
        self.tag = None
        self.overlay = wx.Overlay()
        self.previous_loc_updates = list()
        self.loc_update_index = 0

        worker = LocationTrackerWorker(self, device_manager)
        worker.start()

        self.Show()
        self.Bind(LOC_RECEIVED_EVNT, self.on_location_received)
        self.anc1_pos = [0, 0]
        self.anc2_pos = [-0.7, 0.0]
        self.anc3_pos = [-0.35, 0.7]
Example #20
0
 def create_status_bar(self):
     status = wx.StatusBar(self, -1)  # 实例化 wx.StatusBar
     status.SetFieldsCount(3)  # 状态栏分成3个区域
     status.SetStatusWidths([-2, -1, -1])  # 区域宽度比列,用负数
     status.SetStatusText("当前用户:" + self.user["nickname"], 1)  # 给状态栏设文字
     status.SetStatusText("登录时间:" + self.user["loginTime"], 2)  # 给状态栏设文字
     self.SetStatusBar(status)  # 将状态栏附加到框架上
Example #21
0
 def add_sb(self):
     sb = wx.StatusBar(self)
     self.sb = sb
     sb.SetFieldsCount(2)
     sb.SetStatusWidths([-2, -1])
     sb.SetStatusText("0 Files", 1)
     self.SetStatusBar(sb)
Example #22
0
    def __init__(self, parent=None, *args, **kw):
        wx.Panel.__init__(self, parent, id=-1)
        self.parent = parent
        self.fileOperations = FileOperations()
        self.tabName = kw['tabName']
        self.dataSourceTreeNode = kw['dataSourceTreeNode']
        self.data = list()
        self.sqlList = dict()
        vBox = wx.BoxSizer(wx.VERTICAL)
        logger.debug(kw)
        ####################################################################
        # adding new rows to the list on click of add button
#         self.newRows={}
        ####################################################################
#         self.topResultToolbar = self.constructTopResultToolBar()
        self.bottomResultToolbar = wx.StatusBar(self)
        self.resultPanel, self.toolbar = self.getPanelByTabName(tableName=kw['tableName'], tabName=kw['tabName'])
#         self.resultPanel = ResultPanel(self, data=None)
        self.bottomResultToolbar.SetStatusText("some text")
#         self.bottomResultToolbar = self.constructBottomResultToolBar()
#         self.resultPanel = ResultDataGrid(self, data=self.getData())
#         bottomResultToolbar = self.constructBottomResultToolBar()
        
        ####################################################################
        vBox.Add(self.toolbar , 0, wx.EXPAND | wx.ALL, 0)
#         vBox.Add(self.resultPanel , 1, wx.EXPAND | wx.ALL, 0)
        vBox.Add(self.resultPanel , 1, wx.EXPAND | wx.ALL)
        vBox.Add(self.bottomResultToolbar , 0, wx.EXPAND | wx.ALL, 0)
#         vBox.Add(bottomResultToolbar , 0, wx.EXPAND | wx.ALL, 0)
        sizer = wx.BoxSizer(wx.VERTICAL)
#         sizer.Add(worksheetToolbar ,.9, wx.EXPAND | wx.ALL, 0)
        sizer.Add(vBox, 1, wx.EXPAND , 0)
        self.SetSizer(sizer)    
Example #23
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(
            self,
            id=wxID_RACKDESIGNER,
            name="RackDesigner",
            parent=prnt,
            pos=wx.Point(478, 242),
            size=wx.Size(600, 600),
            style=wx.DEFAULT_FRAME_STYLE,
            title="Wine rack layout designer",
        )
        self.SetClientSize(wx.Size(592, 566))
        self.Bind(wx.EVT_CLOSE, self.OnRackDesignerClose)

        self.statusBar1 = wx.StatusBar(
            id=wxID_RACKDESIGNERSTATUSBAR1, name="statusBar1", parent=self, style=0
        )
        self.SetStatusBar(self.statusBar1)

        self.TB = wx.ToolBar(
            id=wxID_RACKDESIGNERTB,
            name="TB",
            parent=self,
            pos=wx.Point(0, 0),
            size=wx.Size(592, 28),
            style=wx.TB_HORIZONTAL | wx.NO_BORDER,
        )
        self.SetToolBar(self.TB)
Example #24
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self,
                          id=wxID_FRAME2,
                          name='',
                          parent=prnt,
                          pos=wx.Point(789, 368),
                          size=wx.Size(400, 250),
                          style=wx.DEFAULT_FRAME_STYLE,
                          title='1stEdit')
        self._init_utils()
        self.SetClientSize(wx.Size(392, 212))
        self.SetStatusBarPane(0)
        self.SetMenuBar(self.menuBar1)

        self.statusBar1 = wx.StatusBar(id=wxID_FRAME2STATUSBAR1,
                                       name='statusBar1',
                                       parent=self,
                                       style=0)
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

        self.textEditor = wx.TextCtrl(id=wxID_FRAME2TEXTEDITOR,
                                      name='textEditor',
                                      parent=self,
                                      pos=wx.Point(0, 0),
                                      size=wx.Size(392, 169),
                                      style=wx.TE_MULTILINE,
                                      value='')
Example #25
0
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title)
        self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
        # 创建底部菜单
        self.statusBar = wx.StatusBar()
        # 创建菜单
        filemenu = wx.Menu()
        # 添加关于项
        menuAbout = filemenu.Append(wx.ID_ABOUT, "About",
                                    "Information about this program")
        self.Bind(wx.EVT_MENU, self.OnAbout, menuAbout)
        # 添加退出项
        menuExit = filemenu.Append(wx.ID_EXIT, "Exit", "Terminate the program")
        self.Bind(wx.EVT_MENU, self.OnExit, menuExit)

        # 添加打开文件项
        menuOpen = filemenu.Append(wx.ID_OPEN, "&Open", "Open a file")
        self.Bind(wx.EVT_MENU, self.menuOpenFile, menuOpen)
        self.sizer2 = wx.BoxSizer(wx.HORIZONTAL)
        self.buttons = []
        for i in range(0, 6):
            self.buttons.append(wx.Button(self, -1, "Button &" + str(i)))
            self.sizer2.Add(self.buttons[i], 1, wx.EXPAND)
        # 把菜单添加到菜单栏
        menuBar = wx.MenuBar()
        menuBar.Append(filemenu, "File")
        self.SetMenuBar(menuBar)
        self.Show(True)
Example #26
0
 def Status_Bar(self):
     #Status Bar
     self.statusbar = wx.StatusBar(self, 1)
     self.statusbar.SetFieldsCount(2)
     self.statusbar.SetStatusWidths([-1, 110])
     self.SetStatusBar(self.statusbar)
     self.StatusLineColumn(self)
Example #27
0
    def OnInit(self):
        self.main = Frame1.create(None, self)
        try:
          self.conn = win32com.client.Dispatch("ADODB.Connection")
          lPath =  os.getcwd().split("\\")
          self.db = str("\\".join(lPath)+"\\Cep.mdb")
          self.DSN="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + self.db
          self.conn.Open(self.DSN)
          self.cmd = win32com.client.Dispatch("ADODB.Command")
          self.cmd.ActiveConnection = self.conn
          self.rs = win32com.client.Dispatch("ADODB.Recordset")
          self.oParser = Parser()
          self.main.button1.Bind(wx.EVT_BUTTON, self.OnBuscar)
          self.main.button2.Bind(wx.EVT_BUTTON, self.OnBuscarEnd)
          self.main.statusBar = wx.StatusBar(self.main, -1)
          self.main.statusBar.SetFieldsCount(1)
          self.main.SetStatusBar(self.main.statusBar)
          self.main.statusBar.SetStatusText("Digite o CEP a ser consultado")

          self.main.Show()
          self.SetTopWindow(self.main)
          return True

        except Exception, e:
          print("Erro ao conectar com banco de dados! - "+str(e.args))
          sys.exit(2)
Example #28
0
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title="Export fit to EVE", pos=wx.DefaultPosition,
                          size=(wx.Size(350, 100)), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.mainFrame = parent
        self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))

        mainSizer = wx.BoxSizer(wx.VERTICAL)
        hSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.charChoice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [])
        hSizer.Add(self.charChoice, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
        self.updateCharList()
        self.charChoice.SetSelection(0)

        self.exportBtn = wx.Button(self, wx.ID_ANY, "Export Fit", wx.DefaultPosition, wx.DefaultSize, 5)
        hSizer.Add(self.exportBtn, 0, wx.ALL, 5)

        mainSizer.Add(hSizer, 0, wx.EXPAND, 5)

        self.exportBtn.Bind(wx.EVT_BUTTON, self.exportFitting)

        self.statusbar = wx.StatusBar(self)
        self.statusbar.SetFieldsCount(2)
        self.statusbar.SetStatusWidths([100, -1])

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

        self.SetSizer(mainSizer)
        self.SetStatusBar(self.statusbar)
        self.Layout()

        self.Centre(wx.BOTH)
    def __init__(self, ):
        wx.Frame.__init__(self, None, -1, 'CanvasFrame', size=(550, 350))

        self.figure = Figure()
        self.axes = self.figure.add_subplot(111)
        t = np.arange(0.0, 3.0, 0.01)
        s = np.sin(2 * np.pi * t)

        self.axes.plot(t, s)
        self.axes.set_xlabel('t')
        self.axes.set_ylabel('sin(t)')
        self.figure_canvas = FigureCanvas(self, -1, self.figure)

        # Note that event is a MplEvent
        self.figure_canvas.mpl_connect('motion_notify_event',
                                       self.UpdateStatusBar)
        self.figure_canvas.Bind(wx.EVT_ENTER_WINDOW, self.ChangeCursor)

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.figure_canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
        self.SetSizer(self.sizer)
        self.Fit()

        self.statusBar = wx.StatusBar(self, -1)
        self.SetStatusBar(self.statusBar)

        self.toolbar = NavigationToolbar2Wx(self.figure_canvas)
        self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
        self.toolbar.Show()
Example #30
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self,
                          id=wxID_FRAME1,
                          name='',
                          parent=prnt,
                          pos=wx.Point(361, 246),
                          size=wx.Size(613, 436),
                          style=wx.DEFAULT_FRAME_STYLE,
                          title='Notebook')
        self._init_utils()
        self.SetClientSize(wx.Size(605, 402))
        self.SetMenuBar(self.menuBar1)

        self.statusBar1 = wx.StatusBar(id=wxID_FRAME1STATUSBAR1,
                                       name='statusBar1',
                                       parent=self,
                                       style=0)
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

        self.textEditor = wx.TextCtrl(id=wxID_FRAME1TEXTEDITOR,
                                      name='textEditor',
                                      parent=self,
                                      pos=wx.Point(0, 0),
                                      size=wx.Size(605, 359),
                                      style=wx.TE_MULTILINE,
                                      value='')