我们从Python开源项目中,提取了以下48个代码示例,用于说明如何使用wx.DEFAULT_FRAME_STYLE。
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Encrypted Files", pos = wx.DefaultPosition, size = wx.Size( 600,400 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) BodySizer = wx.BoxSizer( wx.VERTICAL ) self.m_panel4 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) TextCtrlSizer = wx.BoxSizer( wx.VERTICAL ) self.EncryptedFilesTextCtrl = wx.TextCtrl( self.m_panel4, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY ) TextCtrlSizer.Add( self.EncryptedFilesTextCtrl, 1, wx.ALL|wx.EXPAND, 5 ) self.m_panel4.SetSizer( TextCtrlSizer ) self.m_panel4.Layout() TextCtrlSizer.Fit( self.m_panel4 ) BodySizer.Add( self.m_panel4, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( BodySizer ) self.Layout() self.Centre( wx.BOTH )
def OnInit(self): frame = wx.Frame(None, -1, "RunDemo: ", pos=(0,0), style=wx.DEFAULT_FRAME_STYLE, name="run a sample") menuBar = wx.MenuBar() menu = wx.Menu() item = menu.Append(wx.ID_EXIT, "E&xit", "Exit demo") self.Bind(wx.EVT_MENU, self.OnExitApp, item) menuBar.Append(menu, "&File") frame.SetMenuBar(menuBar) frame.Show(True) frame.Bind(wx.EVT_CLOSE, self.OnCloseFrame) win = runTest(frame) # set the frame to a good size for showing the two buttons frame.SetSize((200,400)) win.SetFocus() self.window = win frect = frame.GetRect() self.SetTopWindow(frame) self.frame = frame return True
def __init__(self, parent, id, title, size,style): self.parent = parent self.screenSize = wx.DisplaySize() #self.screenSize = [ 786, 768 ] self.screenWidth = int(self.screenSize[0] / 3) self.screenHeight = int(self.screenSize[1] / 2) #fontsy = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPixelSize() wx.Frame.__init__(self, parent, id, title, size=(400, 600), style=wx.DEFAULT_FRAME_STYLE) try: dosiero = open(os.path.join(os.path.expanduser("~"), '.config', 'stopgo.conf.json')) myprefs = json.load(dosiero) except: #print("No config found.") #DEBUG pass self.InitUI(myprefs) self.Show()
def __init__(self,title): super(Frame,self).__init__(None,-1,title,style=wx.DEFAULT_FRAME_STYLE^wx.MAXIMIZE_BOX^wx.RESIZE_BORDER) self.colors = {0:(204,192,179),2:(238, 228, 218),4:(237, 224, 200),8:(242, 177, 121),16:(245, 149, 99),32:(246, 124, 95),64:(246, 94, 59),128:(237, 207, 114),256:(237, 207, 114),512:(237, 207, 114),1024:(237, 207, 114),2048:(237, 207, 114),4096:(237, 207, 114),8192:(237, 207, 114),16384:(237, 207, 114),32768:(237, 207, 114),65536:(237, 207, 114),131072:(237, 207, 114),262144:(237, 207, 114),524288:(237, 207, 114),1048576:(237, 207, 114),2097152:(237, 207, 114),4194304:(237, 207, 114),8388608:(237, 207, 114),16777216:(237, 207, 114)}#????????? self.setIcon() self.initGame() self.initBuffer() panel = wx.Panel(self) #?????? #------???? panel.Bind(wx.EVT_KEY_DOWN,self.onKeyDown) panel.SetFocus() #????? self.Bind(wx.EVT_SIZE,self.onSize) #use wx.BufferedPaintDC self.Bind(wx.EVT_PAINT,self.onPaint) self.Bind(wx.EVT_CLOSE,self.onClose) #???? #------ self.SetClientSize((505,720)) #?????? self.Center() #????? self.Show()
def OnPreviewMenu(self, event): selected = self.TabsOpened.GetSelection() if selected != -1: window = self.TabsOpened.GetPage(selected) data = wx.PrintDialogData(self.PrintData) properties = self.Controler.GetProjectProperties(window.IsDebugging()) page_size = map(int, properties["pageSize"]) margins = (self.PageSetupData.GetMarginTopLeft(), self.PageSetupData.GetMarginBottomRight()) printout = GraphicPrintout(window, page_size, margins, True) printout2 = GraphicPrintout(window, page_size, margins, True) preview = wx.PrintPreview(printout, printout2, data) if preview.Ok(): preview_frame = wx.PreviewFrame(preview, self, _("Print preview"), style=wx.DEFAULT_FRAME_STYLE | wx.FRAME_FLOAT_ON_PARENT) preview_frame.Initialize() preview_canvas = preview.GetCanvas() preview_canvas.SetMinSize(preview_canvas.GetVirtualSize()) preview_frame.Fit() preview_frame.Show(True)
def __init__(self, *args, **kwds): # begin wxGlade: secret_win.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, -1, "School Name") self.text_ctrl_1 = wx.TextCtrl(self, -1, "") self.label_2 = wx.StaticText(self, -1, "School Code") self.text_ctrl_2 = wx.TextCtrl(self, -1, "") self.button_1 = wx.Button(self, -1, "Save") self.DB=db_operations() self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.on_save, self.button_1) self.on_load() self.Center() # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: disclaimer_win.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, wx.ID_ANY, ("Disclaimer")) self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP) self.button_disagree = wx.Button(self, wx.ID_ANY, ("Disagree")) self.button_agree = wx.Button(self, wx.ID_ANY, ("I agree")) self.text=''' This SOFTWARE PRODUCT is a an open source free software distributed with GPL 3 License. Your are free to modify it subject to the conditions laid in the license. It is also stated that the software is provided "as is" and "with all faults." THE developer makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of this SOFTWARE PRODUCT. There are inherent dangers in the use of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT is compatible with your equipment and and suits your needs. You are also solely responsible for the protection of your equipment and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, modifying, or distributing this SOFTWARE PRODUCT.''' self.__set_properties() self.__do_layout() self.agree=False self.Bind(wx.EVT_BUTTON, self.on_disagree, self.button_disagree) self.Bind(wx.EVT_BUTTON, self.on_agree, self.button_agree) # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: ChatFrameGui.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.panel_2 = wx.Panel(self, -1, style=wx.RAISED_BORDER|wx.TAB_TRAVERSAL) self.panel_1 = wx.Panel(self, -1, style=wx.RAISED_BORDER|wx.TAB_TRAVERSAL) self.panel_3 = wx.Panel(self.panel_1, -1) self.panel_4 = wx.Panel(self.panel_1, -1) self.frmMain_statusbar = self.CreateStatusBar(1) self.lblIpAddress = wx.StaticText(self.panel_4, -1, "IP &Address") self.edtIPAddress = wx.TextCtrl(self.panel_4, -1, "127.0.0.1") self.spnConnectPort = wx.SpinCtrl(self.panel_4, -1, "8080", min=1, max=65535, style=wx.SP_ARROW_KEYS|wx.SP_WRAP) self.btnConnect = wx.ToggleButton(self.panel_4, -1, "&Connect") self.lblListenPort = wx.StaticText(self.panel_3, -1, "Listen &on port") self.spnListenPort = wx.SpinCtrl(self.panel_3, -1, "8080", min=1, max=65535, style=wx.SP_ARROW_KEYS|wx.SP_WRAP) self.btnListen = wx.ToggleButton(self.panel_3, -1, "Lis&ten") self.lblReceived = wx.StaticText(self.panel_1, -1, "Received") self.edtReceived = wx.TextCtrl(self.panel_1, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH2|wx.TE_AUTO_URL) self.lblSent = wx.StaticText(self.panel_1, -1, "Sent:") self.edtSent = wx.TextCtrl(self.panel_1, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH2|wx.TE_AUTO_URL) self.edtToSend = wx.TextCtrl(self.panel_2, -1, "") self.btnSend = wx.Button(self.panel_2, -1, "&Send") self.btnClose = wx.Button(self.panel_2, -1, "&Close") self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, size=(700, 650), style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE) self._config = FlashConfig.load(self._get_config_file_path()) self._build_status_bar() self._set_icons() self._build_menu_bar() self._init_ui() sys.stdout = RedirectText(self.console_ctrl) self.SetMinSize((640, 480)) self.Centre(wx.BOTH) self.Show(True)
def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, style=wx.DEFAULT_FRAME_STYLE) self.SetSize((300, 123)) self.SetBackgroundColour('#d4d4d4')#windows self.SetTitle("No Project") self.parent = parent self.InitUI()
def Pref(self,e): logging.exception('INFO: PrefProbe triggered.') pref.PrefProbe() pref.GUIPref(None, -1, 'Stopgo Preferences', (self.screenWidth/2, self.screenHeight/2), wx.DEFAULT_FRAME_STYLE) self.prefdate = 1
def main(opts): app = wx.App(False) window = GUI(None, id=1, title="stopgo", style=wx.DEFAULT_FRAME_STYLE | wx.FULL_REPAINT_ON_RESIZE, clargs=opts) window.Show() app.MainLoop() return True
def init_gl(self): print('creating Frame') self.window = wx.Frame ( parent=None, id=wx.ID_ANY, title=self.title, style=wx.DEFAULT_FRAME_STYLE|wx.WS_EX_PROCESS_IDLE ) print('creating GLCanvas') self.canvas = glcanvas.GLCanvas ( self.window, glcanvas.WX_GL_RGBA ) print('creating GLContext') self.context = glcanvas.GLContext(self.canvas) self.canvas.SetFocus() self.window.SetSize ( (self.renderer.window_size[0], self.renderer.window_size[1]) ) print('showing Frame') self.window.Show(True) print('calling SetTopWindow') self.SetTopWindow(self.window) self.Bind ( wx.EVT_CHAR, self.OnChar ) self.canvas.Bind ( wx.EVT_SIZE, self.OnCanvasSize ) self.canvas.Bind ( wx.EVT_PAINT, self.OnCanvasPaint ) wx.IdleEvent.SetMode ( wx.IDLE_PROCESS_SPECIFIED ) self.Bind ( wx.EVT_IDLE, self.OnIdle ) print('making context current') self.canvas.SetCurrent ( self.context ) self.renderer.init_gl()
def __init__(self, parent, title): style = wx.DEFAULT_FRAME_STYLE & ~( wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX|wx.CLOSE_BOX) wx.Frame.__init__(self, parent, title=title, style=style, size=(400,60)) self.textbox = wx.TextCtrl(self) img = wx.Image("matags.png", wx.BITMAP_TYPE_ANY) bmp = wx.Bitmap(img) self.icon = wx.Icon() self.icon.CopyFromBitmap(bmp) self.SetIcon(self.icon) self.tbIcon = wx.adv.TaskBarIcon() self.tbIcon.SetIcon(self.icon) self.Show(True) self.Centre() self.reg_hot_keys() self.Bind(wx.EVT_HOTKEY, self.on_extract_tag, id=self.hotkeys['extract_tag'][0]) self.Bind(wx.EVT_HOTKEY, self.on_close, id=self.hotkeys['quit'][0]) self.Bind(wx.EVT_HOTKEY, self.on_activate, id=self.hotkeys['activate'][0]) self.Bind(wx.EVT_HOTKEY, self.on_refresh, id=self.hotkeys['refresh'][0]) self.textbox.Bind(wx.EVT_CHAR, self.check_key) # do not use EVT_KEY_DOWN, # it becomes difficult to get lower case # self.textbox.Bind(wx.EVT_KEY_DOWN, self.check_key) # self.Bind(wx.EVT_CLOSE, self.on_close) self.Bind(wx.EVT_ICONIZE, self.on_iconify) self.matags = MaTags() # try: # except Exception as e: # self.textbox.ChangeValue(e.args[0].decode('utf8', 'ignore')) # self.textbox.Disable()
def __init__(self, parent, agwStyle=aui.AUI_NB_TOP | aui.AUI_NB_TAB_SPLIT): aui.AuiNotebook.__init__(self, parent=parent, agwStyle=agwStyle | aui.AUI_NB_TAB_FLOAT) #def FloatPage(self, page_index): # pageTitle = self.GetPageText(page_index) # pageContents = self.GetPage(page_index) # frame = wx.Frame(self, title=pageTitle, # size=self.GetClientSize(), # style=wx.DEFAULT_FRAME_STYLE) # self.RemovePage(page_index) # pageContents.Reparent(frame) # frame.Bind(wx.EVT_CLOSE, self.closeFloatPage) # frame.Move(wx.GetMousePosition()) # frame.Show() #def closeFloatPage(self, event): # self.floated = False # event.Skip() # frame = event.GetEventObject() # pageTitle = frame.GetTitle() # pageContents = frame.GetChildren()[0] # pageContents.Reparent(self) # self.AddPage(pageContents, pageTitle, select=True)
def FloatPage(self, page_index): root_manager = aui.GetManager(self) page_title = self.GetPageText(page_index) page_contents = self.GetPage(page_index) page_bitmap = self.GetPageBitmap(page_index) text_colour = self.GetPageTextColour(page_index) info = self.GetPageInfo(page_index) frame = FloatingFrame(self, title=page_title, size=self.GetClientSize(), # request add to standard AuiNotebook? XXX - idfah style=wx.DEFAULT_FRAME_STYLE) #style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_TOOL_WINDOW| # wx.FRAME_FLOAT_ON_PARENT | wx.FRAME_NO_TASKBAR) if info.control: info.control.Reparent(frame) info.control.Hide() frame.bitmap = page_bitmap frame.page_index = page_index frame.text_colour = text_colour frame.control = info.control page_contents.Reparent(frame) frame.Bind(wx.EVT_CLOSE, self.OnCloseFloatingPage) frame.Move(wx.GetMousePosition()) frame.Show() page_contents.SetFocus() self.RemovePage(page_index) self.RemoveEmptyTabFrames() wx.CallAfter(self.RemoveEmptyTabFrames) #def FloatPage(self, page_index): # page_contents = self.GetPage(page_index) # size = page_contents.GetSize() # aui.AuiNotebook.FloatPage(self, page_index) # page_contents.GetParent().SetSize(size)
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 1200,800 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.Layout() self.Centre( wx.BOTH )
def __init__(self, parent=None): wx.Frame.__init__(self,parent,style=wx.DEFAULT_FRAME_STYLE | wx.RESIZE_BORDER) self.init_db() self.init_ui() self.SetTitle('Card Viewer') #self.SetClientSize((-1,311)) self.Fit() self.Centre() self.Show(True)
def _init_ctrls(self, prnt): wx.Frame.__init__(self, id=ID_HTMLFRAME, name='HtmlFrame', parent=prnt, pos=wx.Point(320, 231), size=wx.Size(853, 616), style=wx.DEFAULT_FRAME_STYLE, title='') self.SetIcon(prnt.icon) self.Bind(wx.EVT_CLOSE, self.OnCloseFrame) self.HtmlContent = UrlClickHtmlWindow(id=ID_HTMLFRAMEHTMLCONTENT, name='HtmlContent', parent=self, pos=wx.Point(0, 0), size=wx.Size(-1, -1), style=wx.html.HW_SCROLLBAR_AUTO | wx.html.HW_NO_SELECTION) self.HtmlContent.Bind(HtmlWindowUrlClick, self.OnLinkClick)
def __init__(self, parent, title='Frame3D', manager=None): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = title, pos = wx.DefaultPosition, size = wx.Size( 800,600 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) sizer = wx.BoxSizer( wx.VERTICAL ) root = os.path.abspath(os.path.dirname(__file__)) self.SetIcon(wx.Icon(os.path.join(root, 'imgs/logo.ico'), wx.BITMAP_TYPE_ICO)) self.viewer = canvas3d.Viewer3D( self , manager) sizer.Add( self.viewer, 1, wx.EXPAND |wx.ALL, 0 ) self.Bind(wx.EVT_CLOSE, self.on_closing) self.SetSizer( sizer ) self.Layout() self.Centre( wx.BOTH )
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.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) 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)) self.SetSizeHints( wx.Size( 600,-1 ), wx.DefaultSize ) IPy.curapp = self # Todo:Fixed absolute/relative path! # print("menuspath:{}".format( os.path.join(root_dir,"menus"))) # print("toolspath:{}".format(os.path.join(root_dir,"tools")) # menuspath = os.path.join(root_dir, "menus") # toolspath = os.path.join(root_dir,"tools") self.menubar = pluginloader.buildMenuBarByPath(self, 'menus') 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') #self.toolbar.Realize() #sizertool.Add(self.toolbar, 1, 0, 5 ) #sizertool.Add(self.morebar, 0, 0, 5) sizer.Add(self.toolbar, 0, wx.EXPAND, 5 ) #sizer.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.line_color = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) #self.line_color.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) ) sizer.AddStretchSpacer(prop=1) sizer.Add(self.line_color, 0, wx.EXPAND |wx.ALL, 0 ) 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()) sizer.Add(stapanel, 0, wx.EXPAND, 5 ) self.SetSizer( sizer ) self.Centre( wx.BOTH ) self.Layout() self.Fit() self.update = False self.Bind(wx.EVT_CLOSE, self.on_close) thread = threading.Thread(None, self.hold, ()) thread.setDaemon(True) thread.start()
def __init__( self, parent,): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'Plugin List', pos = wx.DefaultPosition, size = wx.Size( 612,500 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) 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)) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) bSizer2 = wx.BoxSizer( wx.HORIZONTAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, "Search:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) bSizer2.Add( self.m_staticText1, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.txt_search = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer2.Add( self.txt_search, 1, wx.ALL, 5 ) bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 ) self.lst_plgs = VirtualListCtrl( self, ['Name', 'Location']) self.lst_plgs.SetColumnWidth(0,200) self.lst_plgs.SetColumnWidth(1,400) bSizer1.Add( self.lst_plgs, 1, wx.ALL|wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.txt_search.Bind( wx.EVT_TEXT, self.on_search ) self.lst_plgs.Bind( wx.EVT_LIST_ITEM_ACTIVATED, self.on_run ) self.load()
def __init__( self ): wx.Frame.__init__( self, None, wx.ID_ANY, style=wx.DEFAULT_FRAME_STYLE, name="MWScore Server" ) # MWScore ScoreServer. self.ScoreServer = MWScore.ScoreServer() # Menu Bar self.MenuBar = wx.MenuBar() self.FileMenu = wx.Menu() self.TransponderMenu = wx.Menu() self.SocketMenu = wx.Menu() self.MatchMenu = wx.Menu() self.FileMenu.Append( self.ID_QUIT, "Quit" ) self.Bind( wx.EVT_MENU, self.Quit, id=self.ID_QUIT ) self.TransponderMenu.Append( self.ID_TRANSPONDERSETUP, "Setup" ) self.Bind( wx.EVT_MENU, self.TransponderSetup, id=self.ID_TRANSPONDERSETUP ) self.SocketMenu.Append( self.ID_SOCKETSETUP, "Setup" ) self.Bind( wx.EVT_MENU, self.SocketSetup, id=self.ID_SOCKETSETUP ) self.MatchMenu.Append( self.ID_MATCHSETUP, "Setup" ) self.MatchMenu.Append( self.ID_MATCHSTART, "Start/Resume" ) self.MatchMenu.Append(self.ID_MATCHPAUSE, "Pause" ) self.MatchMenu.Append(self.ID_MATCHRESET, "Reset" ) self.MatchMenu.Append(self.ID_MATCHRESETHP, "Reset HP" ) self.Bind( wx.EVT_MENU, self.MatchSetup, id=self.ID_MATCHSETUP ) self.Bind( wx.EVT_MENU, self.MatchStart, id=self.ID_MATCHSTART ) self.Bind( wx.EVT_MENU, self.MatchPause, id=self.ID_MATCHPAUSE ) self.Bind( wx.EVT_MENU, self.MatchReset, id=self.ID_MATCHRESET ) self.Bind( wx.EVT_MENU, self.MatchResetHP, id=self.ID_MATCHRESETHP ) self.MenuBar.Append( self.FileMenu, "&File" ) self.MenuBar.Append( self.MatchMenu, "&Match" ) self.MenuBar.Append( self.TransponderMenu, "&Transponder" ) self.MenuBar.Append( self.SocketMenu, "&Socket" ) self.SetMenuBar( self.MenuBar ) # Panel self.Panel = MatchPanel( self, -1 ) # Frame Update Timer self.Timer = wx.Timer( self, self.FRAME_UPDATE_TIMER_ID ) self.Timer.Start(100) wx.EVT_TIMER( self, self.FRAME_UPDATE_TIMER_ID, self.OnTimer ) self.Show( True ) self.SetTitle("Mech Warfare Match Score") # Updates the frames panel and Broadcasts match data to clients
def __init__( self ): wx.Frame.__init__( self, None, wx.ID_ANY, "MWCam", style=wx.DEFAULT_FRAME_STYLE & ~wx.RESIZE_BORDER ) # Socket Cleint self.SocketClient = MWScore.SocketClient( SOCKET_CLIENT_HOST, SOCKET_CLIENT_PORT ) self.SocketClient.StartThread() # IP Camera #self.Camera = Trendnet( CAMERA_IP, CAMERA_USERNAME, CAMERA_PASSWORD ) self.Camera = DLink( CAMERA_IP, CAMERA_USERNAME, CAMERA_PASSWORD ) self.Camera.Connect() # Camera Panel self.CameraPanel = CameraPanel( self, self.Camera, self.SocketClient ) # Frame timer self.Timer = wx.Timer( self, self.ID_FRAME_REFRESH ) self.Timer.Start(10) wx.EVT_TIMER( self, self.ID_FRAME_REFRESH, self.Refresh ) # Frame Sizer self.Sizer = None self.Size() # Show frame self.Show( True )
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"Background Task", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) sizer = wx.BoxSizer(wx.VERTICAL) gb_sizer = wx.GridBagSizer(5, 5) gb_sizer.SetFlexibleDirection(wx.BOTH) gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.gauge = wx.Gauge(self, wx.ID_ANY, 10 ** 3, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL) self.gauge.SetValue(0) gb_sizer.Add(self.gauge, wx.GBPosition(0, 0), wx.GBSpan(1, 1), wx.EXPAND, 0) self.button = wx.Button(self, wx.ID_ANY, u"Run", wx.DefaultPosition, wx.DefaultSize, 0) gb_sizer.Add(self.button, wx.GBPosition(1, 0), wx.GBSpan(1, 1), wx.EXPAND, 0) gb_sizer.AddGrowableCol(0) sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) # Connect Events self.button.Bind(wx.EVT_BUTTON, self.on_run) self.model = WatchableDict() self.model["complete"] = 0 pywatch.wx.ValueWatcher(self.gauge, self.model, "complete") # Virtual event handlers, overide them in your derived class
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"Background Logging", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) sizer = wx.BoxSizer(wx.VERTICAL) gb_sizer = wx.GridBagSizer(5, 5) gb_sizer.SetFlexibleDirection(wx.BOTH) gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) list_boxChoices = [] self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, list_boxChoices, 0) gb_sizer.Add(self.list_box, wx.GBPosition(0, 0), wx.GBSpan(1, 1), wx.EXPAND, 0) self.button = wx.Button(self, wx.ID_ANY, u"Run", wx.DefaultPosition, wx.DefaultSize, 0) gb_sizer.Add(self.button, wx.GBPosition(1, 0), wx.GBSpan(1, 1), wx.EXPAND, 0) gb_sizer.AddGrowableCol(0) gb_sizer.AddGrowableRow(0) sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) # Connect Events self.button.Bind(wx.EVT_BUTTON, self.on_run) self.model = WatchableDict() self.model["logs"] = [] pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "logs") # Virtual event handlers, overide them in your derived class
def __init__(self, *args, **kwds): # begin wxGlade: MyFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.bitmap_1 = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap("/home/john/Pictures/jasper gui jarvis/jarvisrotator.png", wx.BITMAP_TYPE_ANY)) self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, *args, **kwds): self.serial = serial.Serial() self.serial.timeout = 0.5 # make sure that the alive event can be checked from time to time self.settings = TerminalSetup() # placeholder for the settings self.thread = None self.alive = threading.Event() # begin wxGlade: TerminalFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) # Menu Bar self.frame_terminal_menubar = wx.MenuBar() wxglade_tmp_menu = wx.Menu() wxglade_tmp_menu.Append(ID_CLEAR, "&Clear", "", wx.ITEM_NORMAL) wxglade_tmp_menu.Append(ID_SAVEAS, "&Save Text As...", "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendSeparator() wxglade_tmp_menu.Append(ID_TERM, "&Terminal Settings...", "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendSeparator() wxglade_tmp_menu.Append(ID_EXIT, "&Exit", "", wx.ITEM_NORMAL) self.frame_terminal_menubar.Append(wxglade_tmp_menu, "&File") wxglade_tmp_menu = wx.Menu() wxglade_tmp_menu.Append(ID_RTS, "RTS", "", wx.ITEM_CHECK) wxglade_tmp_menu.Append(ID_DTR, "&DTR", "", wx.ITEM_CHECK) wxglade_tmp_menu.Append(ID_SETTINGS, "&Port Settings...", "", wx.ITEM_NORMAL) self.frame_terminal_menubar.Append(wxglade_tmp_menu, "Serial Port") self.SetMenuBar(self.frame_terminal_menubar) # Menu Bar end self.text_ctrl_output = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_MENU, self.OnClear, id=ID_CLEAR) self.Bind(wx.EVT_MENU, self.OnSaveAs, id=ID_SAVEAS) self.Bind(wx.EVT_MENU, self.OnTermSettings, id=ID_TERM) self.Bind(wx.EVT_MENU, self.OnExit, id=ID_EXIT) self.Bind(wx.EVT_MENU, self.OnRTS, id=ID_RTS) self.Bind(wx.EVT_MENU, self.OnDTR, id=ID_DTR) self.Bind(wx.EVT_MENU, self.OnPortSettings, id=ID_SETTINGS) # end wxGlade self.__attach_events() # register events self.OnPortSettings(None) # call setup dialog on startup, opens port if not self.alive.isSet(): self.Close()
def __init__(self, *args, **kwds): self.serial = serial.Serial() self.serial.timeout = 0.5 #make sure that the alive event can be checked from time to time self.settings = TerminalSetup() #placeholder for the settings self.thread = None self.alive = threading.Event() # begin wxGlade: TerminalFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.text_ctrl_output = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY) # Menu Bar self.frame_terminal_menubar = wx.MenuBar() self.SetMenuBar(self.frame_terminal_menubar) wxglade_tmp_menu = wx.Menu() wxglade_tmp_menu.Append(ID_CLEAR, "&Clear", "", wx.ITEM_NORMAL) wxglade_tmp_menu.Append(ID_SAVEAS, "&Save Text As...", "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendSeparator() wxglade_tmp_menu.Append(ID_SETTINGS, "&Port Settings...", "", wx.ITEM_NORMAL) wxglade_tmp_menu.Append(ID_TERM, "&Terminal Settings...", "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendSeparator() wxglade_tmp_menu.Append(ID_EXIT, "&Exit", "", wx.ITEM_NORMAL) self.frame_terminal_menubar.Append(wxglade_tmp_menu, "&File") # Menu Bar end self.__set_properties() self.__do_layout() # end wxGlade self.__attach_events() #register events self.OnPortSettings(None) #call setup dialog on startup, opens port if not self.alive.isSet(): self.Close()
def __init__( self, parent=None, id=-1, title=_("Run Snake Run"), pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN, name= _("RunSnakeRun"), ): """Initialise the Frame""" wx.Frame.__init__(self, parent, id, title, pos, size, style, name) # TODO: toolbar for back, up, root, directory-view, percentage view self.adapter = PStatsAdapter() self.CreateControls() self.history = [] # set of (activated_node, selected_node) pairs...
def __init__(self): """Constructor""" wx.Frame.__init__(self, None, title="Default Frame", style=wx.DEFAULT_FRAME_STYLE) panel = wx.Panel(self) self.Show()
def __init__(self): """Constructor""" on_top = wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP wx.Frame.__init__(self, None, title="Stay on top", style=on_top) panel = wx.Panel(self) self.Show()
def __init__(self): """Constructor""" no_resize = wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX) wx.Frame.__init__(self, None, title="No Resize", style=no_resize) panel = wx.Panel(self) self.Show()
def __init__(self, parent, id, title, style, clargs): if _plat.startswith('win'): HANDLER = logging.handlers.WatchedFileHandler(os.environ.get("LOGFILE", os.path.join(os.path.expanduser('~'), 'stopgo.log'))) else: HANDLER = logging.handlers.WatchedFileHandler(os.environ.get("LOGFILE", os.path.join('/','tmp','stopgo.log'))) FORMATTER = logging.Formatter(logging.BASIC_FORMAT) HANDLER.setFormatter(FORMATTER) if not clargs.has_key('verbose'): root = logging.getLogger() root.setLevel(os.environ.get("LOGLEVEL", "INFO")) root.addHandler(HANDLER) logging.exception("Debugging on.") #First retrieve the screen size of the device self.screenSize = wx.DisplaySize() self.framlog = 0 self.thumbsize = 180 self.camset = 0 self.prefdate = 0 prefstr = pref.PrefProbe().PrefGet() logging.exception(prefstr) logging.exception(type(prefstr)) self.myprefs = prefstr #self.myprefs = json.dumps(prefstr, sort_keys=True) #self.screenSize = [ 786, 768 ] self.screenWidth = int(self.screenSize[0]) self.screenHeight = int(self.screenSize[1]) #self.screenWidth = int(self.screenSize[0] / 3) #self.screenHeight = int(self.screenSize[1] / 1.5) self.hasSelected = False self.previous = 0 #fontsy = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPixelSize() wx.Frame.__init__(self, parent, id, title, size=(self.screenWidth, self.screenHeight), style=wx.DEFAULT_FRAME_STYLE) self.timer = wx.Timer(self, ID_TIMER) self.blick = 0 self.Bind(wx.EVT_TIMER, self.OnTimer, id=ID_TIMER) self.Bind(wx.EVT_CHAR_HOOK, lambda event, args=(True, ):self.OnKeyDown(event, args)) self.clargs = clargs logging.exception(prefstr) self.InitUI()
def __init__(self, parent, title): """Create the pydicom image example's main frame window.""" wx.Frame.__init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, size=wx.Size(w=1024, h=768), style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN) # -------------------------------------------------------- # Set up the menubar. # -------------------------------------------------------- self.mainmenu = wx.MenuBar() # Make the 'File' menu. menu = wx.Menu() item = menu.Append(wx.ID_ANY, '&Open', 'Open file for editing') self.Bind(wx.EVT_MENU, self.OnFileOpen, item) item = menu.Append(wx.ID_ANY, 'E&xit', 'Exit Program') self.Bind(wx.EVT_MENU, self.OnFileExit, item) self.mainmenu.Append(menu, '&File') # Attach the menu bar to the window. self.SetMenuBar(self.mainmenu) # -------------------------------------------------------- # Set up the main splitter window. # -------------------------------------------------------- self.mainSplitter = wx.SplitterWindow(self, style=wx.NO_3D | wx.SP_3D) self.mainSplitter.SetMinimumPaneSize(1) # ------------------------------------------------------------- # Create the folderTreeView on the left. # ------------------------------------------------------------- self.dsTreeView = wx.TreeCtrl(self.mainSplitter, style=wx.TR_LINES_AT_ROOT | wx.TR_HAS_BUTTONS) # -------------------------------------------------------- # Create the ImageView on the right pane. # -------------------------------------------------------- self.imView = wx.Panel(self.mainSplitter, style=wx.VSCROLL | wx.HSCROLL | wx.CLIP_CHILDREN) self.imView.Bind(wx.EVT_PAINT, self.OnPaint) self.imView.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.imView.Bind(wx.EVT_SIZE, self.OnSize) # -------------------------------------------------------- # Install the splitter panes. # -------------------------------------------------------- self.mainSplitter.SplitVertically(self.dsTreeView, self.imView) self.mainSplitter.SetSashPosition(300, True) # -------------------------------------------------------- # Initialize some values # -------------------------------------------------------- self.dcmdsRoot = False self.foldersRoot = False self.loadCentered = True self.bitmap = None self.Show(True)
def __init__(self, parent=None): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) 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)) self.SetSizeHints( wx.Size( 560,-1 ), wx.DefaultSize ) WindowsManager.add(self) print('frame added') self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) self.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) sizer = wx.BoxSizer( wx.VERTICAL ) self.txt_info = wx.StaticText( self, wx.ID_ANY, '500*500 pixels 173k', wx.DefaultPosition, wx.DefaultSize, 0 ) self.txt_info.Wrap( -1 ) sizer.Add( self.txt_info, 0, wx.ALL, 0 ) self.canvas = Canvas(self) self.canvas.fit = self sizer.Add( self.canvas, 1, wx.EXPAND |wx.ALL, 0 ) self.page = wx.ScrollBar( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.SB_HORIZONTAL) self.page.SetScrollbar(0,0,0,0, refresh=True) sizer.Add( self.page, 0, wx.ALL|wx.EXPAND, 0 ) #self.page.Hide() self.SetSizer(sizer) self.Layout() self.Bind(wx.EVT_IDLE, self.on_idle) self.Bind(wx.EVT_SCROLL, self.on_scroll) self.Bind(wx.EVT_ACTIVATE, self.on_valid) self.Bind(wx.EVT_CLOSE, self.on_close) self.canvas.Bind(wx.EVT_CHAR, self.on_key) self.canvas.SetFocus() # panel.Bind(wx.EVT_CHAR, self.OnKeyDown) self.opage = 0 self.Fit() self.SetAcceleratorTable(IPy.curapp.shortcut)
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Plugins Tree", pos = wx.DefaultPosition, size = wx.Size( 452,300 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) 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)) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.HORIZONTAL ) self.tre_plugins = wx.TreeCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TR_DEFAULT_STYLE ) self.tre_plugins.SetMinSize( wx.Size( 200,-1 ) ) bSizer1.Add( self.tre_plugins, 0, wx.ALL|wx.EXPAND, 5 ) bSizer3 = wx.BoxSizer( wx.VERTICAL ) bSizer4 = wx.BoxSizer( wx.HORIZONTAL ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, "Plugin Infomation:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer4.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, "[SourceCode]", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) self.m_staticText3.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) ) bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 ) bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 ) self.txt_info = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE ) bSizer3.Add( self.txt_info, 1, wx.ALL|wx.EXPAND, 5 ) bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.tre_plugins.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.on_run ) self.tre_plugins.Bind( wx.EVT_TREE_SEL_CHANGED, self.on_select ) self.m_staticText3.Bind( wx.EVT_LEFT_DOWN, self.on_source ) self.plg = None self.load()
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Tools Tree", pos = wx.DefaultPosition, size = wx.Size( 452,300 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) 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)) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.HORIZONTAL ) self.tre_plugins = wx.TreeCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TR_DEFAULT_STYLE ) self.tre_plugins.SetMinSize( wx.Size( 200,-1 ) ) bSizer1.Add( self.tre_plugins, 0, wx.ALL|wx.EXPAND, 5 ) bSizer3 = wx.BoxSizer( wx.VERTICAL ) bSizer4 = wx.BoxSizer( wx.HORIZONTAL ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, "Tool Infomation:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer4.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, "[SourceCode]", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) self.m_staticText3.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) ) bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 ) bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 ) self.txt_info = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE ) bSizer3.Add( self.txt_info, 1, wx.ALL|wx.EXPAND, 5 ) bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.tre_plugins.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.on_run ) self.tre_plugins.Bind( wx.EVT_TREE_SEL_CHANGED, self.on_select ) self.m_staticText3.Bind( wx.EVT_LEFT_DOWN, self.on_source ) self.plg = None self.load()
def __init__(self, *args, **kwds): # begin wxGlade: sampoorna_win.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0) self.login_pane = wx.Panel(self.notebook_1, wx.ID_ANY) self.panel_login = wx.Panel(self.login_pane, wx.ID_ANY) self.label_1 = wx.StaticText(self.panel_login, wx.ID_ANY, _("Warning: Always backup your database before you proceed to avoid potential data loss !!!")) self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, _("This software does not save Sampoorna credentials. It is used for one time login")) self.panel_1 = wx.Panel(self.panel_login, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Username")) self.text_ctrl_user = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER) self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Password")) self.text_ctrl_passw = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PASSWORD | wx.NO_BORDER) self.button_next = wx.Button(self.panel_login, wx.ID_ANY, _("Next >>")) self.standard_pane = wx.Panel(self.notebook_1, wx.ID_ANY) self.panel_3 = wx.Panel(self.standard_pane, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL) self.checkbox_8 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("8 Standard")) self.checkbox_9 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("9 Standard")) self.checkbox_10 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("10 Standard")) self.button_next_copy_copy = wx.Button(self.standard_pane, wx.ID_ANY, _("<<Previous")) self.button_next_copy = wx.Button(self.standard_pane, wx.ID_ANY, _("Proceed >>")) self.report_pane = wx.Panel(self.notebook_1, wx.ID_ANY) self.panel_2 = wx.Panel(self.report_pane, wx.ID_ANY) self.label_7 = wx.StaticText(self.panel_2, wx.ID_ANY, _("Progress")) self.progresss_total = wx.TextCtrl(self.panel_2, wx.ID_ANY, "") self.progress_each = wx.TextCtrl(self.panel_2, wx.ID_ANY, "") self.label_satus = wx.StaticText(self.panel_2, wx.ID_ANY, _("Status")) self.text_ctrl_1 = wx.TextCtrl(self.panel_2, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL | wx.NO_BORDER) self.button_finished = wx.Button(self.panel_2, wx.ID_ANY, _("Finished")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_TEXT_ENTER, self.on_password_enter, self.text_ctrl_passw) self.Bind(wx.EVT_BUTTON, self.on_next, self.button_next) self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_8) self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_9) self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_10) self.Bind(wx.EVT_BUTTON, self.on_previous, self.button_next_copy_copy) self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_next_copy) self.Bind(wx.EVT_BUTTON, self.on_finished, self.button_finished) # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: sampoorna_win.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0) self.login_pane = wx.Panel(self.notebook_1, wx.ID_ANY) self.panel_login = wx.Panel(self.login_pane, wx.ID_ANY) self.label_1 = wx.StaticText(self.panel_login, wx.ID_ANY, _("Warning: Always backup your database before you proceed to avoid potential data loss !!!")) self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, _("This software does not save Sampoorna credentials. It is used for one time login")) self.panel_1 = wx.Panel(self.panel_login, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Username")) self.text_ctrl_user = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER) self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Password")) self.text_ctrl_passw = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PASSWORD | wx.NO_BORDER) self.button_next = wx.Button(self.panel_login, wx.ID_ANY, _("Next >>")) self.standard_pane = wx.Panel(self.notebook_1, wx.ID_ANY) self.panel_3 = wx.Panel(self.standard_pane, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL) self.checkbox_8 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("8 Standard")) self.checkbox_9 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("9 Standard")) self.checkbox_10 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("10 Standard")) self.button_previous = wx.Button(self.standard_pane, wx.ID_ANY, _("<<Previous")) self.button_proceed = wx.Button(self.standard_pane, wx.ID_ANY, _("Proceed >>")) self.report_pane = wx.Panel(self.notebook_1, wx.ID_ANY) self.panel_2 = wx.Panel(self.report_pane, wx.ID_ANY) self.label_7 = wx.StaticText(self.panel_2, wx.ID_ANY, _("Progress")) self.progresss_total = wx.Gauge(self.panel_2, wx.ID_ANY, range=100) self.progress_each = wx.Gauge(self.panel_2, wx.ID_ANY, range=100) self.label_satus = wx.StaticText(self.panel_2, wx.ID_ANY, _("Status")) self.list_ctrl_1 = wx.ListCtrl(self.panel_2, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_ALIGN_LEFT | wx.SUNKEN_BORDER | wx.NO_BORDER) self.button_finished = wx.Button(self.panel_2, wx.ID_ANY, _("Finished")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_passw) self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_user) self.Bind(wx.EVT_BUTTON, self.on_next, self.button_next) self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_8) self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_9) self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_10) self.Bind(wx.EVT_BUTTON, self.on_previous, self.button_previous) self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_proceed) self.Bind(wx.EVT_BUTTON, self.on_finished, self.button_finished) # create a pubsub receiver Publisher().subscribe(self.updateDisplay, "update") # end wxGlade
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"Selection Frame", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.model = WatchableDict() self.model["selection"] = 1 self.model["list"] = [u"One", u"Two", u"Three"] self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) sizer = wx.BoxSizer(wx.VERTICAL) gb_sizer = wx.GridBagSizer(5, 5) gb_sizer.SetFlexibleDirection(wx.BOTH) gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) choices = [] self.combo_box = wx.ComboBox(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, choices, 0) gb_sizer.Add(self.combo_box, wx.GBPosition(0, 0), wx.GBSpan(1, 1), wx.EXPAND, 5) pywatch.wx.ItemContainerItemWatcher(self.combo_box, self.model, "list") pywatch.wx.SelectionChanger(self.combo_box, self.model, "selection") self.choice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choices, 0) self.choice.SetSelection(0) gb_sizer.Add(self.choice, wx.GBPosition(1, 0), wx.GBSpan(1, 1), wx.EXPAND, 5) pywatch.wx.ItemContainerItemWatcher(self.choice, self.model, "list") pywatch.wx.SelectionChanger(self.choice, self.model, "selection") self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choices, 0) gb_sizer.Add(self.list_box, wx.GBPosition(2, 0), wx.GBSpan(1, 1), wx.EXPAND, 5) pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "list") pywatch.wx.SelectionChanger(self.list_box, self.model, "selection") self.radio_box = wx.RadioBox(self, wx.ID_ANY, u"Radio Box", wx.DefaultPosition, wx.DefaultSize, [u"One", u"Two", u"Three"], 1, wx.RA_SPECIFY_COLS) self.radio_box.SetSelection(0) gb_sizer.Add(self.radio_box, wx.GBPosition(3, 0), wx.GBSpan(1, 1), wx.EXPAND, 5) pywatch.wx.SelectionChanger(self.radio_box, self.model, "selection") gb_sizer.AddGrowableCol(0) gb_sizer.AddGrowableRow(2) sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH)
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"List Editor", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) sizer = wx.BoxSizer(wx.VERTICAL) gb_sizer = wx.GridBagSizer(5, 5) gb_sizer.SetFlexibleDirection(wx.BOTH) gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) list_boxChoices = [] self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, list_boxChoices, 0) gb_sizer.Add(self.list_box, wx.GBPosition(0, 0), wx.GBSpan(1, 2), wx.EXPAND, 0) self.add_button = wx.Button(self, wx.ID_ANY, u"Add", wx.DefaultPosition, wx.DefaultSize, 0) gb_sizer.Add(self.add_button, wx.GBPosition(1, 0), wx.GBSpan(1, 1), wx.EXPAND, 0) self.remove_button = wx.Button(self, wx.ID_ANY, u"Remove", wx.DefaultPosition, wx.DefaultSize, 0) gb_sizer.Add(self.remove_button, wx.GBPosition(1, 1), wx.GBSpan(1, 1), wx.EXPAND, 0) self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) gb_sizer.Add(self.text_ctrl, wx.GBPosition(2, 0), wx.GBSpan(1, 2), wx.EXPAND, 0) gb_sizer.AddGrowableCol(0) gb_sizer.AddGrowableCol(1) gb_sizer.AddGrowableRow(0) sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) self.add_button.Bind(wx.EVT_BUTTON, self.on_add) self.remove_button.Bind(wx.EVT_BUTTON, self.on_remove) self.model = WatchableDict() self.model["list"] = ["one", "two", "three", "four"] self.model["selection"] = 0 pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "list") pywatch.wx.SelectionChanger(self.list_box, self.model, "selection") def getter(): return self.model["list"][self.model["selection"]] def setter(value): self.model["list"][self.model["selection"]] = value pywatch.wx.ValueChanger(self.text_ctrl, self.model, ("list", "selection", setter, getter))
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"List Frame", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) sizer = wx.BoxSizer(wx.VERTICAL) gb_sizer = wx.GridBagSizer(5, 5) gb_sizer.SetFlexibleDirection(wx.BOTH) gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) list_boxChoices = [] self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, list_boxChoices, 0) gb_sizer.Add(self.list_box, wx.GBPosition(0, 0), wx.GBSpan(1, 2), wx.EXPAND, 0) combo_boxChoices = [] self.combo_box = wx.ComboBox(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, combo_boxChoices, 0) gb_sizer.Add(self.combo_box, wx.GBPosition(1, 0), wx.GBSpan(1, 2), wx.EXPAND, 0) choiceChoices = [] self.choice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choiceChoices, 0) self.choice.SetSelection(0) gb_sizer.Add(self.choice, wx.GBPosition(2, 0), wx.GBSpan(1, 2), wx.EXPAND, 0) self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER) gb_sizer.Add(self.text_ctrl, wx.GBPosition(3, 0), wx.GBSpan(1, 1), wx.EXPAND, 0) self.button = wx.Button(self, wx.ID_ANY, u"Add", wx.DefaultPosition, wx.DefaultSize, 0) gb_sizer.Add(self.button, wx.GBPosition(3, 1), wx.GBSpan(1, 1), wx.ALL, 0) gb_sizer.AddGrowableCol(0) gb_sizer.AddGrowableRow(0) sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(sizer) self.Layout() self.Centre(wx.BOTH) # Connect Events self.button.Bind(wx.EVT_BUTTON, self.on_add) self.text_ctrl.Bind(wx.EVT_TEXT_ENTER, self.on_add) self.model = WatchableDict() self.model["list"] = [] self.model["text"] = "" pywatch.wx.ValueChanger(self.text_ctrl, self.model, "text") pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "list") pywatch.wx.ItemContainerItemWatcher(self.choice, self.model, "list") pywatch.wx.ItemContainerItemWatcher(self.combo_box, self.model, "list") # Virtual event handlers, overide them in your derived class
def __init__(self, controller_uid): UIViewBase.__init__(self, controller_uid) wx.Frame.__init__(self, None, -1, title='LogPlotEditor', size=(950, 600), style=wx.DEFAULT_FRAME_STYLE & (~wx.RESIZE_BORDER) &(~wx.MAXIMIZE_BOX) ) main_sizer = wx.BoxSizer(wx.VERTICAL) self.base_panel = wx.Panel(self) self.note = wx.Notebook(self.base_panel) bsizer = wx.BoxSizer(wx.HORIZONTAL) bsizer.Add(self.note, 1, wx.ALL|wx.EXPAND, border=5) self.base_panel.SetSizer(bsizer) #UIM = UIManager() #UIM.create('lpe_track_panel_controller', self.uid) #parent_controller_uid = UIM._getparentuid(self._controller_uid) ''' tracks_base_panel = wx.Panel(note, style=wx.SIMPLE_BORDER) sizer_grid_panel = wx.BoxSizer(wx.VERTICAL) self.tracks_model = TracksModel(parent_controller_uid) tp = TracksPanel(tracks_base_panel, self.tracks_model) sizer_grid_panel.Add(tp, 1, wx.EXPAND|wx.ALL, border=10) tracks_base_panel.SetSizer(sizer_grid_panel) note.AddPage(tracks_base_panel, "Tracks", True) ''' ''' curves_base_panel = wx.Panel(note, style=wx.SIMPLE_BORDER) sizer_curves_panel = wx.BoxSizer(wx.VERTICAL) self.curves_model = CurvesModel(parent_controller_uid) cp = TrackObjectsPanel(curves_base_panel, self.curves_model) sizer_curves_panel.Add(cp, 1, wx.EXPAND|wx.ALL, border=10) curves_base_panel.SetSizer(sizer_curves_panel) note.AddPage(curves_base_panel, "Objects", True) ''' main_sizer.Add(self.base_panel, 1, wx.EXPAND) bottom_panel = wx.Panel(self) sizer = wx.BoxSizer(wx.VERTICAL) btn_close = wx.Button(bottom_panel, -1, "Close") sizer.Add(btn_close, 0, wx.ALIGN_RIGHT|wx.RIGHT|wx.BOTTOM, border=10) btn_close.Bind(wx.EVT_BUTTON, self.on_close) bottom_panel.SetSizer(sizer) main_sizer.Add(bottom_panel, 0, wx.EXPAND) self.SetSizer(main_sizer) class_full_name = str(self.__class__.__module__) + '.' + str(self.__class__.__name__) log.debug('Successfully created View object from class: {}.'.format(class_full_name)) self.Bind(wx.EVT_CLOSE, self.on_close)
def __init__(self, logplot, track_id=ID_ALL_TRACKS, logplotformat=None, ok_callback=None): self.logplot = logplot self.track_id = track_id self.welluid = self.logplot.get_well_uid() self._OM = ObjectManager(self) #well = self._OM.get(self.welluid) if logplotformat is None: logplotformat = LogPlotFormat() self.original_logplotformat = logplotformat self.edited_logplotformat = copy.deepcopy(self.original_logplotformat) wx.Frame.__init__(self, self.logplot, -1, title="Log Plot Format - TESTE", size=(850, 600), style=wx.DEFAULT_FRAME_STYLE & (~wx.RESIZE_BORDER) &(~wx.MAXIMIZE_BOX)) self.callback = ok_callback sizer = wx.BoxSizer(wx.VERTICAL) self.base = wx.Panel(self) note = wx.Notebook(self.base) bsizer = wx.BoxSizer(wx.HORIZONTAL) bsizer.Add(note, 1, wx.ALL|wx.EXPAND, border=5) self.base.SetSizer(bsizer) self.tracks_model = None self.curves_model = CurvesModel(self.edited_logplotformat, self.track_id) if self.track_id == self.ID_ALL_TRACKS: self.tracks_model = TracksModel(self.edited_logplotformat) tn = TracksNotifier(self.edited_logplotformat, self.curves_model) self.tracks_model.AddNotifier(tn) tn.SetOwner(self.tracks_model) self.grid_panel = BasePanel(note, 'grid', self.welluid, self.track_id, self.tracks_model) note.AddPage(self.grid_panel, "Grid", True) else: self.grid_panel = None if self.tracks_model is not None: cn = CurvesNotifier(self.edited_logplotformat, self.tracks_model) self.curves_model.AddNotifier(cn) cn.SetOwner(self.curves_model) self.curves_panel = BasePanel(note, 'curves', self.welluid, self.track_id, self.curves_model) note.AddPage(self.curves_panel, "Curves", False) note.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self._OnNotePageChanging) sizer.Add(self.base, 1, wx.EXPAND) sizer.Add(self.getPanelBottomButtons(), 0, wx.EXPAND|wx.BOTTOM|wx.TOP) self.SetSizer(sizer)
def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_TFRAME, name='TFrame', parent=prnt, pos=wx.Point(254, 241), size=wx.Size(829, 786), style=wx.DEFAULT_FRAME_STYLE, title=u'PAWS Terminal') self._init_utils() self.SetClientSize(wx.Size(821, 748)) self.SetMenuBar(self.TMenuBar) self.SetAutoLayout(True) self.SetToolTipString('TFrame') self.SetMinSize(wx.Size(-1, 21)) self.TStatusBar = wx.StatusBar(id=wxID_TFRAMETSTATUSBAR, name='TStatusBar', parent=self, style=0) self.TStatusBar.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'Courier New')) self._init_coll_TStatusBar_Fields(self.TStatusBar) self.SetStatusBar(self.TStatusBar) self.TInput = wx.TextCtrl(id=wxID_TFRAMETINPUT, name='TInput', parent=self, pos=wx.Point(1, 728), size=wx.Size(819, 20), style=wx.SIMPLE_BORDER | wx.TE_PROCESS_ENTER, value="''") self.TInput.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'Courier')) self.TInput.SetToolTipString(u'Type command here.') self.TInput.SetAutoLayout(False) self.TInput.SetEditable(True) self.TInput.Enable(False) self.TInput.Bind(wx.EVT_TEXT_ENTER, self.OnTInputTextEnter, id=wxID_TFRAMETINPUT) self.TDisplay = wx.TextCtrl(id=wxID_TFRAMETDISPLAY, name='TDisplay', parent=self, pos=wx.Point(0, 0), size=wx.Size(821, 728), style=wx.TE_RICH2 | wx.TE_MULTILINE | wx.TE_READONLY, value=u'To run a game, choose File ? Pick Game … then choose a game from the list.') self.TDisplay.SetMinSize(wx.Size(517, 440)) self.TDisplay.SetEditable(False) self.TDisplay.SetToolTipString(u"Game's output displays here.") self.TDisplay.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Arial')) self.TDisplay.Enable(True) self._init_sizers()