def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"DDL Creator Wizard", pos = wx.DefaultPosition, size = wx.Size( 923,704 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Welcome to the Data Definition Language (DDL) creator 1.0", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) self.m_staticText3.SetFont( wx.Font( 15, 70, 90, 92, False, wx.EmptyString ) ) bSizer1.Add( self.m_staticText3, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) gSizer5 = wx.GridSizer( 2, 1, 0, 0 ) self.m_staticText21 = wx.StaticText( self, wx.ID_ANY, u"Select the XML Database Schema ", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText21.Wrap( -1 ) self.m_staticText21.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 70, 90, 92, False, wx.EmptyString ) ) gSizer5.Add( self.m_staticText21, 0, wx.ALL, 5 ) self.m_filePicker2 = wx.FilePickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Select a file", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE ) gSizer5.Add( self.m_filePicker2, 0, wx.ALL|wx.EXPAND, 5 ) bSizer1.Add( gSizer5, 1, wx.EXPAND, 5 ) self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) bSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, u"Create sequential primary keys ?", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_checkBox1.SetValue(True) bSizer1.Add( self.m_checkBox1, 0, wx.ALL, 5 ) self.m_checkBox2 = wx.CheckBox( self, wx.ID_ANY, u"Check Me!", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.m_checkBox2, 0, wx.ALL, 5 ) self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) bSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 ) self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) bSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 ) self.m_checkBox6 = wx.CheckBox( self, wx.ID_ANY, u"SQLite Name:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_checkBox6.SetValue(True) bSizer1.Add( self.m_checkBox6, 0, wx.ALL, 5 ) self.m_textCtrl1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.m_textCtrl1, 0, wx.ALL|wx.EXPAND, 5 ) self.m_checkBox3 = wx.CheckBox( self, wx.ID_ANY, u"Postgres", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_checkBox3.SetValue(True) bSizer1.Add( self.m_checkBox3, 0, wx.ALL, 5 ) self.m_textCtrl3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.m_textCtrl3, 0, wx.ALL|wx.EXPAND, 5 ) self.m_checkBox4 = wx.CheckBox( self, wx.ID_ANY, u"SQL Server", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_checkBox4.SetValue(True) bSizer1.Add( self.m_checkBox4, 0, wx.ALL, 5 ) self.m_textCtrl4 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.m_textCtrl4, 0, wx.ALL|wx.EXPAND, 5 ) self.m_checkBox5 = wx.CheckBox( self, wx.ID_ANY, u"MySQL", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_checkBox5.SetValue(True) bSizer1.Add( self.m_checkBox5, 0, wx.ALL, 5 ) self.m_textCtrl2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.m_textCtrl2, 0, wx.ALL|wx.EXPAND, 5 ) self.m_staticText12 = wx.StaticText( self, wx.ID_ANY, u"Edit a descriptive test to be added on top of the DDL text file to describe your schema", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText12.Wrap( -1 ) bSizer1.Add( self.m_staticText12, 0, wx.ALL, 5 ) self.m_textCtrl21 = wx.TextCtrl( self, wx.ID_ANY, u"-- This is a Data Definition Language (DDL) script that\n\n-- generates a blank schema of the Water Management Data \nModel (WaM-DaM)\n\n-- for SQLite database\n\n-- Generated by Adel Abdallah February 16, 2017 based on WaM-DaM XML design named WaMDaMFeb16_2017.xml generated by DbWrench V4.0 @ http://www.dbwrench.com\n-- WaM-DaM All rights reserved. See Licence @ https://github.com/amabdallah/WaM-DaM ", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1.Add( self.m_textCtrl21, 1, wx.ALL|wx.EXPAND, 5 ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Select where you want your database files to be created to", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.m_dirPicker1 = wx.DirPickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE ) bSizer1.Add( self.m_dirPicker1, 0, wx.ALL, 5 ) gSizer4 = wx.GridSizer( 1, 2, 0, 0 ) self.m_button3 = wx.Button( self, wx.ID_ANY, u"Generate", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer4.Add( self.m_button3, 0, wx.ALL|wx.ALIGN_BOTTOM|wx.ALIGN_RIGHT, 5 ) self.m_button2 = wx.Button( self, wx.ID_ANY, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer4.Add( self.m_button2, 0, wx.ALL|wx.ALIGN_BOTTOM, 5 ) bSizer1.Add( gSizer4, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.m_statusBar4 = self.CreateStatusBar( 1, wx.ST_SIZEGRIP, wx.ID_ANY ) self.Centre( wx.BOTH )
def __init__(self, dsviewer): wx.Panel.__init__(self, dsviewer) self.dsviewer = dsviewer self.image = dsviewer.image dsviewer.do.overlays.append(self.DrawOverlays) vsizer = wx.BoxSizer(wx.VERTICAL) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(self, -1, 'Reference Channel:'), 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2) self.chMaster = wx.Choice(self, -1, choices=self.image.names) self.chMaster.SetSelection(0) hsizer.Add(self.chMaster, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2) vsizer.Add(hsizer, 0, wx.EXPAND, 0) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(self, -1, 'Orient by:'), 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2) self.chOrient = wx.Choice(self, -1, choices=self.image.names) self.chOrient.SetSelection(1) hsizer.Add(self.chOrient, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2) self.chDirection = wx.Choice( self, -1, choices=['-ve from reference', '+ve from reference'], size=(30, -1)) self.chDirection.SetSelection(0) hsizer.Add(self.chDirection, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2) vsizer.Add(hsizer, 0, wx.EXPAND, 0) sbsizer = wx.StaticBoxSizer( wx.StaticBox(self, -1, 'Minimum Amplitudes:'), wx.VERTICAL) nChans = len(self.image.names) gsizer = wx.FlexGridSizer(nChans, 2, 2, 5) self.aTexts = [] for chan in range(nChans): gsizer.Add(wx.StaticText(self, -1, self.image.names[chan]), 1, wx.ALIGN_CENTER_VERTICAL) at = wx.TextCtrl(self, -1, '0') self.aTexts.append(at) gsizer.Add(at, 2, wx.ALIGN_CENTER_VERTICAL) sbsizer.Add(gsizer, 0, wx.ALL | wx.EXPAND, 2) vsizer.Add(sbsizer, 0, wx.EXPAND, 2) bCalculate = wx.Button(self, -1, 'Measure') bCalculate.Bind(wx.EVT_BUTTON, self.OnCalculate) vsizer.Add(bCalculate, 0, wx.EXPAND | wx.ALL, 2) bHide = wx.Button(self, -1, 'Hide Object') bHide.Bind(wx.EVT_BUTTON, self.OnHideObject) vsizer.Add(bHide, 0, wx.EXPAND | wx.ALL, 2) bView = wx.Button(self, -1, 'View Results') bView.Bind(wx.EVT_BUTTON, self.OnView) vsizer.Add(bView, 0, wx.EXPAND | wx.ALL, 2) bXls = wx.Button(self, -1, 'Export to xls') bXls.Bind(wx.EVT_BUTTON, self.OnExportXls) vsizer.Add(bXls, 0, wx.EXPAND | wx.ALL, 2) self.SetSizerAndFit(vsizer) self.objects = [] self.ID = getNewID() self.StartServing()
def get_input_text(self, width): input_edit_text = wx.TextCtrl(self.panel, size=(width, self.input_height), style=wx.TE_CENTRE) input_edit_text.SetFont(self.input_font) return input_edit_text
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.Size(656, 398), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHints(wx.DefaultSize, wx.DefaultSize) self.SetBackgroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)) wSizer_win = wx.WrapSizer(wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS) self.m_staticText_deviceModel = wx.StaticText( self, wx.ID_ANY, u"Use Typical Device Model:", wx.DefaultPosition, wx.Size(149, -1), 0) self.m_staticText_deviceModel.Wrap(-1) wSizer_win.Add(self.m_staticText_deviceModel, 0, wx.ALL, 5) m_choice_deviceModeChoices = [ u"No", u"ISSI_IS25LP064A_IS25WP064A", u"ISSI_IS26KS512S", u"MXIC_MX25UM51245G_MX66UM51245G_MX25LM51245G", u"MXIC_MX25UM51345G", u"Micron_MT35X", u"Adesto_AT25SF128A", u"Adesto_ATXP032", u"Cypress_S26KS512S", u"GigaDevice_GD25LB256E", u"GigaDevice_GD25LT256E", u"GigaDevice_GD25LX256E" ] self.m_choice_deviceMode = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(340, -1), m_choice_deviceModeChoices, 0) self.m_choice_deviceMode.SetSelection(0) wSizer_win.Add(self.m_choice_deviceMode, 0, wx.ALL, 5) self.m_staticText_winNull0 = wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(100, -1), 0) self.m_staticText_winNull0.Wrap(-1) wSizer_win.Add(self.m_staticText_winNull0, 0, wx.ALL, 5) self.m_notebook_norOpt0 = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.m_panel_norOpt0 = wx.Panel(self.m_notebook_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) gSizer_norOpt0 = wx.GridSizer(0, 2, 0, 0) self.m_staticText_deviceType = wx.StaticText(self.m_panel_norOpt0, wx.ID_ANY, u"Device Type:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_deviceType.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_deviceType, 0, wx.ALL, 5) m_choice_deviceTypeChoices = [ u"QuadSPI SDR NOR", u"QuadSPI DDR NOR", u"Hyper Flash 1.8V", u"Hyper Flash 3.0V", u"Macronix Octal DDR", u"Macronix Octal SDR", u"Micron Octal DDR", u"Micron Octal SDR", u"Adesto EcoXIP DDR", u"Adesto EcoXIP SDR" ] self.m_choice_deviceType = wx.Choice(self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_deviceTypeChoices, 0) self.m_choice_deviceType.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_deviceType, 0, wx.ALL, 5) self.m_staticText_queryPads = wx.StaticText(self.m_panel_norOpt0, wx.ID_ANY, u"Query Pads:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_queryPads.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_queryPads, 0, wx.ALL, 5) m_choice_queryPadsChoices = [u"1", u"4", u"8"] self.m_choice_queryPads = wx.Choice(self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_queryPadsChoices, 0) self.m_choice_queryPads.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_queryPads, 0, wx.ALL, 5) self.m_staticText_cmdPads = wx.StaticText(self.m_panel_norOpt0, wx.ID_ANY, u"Cmd Pads:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_cmdPads.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_cmdPads, 0, wx.ALL, 5) m_choice_cmdPadsChoices = [u"1", u"4", u"8"] self.m_choice_cmdPads = wx.Choice(self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_cmdPadsChoices, 0) self.m_choice_cmdPads.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_cmdPads, 0, wx.ALL, 5) self.m_staticText_quadModeSetting = wx.StaticText( self.m_panel_norOpt0, wx.ID_ANY, u"Quad Mode Setting:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_quadModeSetting.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_quadModeSetting, 0, wx.ALL, 5) m_choice_quadModeSettingChoices = [ u"Not Configured", u"Set StatusReg1[6]", u"Set StatusReg2[1]", u"Set StatusReg2[7]", u"Set StatusReg2[1] by 0x31" ] self.m_choice_quadModeSetting = wx.Choice( self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_quadModeSettingChoices, 0) self.m_choice_quadModeSetting.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_quadModeSetting, 0, wx.ALL, 5) self.m_staticText_miscMode = wx.StaticText(self.m_panel_norOpt0, wx.ID_ANY, u"Misc Mode:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_miscMode.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_miscMode, 0, wx.ALL, 5) m_choice_miscModeChoices = [ u"Disabled", u"0_4_4 Mode", u"0_8_8 Mode", u"Data Order Swapped" ] self.m_choice_miscMode = wx.Choice(self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_miscModeChoices, 0) self.m_choice_miscMode.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_miscMode, 0, wx.ALL, 5) self.m_staticText_maxFrequency = wx.StaticText(self.m_panel_norOpt0, wx.ID_ANY, u"Max Frequency:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_maxFrequency.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_maxFrequency, 0, wx.ALL, 5) m_choice_maxFrequencyChoices = [ u"30MHz", u"50MHz", u"60MHz", u"75MHz", u"80MHz", u"100MHz", u"133MHz", u"166MHz" ] self.m_choice_maxFrequency = wx.Choice(self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_maxFrequencyChoices, 0) self.m_choice_maxFrequency.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_maxFrequency, 0, wx.ALL, 5) self.m_staticText_hasOption1 = wx.StaticText(self.m_panel_norOpt0, wx.ID_ANY, u"Has Option1:", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText_hasOption1.Wrap(-1) gSizer_norOpt0.Add(self.m_staticText_hasOption1, 0, wx.ALL, 5) m_choice_hasOption1Choices = [u"No", u"Yes"] self.m_choice_hasOption1 = wx.Choice(self.m_panel_norOpt0, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_hasOption1Choices, 0) self.m_choice_hasOption1.SetSelection(0) gSizer_norOpt0.Add(self.m_choice_hasOption1, 0, wx.ALL, 5) self.m_panel_norOpt0.SetSizer(gSizer_norOpt0) self.m_panel_norOpt0.Layout() gSizer_norOpt0.Fit(self.m_panel_norOpt0) self.m_notebook_norOpt0.AddPage(self.m_panel_norOpt0, u"Nor Option0", False) wSizer_win.Add(self.m_notebook_norOpt0, 1, wx.EXPAND | wx.ALL, 5) self.m_notebook_norOpt1 = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.m_panel_norOpt1 = wx.Panel(self.m_notebook_norOpt1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) gSizer_norOpt1 = wx.GridSizer(0, 2, 0, 0) self.m_staticText_flashConnection = wx.StaticText( self.m_panel_norOpt1, wx.ID_ANY, u"Flash Connection:", wx.DefaultPosition, wx.Size(140, -1), 0) self.m_staticText_flashConnection.Wrap(-1) gSizer_norOpt1.Add(self.m_staticText_flashConnection, 0, wx.ALL, 5) m_choice_flashConnectionChoices = [ u"Single Port A", u"Parallel", u"Single Port B", u"Both Ports" ] self.m_choice_flashConnection = wx.Choice( self.m_panel_norOpt1, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_flashConnectionChoices, 0) self.m_choice_flashConnection.SetSelection(0) gSizer_norOpt1.Add(self.m_choice_flashConnection, 0, wx.ALL, 5) self.m_staticText_driveStrength = wx.StaticText( self.m_panel_norOpt1, wx.ID_ANY, u"Drive Strength:", wx.DefaultPosition, wx.Size(140, -1), 0) self.m_staticText_driveStrength.Wrap(-1) gSizer_norOpt1.Add(self.m_staticText_driveStrength, 0, wx.ALL, 5) self.m_textCtrl_driveStrength = wx.TextCtrl(self.m_panel_norOpt1, wx.ID_ANY, u"0", wx.DefaultPosition, wx.Size(140, -1), 0) gSizer_norOpt1.Add(self.m_textCtrl_driveStrength, 0, wx.ALL, 5) self.m_staticText_dqsPinmuxGroup = wx.StaticText( self.m_panel_norOpt1, wx.ID_ANY, u"DQS Pinmux Group:", wx.DefaultPosition, wx.Size(140, -1), 0) self.m_staticText_dqsPinmuxGroup.Wrap(-1) gSizer_norOpt1.Add(self.m_staticText_dqsPinmuxGroup, 0, wx.ALL, 5) self.m_textCtrl_dqsPinmuxGroup = wx.TextCtrl(self.m_panel_norOpt1, wx.ID_ANY, u"0", wx.DefaultPosition, wx.Size(140, -1), 0) gSizer_norOpt1.Add(self.m_textCtrl_dqsPinmuxGroup, 0, wx.ALL, 5) self.m_staticText_enableSecondPinmux = wx.StaticText( self.m_panel_norOpt1, wx.ID_ANY, u"Enable Second Pinmux:", wx.DefaultPosition, wx.Size(140, -1), 0) self.m_staticText_enableSecondPinmux.Wrap(-1) gSizer_norOpt1.Add(self.m_staticText_enableSecondPinmux, 0, wx.ALL, 5) m_choice_enableSecondPinmuxChoices = [u"No", u"Yes"] self.m_choice_enableSecondPinmux = wx.Choice( self.m_panel_norOpt1, wx.ID_ANY, wx.DefaultPosition, wx.Size(140, -1), m_choice_enableSecondPinmuxChoices, 0) self.m_choice_enableSecondPinmux.SetSelection(0) gSizer_norOpt1.Add(self.m_choice_enableSecondPinmux, 0, wx.ALL, 5) self.m_staticText_statusOverride = wx.StaticText( self.m_panel_norOpt1, wx.ID_ANY, u"Status Override:", wx.DefaultPosition, wx.Size(140, -1), 0) self.m_staticText_statusOverride.Wrap(-1) gSizer_norOpt1.Add(self.m_staticText_statusOverride, 0, wx.ALL, 5) self.m_textCtrl_statusOverride = wx.TextCtrl(self.m_panel_norOpt1, wx.ID_ANY, u"0", wx.DefaultPosition, wx.Size(140, -1), 0) gSizer_norOpt1.Add(self.m_textCtrl_statusOverride, 0, wx.ALL, 5) self.m_staticText_dummyCycles = wx.StaticText(self.m_panel_norOpt1, wx.ID_ANY, u"Dummy Cycles:", wx.DefaultPosition, wx.Size(140, -1), 0) self.m_staticText_dummyCycles.Wrap(-1) gSizer_norOpt1.Add(self.m_staticText_dummyCycles, 0, wx.ALL, 5) self.m_textCtrl_dummyCycles = wx.TextCtrl(self.m_panel_norOpt1, wx.ID_ANY, u"0", wx.DefaultPosition, wx.Size(140, -1), 0) gSizer_norOpt1.Add(self.m_textCtrl_dummyCycles, 0, wx.ALL, 5) self.m_panel_norOpt1.SetSizer(gSizer_norOpt1) self.m_panel_norOpt1.Layout() gSizer_norOpt1.Fit(self.m_panel_norOpt1) self.m_notebook_norOpt1.AddPage(self.m_panel_norOpt1, u"Nor Option1", False) wSizer_win.Add(self.m_notebook_norOpt1, 1, wx.EXPAND | wx.ALL, 5) self.m_staticText_winNull1 = wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(356, -1), 0) self.m_staticText_winNull1.Wrap(-1) wSizer_win.Add(self.m_staticText_winNull1, 0, wx.ALL, 5) self.m_button_ok = wx.Button(self, wx.ID_ANY, u"Ok", wx.DefaultPosition, wx.Size(100, -1), 0) wSizer_win.Add(self.m_button_ok, 0, wx.ALL, 5) self.m_button_cancel = wx.Button(self, wx.ID_ANY, u"Cancel", wx.DefaultPosition, wx.Size(100, -1), 0) wSizer_win.Add(self.m_button_cancel, 0, wx.ALL, 5) self.SetSizer(wSizer_win) self.Layout() self.Centre(wx.BOTH) # Connect Events self.Bind(wx.EVT_CLOSE, self.callbackClose) self.m_choice_deviceMode.Bind(wx.EVT_CHOICE, self.callbackUseTypicalDeviceModel) self.m_choice_hasOption1.Bind(wx.EVT_CHOICE, self.callbackHasOption1) self.m_button_ok.Bind(wx.EVT_BUTTON, self.callbackOk) self.m_button_cancel.Bind(wx.EVT_BUTTON, self.callbackCancel)
def get_specific_widget(self, parent): import wx self.widget = wx.TextCtrl(parent, -1, str(self.value)) return self.widget
def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_PYTHONDEMOFRAME, name=u'PythonDemoFrame', parent=prnt, pos=wx.Point(431, 236), size=wx.Size(805, 389), style=wx.DEFAULT_FRAME_STYLE, title=u'Csound Python Demo') self.SetClientSize(wx.Size(797, 362)) self.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Terminal')) self.Bind(wx.EVT_CLOSE, self.OnPythonDemoFrameClose) self.notebook = wx.Notebook(id=wxID_PYTHONDEMOFRAMENOTEBOOK, name=u'notebook', parent=self, pos=wx.Point(0, 0), size=wx.Size(797, 362), style=0) self.notebook.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'MS Shell Dlg 2')) self.playPanel = wx.Panel(id=wxID_PYTHONDEMOFRAMEPLAYPANEL, name=u'playPanel', parent=self.notebook, pos=wx.Point(0, 0), size=wx.Size(789, 336), style=wx.TAB_TRAVERSAL) self.outputPanel = wx.Panel(id=wxID_PYTHONDEMOFRAMEOUTPUTPANEL, name=u'outputPanel', parent=self.playPanel, pos=wx.Point(400, 160), size=wx.Size(384, 120), style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.outputPanel.SetLabel(u'Wavetable high harmonics') self.staticText1 = wx.StaticText(id=wxID_PYTHONDEMOFRAMESTATICTEXT1, label=u'Rendering', name='staticText1', parent=self.outputPanel, pos=wx.Point(8, 8), size=wx.Size(58, 13), style=0) self.staticText1.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.harmonicsPanel = wx.Panel(id=wxID_PYTHONDEMOFRAMEHARMONICSPANEL, name=u'harmonicsPanel', parent=self.playPanel, pos=wx.Point(8, 8), size=wx.Size(384, 56), style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.harmonicsPanel.SetLabel(u'Wavetable high harmonics') self.gkHarmonicTableFactorText = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEGKHARMONICTABLEFACTORTEXT, name=u'gkHarmonicTableFactorText', parent=self.harmonicsPanel, pos=wx.Point(280, 24), size=wx.Size(92, 21), style=0, value=u'') self.staticText2 = wx.StaticText( id=wxID_PYTHONDEMOFRAMESTATICTEXT2, label=u'Wavetable high harmonics multiplier', name='staticText2', parent=self.harmonicsPanel, pos=wx.Point(8, 8), size=wx.Size(208, 13), style=0) self.staticText2.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.waveshapingPanel = wx.Panel( id=wxID_PYTHONDEMOFRAMEWAVESHAPINGPANEL, name=u'waveshapingPanel', parent=self.playPanel, pos=wx.Point(8, 72), size=wx.Size(384, 192), style=wx.CAPTION | wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.waveshapingPanel.SetLabel(u'Waveshaping distortion') self.reverbPanel = wx.Panel(id=wxID_PYTHONDEMOFRAMEREVERBPANEL, name=u'reverbPanel', parent=self.playPanel, pos=wx.Point(8, 272), size=wx.Size(384, 56), style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.reverbPanel.SetLabel(u'Wavetable high harmonics') self.gkReverbscFeedback = wx.Slider( id=wxID_PYTHONDEMOFRAMEGKREVERBSCFEEDBACK, maxValue=1000000, minValue=0, name=u'gkReverbscFeedback', parent=self.reverbPanel, pos=wx.Point(0, 24), size=wx.Size(272, 32), style=wx.SL_HORIZONTAL, value=0) self.gkReverbscFeedback.SetMax(1000000) self.gkReverbscFeedback.Bind(wx.EVT_SCROLL, self.on_gkReverbscFeedbackScroll) self.gkReverbscFeedbackText = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEGKREVERBSCFEEDBACKTEXT, name=u'gkReverbscfeedbackText', parent=self.reverbPanel, pos=wx.Point(280, 24), size=wx.Size(92, 21), style=0, value=u'') self.staticText4 = wx.StaticText( id=wxID_PYTHONDEMOFRAMESTATICTEXT4, label=u'Reverberation feedback (delay time)', name='staticText4', parent=self.reverbPanel, pos=wx.Point(8, 8), size=wx.Size(210, 13), style=0) self.staticText4.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.gainPanel = wx.Panel(id=wxID_PYTHONDEMOFRAMEGAINPANEL, name=u'gainPanel', parent=self.playPanel, pos=wx.Point(400, 8), size=wx.Size(384, 56), style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.gainPanel.SetLabel(u'Wavetable high harmonics') self.gkMasterLevel = wx.Slider(id=wxID_PYTHONDEMOFRAMEGKMASTERLEVEL, maxValue=1000000, minValue=0, name=u'gkMasterLevel', parent=self.gainPanel, pos=wx.Point(0, 24), size=wx.Size(272, 32), style=wx.SL_HORIZONTAL, value=0) self.gkMasterLevel.SetMax(1000000) self.gkMasterLevel.Bind(wx.EVT_SCROLL, self.on_gkMasterLevelScroll) self.gkMasterLevelText = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEGKMASTERLEVELTEXT, name=u'gkMasterLevelText', parent=self.gainPanel, pos=wx.Point(280, 24), size=wx.Size(92, 21), style=0, value=u'') self.staticText5 = wx.StaticText(id=wxID_PYTHONDEMOFRAMESTATICTEXT5, label=u'Master gain', name='staticText5', parent=self.gainPanel, pos=wx.Point(8, 8), size=wx.Size(67, 13), style=0) self.staticText5.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.panel1 = wx.Panel(id=wxID_PYTHONDEMOFRAMEPANEL1, name='panel1', parent=self.waveshapingPanel, pos=wx.Point(0, 128), size=wx.Size(384, 56), style=wx.TAB_TRAVERSAL) self.panel1.SetLabel(u'Wavetable high harmonics') self.gkChebyshevpoly3 = wx.Slider( id=wxID_PYTHONDEMOFRAMEGKCHEBYSHEVPOLY3, maxValue=1000000, minValue=0, name=u'gkChebyshevpoly3', parent=self.panel1, pos=wx.Point(0, 24), size=wx.Size(272, 32), style=wx.SL_HORIZONTAL, value=0) self.gkChebyshevpoly3.SetMax(1000000) self.gkChebyshevpoly3.Bind(wx.EVT_SCROLL, self.on_gkChebyshevpoly3Scroll) self.staticText3 = wx.StaticText( id=wxID_PYTHONDEMOFRAMESTATICTEXT3, label=u'Chebyshev polynomial coefficient 3', name='staticText3', parent=self.panel1, pos=wx.Point(8, 8), size=wx.Size(169, 13), style=0) self.gkChebyshevpoly3Text = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEGKCHEBYSHEVPOLY3TEXT, name=u'gkChebyshevpoly3Text', parent=self.panel1, pos=wx.Point(280, 24), size=wx.Size(92, 21), style=0, value=u'') self.panel2 = wx.Panel(id=wxID_PYTHONDEMOFRAMEPANEL2, name='panel2', parent=self.waveshapingPanel, pos=wx.Point(0, 32), size=wx.Size(384, 56), style=wx.TAB_TRAVERSAL) self.panel2.SetLabel(u'Wavetable high harmonics') self.gkChebyshevpoly1 = wx.Slider( id=wxID_PYTHONDEMOFRAMEGKCHEBYSHEVPOLY1, maxValue=1000000, minValue=0, name=u'gkChebyshevpoly1', parent=self.panel2, pos=wx.Point(0, 24), size=wx.Size(272, 32), style=wx.SL_HORIZONTAL, value=0) self.gkChebyshevpoly1.SetMax(1000000) self.gkChebyshevpoly1.Bind(wx.EVT_SCROLL, self.on_gkChebyshevpoly1Scroll) self.staticText6 = wx.StaticText( id=wxID_PYTHONDEMOFRAMESTATICTEXT6, label=u'Chebyshev polynomial coefficient 1', name='staticText6', parent=self.panel2, pos=wx.Point(8, 8), size=wx.Size(169, 13), style=0) self.gkChebyshevpoly1Text = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEGKCHEBYSHEVPOLY1TEXT, name=u'gkChebyshevpoly1Text', parent=self.panel2, pos=wx.Point(280, 24), size=wx.Size(92, 21), style=0, value=u'') self.staticText7 = wx.StaticText(id=wxID_PYTHONDEMOFRAMESTATICTEXT7, label=u'Waveshaping distortion', name='staticText7', parent=self.waveshapingPanel, pos=wx.Point(8, 8), size=wx.Size(135, 13), style=0) self.staticText7.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.panel5 = wx.Panel(id=wxID_PYTHONDEMOFRAMEPANEL5, name='panel5', parent=self.waveshapingPanel, pos=wx.Point(0, 80), size=wx.Size(384, 56), style=wx.TAB_TRAVERSAL) self.panel5.SetLabel(u'Wavetable high harmonics') self.gkChebyshevpoly2 = wx.Slider( id=wxID_PYTHONDEMOFRAMEGKCHEBYSHEVPOLY2, maxValue=1000000, minValue=0, name=u'gkChebyshevpoly2', parent=self.panel5, pos=wx.Point(0, 24), size=wx.Size(272, 32), style=wx.SL_HORIZONTAL, value=0) self.gkChebyshevpoly2.SetMax(1000000) self.gkChebyshevpoly2.Bind(wx.EVT_SCROLL, self.on_gkChebyshevpoly2Scroll) self.staticText8 = wx.StaticText( id=wxID_PYTHONDEMOFRAMESTATICTEXT8, label=u'Chebyshev polynomial coefficient 2', name='staticText8', parent=self.panel5, pos=wx.Point(8, 8), size=wx.Size(169, 13), style=0) self.gkChebyshevpoly2Text = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEGKCHEBYSHEVPOLY2TEXT, name=u'gkChebyshevpoly2Text', parent=self.panel5, pos=wx.Point(280, 24), size=wx.Size(92, 21), style=0, value=u'') self.gkHarmonicTableFactor = wx.Slider( id=wxID_PYTHONDEMOFRAMEGKHARMONICTABLEFACTOR, maxValue=1000000, minValue=0, name=u'gkHarmonicTableFactor', parent=self.harmonicsPanel, pos=wx.Point(0, 24), size=wx.Size(272, 24), style=wx.SL_HORIZONTAL, value=0) self.gkHarmonicTableFactor.Bind(wx.EVT_SCROLL, self.on_gkHarmonicTableFactorScroll) self.snapshotPanel = wx.Panel(id=wxID_PYTHONDEMOFRAMESNAPSHOTPANEL, name=u'snapshotPanel', parent=self.playPanel, pos=wx.Point(400, 72), size=wx.Size(384, 80), style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.staticText9 = wx.StaticText(id=wxID_PYTHONDEMOFRAMESTATICTEXT9, label=u'Settings snapshots', name='staticText9', parent=self.snapshotPanel, pos=wx.Point(8, 8), size=wx.Size(108, 13), style=0) self.staticText9.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.saveNewSnapshotButton = wx.Button( id=wxID_PYTHONDEMOFRAMESAVENEWSNAPSHOTBUTTON, label=u'New', name=u'saveNewSnapshotButton', parent=self.snapshotPanel, pos=wx.Point(8, 32), size=wx.Size(64, 32), style=0) self.saveNewSnapshotButton.Bind( wx.EVT_BUTTON, self.OnSaveNewSnapshotButtonButton, id=wxID_PYTHONDEMOFRAMESAVENEWSNAPSHOTBUTTON) self.deleteSnapshotButton = wx.Button( id=wxID_PYTHONDEMOFRAMEDELETESNAPSHOTBUTTON, label=u'Delete', name=u'deleteSnapshotButton', parent=self.snapshotPanel, pos=wx.Point(152, 32), size=wx.Size(64, 32), style=0) self.deleteSnapshotButton.SetToolTipString(u'Save snapshot') self.deleteSnapshotButton.Bind( wx.EVT_BUTTON, self.OnDeleteSnapshotButtonButton, id=wxID_PYTHONDEMOFRAMEDELETESNAPSHOTBUTTON) self.renderButton = wx.Button(id=wxID_PYTHONDEMOFRAMERENDERBUTTON, label=u'Render', name=u'renderButton', parent=self.outputPanel, pos=wx.Point(160, 32), size=wx.Size(64, 32), style=0) self.renderButton.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.renderButton.SetForegroundColour(wx.Colour(0, 128, 128)) self.renderButton.Bind(wx.EVT_BUTTON, self.OnRenderButtonButton, id=wxID_PYTHONDEMOFRAMERENDERBUTTON) self.playButton = wx.Button(id=wxID_PYTHONDEMOFRAMEPLAYBUTTON, label=u'Edit', name=u'playButton', parent=self.outputPanel, pos=wx.Point(304, 32), size=wx.Size(64, 32), style=0) self.playButton.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.playButton.SetForegroundColour(wx.Colour(0, 128, 255)) self.playButton.Bind(wx.EVT_BUTTON, self.OnPlayButtonButton, id=wxID_PYTHONDEMOFRAMEPLAYBUTTON) self.button1 = wx.Button(id=wxID_PYTHONDEMOFRAMEBUTTON1, label=u'Stop', name='button1', parent=self.outputPanel, pos=wx.Point(232, 32), size=wx.Size(64, 32), style=0) self.button1.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False, u'MS Shell Dlg 2')) self.button1.SetForegroundColour(wx.Colour(255, 0, 0)) self.button1.Bind(wx.EVT_BUTTON, self.OnStopButtonButton, id=wxID_PYTHONDEMOFRAMEBUTTON1) self.panel3 = wx.Panel(id=wxID_PYTHONDEMOFRAMEPANEL3, name='panel3', parent=self.outputPanel, pos=wx.Point(8, 72), size=wx.Size(360, 32), style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.playerBrowser = wx.lib.filebrowsebutton.FileBrowseButton( buttonText='Browse', dialogTitle='Choose a file', fileMask=u'*.*', id=wxID_PYTHONDEMOFRAMEPLAYERBROWSER, initialValue=u'sndrec.exe', labelText=u'Player', parent=self.panel3, pos=wx.Point(8, 0), size=wx.Size(344, 24), startDirectory='.', style=wx.TAB_TRAVERSAL, toolTip='Type filename or click browse to choose file') self.playerBrowser.SetName(u'playerBrowser') self.aboutText = wx.TextCtrl( id=wxID_PYTHONDEMOFRAMEABOUTTEXT, name=u'aboutText', parent=self.notebook, pos=wx.Point(0, 0), size=wx.Size(789, 336), style=wx.TE_READONLY | wx.TE_LINEWRAP | wx.TE_MULTILINE, value= u"This application demonstrates the use of Boa Constructor to build a Python program with a graphical user interface using the wxPython toolkit.\n\nThe purpose of this application is not so much real-time performance, as to enable the composer to 'fine-tune' parameters of the composition that have a global effect on the sound.\n\nThe application communicates with Csound via Csound's Python application programming interface (API). Csound runs in a separate thread using a csnd6.CsoundPerformandeThread object, and the sliders on the user interface control global variables in the Csound orchestra during performance, using the channel API.\n\nThe application also provides for taking any number of 'snapshots' of the control settings, including the Csound orchestra and score, and saving or restoring the settings.\n\nYou can adapt this application to use for your own compositions by copying the files to a new directory, opening them with Boa Constructor, and editing the application." ) self.aboutText.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Courier New')) self.orchestraText = wx.TextCtrl(id=wxID_PYTHONDEMOFRAMEORCHESTRATEXT, name=u'orchestraText', parent=self.notebook, pos=wx.Point(0, 0), size=wx.Size(789, 336), style=wx.TE_DONTWRAP | wx.TE_LINEWRAP | wx.TE_WORDWRAP | wx.TE_MULTILINE, value=u'') self.orchestraText.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Courier New')) self.scoreText = wx.TextCtrl(id=wxID_PYTHONDEMOFRAMESCORETEXT, name=u'scoreText', parent=self.notebook, pos=wx.Point(0, 0), size=wx.Size(789, 336), style=wx.TE_DONTWRAP | wx.TE_LINEWRAP | wx.TE_WORDWRAP | wx.TE_MULTILINE, value=u'') self.scoreText.SetFont( wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, u'Courier New')) self.snapshotComboBox = wx.ComboBox( choices=[], id=wxID_PYTHONDEMOFRAMESNAPSHOTCOMBOBOX, name=u'snapshotComboBox', parent=self.snapshotPanel, pos=wx.Point(280, 32), size=wx.Size(88, 21), style=0, value=u'1') self.snapshotComboBox.SetLabel(u'1') self.snapshotComboBox.Bind(wx.EVT_COMBOBOX, self.OnSnapshotComboBoxCombobox, id=wxID_PYTHONDEMOFRAMESNAPSHOTCOMBOBOX) self.saveSnapshotButton = wx.Button( id=wxID_PYTHONDEMOFRAMESAVESNAPSHOTBUTTON, label=u'Save', name=u'saveSnapshotButton', parent=self.snapshotPanel, pos=wx.Point(80, 32), size=wx.Size(64, 32), style=0) self.saveSnapshotButton.SetToolTipString(u'Save snapshot') self.saveSnapshotButton.Bind(wx.EVT_BUTTON, self.OnSaveSnapshotButtonButton, id=wxID_PYTHONDEMOFRAMESAVESNAPSHOTBUTTON) self.genStaticText1 = wx.lib.stattext.GenStaticText( ID=wxID_PYTHONDEMOFRAMEGENSTATICTEXT1, label=u'Output', name='genStaticText1', parent=self.outputPanel, pos=wx.Point(8, 32), size=wx.Size(34, 13), style=0) self.outputComboBox = wx.ComboBox( choices=[], id=wxID_PYTHONDEMOFRAMEOUTPUTCOMBOBOX, name=u'outputComboBox', parent=self.outputPanel, pos=wx.Point(56, 32), size=wx.Size(96, 21), style=0, value=u'dac') self.outputComboBox.SetLabel(u'dac') self.outputComboBox.Bind(wx.EVT_COMBOBOX, self.OnOutputComboBoxCombobox, id=wxID_PYTHONDEMOFRAMEOUTPUTCOMBOBOX) self._init_coll_notebook_Pages(self.notebook)
def __init__(self, parent, inet): """ Initialize Panel class """ # Inits variables self.inet = inet self.message_color = (240, 240, 240) # new panel wx.Panel.__init__(self, parent) # new font DEFAULT_FONT = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) # Create sizer self.layout_main = wx.BoxSizer(wx.VERTICAL) self.layout = [wx.BoxSizer(wx.HORIZONTAL) for i in range(3)] # Creates a button to open the port self.button_standby = wx.Button(self, id=wx.ID_ANY, label=u"Standby", size=(96, 32)) self.button_standby.SetFont(DEFAULT_FONT) self.button_standby.Bind(wx.EVT_BUTTON, self.inet.create_socket) self.layout[0].Add(self.button_standby, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=0) # text = "at" label = wx.StaticText(self, id=wx.ID_ANY, label=u"at") label.SetFont(DEFAULT_FONT) self.layout[0].Add(label, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=8) # Creates a text control to enter the hostname into self.text_ip = wx.TextCtrl(self, id=wx.ID_ANY, value=self.getmyip(), size=(256, 32)) self.text_ip.SetFont(DEFAULT_FONT) self.text_ip.SetToolTipString(u"Hostname or IP address") self.layout[0].Add(self.text_ip, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=0) # text = "with port" label = wx.StaticText(self, id=wx.ID_ANY, label=u"with port") label.SetFont(DEFAULT_FONT) self.layout[0].Add(label, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=8) # Creates a text control to enter the port number into self.text_port = wx.TextCtrl(self, id=wx.ID_ANY, value=u"8080", size=(64, 32)) self.text_port.SetFont(DEFAULT_FONT) self.text_port.SetToolTipString(u"Port number") self.layout[0].Add(self.text_port, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=0) # Creates a list control to display the history on self.list_history = wx.ListCtrl(self, id=wx.ID_ANY, style=wx.LC_REPORT | wx.SUNKEN_BORDER) self.list_history.Show(True) self.list_history.InsertColumn(0, u"Message", width=320) self.list_history.InsertColumn(1, u"Date", width=196) self.list_history.InsertColumn(2, u"ID") self.layout[1].Add(self.list_history, proportion=1, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=0) # Creates a button to configure the message color self.button_color = wx.Button(self, id=wx.ID_ANY, label=u"COLOR", size=(64, 32)) self.button_color.SetBackgroundColour(self.message_color) self.button_color.SetForegroundColour(self.message_color) self.button_color.SetToolTipString(u"Message color") self.button_color.Bind(wx.EVT_BUTTON, self.configure_color) self.layout[2].Add(self.button_color, flag=wx.ALIGN_LEFT | wx.ALL, border=0) # Creates a spin control to configure the character size self.spin_size = wx.SpinCtrl(self, id=wx.ID_ANY, size=(64, 32), min=16, max=64, initial=32) self.spin_size.SetToolTipString(u"Message size") self.layout[2].Add(self.spin_size, flag=wx.ALIGN_LEFT | wx.ALL, border=0) # Creates a text control to enter the message into self.text_message = wx.TextCtrl(self, id=wx.ID_ANY, style=wx.TE_PROCESS_ENTER, size=(320, 32)) self.text_message.Bind(wx.EVT_TEXT_ENTER, self.inet.post_message) self.text_message.SetFont(DEFAULT_FONT) self.text_message.SetMaxLength(60) self.text_message.SetToolTipString("Message") self.layout[2].Add(self.text_message, proportion=1, flag=wx.EXPAND | wx.ALIGN_LEFT | wx.ALL, border=0) # Creates a button to post a message self.button_send = wx.Button(self, id=wx.ID_ANY, label=u"Post", size=(64, 32)) self.button_send.SetFont(DEFAULT_FONT) self.button_send.Bind(wx.EVT_BUTTON, self.inet.post_message) self.layout[2].Add(self.button_send, flag=wx.ALIGN_LEFT | wx.ALL, border=0) # Set sizer self.layout_main.Add(self.layout[0], flag=wx.ALIGN_TOP) self.layout_main.Add(self.layout[1], proportion=1, flag=wx.EXPAND | wx.ALIGN_CENTER) self.layout_main.Add(self.layout[2], flag=wx.ALIGN_LEFT) self.SetSizer(self.layout_main) return
def __init__(self, parent=None, id=wx.ID_ANY, title=_("Data Catalog Beta"), workspace=None,size=wx.DefaultSize,pos=wx.DefaultPosition): self.iconsize = (16, 16) self.baseTitle = title self.parent = parent wx.Frame.__init__(self, parent, id, title, pos=pos, size=size) self.SetName("LayerManager") self._auimgr=wx.aui.AuiManager(self) self.gisbase = os.getenv("GISBASE") self.gisrc = self.read_gisrc() self.viewInfo = True #to display v/r.info on mapdisplay self.gisdbase = self.gisrc['GISDBASE'] #backup location and mapset from gisrc which may be modified by datacatalog self.iLocation = self.gisrc['LOCATION_NAME'] self.iMapset = self.gisrc['MAPSET'] # initialize variables self.disp_idx = 0 # index value for map displays and layer trees self.curr_page = '' # currently selected page for layer tree notebook self.curr_pagenum = '' # currently selected page number for layer tree notebook self.workspaceFile = workspace # workspace file self.workspaceChanged = False # track changes in workspace self.georectifying = None # reference to GCP class or None # list of open dialogs self.dialogs = dict() self.dialogs['preferences'] = None self.dialogs['atm'] = list() #print os.getenv("integrated-gui") # creating widgets if grassversion.rfind("6.4") != 0: self.menubar = menu.Menu(parent = self, data = menudata.ManagerData()) self.SetMenuBar(self.menubar) self.menucmd = self.menubar.GetCmd() self.statusbar = self.CreateStatusBar(number=1) self.notebook = self.__createNoteBook() if grassversion.rfind("6.4") != 0: self.toolbar = LayerManagerToolbar(parent = self) else: self.toolbar = self.__createToolBar() self.SetToolBar(self.toolbar) self.locationchange = True #creating sizers self.cmbSizer = wx.BoxSizer(wx.HORIZONTAL) self.mSizer = wx.BoxSizer(wx.VERTICAL) #these two sizers are applied to splitter window self.leftSizer = wx.BoxSizer(wx.HORIZONTAL) self.rightSizer = wx.BoxSizer(wx.HORIZONTAL) #populate location combobox self.loclist = self.GetLocations() self.loclist.sort() #self.pg_panel4 = None if grassversion.rfind("6.4") != 0: self.menubar = menu.Menu(parent = self, data = menudata.ManagerData()) else: self.menubar, self.menudata = self.__createMenuBar() self.SetMenuBar(self.menubar) self.menucmd = self.menubar.GetCmd() self.statusbar = self.CreateStatusBar(number=4, style=0) self.notebook = self.__createNoteBook() self.toolbar = LayerManagerToolbar(parent = self) self.SetToolBar(self.toolbar) #setting splitter window self.cmbPanel = wx.Panel(self,name="cmbpanel") self.maptree = None self.pg_panel = None self.cb_loclist = [] self.cb_maplist = [] self.cb_mapfile = [] #creating controls self.mInfo = wx.TextCtrl(self.cmbPanel, wx.ID_ANY, style = wx.TE_READONLY,size=(300,30)) # # start radiobutton to activate - deactivate the mouse actions to send position to ossimplanet # self.options = ['on', 'off'] self.radiobox = wx.RadioBox(self.cmbPanel, wx.ID_ANY, choices=self.options, style=wx.HORIZONTAL) self.radiobox.SetSelection(1) self.treeExpand = wx.CheckBox(self.cmbPanel, wx.ID_ANY,"Expand All", wx.DefaultPosition, wx.DefaultSize) self.cmbLocation = wx.ComboBox(self.cmbPanel, value = "Select Location",size=wx.DefaultSize, choices=self.loclist) self.cmbMapset = wx.ComboBox(self.cmbPanel, value = "Select Mapset", size=wx.DefaultSize) self.itemFont = wx.Font(pointSize=9,weight=0, family=wx.FONTFAMILY_DEFAULT ,style=wx.FONTSTYLE_ITALIC) self.notebook = self.__createNoteBook() self.curr_page = self.notebook.GetCurrentPage() self.cmbLocation.SetValue(grass.gisenv()['LOCATION_NAME']) self.cmbMapset.SetValue(grass.gisenv()['MAPSET']) self.doBindings() self.doLayout()
def __init__(self): wx.Frame.__init__(self, None, -1, "Widget Layout Tester") p = wx.Panel(self) # Create control widgets self.testHistory = wx.ListBox(p, -1, size=(150, 300)) self.moduleName = wx.TextCtrl(p, -1, "wx") self.className = wx.TextCtrl(p, -1, "") self.parameters = wx.TextCtrl(p, -1, "") self.postCreate = wx.TextCtrl(p, -1, "", size=(1, 75), style=wx.TE_MULTILINE | wx.TE_DONTWRAP) self.expression = wx.TextCtrl(p, -1, "", style=wx.TE_READONLY) self.docstring = wx.TextCtrl(p, -1, "", size=(1, 75), style=wx.TE_READONLY | wx.TE_MULTILINE | wx.TE_DONTWRAP) self.expression.SetBackgroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_INFOBK)) self.docstring.SetBackgroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_INFOBK)) addBtn = wx.Button(p, -1, "Add") remBtn = wx.Button(p, -1, "Remove") repBtn = wx.Button(p, -1, "Replace") createBtn = wx.Button(p, -1, " Create Widget ") createBtn.SetDefault() destroyBtn = wx.Button(p, -1, "Destroy Widget") clearBtn = wx.Button(p, -1, "Clear") self.createBtn = createBtn self.destroyBtn = destroyBtn bottomPanel = wx.Panel(p, style=wx.SUNKEN_BORDER, name="bottomPanel") bottomPanel.SetMinSize((640, 240)) bottomPanel.SetOwnBackgroundColour("light blue") self.testPanel = wx.Panel(bottomPanel, name="testPanel") self.testPanel.SetOwnBackgroundColour((205, 183, 181)) # mistyrose3 self.testWidget = None self.infoPane = InfoPane(p) # setup event bindings self.Bind(wx.EVT_TEXT, self.OnUpdate, self.moduleName) self.Bind(wx.EVT_TEXT, self.OnUpdate, self.className) self.Bind(wx.EVT_TEXT, self.OnUpdate, self.parameters) self.Bind(wx.EVT_UPDATE_UI, self.OnEnableCreate, createBtn) self.Bind(wx.EVT_UPDATE_UI, self.OnEnableDestroy, destroyBtn) self.Bind(wx.EVT_BUTTON, self.OnCreateWidget, createBtn) self.Bind(wx.EVT_BUTTON, self.OnDestroyWidget, destroyBtn) self.Bind(wx.EVT_BUTTON, self.OnClear, clearBtn) self.Bind(wx.EVT_CLOSE, self.OnSaveHistory) self.Bind(wx.EVT_BUTTON, self.OnAddHistory, addBtn) self.Bind(wx.EVT_BUTTON, self.OnRemoveHistory, remBtn) self.Bind(wx.EVT_BUTTON, self.OnReplaceHistory, repBtn) self.Bind(wx.EVT_LISTBOX, self.OnHistorySelect, self.testHistory) self.Bind(wx.EVT_LISTBOX_DCLICK, self.OnHistoryActivate, self.testHistory) if 'wxMac' in wx.PlatformInfo or 'wxGTK' in wx.PlatformInfo: self.testHistory.Bind(wx.EVT_KEY_DOWN, self.OnHistoryKey) # setup the layout mainSizer = wx.BoxSizer(wx.VERTICAL) topSizer = wx.BoxSizer(wx.HORIZONTAL) ctlsSizer = wx.FlexGridSizer(2, 2, 5, 5) ctlsSizer.AddGrowableCol(1) btnSizer = wx.BoxSizer(wx.HORIZONTAL) topSizer.Add(self.testHistory, 0, wx.RIGHT, 30) ctlsSizer.Add(wx.StaticText(p, -1, "Module name:"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) mcSizer = wx.BoxSizer(wx.HORIZONTAL) mcSizer.Add(self.moduleName, 0, 0) mcSizer.Add( wx.StaticText(p, -1, "Class name:"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 10) mcSizer.Add(self.className, 1, 0) ctlsSizer.Add(mcSizer, 0, wx.EXPAND) ctlsSizer.Add(wx.StaticText(p, -1, "Parameters:"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) ctlsSizer.Add(self.parameters, 0, wx.EXPAND) ctlsSizer.Add(wx.StaticText(p, -1, "Create Expr:"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL) ctlsSizer.Add(self.expression, 0, wx.EXPAND) ctlsSizer.Add(wx.StaticText(p, -1, "Post create:"), 0, wx.ALIGN_RIGHT) ctlsSizer.Add(self.postCreate, 0, wx.EXPAND) ctlsSizer.Add(wx.StaticText(p, -1, "DocString:"), 0, wx.ALIGN_RIGHT) ctlsSizer.Add(self.docstring, 0, wx.EXPAND) ctlsSizer.AddGrowableRow(4) topSizer.Add(ctlsSizer, 1, wx.EXPAND) btnSizer.Add((5, 5)) btnSizer.Add(addBtn, 0, wx.RIGHT, 5) btnSizer.Add(remBtn, 0, wx.RIGHT, 5) btnSizer.Add(repBtn, 0, wx.RIGHT, 5) btnSizer.Add((0, 0), 1) btnSizer.Add(createBtn, 0, wx.RIGHT, 5) btnSizer.Add(destroyBtn, 0, wx.RIGHT, 5) btnSizer.Add(clearBtn, 0, wx.RIGHT, 5) btnSizer.Add((0, 0), 1) mainSizer.Add(topSizer, 0, wx.EXPAND | wx.ALL, 10) mainSizer.Add(btnSizer, 0, wx.EXPAND) mainSizer.Add((10, 10)) ##mainSizer.Add(wx.StaticLine(p, -1), 0, wx.EXPAND) mainSizer.Add(bottomPanel, 1, wx.EXPAND) mainSizer.Add(self.infoPane, 0, wx.EXPAND) self.bottomSizer = sz = wx.BoxSizer(wx.VERTICAL) sz.Add((0, 0), 1) sz.Add(self.testPanel, 0, wx.ALIGN_CENTER) sz.Add((0, 0), 1) bottomPanel.SetSizer(sz) p.SetSizerAndFit(mainSizer) self.Fit() self.PopulateHistory()
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Platform Silicon Test Suite - Renoir", pos = wx.DefaultPosition, size = wx.Size( 788,700 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) self.m_menubar1 = wx.MenuBar( 0 ) self.m_menu1 = wx.Menu() self.m_menuItem1 = wx.MenuItem( self.m_menu1, wx.ID_ANY, u"Renoir", wx.EmptyString, wx.ITEM_CHECK ) self.m_menu1.Append( self.m_menuItem1 ) self.m_menuItem1.Check( True ) self.m_menuItem2 = wx.MenuItem( self.m_menu1, wx.ID_ANY, u"Vermeer", wx.EmptyString, wx.ITEM_CHECK ) self.m_menu1.Append( self.m_menuItem2 ) self.m_menubar1.Append( self.m_menu1, u"Processor Family" ) self.m_menu2 = wx.Menu() self.m_menuItem3 = wx.MenuItem( self.m_menu2, wx.ID_ANY, u"Add...", wx.EmptyString, wx.ITEM_NORMAL ) self.m_menu2.Append( self.m_menuItem3 ) self.m_menubar1.Append( self.m_menu2, u"Wombat IP" ) self.SetMenuBar( self.m_menubar1 ) fgSizer49 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer49.SetFlexibleDirection( wx.BOTH ) fgSizer49.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_panel17 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 775,725 ), wx.TAB_TRAVERSAL ) bSizer18 = wx.BoxSizer( wx.VERTICAL ) fgSizer201 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer201.SetFlexibleDirection( wx.BOTH ) fgSizer201.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) m_choice2Choices = [] self.m_choice2 = wx.Choice( self.m_panel17, wx.ID_ANY, wx.DefaultPosition, wx.Size( 125,-1 ), m_choice2Choices, 0 ) self.m_choice2.SetSelection( 0 ) fgSizer201.Add( self.m_choice2, 0, wx.ALL, 5 ) fgSizer222 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer222.SetFlexibleDirection( wx.BOTH ) fgSizer222.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_button121 = wx.Button( self.m_panel17, wx.ID_ANY, u"Power On", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer222.Add( self.m_button121, 0, wx.ALL, 5 ) fgSizer211 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer211.SetFlexibleDirection( wx.BOTH ) fgSizer211.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_button14 = wx.Button( self.m_panel17, wx.ID_ANY, u"Power Off", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer211.Add( self.m_button14, 0, wx.ALL, 5 ) fgSizer23 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer23.SetFlexibleDirection( wx.BOTH ) fgSizer23.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_button15 = wx.Button( self.m_panel17, wx.ID_ANY, u"Cold Reset", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer23.Add( self.m_button15, 0, wx.ALL, 5 ) fgSizer241 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer241.SetFlexibleDirection( wx.BOTH ) fgSizer241.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_button16 = wx.Button( self.m_panel17, wx.ID_ANY, u"Warm Reset", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer241.Add( self.m_button16, 0, wx.ALL, 5 ) fgSizer30 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer30.SetFlexibleDirection( wx.BOTH ) fgSizer30.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_button19 = wx.Button( self.m_panel17, wx.ID_ANY, u"Unlock Wombat", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer30.Add( self.m_button19, 0, wx.ALL, 5 ) fgSizer241.Add( fgSizer30, 1, wx.EXPAND, 5 ) fgSizer23.Add( fgSizer241, 1, wx.EXPAND, 5 ) fgSizer211.Add( fgSizer23, 1, wx.EXPAND, 5 ) fgSizer222.Add( fgSizer211, 1, wx.EXPAND, 5 ) fgSizer201.Add( fgSizer222, 1, wx.EXPAND, 5 ) bSizer18.Add( fgSizer201, 1, wx.EXPAND, 5 ) fgSizer17 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer17.SetFlexibleDirection( wx.BOTH ) fgSizer17.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_panel18 = wx.Panel( self.m_panel17, wx.ID_ANY, wx.DefaultPosition, wx.Size( 750,700 ), wx.TAB_TRAVERSAL ) fgSizer221 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer221.SetFlexibleDirection( wx.BOTH ) fgSizer221.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_panel7 = wx.Panel( self.m_panel18, wx.ID_ANY, wx.DefaultPosition, wx.Size( 325,685 ), wx.TAB_TRAVERSAL ) fgSizer20 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer20.SetFlexibleDirection( wx.BOTH ) fgSizer20.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_treeCtrl1 = wx.TreeCtrl( self.m_panel7, wx.ID_ANY, wx.DefaultPosition, wx.Size( 325,685 ), wx.TR_DEFAULT_STYLE|wx.BORDER_NONE ) fgSizer20.Add( self.m_treeCtrl1, 0, wx.ALL, 5 ) self.m_panel7.SetSizer( fgSizer20 ) self.m_panel7.Layout() fgSizer221.Add( self.m_panel7, 1, wx.EXPAND |wx.ALL, 5 ) self.m_panel8 = wx.Panel( self.m_panel18, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,700 ), wx.TAB_TRAVERSAL ) fgSizer7 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer7.SetFlexibleDirection( wx.BOTH ) fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.fusePanel = wx.Panel( self.m_panel8, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,675 ), wx.BORDER_SUNKEN ) self.fusePanel.Hide() bSizer21 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText21 = wx.StaticText( self.fusePanel, wx.ID_ANY, u"Fuse Window:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText21.Wrap( -1 ) self.m_staticText21.SetFont( wx.Font( 10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True, "Arial" ) ) bSizer21.Add( self.m_staticText21, 0, wx.ALL, 5 ) fgSizer21 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer21.SetFlexibleDirection( wx.BOTH ) fgSizer21.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText9 = wx.StaticText( self.fusePanel, wx.ID_ANY, u"Fuse File:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText9.Wrap( -1 ) fgSizer21.Add( self.m_staticText9, 0, wx.ALL, 5 ) self.m_filePicker1 = wx.FilePickerCtrl( self.fusePanel, wx.ID_ANY, wx.EmptyString, u"Select a file", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE ) fgSizer21.Add( self.m_filePicker1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) bSizer21.Add( fgSizer21, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_button11 = wx.Button( self.fusePanel, wx.ID_ANY, u"Fuse", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer21.Add( self.m_button11, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.fusePanel.SetSizer( bSizer21 ) self.fusePanel.Layout() fgSizer7.Add( self.fusePanel, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.readClkPanel = wx.Panel( self.m_panel8, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,675 ), wx.BORDER_SUNKEN|wx.TAB_TRAVERSAL ) self.readClkPanel.Hide() bSizer1111 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText21111 = wx.StaticText( self.readClkPanel, wx.ID_ANY, u"Read Clock Window:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText21111.Wrap( -1 ) self.m_staticText21111.SetFont( wx.Font( 10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True, "Arial" ) ) bSizer1111.Add( self.m_staticText21111, 0, wx.ALL, 5 ) fgSizer1111 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer1111.SetFlexibleDirection( wx.BOTH ) fgSizer1111.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) fgSizer1111.Add( ( 0, 0), 1, wx.EXPAND, 5 ) bSizer1111.Add( fgSizer1111, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_button511 = wx.Button( self.readClkPanel, wx.ID_ANY, u"Read Clock", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer1111.Add( self.m_button511, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.readClkPanel.SetSizer( bSizer1111 ) self.readClkPanel.Layout() fgSizer7.Add( self.readClkPanel, 1, wx.EXPAND |wx.ALL, 5 ) self.readPostCodesPanel = wx.Panel( self.m_panel8, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,675 ), wx.BORDER_SUNKEN|wx.TAB_TRAVERSAL ) self.readPostCodesPanel.Hide() bSizer11111 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText211111 = wx.StaticText( self.readPostCodesPanel, wx.ID_ANY, u"Read Postcodes Window:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText211111.Wrap( -1 ) self.m_staticText211111.SetFont( wx.Font( 10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True, "Arial" ) ) bSizer11111.Add( self.m_staticText211111, 0, wx.ALL, 5 ) fgSizer11111 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer11111.SetFlexibleDirection( wx.BOTH ) fgSizer11111.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) fgSizer11111.Add( ( 0, 0), 1, wx.EXPAND, 5 ) bSizer11111.Add( fgSizer11111, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_button5111 = wx.Button( self.readPostCodesPanel, wx.ID_ANY, u"Read Postcodes", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer11111.Add( self.m_button5111, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.readPostCodesPanel.SetSizer( bSizer11111 ) self.readPostCodesPanel.Layout() fgSizer7.Add( self.readPostCodesPanel, 1, wx.EXPAND |wx.ALL, 5 ) self.readVDDsPanel = wx.Panel( self.m_panel8, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,675 ), wx.BORDER_SUNKEN|wx.TAB_TRAVERSAL ) self.readVDDsPanel.Hide() bSizer111112 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText2111112 = wx.StaticText( self.readVDDsPanel, wx.ID_ANY, u"Read VDDs Window:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2111112.Wrap( -1 ) self.m_staticText2111112.SetFont( wx.Font( 10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True, "Arial" ) ) bSizer111112.Add( self.m_staticText2111112, 0, wx.ALL, 5 ) fgSizer111112 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer111112.SetFlexibleDirection( wx.BOTH ) fgSizer111112.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) fgSizer111112.Add( ( 0, 0), 1, wx.EXPAND, 5 ) bSizer111112.Add( fgSizer111112, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_button51112 = wx.Button( self.readVDDsPanel, wx.ID_ANY, u"Read VDDs", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer111112.Add( self.m_button51112, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.readVDDsPanel.SetSizer( bSizer111112 ) self.readVDDsPanel.Layout() fgSizer7.Add( self.readVDDsPanel, 1, wx.EXPAND |wx.ALL, 5 ) self.trainConPanel = wx.Panel( self.m_panel8, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,675 ), wx.BORDER_SUNKEN ) self.trainConPanel.Hide() bSizer112 = wx.BoxSizer( wx.VERTICAL ) self.m_panel16 = wx.Panel( self.trainConPanel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) bSizer15 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText221 = wx.StaticText( self.m_panel16, wx.ID_ANY, u"Training Consistency Window:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText221.Wrap( -1 ) self.m_staticText221.SetFont( wx.Font( 10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True, "Arial" ) ) bSizer15.Add( self.m_staticText221, 0, wx.ALL, 5 ) bSizer12 = wx.BoxSizer( wx.VERTICAL ) fgSizer13 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer13.SetFlexibleDirection( wx.BOTH ) fgSizer13.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText24 = wx.StaticText( self.m_panel16, wx.ID_ANY, u"COM Port:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText24.Wrap( -1 ) fgSizer13.Add( self.m_staticText24, 0, wx.ALL, 5 ) m_choice1Choices = [ u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"10", u"11", u"12", u"13", u"14", u"15", u"16", u"17", u"18", u"19", u"20", u"21", u"22", u"23", u"24", u"25", u"26", u"27", u"28", u"29", u"30", u"31", u"32", u"33", u"34", u"35", u"36", u"37", u"38", u"39", u"40", u"41", u"42", u"43", u"44", u"45", u"46", u"47", u"48", u"49", u"50", u"51", u"52", u"53", u"54", u"55", u"56", u"57", u"58", u"59", u"60", u"61", u"62", u"63", u"64", u"65", u"66", u"67", u"68", u"69", u"70", u"71", u"72", u"73", u"74", u"75", u"76", u"77", u"78", u"79", u"80", u"81", u"82", u"83", u"84", u"85", u"86", u"87", u"88", u"89", u"90", u"91", u"92", u"93", u"94", u"95", u"96", u"97", u"98", u"99", u"10", u"101", u"102", u"103", u"104", u"105", u"106", u"107", u"108", u"109", u"110", u"111", u"112", u"113", u"114", u"115", u"116", u"117", u"118", u"119", u"120", u"121", u"122", u"123", u"124", u"125", u"126", u"127", u"128", u"129", u"131", u"132", u"133", u"134", u"135", u"136", u"137", u"138", u"139", u"140", u"141", u"142", u"143", u"144", u"145", u"146", u"147", u"148", u"149", u"150", u"151", u"152", u"153", u"154", u"155", u"156", u"157", u"158", u"159", u"160", u"161", u"162", u"163", u"164", u"165", u"166", u"167", u"168", u"169", u"170", u"171", u"172", u"173", u"174", u"175", u"176", u"177", u"178", u"179", u"180", u"181", u"182", u"183", u"184", u"185", u"186", u"187", u"188", u"189", u"190", u"191", u"192", u"193", u"194", u"195", u"196", u"197", u"198", u"199", u"200", u"201", u"202", u"203", u"204", u"205", u"206", u"207", u"208", u"209", u"210", u"211", u"212", u"213", u"214", u"215", u"216", u"217", u"218", u"219", u"220", u"221", u"222", u"223", u"224", u"225", u"226", u"227", u"228", u"229", u"230", u"231", u"232", u"234", u"235", u"236", u"237", u"238", u"239", u"240", u"241", u"242", u"243", u"244", u"245", u"246", u"247", u"248", u"249", u"250", u"251", u"252", u"253", u"254", u"255", u"256" ] self.m_choice1 = wx.Choice( self.m_panel16, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice1Choices, 0 ) self.m_choice1.SetSelection( 0 ) fgSizer13.Add( self.m_choice1, 0, wx.ALL, 5 ) self.m_staticText25 = wx.StaticText( self.m_panel16, wx.ID_ANY, u"Number of Reboots:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText25.Wrap( -1 ) fgSizer13.Add( self.m_staticText25, 0, wx.ALL, 5 ) self.m_textCtrl121 = wx.TextCtrl( self.m_panel16, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer13.Add( self.m_textCtrl121, 0, wx.ALL, 5 ) self.m_staticText26 = wx.StaticText( self.m_panel16, wx.ID_ANY, u"Output File Name:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText26.Wrap( -1 ) fgSizer13.Add( self.m_staticText26, 0, wx.ALL, 5 ) self.m_textCtrl13 = wx.TextCtrl( self.m_panel16, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer13.Add( self.m_textCtrl13, 0, wx.ALL, 5 ) self.m_checkBox1 = wx.CheckBox( self.m_panel16, wx.ID_ANY, u"Fuse File:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer13.Add( self.m_checkBox1, 0, wx.ALL, 5 ) self.m_filePicker2 = wx.FilePickerCtrl( self.m_panel16, wx.ID_ANY, wx.EmptyString, u"Select a file", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE ) self.m_filePicker2.Hide() fgSizer13.Add( self.m_filePicker2, 0, wx.ALL, 5 ) bSizer12.Add( fgSizer13, 0, 0, 5 ) self.m_staticline1 = wx.StaticLine( self.m_panel16, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) bSizer12.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) self.m_checkBox12 = wx.CheckBox( self.m_panel16, wx.ID_ANY, u"Custom Settings", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer12.Add( self.m_checkBox12, 0, wx.ALL, 5 ) bSizer15.Add( bSizer12, 1, wx.EXPAND, 5 ) self.m_panel16.SetSizer( bSizer15 ) self.m_panel16.Layout() bSizer15.Fit( self.m_panel16 ) bSizer112.Add( self.m_panel16, 0, wx.ALL, 5 ) self.m_panel15 = wx.Panel( self.trainConPanel, wx.ID_ANY, wx.DefaultPosition, wx.Size( 350,-1 ), wx.TAB_TRAVERSAL ) self.m_panel15.Hide() fgSizer14 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer14.SetFlexibleDirection( wx.BOTH ) fgSizer14.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_checkBox2 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"Breakpoint", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox2, 0, wx.ALL, 5 ) self.m_checkBox3 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"Username/Password", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox3, 0, wx.ALL, 5 ) self.m_staticText27 = wx.StaticText( self.m_panel15, wx.ID_ANY, u"Username:"******"Password:"******"ABL Timeout:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox4, 0, wx.ALL, 5 ) self.m_textCtrl17 = wx.TextCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl17.Hide() fgSizer14.Add( self.m_textCtrl17, 0, wx.ALL, 5 ) self.m_checkBox5 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"1D String:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox5, 0, wx.ALL, 5 ) self.m_dirPicker1 = wx.DirPickerCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE ) self.m_dirPicker1.Hide() fgSizer14.Add( self.m_dirPicker1, 0, wx.ALL, 5 ) self.m_checkBox6 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"2D String:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox6, 0, wx.ALL, 5 ) self.m_dirPicker2 = wx.DirPickerCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, u"Select a folder", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE ) self.m_dirPicker2.Hide() fgSizer14.Add( self.m_dirPicker2, 0, wx.ALL, 5 ) self.m_checkBox7 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"End-Flag String:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox7, 0, wx.ALL, 5 ) self.m_textCtrl18 = wx.TextCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl18.Hide() fgSizer14.Add( self.m_textCtrl18, 0, wx.ALL, 5 ) self.m_staticText29 = wx.StaticText( self.m_panel15, wx.ID_ANY, u"End-Flag Timeout:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText29.Wrap( -1 ) self.m_staticText29.Hide() fgSizer14.Add( self.m_staticText29, 0, wx.ALL, 5 ) self.m_textCtrl14 = wx.TextCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl14.Hide() fgSizer14.Add( self.m_textCtrl14, 0, wx.ALL, 5 ) self.m_checkBox8 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"Connect to SUT IP:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox8, 0, wx.ALL, 5 ) self.m_textCtrl19 = wx.TextCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl19.Hide() fgSizer14.Add( self.m_textCtrl19, 0, wx.ALL, 5 ) self.m_checkBox9 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"MST Loops:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox9, 0, wx.ALL, 5 ) self.m_textCtrl20 = wx.TextCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl20.Hide() fgSizer14.Add( self.m_textCtrl20, 0, wx.ALL, 5 ) self.m_checkBox10 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"Memory Snapshot:", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox10, 0, wx.ALL, 5 ) self.m_textCtrl21 = wx.TextCtrl( self.m_panel15, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_textCtrl21.Hide() fgSizer14.Add( self.m_textCtrl21, 0, wx.ALL, 5 ) self.m_checkBox11 = wx.CheckBox( self.m_panel15, wx.ID_ANY, u"Parsed-Log Only", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer14.Add( self.m_checkBox11, 0, wx.ALL, 5 ) self.m_panel15.SetSizer( fgSizer14 ) self.m_panel15.Layout() bSizer112.Add( self.m_panel15, 0, wx.ALL, 5 ) fgSizer24 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer24.SetFlexibleDirection( wx.BOTH ) fgSizer24.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) fgSizer24.Add( ( 0, 0), 1, wx.EXPAND, 5 ) bSizer112.Add( fgSizer24, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_button111 = wx.Button( self.trainConPanel, wx.ID_ANY, u"Start Test", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer112.Add( self.m_button111, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.trainConPanel.SetSizer( bSizer112 ) self.trainConPanel.Layout() fgSizer7.Add( self.trainConPanel, 1, wx.EXPAND |wx.ALL, 5 ) self.voltVSTempPanel = wx.Panel( self.m_panel8, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,675 ), wx.BORDER_SUNKEN|wx.TAB_TRAVERSAL ) self.voltVSTempPanel.Hide() bSizer9 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText13 = wx.StaticText( self.voltVSTempPanel, wx.ID_ANY, u"Voltage vs Frequency Window:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText13.Wrap( -1 ) self.m_staticText13.SetFont( wx.Font( 10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "Arial" ) ) bSizer9.Add( self.m_staticText13, 0, wx.ALL, 5 ) fgSizer19 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer19.SetFlexibleDirection( wx.BOTH ) fgSizer19.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) m_radioBox1Choices = [ u"50°C", u"70°C", u"90°C" ] self.m_radioBox1 = wx.RadioBox( self.voltVSTempPanel, wx.ID_ANY, u"Temperature", wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS ) self.m_radioBox1.SetSelection( 0 ) fgSizer19.Add( self.m_radioBox1, 0, wx.ALL, 5 ) bSizer10 = wx.BoxSizer( wx.VERTICAL ) fgSizer202 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer202.SetFlexibleDirection( wx.BOTH ) fgSizer202.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText15 = wx.StaticText( self.voltVSTempPanel, wx.ID_ANY, u"Chiller COM: ", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText15.Wrap( -1 ) fgSizer202.Add( self.m_staticText15, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 5 ) m_choice3Choices = [ u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"10", u"11", u"12", u"13", u"14", u"15", u"16", u"17", u"18", u"19", u"20", u"21", u"22", u"23", u"24", u"25", u"26", u"27", u"28", u"29", u"30", u"31", u"32", u"33", u"34", u"35", u"36", u"37", u"38", u"39", u"40", u"41", u"42", u"43", u"44", u"45", u"46", u"47", u"48", u"49", u"50", u"51", u"52", u"53", u"54", u"55", u"56", u"57", u"58", u"59", u"60", u"61", u"62", u"63", u"64", u"65", u"66", u"67", u"68", u"69", u"70", u"71", u"72", u"73", u"74", u"75", u"76", u"77", u"78", u"79", u"80", u"81", u"82", u"83", u"84", u"85", u"86", u"87", u"88", u"89", u"90", u"91", u"92", u"93", u"94", u"95", u"96", u"97", u"98", u"99", u"10", u"101", u"102", u"103", u"104", u"105", u"106", u"107", u"108", u"109", u"110", u"111", u"112", u"113", u"114", u"115", u"116", u"117", u"118", u"119", u"120", u"121", u"122", u"123", u"124", u"125", u"126", u"127", u"128", u"129", u"131", u"132", u"133", u"134", u"135", u"136", u"137", u"138", u"139", u"140", u"141", u"142", u"143", u"144", u"145", u"146", u"147", u"148", u"149", u"150", u"151", u"152", u"153", u"154", u"155", u"156", u"157", u"158", u"159", u"160", u"161", u"162", u"163", u"164", u"165", u"166", u"167", u"168", u"169", u"170", u"171", u"172", u"173", u"174", u"175", u"176", u"177", u"178", u"179", u"180", u"181", u"182", u"183", u"184", u"185", u"186", u"187", u"188", u"189", u"190", u"191", u"192", u"193", u"194", u"195", u"196", u"197", u"198", u"199", u"200", u"201", u"202", u"203", u"204", u"205", u"206", u"207", u"208", u"209", u"210", u"211", u"212", u"213", u"214", u"215", u"216", u"217", u"218", u"219", u"220", u"221", u"222", u"223", u"224", u"225", u"226", u"227", u"228", u"229", u"230", u"231", u"232", u"234", u"235", u"236", u"237", u"238", u"239", u"240", u"241", u"242", u"243", u"244", u"245", u"246", u"247", u"248", u"249", u"250", u"251", u"252", u"253", u"254", u"255", u"256" ] self.m_choice3 = wx.Choice( self.voltVSTempPanel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice3Choices, 0 ) self.m_choice3.SetSelection( 0 ) fgSizer202.Add( self.m_choice3, 0, wx.ALL, 5 ) bSizer10.Add( fgSizer202, 0, 0, 5 ) fgSizer22 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer22.SetFlexibleDirection( wx.BOTH ) fgSizer22.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText16 = wx.StaticText( self.voltVSTempPanel, wx.ID_ANY, u"SUT IP: ", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText16.Wrap( -1 ) fgSizer22.Add( self.m_staticText16, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.m_textCtrl11 = wx.TextCtrl( self.voltVSTempPanel, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer22.Add( self.m_textCtrl11, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 5 ) bSizer10.Add( fgSizer22, 0, 0, 5 ) fgSizer231 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer231.SetFlexibleDirection( wx.BOTH ) fgSizer231.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText17 = wx.StaticText( self.voltVSTempPanel, wx.ID_ANY, u"Output Name:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText17.Wrap( -1 ) fgSizer231.Add( self.m_staticText17, 0, wx.ALL, 5 ) self.m_textCtrl12 = wx.TextCtrl( self.voltVSTempPanel, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer231.Add( self.m_textCtrl12, 0, wx.ALL, 5 ) bSizer10.Add( fgSizer231, 1, wx.EXPAND, 5 ) fgSizer212 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer212.SetFlexibleDirection( wx.BOTH ) fgSizer212.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_checkBox13 = wx.CheckBox( self.voltVSTempPanel, wx.ID_ANY, u"Fuse File: ", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer212.Add( self.m_checkBox13, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) self.m_filePicker3 = wx.FilePickerCtrl( self.voltVSTempPanel, wx.ID_ANY, wx.EmptyString, u"Select a file", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE ) fgSizer212.Add( self.m_filePicker3, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) bSizer10.Add( fgSizer212, 0, 0, 5 ) fgSizer19.Add( bSizer10, 1, wx.EXPAND, 5 ) m_radioBox2Choices = [ u"0", u"1", u"2", u"3", u"4", u"5", u"6", u"7" ] self.m_radioBox2 = wx.RadioBox( self.voltVSTempPanel, wx.ID_ANY, u"Starting Core", wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS ) self.m_radioBox2.SetSelection( 0 ) fgSizer19.Add( self.m_radioBox2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) fgSizer242 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer242.SetFlexibleDirection( wx.BOTH ) fgSizer242.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) m_radioBox3Choices = [ u"0", u"1", u"2", u"3", u"4", u"5", u"6", u"7" ] self.m_radioBox3 = wx.RadioBox( self.voltVSTempPanel, wx.ID_ANY, u"Ending Core", wx.DefaultPosition, wx.DefaultSize, m_radioBox3Choices, 1, wx.RA_SPECIFY_COLS ) self.m_radioBox3.SetSelection( 7 ) fgSizer242.Add( self.m_radioBox3, 0, wx.ALL|wx.EXPAND, 5 ) m_radioBox4Choices = [ u"0.90", u"0.95", u"1.00", u"1.05", u"1.10", u"1.15", u"1.20", u"1.25", u"1.30", u"1.35", u"1.40", u"1.45" ] self.m_radioBox4 = wx.RadioBox( self.voltVSTempPanel, wx.ID_ANY, u"Starting Voltage", wx.DefaultPosition, wx.DefaultSize, m_radioBox4Choices, 1, wx.RA_SPECIFY_COLS ) self.m_radioBox4.SetSelection( 0 ) fgSizer242.Add( self.m_radioBox4, 0, wx.ALL|wx.EXPAND, 5 ) fgSizer19.Add( fgSizer242, 1, wx.EXPAND, 5 ) bSizer9.Add( fgSizer19, 0, 0, 5 ) bSizer9.Add( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_gauge1 = wx.Gauge( self.voltVSTempPanel, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL|wx.GA_SMOOTH ) self.m_gauge1.SetValue( 0 ) self.m_gauge1.Hide() bSizer9.Add( self.m_gauge1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 ) self.m_button112 = wx.Button( self.voltVSTempPanel, wx.ID_ANY, u"Start", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer9.Add( self.m_button112, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.voltVSTempPanel.SetSizer( bSizer9 ) self.voltVSTempPanel.Layout() fgSizer7.Add( self.voltVSTempPanel, 1, wx.EXPAND |wx.ALL, 5 ) self.m_panel8.SetSizer( fgSizer7 ) self.m_panel8.Layout() fgSizer221.Add( self.m_panel8, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 ) self.m_panel18.SetSizer( fgSizer221 ) self.m_panel18.Layout() fgSizer17.Add( self.m_panel18, 1, wx.EXPAND |wx.ALL, 5 ) bSizer18.Add( fgSizer17, 1, wx.EXPAND, 5 ) self.m_panel17.SetSizer( bSizer18 ) self.m_panel17.Layout() fgSizer49.Add( self.m_panel17, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( fgSizer49 ) self.Layout() self.m_statusBar1 = self.CreateStatusBar( 1, wx.STB_SIZEGRIP, wx.ID_ANY ) self.Centre( wx.BOTH ) # Connect Events self.Bind( wx.EVT_MENU, self.renoirSelect, id = self.m_menuItem1.GetId() ) self.Bind( wx.EVT_MENU, self.vermeerSelect, id = self.m_menuItem2.GetId() ) self.Bind( wx.EVT_MENU, self.newIPSelect, id = self.m_menuItem3.GetId() ) self.m_button121.Bind( wx.EVT_BUTTON, self.powerOn ) self.m_button14.Bind( wx.EVT_BUTTON, self.powerOff ) self.m_button15.Bind( wx.EVT_BUTTON, self.coldReset ) self.m_button16.Bind( wx.EVT_BUTTON, self.warmReset ) self.m_button19.Bind( wx.EVT_BUTTON, self.unlockWombat ) self.m_treeCtrl1.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.itemSelect ) self.m_button11.Bind( wx.EVT_BUTTON, self.fuse ) self.m_button511.Bind( wx.EVT_BUTTON, self.readClk ) self.m_button5111.Bind( wx.EVT_BUTTON, self.readPostcodes ) self.m_button51112.Bind( wx.EVT_BUTTON, self.readVDDs ) self.m_checkBox1.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox12.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox3.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox4.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox5.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox6.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox7.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox8.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox9.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox10.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_checkBox11.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_button111.Bind( wx.EVT_BUTTON, self.trainConsistency ) self.m_checkBox13.Bind( wx.EVT_CHECKBOX, self.guiInteract ) self.m_button112.Bind( wx.EVT_BUTTON, self.voltVsFreqMarg )
def loadPage(self): self.logger.debug('Page2: __onObjectSelection: received objType {} and objDef {}'.format(self.objectType, self.objectDefinition)) mainBox = wx.BoxSizer(wx.HORIZONTAL) mainBox.AddSpacer(60) vbox = wx.BoxSizer(wx.VERTICAL) vbox.AddSpacer(20) self.logger.debug(' Page2 objectType from page1: {}'.format(self.objectType)) label = 'Manually insert object type: {}'.format(self.objectType) banner = wx.StaticText(self, label=label) f = banner.GetFont() f.SetPointSize(f.GetPointSize()+6) f.SetWeight(wx.FONTWEIGHT_BOLD) banner.SetFont(f) vbox.Add(banner, 0, wx.LEFT|wx.EXPAND, 20) vbox.AddSpacer(20) text = 'Complete this form and click Next to insert the object.' description = wx.StaticText(self, label=text) font = description.GetFont() font.SetPointSize(font.GetPointSize()+2) description.SetFont(font) vbox.Add(description, 0, wx.LEFT|wx.EXPAND, 20) vbox.AddSpacer(20) bufferSizer = wx.BoxSizer(wx.HORIZONTAL) bufferSizer.AddSpacer(20) panelSizer = wx.FlexGridSizer(cols=2, hgap=20, vgap=20) panelSizer.AddGrowableCol(1) for attrName,attrType in self.objectDefinition.items(): self.logger.debug(' ... working on {} : {} : {}'.format(attrName, attrType, type(attrType))) thisText = wx.StaticText(self, -1, '{} :'.format(attrName)) thisText.SetFont(font) thisControl = None if isinstance(attrType, str): self.logger.debug(' ... found string') thisControl = wx.TextCtrl(self, wx.ID_ANY, "") thisControl.SetFont(font) elif isinstance(attrType, bool): self.logger.debug(' ... found boolean') thisControl = wx.Choice(self, wx.ID_ANY, (120, 50), choices=['True', 'False']) thisControl.SetSelection(0) thisControl.SetFont(font) self.boolValue = True self.Bind(wx.EVT_CHOICE, self.EvtChooseBool, thisControl) elif isinstance(attrType, list): self.logger.debug(' ... found list') thisControl = wx.Choice(self, wx.ID_ANY, (120, 50), choices=attrType) thisControl.SetSelection(0) thisControl.SetFont(font) self.listValue = attrType[0] self.Bind(wx.EVT_CHOICE, self.EvtChooseList, thisControl) else: self.logger.debug('Unsupported instance {} type {}'.format(attrType, type(attrType))) continue self.ctrlTracker[attrName] = thisControl panelSizer.Add(thisText, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL) panelSizer.Add(thisControl, 0, wx.EXPAND) bufferSizer.Add(panelSizer, 0) vbox.Add(bufferSizer, 0) vbox.AddSpacer(20) btn = wx.Button(self, label="Insert") btn.SetFont(font) self.Bind(wx.EVT_BUTTON, self.onInsert, btn) vbox.Add(btn, 0, wx.LEFT|wx.RIGHT, 20) btn.SetDefault() btn.SetFocus() vbox.AddStretchSpacer() mainBox.Add(vbox, 1, wx.EXPAND|wx.RIGHT, 60) self.SetSizer(mainBox)
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"CLIENTE", pos = wx.DefaultPosition, size = wx.Size( 1003,439 ), style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHTTEXT ) ) gbSizer1 = wx.GridBagSizer( 0, 0 ) gbSizer1.SetFlexibleDirection( wx.BOTH ) gbSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) sbSizer1 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Búsqueda" ), wx.VERTICAL ) gbSizer2 = wx.GridBagSizer( 0, 0 ) gbSizer2.SetFlexibleDirection( wx.BOTH ) gbSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.tc_dato_busqueda = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,-1 ), wx.TE_PROCESS_ENTER ) self.tc_dato_busqueda.SetMaxLength( 150 ) self.tc_dato_busqueda.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer2.Add( self.tc_dato_busqueda, wx.GBPosition( 1, 0 ), wx.GBSpan( 1, 2 ), wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.btn_buscar = wx.Button( self, wx.ID_ANY, u"Buscar", wx.DefaultPosition, wx.Size( 100,30 ), 0 ) self.btn_buscar.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer2.Add( self.btn_buscar, wx.GBPosition( 1, 2 ), wx.GBSpan( 1, 1 ), wx.ALL, 5 ) rbx_tipo_busquedaChoices = [ u"Por Código", u"Por Apellido y Nombre" ] self.rbx_tipo_busqueda = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, rbx_tipo_busquedaChoices, 1, wx.RA_SPECIFY_ROWS ) self.rbx_tipo_busqueda.SetSelection( 0 ) self.rbx_tipo_busqueda.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer2.Add( self.rbx_tipo_busqueda, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.LEFT, 5 ) sbSizer1.Add( gbSizer2, 1, wx.EXPAND, 5 ) gbSizer1.Add( sbSizer1, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.EXPAND|wx.TOP|wx.LEFT, 20 ) sbSizer2 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Resultados" ), wx.VERTICAL ) gbSizer3 = wx.GridBagSizer( 0, 0 ) gbSizer3.SetFlexibleDirection( wx.BOTH ) gbSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.grilla = wx.grid.Grid( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 510,120 ), 0 ) # Grid self.grilla.CreateGrid( 0, 3 ) self.grilla.EnableEditing( False ) self.grilla.EnableGridLines( True ) self.grilla.EnableDragGridSize( False ) self.grilla.SetMargins( 0, 0 ) # Columns self.grilla.SetColSize( 0, 80 ) self.grilla.SetColSize( 1, 185 ) self.grilla.SetColSize( 2, 182 ) self.grilla.EnableDragColMove( False ) self.grilla.EnableDragColSize( True ) self.grilla.SetColLabelSize( 30 ) self.grilla.SetColLabelValue( 0, u"Código" ) self.grilla.SetColLabelValue( 1, u"Apellido y Nombre" ) self.grilla.SetColLabelValue( 2, u"Domicilio" ) self.grilla.SetColLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE ) # Rows self.grilla.EnableDragRowSize( True ) self.grilla.SetRowLabelSize( 50 ) self.grilla.SetRowLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE ) # Label Appearance # Cell Defaults self.grilla.SetDefaultCellFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.grilla.SetDefaultCellAlignment( wx.ALIGN_LEFT, wx.ALIGN_TOP ) self.grilla.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer3.Add( self.grilla, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.ALL, 5 ) self.btn_seleccionar = wx.Button( self, wx.ID_ANY, u"Seleccionar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.btn_seleccionar.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.btn_seleccionar.Enable( False ) gbSizer3.Add( self.btn_seleccionar, wx.GBPosition( 1, 0 ), wx.GBSpan( 1, 1 ), wx.ALL|wx.EXPAND, 5 ) sbSizer2.Add( gbSizer3, 1, wx.EXPAND, 5 ) gbSizer1.Add( sbSizer2, wx.GBPosition( 1, 0 ), wx.GBSpan( 1, 1 ), wx.EXPAND|wx.TOP|wx.LEFT, 20 ) sbSizer3 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Movimiento" ), wx.VERTICAL ) gbSizer4 = wx.GridBagSizer( 0, 0 ) gbSizer4.SetFlexibleDirection( wx.BOTH ) gbSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Código:", wx.DefaultPosition, wx.Size( -1,-1 ), 0 ) self.m_staticText1.Wrap( -1 ) self.m_staticText1.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.m_staticText1.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) gbSizer4.Add( self.m_staticText1, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.RIGHT|wx.LEFT, 5 ) self.tc_codigo = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,-1 ), wx.TE_CENTRE|wx.TE_READONLY ) self.tc_codigo.SetMaxLength( 10 ) self.tc_codigo.SetFont( wx.Font( 11, 70, 90, 92, False, wx.EmptyString ) ) gbSizer4.Add( self.tc_codigo, wx.GBPosition( 1, 0 ), wx.GBSpan( 1, 1 ), wx.RIGHT|wx.LEFT, 5 ) self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Apellido y Nombre:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText5.Wrap( -1 ) self.m_staticText5.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.m_staticText5.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) gbSizer4.Add( self.m_staticText5, wx.GBPosition( 2, 0 ), wx.GBSpan( 1, 1 ), wx.TOP|wx.RIGHT|wx.LEFT, 5 ) self.tc_apenom = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 250,-1 ), wx.TE_READONLY ) self.tc_apenom.SetMaxLength( 150 ) self.tc_apenom.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer4.Add( self.tc_apenom, wx.GBPosition( 3, 0 ), wx.GBSpan( 1, 2 ), wx.RIGHT|wx.LEFT, 5 ) self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Campaña:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText6.Wrap( -1 ) self.m_staticText6.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.m_staticText6.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) gbSizer4.Add( self.m_staticText6, wx.GBPosition( 4, 0 ), wx.GBSpan( 1, 1 ), wx.TOP|wx.RIGHT|wx.LEFT, 5 ) self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Deuda:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText7.Wrap( -1 ) self.m_staticText7.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.m_staticText7.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) gbSizer4.Add( self.m_staticText7, wx.GBPosition( 4, 1 ), wx.GBSpan( 1, 1 ), wx.TOP|wx.RIGHT|wx.LEFT, 5 ) self.m_staticText51 = wx.StaticText( self, wx.ID_ANY, u"Aproximado:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText51.Wrap( -1 ) self.m_staticText51.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.m_staticText51.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT ) ) gbSizer4.Add( self.m_staticText51, wx.GBPosition( 4, 2 ), wx.GBSpan( 1, 1 ), wx.RIGHT|wx.LEFT|wx.ALIGN_BOTTOM, 5 ) self.tc_camp = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_READONLY ) self.tc_camp.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer4.Add( self.tc_camp, wx.GBPosition( 5, 0 ), wx.GBSpan( 1, 1 ), wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 ) self.tc_deuda = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_READONLY ) self.tc_deuda.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer4.Add( self.tc_deuda, wx.GBPosition( 5, 1 ), wx.GBSpan( 1, 1 ), wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 ) self.tc_aproximado = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_READONLY ) self.tc_aproximado.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer4.Add( self.tc_aproximado, wx.GBPosition( 5, 2 ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER_VERTICAL|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 ) self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) gbSizer4.Add( self.m_staticline1, wx.GBPosition( 6, 0 ), wx.GBSpan( 1, 3 ), wx.EXPAND |wx.ALL, 5 ) self.cb_entregado = wx.CheckBox( self, wx.ID_ANY, u"Entregado", wx.DefaultPosition, wx.DefaultSize, 0 ) self.cb_entregado.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer4.Add( self.cb_entregado, wx.GBPosition( 7, 0 ), wx.GBSpan( 1, 1 ), wx.ALL, 5 ) self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) gbSizer4.Add( self.m_staticline2, wx.GBPosition( 8, 0 ), wx.GBSpan( 1, 3 ), wx.EXPAND |wx.ALL, 5 ) self.rb_efectivo = wx.RadioButton( self, wx.ID_ANY, u"Efectivo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.rb_efectivo.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer4.Add( self.rb_efectivo, wx.GBPosition( 9, 0 ), wx.GBSpan( 1, 1 ), wx.ALL, 5 ) self.tc_importe = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_PROCESS_ENTER ) self.tc_importe.SetMaxLength( 10 ) self.tc_importe.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.tc_importe.Enable( False ) self.tc_importe.SetToolTipString( u"Importe Recibido" ) gbSizer4.Add( self.tc_importe, wx.GBPosition( 10, 0 ), wx.GBSpan( 1, 1 ), wx.BOTTOM, 5 ) self.tc_vuelto = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_READONLY ) self.tc_vuelto.SetMaxLength( 10 ) self.tc_vuelto.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.tc_vuelto.Enable( False ) self.tc_vuelto.SetToolTipString( u"Vuelto a entregar" ) gbSizer4.Add( self.tc_vuelto, wx.GBPosition( 11, 0 ), wx.GBSpan( 1, 1 ), wx.BOTTOM, 5 ) self.rb_boleta = wx.RadioButton( self, wx.ID_ANY, u"Boleta", wx.DefaultPosition, wx.DefaultSize, 0 ) self.rb_boleta.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.rb_boleta.SetToolTipString( u"Centros de pago" ) gbSizer4.Add( self.rb_boleta, wx.GBPosition( 9, 1 ), wx.GBSpan( 1, 1 ), wx.ALL, 5 ) self.rb_oficina = wx.RadioButton( self, wx.ID_ANY, u"Oficina", wx.DefaultPosition, wx.DefaultSize, 0 ) self.rb_oficina.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) self.rb_oficina.SetToolTipString( u"Susana" ) gbSizer4.Add( self.rb_oficina, wx.GBPosition( 9, 2 ), wx.GBSpan( 1, 1 ), wx.ALL, 5 ) sbSizer3.Add( gbSizer4, 1, wx.EXPAND, 5 ) gbSizer1.Add( sbSizer3, wx.GBPosition( 0, 1 ), wx.GBSpan( 2, 4 ), wx.EXPAND|wx.TOP|wx.LEFT, 20 ) self.btn_aceptar = wx.Button( self, wx.ID_OK, u"Aceptar", wx.DefaultPosition, wx.Size( 100,30 ), 0 ) self.btn_aceptar.SetFont( wx.Font( 11, 70, 90, 92, False, wx.EmptyString ) ) gbSizer1.Add( self.btn_aceptar, wx.GBPosition( 2, 3 ), wx.GBSpan( 1, 1 ), wx.ALL|wx.ALIGN_RIGHT, 5 ) self.btn_cancelar = wx.Button( self, wx.ID_CANCEL, u"Cancelar", wx.DefaultPosition, wx.Size( 100,30 ), 0 ) self.btn_cancelar.SetFont( wx.Font( 11, 70, 90, 90, False, wx.EmptyString ) ) gbSizer1.Add( self.btn_cancelar, wx.GBPosition( 2, 4 ), wx.GBSpan( 1, 1 ), wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.SetSizer( gbSizer1 ) self.Layout() self.Centre( wx.BOTH )
def __init__(self, parent): wx.Panel.__init__(self, parent) self.parent = parent #widgets lab1 = wx.StaticText(self, wx.ID_ANY, 'hydrogen :', style=wx.ALIGN_RIGHT) lab2 = wx.StaticText(self, wx.ID_ANY, 'tin :', style=wx.ALIGN_RIGHT) s = ('mendelevium -- ' * 3).rstrip('- ') + ' :' lab3 = wx.StaticText(self, wx.ID_ANY, s, style=wx.ALIGN_RIGHT) lab4 = wx.StaticText(self, wx.ID_ANY, 'carbon :', style=wx.ALIGN_RIGHT) lab5 = wx.StaticText(self, wx.ID_ANY, 'nitrogen :', style=wx.ALIGN_RIGHT) lab6 = wx.StaticText(self, wx.ID_ANY, 'argon :', style=wx.ALIGN_RIGHT) lab7 = wx.StaticText(self, wx.ID_ANY, 'iron :', style=wx.ALIGN_RIGHT) lab8 = wx.StaticText(self, wx.ID_ANY, 'gold :', style=wx.ALIGN_RIGHT) txt1 = wx.TextCtrl(self, wx.ID_ANY, '') txt2 = wx.TextCtrl(self, wx.ID_ANY, '') txt3 = wx.TextCtrl(self, wx.ID_ANY, '') txt4 = wx.TextCtrl(self, wx.ID_ANY, '') txt5 = wx.TextCtrl(self, wx.ID_ANY, '') txt6 = wx.TextCtrl(self, wx.ID_ANY, '') txt7 = wx.TextCtrl(self, wx.ID_ANY, '') txt8 = wx.TextCtrl(self, wx.ID_ANY, '') lab0 = wx.StaticText(self, wx.ID_ANY, 'A few chemical elements', style=wx.ALIGN_CENTER) lab0.SetBackgroundColour('#f0f0f0') lab0.SetForegroundColour(wx.RED) tmpfo = lab0.GetFont() tmpfo.SetPointSize(int(tmpfo.GetPointSize() * 1.5)) lab0.SetFont(tmpfo) wblue = ColWin(self, wx.ID_ANY, wx.BLUE) wyellow = ColWin(self, wx.ID_ANY, '#ffff00') h = 50 wblue.SetSize((-1, h)) wyellow.SetSize((-1, h)) vgap, hgap = 4, 10 gbs1 = wx.GridBagSizer(vgap, hgap) b = 0 gbs1.Add(lab0, (0, 0), (1, 2), wx.EXPAND, b), gbs1.Add(lab1, (1, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt1, (1, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab2, (2, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt2, (2, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab3, (3, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt3, (3, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab4, (4, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt4, (4, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab5, (5, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt5, (5, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab6, (6, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt6, (6, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab7, (7, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt7, (7, 1), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(lab8, (8, 0), (1, 1), wx.EXPAND | wx.ALL, b) gbs1.Add(txt8, (8, 1), (1, 1), wx.EXPAND | wx.ALL, b) b = 10 hsizer1 = wx.BoxSizer(wx.HORIZONTAL) hsizer1.AddStretchSpacer() hsizer1.Add(gbs1, 0, wx.TOP | wx.BOTTOM, b) hsizer1.AddStretchSpacer() b = 0 vsizer1 = wx.BoxSizer(wx.VERTICAL) vsizer1.Add(wblue, 0, wx.GROW | wx.ALL, b) vsizer1.SetItemMinSize(wblue, (600, -1)) vsizer1.Add(hsizer1, 0, wx.EXPAND | wx.ALL, b) vsizer1.Add(wyellow, 0, wx.GROW | wx.ALL, b) self.SetSizerAndFit(vsizer1) self.parent.SetClientSize(vsizer1.GetSize())
def __init__(self, parent, title, *args, **kw): super(Example, self).__init__(parent, title=title) self.currentDirectory = os.getcwd() panel = wx.Panel(self) sizer = wx.GridBagSizer(5, 5) #---------------------------------------------------- text1 = wx.StaticText(panel, label="Compliance Manager") sizer.Add(text1, pos=(0, 0), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=15) icon = wx.StaticBitmap(panel, bitmap=wx.Bitmap('')) sizer.Add(icon, pos=(0, 4), flag=wx.TOP | wx.RIGHT | wx.ALIGN_RIGHT, border=5) line = wx.StaticLine(panel) sizer.Add(line, pos=(1, 0), span=(1, 5), flag=wx.EXPAND | wx.BOTTOM, border=10) #---------------------------------------------------- #text next to date box dateText = wx.StaticText(panel, label="Date use YYYY-MM-DD Format") sizer.Add(dateText, pos=(2, 0), flag=wx.LEFT, border=10) #positing in contorl panel self.tc1 = wx.TextCtrl(panel) sizer.Add(self.tc1, pos=(2, 1), span=(1, 3), flag=wx.TOP | wx.EXPAND) #---------------------------------------------------- #File Lcoation fileLocText = wx.StaticText(panel, label="File Location") sizer.Add(fileLocText, pos=(3, 0), flag=wx.LEFT | wx.TOP, border=10) #Text box next to file location self.tc2 = wx.TextCtrl(panel, value='C:\\') sizer.Add(self.tc2, pos=(3, 1), span=(1, 3), flag=wx.TOP | wx.EXPAND, border=5) button1 = wx.Button(panel, label="Browse") sizer.Add(button1, pos=(3, 4), flag=wx.TOP | wx.RIGHT, border=5) button1.Bind(wx.EVT_BUTTON, self.onDir) #--------------------------------------------------- text4 = wx.StaticText(panel, label="Save Location") sizer.Add(text4, pos=(4, 0), flag=wx.TOP | wx.LEFT, border=10) self.tc3 = wx.TextCtrl(panel) sizer.Add(self.tc3, pos=(4, 1), span=(1, 3), flag=wx.TOP | wx.EXPAND, border=5) button2 = wx.Button(panel, label="Browse...") sizer.Add(button2, pos=(4, 4), flag=wx.TOP | wx.RIGHT, border=5) button2.Bind(wx.EVT_BUTTON, self.onDirSave) #---------------------------------------------------- button3 = wx.Button(panel, label='Help') sizer.Add(button3, pos=(7, 0), flag=wx.LEFT, border=10) button4 = wx.Button(panel, label="Ok") button4.Bind(wx.EVT_BUTTON, self.onOk) sizer.Add(button4, pos=(7, 3)) #---------------------------------------------------- self.radio1 = wx.RadioButton(panel, label='Mortgage Best Ex') sizer.Add(self.radio1, pos=(6, 1)) #----------------------------------------------------- self.radio2 = wx.RadioButton(panel, label='Treasury Best Ex') sizer.Add(self.radio2, pos=(6, 2)) #------------- self.radio3 = wx.RadioButton(panel, label='Wash Sale Report Bloomberg') sizer.Add(self.radio3, pos=(6, 3)) sizer.AddGrowableCol(2) panel.SetSizer(sizer) sizer.Fit(self) self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) self.SetTitle('Compliance Manager') self.Centre()
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"登录界面", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) bSizer3 = wx.BoxSizer(wx.VERTICAL) bSizer3.AddSpacer(10) self.sys_name = wx.StaticText(self, wx.ID_ANY, u"图 像 压 缩 系 统", wx.DefaultPosition, wx.DefaultSize, 0) self.sys_name.Wrap(-1) self.sys_name.SetFont(wx.Font(20, 70, 90, 90, False, wx.EmptyString)) bSizer3.Add(self.sys_name, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) gSizer2 = wx.GridSizer(0, 2, 0, 0) self.m_staticText8 = wx.StaticText(self, wx.ID_ANY, u"用户名", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText8.Wrap(-1) self.m_staticText8.SetFont( wx.Font(14, 70, 90, 90, False, wx.EmptyString)) gSizer2.Add( self.m_staticText8, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 5) self.username = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(150, -1), 0) self.username.SetMaxLength(6) gSizer2.Add(self.username, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.m_staticText9 = wx.StaticText(self, wx.ID_ANY, u"密 码", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText9.Wrap(-1) self.m_staticText9.SetFont( wx.Font(14, 70, 90, 90, False, wx.EmptyString)) gSizer2.Add(self.m_staticText9, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5) self.password = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(150, -1), wx.TE_PASSWORD) self.password.SetMaxLength(6) gSizer2.Add(self.password, 0, wx.ALL, 5) bSizer3.Add(gSizer2, 1, wx.EXPAND, 5) ok_cancel_help = wx.StdDialogButtonSizer() self.ok_cancel_helpOK = wx.Button(self, wx.ID_OK) ok_cancel_help.AddButton(self.ok_cancel_helpOK) self.ok_cancel_helpCancel = wx.Button(self, wx.ID_CANCEL) ok_cancel_help.AddButton(self.ok_cancel_helpCancel) self.ok_cancel_helpHelp = wx.Button(self, wx.ID_HELP) ok_cancel_help.AddButton(self.ok_cancel_helpHelp) ok_cancel_help.Realize() bSizer3.Add(ok_cancel_help, 0, wx.ALIGN_CENTER_HORIZONTAL, 5) self.register = wx.Button(self, wx.ID_ANY, u"注册", wx.DefaultPosition, wx.DefaultSize, 0) self.register.SetFont( wx.Font(wx.NORMAL_FONT.GetPointSize(), 70, 90, 90, False, wx.EmptyString)) bSizer3.Add(self.register, 0, wx.ALL | wx.ALIGN_RIGHT, 5) self.SetSizer(bSizer3) self.Layout() self.Centre(wx.BOTH) # Connect Events self.ok_cancel_helpCancel.Bind(wx.EVT_BUTTON, self.cancel_event) self.ok_cancel_helpHelp.Bind(wx.EVT_BUTTON, self.help_event) self.ok_cancel_helpOK.Bind(wx.EVT_BUTTON, self.ok_event) self.register.Bind(wx.EVT_BUTTON, self.open_register_frame_event)
def layout(self, status): #logo self.SetIcon(logo.get_icon()) # wx.StaticLine(parent=self.panel, id=-1, pos=(0, 0), size=(300, -1), style=wx.ALL | wx.EXPAND) #WebSite + Account + Password wx.StaticText(parent=self.panel, id=-1, label='WebSite:', pos=(24, 15), size=(60, 30)) self.website = wx.Choice(parent=self.panel, id=-1, pos=(90, 7), size=(180, 30), choices=SITE_CHOICES) self.website.SetSelection(0) wx.StaticText(parent=self.panel, id=-1, label='Account:', pos=(25, 47), size=(60, 30)) self.account = wx.TextCtrl(parent=self.panel, id=-1, value='', pos=(90, 42), size=(180, 30)) wx.StaticText(parent=self.panel, id=-1, label='Password:'******'', pos=(90, 77), size=(180, 30), style=wx.TE_PASSWORD | wx.TE_PROCESS_ENTER) #Login btn self.login_btn = wx.Button(parent=self.panel, id=-1, label='Login', pos=(125, 110), size=(90, 35)) # wx.StaticLine(parent=self.panel, id=-1, pos=(0, 145), size=(300, -1), style=wx.ALL | wx.EXPAND) #site link wx.StaticText(parent=self.panel, id=-1, label='Home Page:', pos=(30, 155), size=(90, 30)) self.link = hyperlink.HyperLinkCtrl(parent=self.panel, id=-1, pos=(115, 155)) self.link.SetURL(URL=HOME_PAGE) self.link.SetLabel(label=HOME_PAGE) self.link.SetBackgroundColour(self.GetBackgroundColour()) #status bar stbar = MyStatusBar(self) self.SetStatusBar(stbar)
def __init__(self, parent, text, **kwargs): super(SimpleTextViewer, self).__init__(parent, **add_size(kwargs)) wx.TextCtrl(self, -1, text, style=wx.TE_MULTILINE | wx.TE_LEFT | wx.TE_READONLY)
def __init__(self): wx.Frame.__init__(self, None, title='Stepper Motor Test', size=(400, 305), style=wx.STAY_ON_TOP) self.Centre() self.panel2 = panel2 = wx.Panel(self) sizer = wx.GridBagSizer(5, 4) text1 = wx.StaticText(panel2, label='Stepper Motor') sizer.Add(text1, pos=(0, 0), flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=15) icon = wx.StaticBitmap(panel2, bitmap=wx.Bitmap('images/stm2.png')) sizer.Add(icon, pos=(0, 3), flag=wx.TOP | wx.RIGHT | wx.ALIGN_RIGHT, border=7) line = wx.StaticLine(panel2) sizer.Add(line, pos=(1, 0), span=(1, 5), flag=wx.EXPAND | wx.BOTTOM, border=10) text2 = wx.StaticText(panel2, label='Distance') sizer.Add(text2, pos=(2, 0), flag=wx.LEFT, border=10) unit1 = wx.StaticText(panel2, label='mm') sizer.Add(unit1, pos=(2, 3), flag=wx.LEFT, border=7) unit2 = wx.StaticText(panel2, label='rpm') sizer.Add(unit2, pos=(3, 3), flag=wx.LEFT | wx.TOP, border=7) distance = "123" speed = '456' tc1 = wx.TextCtrl(panel2, value=distance) sizer.Add(tc1, pos=(2, 1), span=(1, 2), flag=wx.TOP | wx.EXPAND) text3 = wx.StaticText(panel2, label='Speed') sizer.Add(text3, pos=(3, 0), flag=wx.LEFT | wx.TOP, border=10) tc2 = wx.TextCtrl(panel2, value=speed) sizer.Add(tc2, pos=(3, 1), span=(1, 2), flag=wx.TOP | wx.EXPAND, border=5) #button1 = wx.Button(simulationDataPanel, label='Browse...') #sizer.Add(button1, pos=(3, 4), flag=wx.TOP|wx.RIGHT, border=5) text4 = wx.StaticText(panel2, label='Direction') sizer.Add(text4, pos=(4, 0), flag=wx.TOP | wx.LEFT, border=10) combo3 = wx.ComboBox(panel2, style=wx.CB_DROPDOWN | wx.CB_READONLY, choices=['Clockwise', 'Counter Clockwise']) combo3.SetSelection(0) sizer.Add(combo3, pos=(4, 1), span=(1, 3), flag=wx.TOP | wx.EXPAND, border=5) #button2 = wx.Button(simulationDataPanel, label='Browse...') #sizer.Add(button2, pos=(4, 4), flag=wx.TOP|wx.RIGHT, border=5) sb = wx.StaticBox(panel2, label='Optional Attributes') boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL) boxsizer.Add(wx.CheckBox(panel2, label='Public'), flag=wx.LEFT | wx.TOP, border=5) boxsizer.Add(wx.CheckBox(panel2, label='Generate Default Constructor'), flag=wx.LEFT, border=5) boxsizer.Add(wx.CheckBox(panel2, label='Generate Main Method'), flag=wx.LEFT | wx.BOTTOM, border=5) sizer.Add(boxsizer, pos=(5, 0), span=(1, 5), flag=wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border=10) #button3 = wx.Button(simulationDataPanel, label='Help') #sizer.Add(button3, pos=(7, 0), flag=wx.LEFT, border=10) button4 = wx.Button(panel2, label='RUN') sizer.Add(button4, pos=(7, 2), flag=wx.LEFT, border=50) button5 = wx.Button(panel2, label='STOP') sizer.Add(button5, pos=(7, 3), span=(1, 1), flag=wx.BOTTOM | wx.RIGHT, border=5) sizer.AddGrowableCol(2) panel2.SetSizer(sizer) #self.Bind(wx.EVT_RIGHT_DONW, Onrightdown()) self.popupmenu = wx.Menu() menulist = ['Save', 'Quit'] for text in menulist: item = self.popupmenu.Append(-1, text) self.Bind(wx.EVT_MENU, self.OnPopupItemSelected, item) panel2.Bind(wx.EVT_CONTEXT_MENU, self.showPopupMenu)
def _init_ctrls(self, prnt): #-----Main frame----- wx.Frame.__init__( self, id=wxID_FRAME1, name='', parent=prnt, style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN | wx.RESIZE_BORDER, title= 'SWAPY - Simple Windows Automation on Python v. %s. pywinauto v. %s. %s' % (const.VERSION, proxy.pywinauto.__version__, platform.architecture()[0])) self.SetIcon( wx.Icon(proxy.resource_path("swapy_dog_head.ico"), wx.BITMAP_TYPE_ICO)) self.Bind(wx.EVT_MENU, self.menu_action) # - make action #---------- #-----Static Boxes----- self.staticBox_ObjectsBrowser = wx.StaticBox( id=wxID_FRAME1STATICBOX_OBJECTSBROWSER, label='Objects browser', name='staticBox_ObjectsBrowser', parent=self) self.staticBox_Editor = wx.StaticBox( id=wxID_FRAME1STATICBOX_EDITOR, label='Editor', name='staticBox_Editor', parent=self, ) self.staticBox_Proprties = wx.StaticBox( id=wxID_FRAME1STATICBOX_PROPRTIES, label='Properties', name='staticBox_Proprties', parent=self) #---------- #-----ObjectsBrowser----- self.treeCtrl_ObjectsBrowser = wx.TreeCtrl( id=wxID_FRAME1TREECTRL_OBJECTSBROWSER, name='treeCtrl_ObjectsBrowser', parent=self, style=wx.TR_HAS_BUTTONS) self.treeCtrl_ObjectsBrowser.Bind( wx.EVT_TREE_SEL_CHANGED, self.OnTreeCtrl1TreeSelChanged, id=wxID_FRAME1TREECTRL_OBJECTSBROWSER) self.treeCtrl_ObjectsBrowser.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.ObjectsBrowserRight_Click) #---------- #-----Editor----- self.textCtrl_Editor = wx.TextCtrl(id=wxID_FRAME1TEXTCTRL_EDITOR, name='textCtrl_Editor', parent=self, style=wx.TE_MULTILINE | wx.TE_READONLY, value='') self.textCtrl_Editor.SetInitialSize((300, 250)) #---------- #-----Properties----- self.listCtrl_Properties = wx.ListCtrl( id=wxID_FRAME1LISTCTRL1_PROPERTIES, name='listCtrl1_Properties', parent=self, style=wx.LC_REPORT) self.listCtrl_Properties.InsertColumn(col=0, format=wx.LIST_FORMAT_LEFT, heading='Property', width=-1) self.listCtrl_Properties.InsertColumn(col=1, format=wx.LIST_FORMAT_LEFT, heading='Value', width=-1) self.listCtrl_Properties.Bind( wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnlistCtrl_PropertiesListItemRightClick, id=wxID_FRAME1LISTCTRL1_PROPERTIES) #self.listCtrl_Properties.Bind(wx.EVT_LEFT_DCLICK, self.Refresh, id=wxID_FRAME1LISTCTRL1_PROPERTIES) #---------- #-----Sizers----- staticBox_ObjectsBrowser_sizer = wx.StaticBoxSizer( self.staticBox_ObjectsBrowser) staticBox_ObjectsBrowser_sizer.Add(self.treeCtrl_ObjectsBrowser, 1, wx.EXPAND, 2) staticBox_Editor_sizer = wx.StaticBoxSizer(self.staticBox_Editor) staticBox_Editor_sizer.Add(self.textCtrl_Editor, 1, wx.EXPAND, 2) staticBox_Proprties_sizer = wx.StaticBoxSizer(self.staticBox_Proprties) staticBox_Proprties_sizer.Add(self.listCtrl_Properties, 1, wx.EXPAND, 2) sizer_h = wx.BoxSizer(wx.HORIZONTAL) sizer_v = wx.BoxSizer(wx.VERTICAL) sizer_h.Add(staticBox_ObjectsBrowser_sizer, 1, wx.EXPAND, 2) sizer_h.Add(sizer_v, 1, wx.EXPAND | wx.ALL, 2) sizer_v.Add(staticBox_Editor_sizer, 1, wx.EXPAND, 2) sizer_v.Add(staticBox_Proprties_sizer, 1, wx.EXPAND, 2) self.SetSizerAndFit(sizer_h)
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _("Add template"), pos = wx.DefaultPosition, size = wx.Size( 416,354 ), style = wx.DEFAULT_DIALOG_STYLE ) self.EditMode = False self.SetSizeHintsSz( wx.DefaultSize, maxSize=wx.DefaultSize ) bSizer = wx.BoxSizer( wx.VERTICAL ) gSizer = wx.GridSizer( 2, 2, 0, 1 ) self.stName = wx.StaticText( self, wx.ID_ANY, _("Template name:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.stName.Wrap( -1 ) gSizer.Add( self.stName, proportion=0, flag=wx.LEFT|wx.RIGHT|wx.TOP, border=5 ) self.stProto = wx.StaticText( self, wx.ID_ANY, _("Prototype:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.stProto.Wrap( -1 ) gSizer.Add( self.stProto, proportion=0, flag=wx.LEFT|wx.RIGHT|wx.TOP, border=5 ) self.txtName = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) gSizer.Add( self.txtName, proportion=0, flag=wx.BOTTOM|wx.EXPAND|wx.LEFT|wx.RIGHT, border=5 ) cbProtoChoices = [] self.cbProto = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, cbProtoChoices, 0 ) self.cbProto.SetSelection( 0 ) gSizer.Add( self.cbProto, proportion=0, flag=wx.BOTTOM|wx.EXPAND|wx.RIGHT, border=5 ) bSizer.Add( gSizer, proportion=0, flag=wx.EXPAND, border=0 ) self.mstAttrs = wx.StaticText( self, wx.ID_ANY, _("Attributes:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.mstAttrs.Wrap( -1 ) bSizer.Add( self.mstAttrs, proportion=0, flag=wx.LEFT, border=5 ) gbSizer = wx.GridBagSizer( 0, 0 ) gbSizer.AddGrowableCol( 0 ) gbSizer.AddGrowableRow( 2 ) gbSizer.SetFlexibleDirection( wx.BOTH ) gbSizer.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.attrGrid = wx.grid.Grid( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 ) # Grid self.attrGrid.CreateGrid( numRows = 0,numCols = 2 ) self.attrGrid.EnableEditing( True ) self.attrGrid.EnableGridLines( True ) self.attrGrid.EnableDragGridSize( False ) self.attrGrid.SetMargins( 0, 0 ) # Columns self.attrGrid.SetColSize( 0, width = 130 ) self.attrGrid.SetColSize( 1, width = 150 ) self.attrGrid.EnableDragColMove( False ) self.attrGrid.EnableDragColSize( True ) self.attrGrid.SetColLabelSize( 30 ) self.attrGrid.SetColLabelValue( 0, _("Attribute") ) self.attrGrid.SetColLabelValue( 1, _("Default value") ) self.attrGrid.SetColLabelAlignment( horiz = wx.ALIGN_CENTRE, vert = wx.ALIGN_CENTRE ) # Rows self.attrGrid.EnableDragRowSize( True ) self.attrGrid.SetRowLabelSize( 20 ) self.attrGrid.SetRowLabelAlignment( horiz=wx.ALIGN_CENTRE, vert=wx.ALIGN_CENTRE ) # Label Appearance # Cell Defaults self.attrGrid.SetDefaultCellAlignment( horiz=wx.ALIGN_LEFT, vert=wx.ALIGN_TOP ) gbSizer.Add( self.attrGrid, pos=wx.GBPosition( 0, 0 ), span=wx.GBSpan( 3, 1 ), flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2 ) self.btnAdd = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider_GetBitmap(str(ed_glob.ID_ADD), wx.ART_MENU, wx.Size(16, 16)), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) gbSizer.Add( self.btnAdd, pos=wx.GBPosition( 0, 1 ), span=wx.GBSpan( 1, 1 ), flag=wx.ALL, border=5 ) self.btnDel = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider_GetBitmap(str(ed_glob.ID_REMOVE), wx.ART_MENU, wx.Size(16, 16)), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) gbSizer.Add( self.btnDel, pos=wx.GBPosition( 1, 1 ), span=wx.GBSpan( 1, 1 ), flag=wx.ALL, border=5 ) self.btnSet = wx.BitmapButton( self, wx.ID_ANY, wx.ArtProvider_GetBitmap(str(ed_glob.ID_FONT), wx.ART_MENU, wx.Size(16, 16)), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) gbSizer.Add( self.btnSet, pos=wx.GBPosition( 2, 1 ), span=wx.GBSpan( 1, 1 ), flag=wx.ALL, border=5 ) bSizer.Add( gbSizer, proportion=1, flag=wx.EXPAND, border=0 ) bSizerBottom = wx.BoxSizer( wx.HORIZONTAL ) self.stTitle = wx.StaticText( self, wx.ID_ANY, _("Title attribute: %s") % 'None', wx.DefaultPosition, wx.DefaultSize, 0 ) self.stTitle.Wrap( -1 ) bSizerBottom.Add( self.stTitle, proportion=1, flag=wx.ALL|wx.ALIGN_CENTER_VERTICAL, border=5 ) shapeSelChoices = [ "DefaultShape" ] shapeSelChoices.extend(Deca.world.GetShapes()) self.shapeSel = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, shapeSelChoices, 0 ) self.shapeSel.SetSelection( 0 ) bSizerBottom.Add( self.shapeSel, proportion=1, flag=wx.ALL|wx.EXPAND, border=2 ) bSizer.Add( bSizerBottom, proportion=0, flag=wx.EXPAND, border=0 ) dlgButtons = wx.StdDialogButtonSizer() self.dlgButtonsOK = wx.Button( self, wx.ID_OK ) dlgButtons.AddButton( self.dlgButtonsOK ) self.dlgButtonsCancel = wx.Button( self, wx.ID_CANCEL ) dlgButtons.AddButton( self.dlgButtonsCancel ) dlgButtons.Realize() bSizer.Add( dlgButtons, proportion=0, flag=wx.BOTTOM|wx.EXPAND|wx.LEFT|wx.RIGHT, border=5 ) self.SetSizer( bSizer ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.cbProto.Bind( wx.EVT_CHOICE, self.OnPrototype ) self.btnAdd.Bind( wx.EVT_BUTTON, self.OnAdd ) self.btnDel.Bind( wx.EVT_BUTTON, self.OnDel ) self.btnSet.Bind( wx.EVT_BUTTON, self.OnSet ) self.dlgButtonsOK.Bind( wx.EVT_BUTTON, self.OnOK ) self.TitlePos = -1
def __init__(self, parent, default_text=""): """ Initialize and populate the Note Editor panel """ # Due to an odd behavior on the part of wxTextCtrl (it selects all text upon initialization and ignores # SetSelection requests), we need to track to see if we have done the initial SetSelection. We haven't. self.initialized = False # Remember your ancestors. self.parent = parent # Get the global print data self.printData = TransanaGlobal.printData # Create the Panel wx.Panel.__init__(self, parent, style = wx.RAISED_BORDER) # Give the Panel a Sizer pnlSizer = wx.BoxSizer(wx.VERTICAL) # To look right, the Mac needs the Small Window Variant. if "__WXMAC__" in wx.PlatformInfo: self.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) # Place a Tool Bar on the Panel self.toolbar = wx.ToolBar(self, style = wx.TB_HORIZONTAL | wx.TB_TEXT) # wx.RAISED_BORDER | # Add an Insert Date/Time button to the Toolbar self.toolbar.AddTool(T_DATETIME, TransanaImages.Time16.GetBitmap(), shortHelpString=_('Insert Date / Time')) # Add a Save As Text button to the Toolbar self.toolbar.AddTool(T_SAVEAS, TransanaImages.SaveTXT16.GetBitmap(), shortHelpString=_('Save As')) # Add a Page Setup button to the toolbar self.toolbar.AddTool(T_PAGESETUP, TransanaImages.PrintSetup.GetBitmap(), shortHelpString=_('Page Setup')) # Disable Print Setup for Right-To-Left languages if (TransanaGlobal.configData.LayoutDirection == wx.Layout_RightToLeft): self.toolbar.EnableTool(T_PAGESETUP, False) # Add a Print Preview button to the Toolbar self.toolbar.AddTool(T_PRINTPREVIEW, TransanaImages.PrintPreview.GetBitmap(), shortHelpString=_('Print Preview')) # Disable Print Preview on the PPC Mac and for Right-To-Left languages if (platform.processor() == 'powerpc') or (TransanaGlobal.configData.LayoutDirection == wx.Layout_RightToLeft): self.toolbar.EnableTool(T_PRINTPREVIEW, False) # Add a Print button to the Toolbar self.toolbar.AddTool(T_PRINT, TransanaImages.Print.GetBitmap(), shortHelpString=_('Print')) # Disable Print for Right-To-Left languages if (TransanaGlobal.configData.LayoutDirection == wx.Layout_RightToLeft): self.toolbar.EnableTool(T_PRINT, False) # ... and create a bitmap button for the Help button self.toolbar.AddTool(T_HELP, TransanaImages.ArtProv_HELP.GetBitmap(), shortHelpString=_("Help")) # Add an Exit button to the Toolbar self.toolbar.AddTool(T_EXIT, TransanaImages.Exit.GetBitmap(), shortHelpString=_('Exit')) # Adding a separator here helps things look better on the Mac. self.toolbar.AddSeparator() # Cause the Toolbar to be built self.toolbar.Realize() # Create a horizontal Sizer for the toolbar hsizer = wx.BoxSizer(wx.HORIZONTAL) # Add the Toolbar to the Sizer hsizer.Add(self.toolbar) # Add a space to the Sizer hsizer.Add((20, 1)) # Add Quick Search tools # Get the icon for the Search Backwards button bmp = TransanaImages.ArtProv_BACK.GetBitmap() # If we're in a Right-To-Left language ... if TransanaGlobal.configData.LayoutDirection == wx.Layout_RightToLeft: # ... reverse the direction of the image arrow bmp = bmp.ConvertToImage().Mirror().ConvertToBitmap() # Create the Bitmap Button for Search Back self.searchBack = wx.BitmapButton(self, CMD_SEARCH_BACK_ID, bmp, style=wx.NO_BORDER) # Add LayoutDirection to prevent problems with Right-To-Left languages self.searchBack.SetLayoutDirection(wx.Layout_LeftToRight) # Add this button to the Toolbar Sizer hsizer.Add(self.searchBack, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 10) # Connect the button to the OnSearch Method wx.EVT_BUTTON(self, CMD_SEARCH_BACK_ID, self.OnSearch) # Add a spacer to the Toolbar Sizer hsizer.Add((10, 1)) # Create a Search Text control self.searchText = wx.TextCtrl(self, -1, size=(100, 20), style=wx.TE_PROCESS_ENTER) # Add it to the Toolbar Sizer hsizer.Add(self.searchText, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 10) # Call OnSearch on Enter from within the searchText box self.Bind(wx.EVT_TEXT_ENTER, self.OnSearch, self.searchText) # Add a spacer hsizer.Add((10, 1)) # Get the icon for the Search Forwards button bmp = TransanaImages.ArtProv_FORWARD.GetBitmap() # If we're in a Right-To-Left language ... if TransanaGlobal.configData.LayoutDirection == wx.Layout_RightToLeft: # ... reverse the direction of the image arrow bmp = bmp.ConvertToImage().Mirror().ConvertToBitmap() # Create the Bitmap Button for Search Back self.searchNext = wx.BitmapButton(self, CMD_SEARCH_NEXT_ID, bmp, style=wx.NO_BORDER) # Add this button to the Toolbar Sizer hsizer.Add(self.searchNext, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 10) # Connect the button to the OnSearch Method wx.EVT_BUTTON(self, CMD_SEARCH_NEXT_ID, self.OnSearch) # Add the Toolbar Sizer to the Panel Sizer pnlSizer.Add(hsizer) # add the note editing widget to the panel. User a multi-line TextCtrl, and TE_RICH style to enable # font size change on Windows. self.txt = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE | wx.TE_RICH2) # Get the Default Style txtStyle = self.txt.GetDefaultStyle() # Get the Default Font from the Default Style self.txtFont = txtStyle.GetFont() # On Windows ... if 'wxMSW' in wx.PlatformInfo: # ... 10 point looks about right. 12 is too big. (default is 8) fontSize = 10 # On Mac ... else: # ... 12 point looks about right. (default is 11) fontSize = 12 # If that doesn't work, as it doesn't on Windows ... if not self.txtFont.IsOk(): # ... just create a Default Font with point size 10 on Windows, 12 on Mac to look right. self.txtFont = wx.Font(pointSize=fontSize, family = wx.DEFAULT, style = wx.NORMAL, weight = wx.NORMAL) # If we did get the default font ... else: # ... change it to the desired size self.txtFont.SetPointSize(fontSize) # Apply the Font to the Style txtStyle.SetFont(self.txtFont) # Set the Style in the Text Control self.txt.SetDefaultStyle(txtStyle) # If there is default text ... (Windows requires this conditional. Otherwise, the font size is # wrong on new Notes!) if default_text != "": # ... add the existing text to the note's text control self.txt.WriteText(default_text) # We want to trap a couple of key combinations self.txt.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) # Add the Text Ctrl to the Panel Sizer pnlSizer.Add(self.txt, 1, wx.EXPAND | wx.ALL, 2) # Define the Panel Sizer as the main Sizer self.SetSizer(pnlSizer) # Fit the controls to the Panel self.Fit() # Define the Methods for the Toolbar Buttons wx.EVT_MENU(self, T_DATETIME, self.OnDateTime) wx.EVT_MENU(self, T_SAVEAS, self.OnSaveAs) wx.EVT_MENU(self, T_PAGESETUP, self.OnPageSetup) wx.EVT_MENU(self, T_PRINTPREVIEW, self.OnPrintPreview) wx.EVT_MENU(self, T_PRINT, self.OnPrint) wx.EVT_MENU(self, T_HELP, self.OnHelp) wx.EVT_MENU(self, T_EXIT, self.OnClose) # Define the SetFocus Event for the Text Control. This is where the SetSelection can get called so it will work. ## wx.EVT_SET_FOCUS(self.txt, self.OnSetFocus) # Put the focus on the Text Control (needed for Mac) self.txt.SetFocus() wx.CallAfter(self.txt.SetSelection, 0, 0)
def __init__(self, parent, id=-1, title='Pinguino', pos=wx.DefaultPosition, size=(600, 600), style=wx.DEFAULT_FRAME_STYLE): # ---------------------------------------------------------------------- # load settings from config file # ---------------------------------------------------------------------- self.config = wx.FileConfig(localFilename=APP_CONFIG, style=wx.CONFIG_USE_LOCAL_FILE) self.filehistory = wx.FileHistory() self.filehistory.Load(self.config) framesize = (self.config.ReadInt('Window/Width', -1), self.config.ReadInt('Window/Height', -1)) framepos = (self.config.ReadInt('Window/Posx', -1), self.config.ReadInt('Window/Posy', -1)) outputsize = (self.config.ReadInt('Output/Width', -1), self.config.ReadInt('Output/Height', -1)) self.theme = self.config.Read('Theme/name') if self.theme == '': self.theme = THEME_DEFAULT wx.Frame.__init__(self, parent, id, title, framepos, framesize, style) loc = locale.getdefaultlocale()[0][0:2] self.lang = gettext.translation('pinguino', sys.path[0] + '/locale', languages=[loc], fallback=True) _ = self.lang.ugettext #self.SetTitle('Pinguino '+pinguino_version) self.SetTitle('Qubotic - www.roboticawilde.com.ar') _icon = wx.EmptyIcon() _icon.CopyFromBitmap( wx.Bitmap(sys.path[0] + "/logo.png", wx.BITMAP_TYPE_ANY)) self.SetIcon(_icon) self._mgr = wx.aui.AuiManager(self) self.menu = wx.MenuBar() # file menu self.file_menu = wx.Menu() self.NEW = wx.MenuItem(self.file_menu, wx.ID_NEW, _("New"), "", wx.ITEM_NORMAL) self.file_menu.AppendItem(self.NEW) self.OPEN = wx.MenuItem(self.file_menu, wx.ID_OPEN, _("Open"), "", wx.ITEM_NORMAL) self.file_menu.AppendItem(self.OPEN) self.SAVE = wx.MenuItem(self.file_menu, wx.ID_SAVE, _("Save"), "", wx.ITEM_NORMAL) self.file_menu.AppendItem(self.SAVE) self.SAVEAS = wx.MenuItem(self.file_menu, wx.ID_SAVEAS, _("Save as"), "", wx.ITEM_NORMAL) self.file_menu.AppendItem(self.SAVEAS) self.CLOSE = wx.MenuItem(self.file_menu, wx.ID_CLOSE, _("Close"), "", wx.ITEM_NORMAL) self.file_menu.AppendItem(self.CLOSE) self.EXIT = wx.MenuItem(self.file_menu, wx.ID_EXIT, _("Exit"), "", wx.ITEM_NORMAL) self.file_menu.AppendItem(self.EXIT) # ---file history------------------------------------------------------- self.filehistory.UseMenu(self.file_menu) self.filehistory.AddFilesToMenu() self.menu.Append(self.file_menu, _("File")) # edit menu self.edit_menu = wx.Menu() self.UNDO = wx.MenuItem(self.edit_menu, wx.ID_UNDO, _("Undo"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.UNDO) self.REDO = wx.MenuItem(self.edit_menu, wx.ID_REDO, _("Redo"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.REDO) self.edit_menu.AppendSeparator() self.FIND = wx.MenuItem(self.edit_menu, wx.ID_FIND, _("Find"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.FIND) self.REPLACE = wx.MenuItem(self.edit_menu, wx.ID_REPLACE, _("Replace"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.REPLACE) self.REPLACE.Enable(False) self.edit_menu.AppendSeparator() self.CUT = wx.MenuItem(self.edit_menu, wx.ID_CUT, _("Cut"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.CUT) self.COPY = wx.MenuItem(self.edit_menu, wx.ID_COPY, _("Copy"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.COPY) self.PASTE = wx.MenuItem(self.edit_menu, wx.ID_PASTE, _("Paste"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.PASTE) self.CLEAR = wx.MenuItem(self.edit_menu, wx.ID_CLEAR, _("Clear"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.CLEAR) self.SELECTALL = wx.MenuItem(self.edit_menu, wx.ID_SELECTALL, _("Select all"), "", wx.ITEM_NORMAL) self.edit_menu.AppendItem(self.SELECTALL) self.menu.Append(self.edit_menu, _("Edit")) # preferences menu self.pref_menu = wx.Menu() # ---theme submenu self.theme_menu = wx.Menu() self.GetTheme() i = 0 for th in self.themeList: self.THEME.append( wx.MenuItem(self.theme_menu, self.ID_THEME1 + i, th, "", wx.ITEM_CHECK)) self.theme_menu.AppendItem(self.THEME[i]) i = i + 1 self.pref_menu.AppendMenu(self.ID_THEME, _("Themes"), self.theme_menu) # ---debug submenu self.debug_menu = wx.Menu() self.USBBULK = wx.MenuItem(self.debug_menu, self.ID_USBBULK, _("USB Bulk"), "", wx.ITEM_CHECK) self.debug_menu.AppendItem(self.USBBULK) self.USBBULK.Enable(False) self.CDC = wx.MenuItem(self.debug_menu, self.ID_CDC, _("CDC"), "", wx.ITEM_CHECK) self.debug_menu.AppendItem(self.CDC) self.CDC.Enable(False) self.pref_menu.AppendMenu(self.ID_DEBUG, _("Debug"), self.debug_menu) self.menu.Append(self.pref_menu, _("Preferences")) self.HELP = wx.Menu() self.ABOUT = wx.MenuItem(self.HELP, self.ID_WEBSITE, _("Website"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.ABOUT = wx.MenuItem(self.HELP, self.ID_BLOG, _("Blog"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.ABOUT = wx.MenuItem(self.HELP, self.ID_FORUM, _("Forum"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.ABOUT = wx.MenuItem(self.HELP, self.ID_GROUP, _("Group"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.ABOUT = wx.MenuItem(self.HELP, self.ID_WIKI, _("Wiki"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.ABOUT = wx.MenuItem(self.HELP, self.ID_TUTORIAL, _("Tutorial"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.ABOUT = wx.MenuItem(self.HELP, self.ID_ABOUT, _("About..."), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.menu.Append(self.HELP, _("Help")) self.SetMenuBar(self.menu) # ------------------------------------------------------------------------------ # Load toolbar icons # ------------------------------------------------------------------------------ self.DrawToolbar() # define output window self.logwindow = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size(400, 300), style=wx.TE_MULTILINE | wx.TE_READONLY) self.logwindow.SetBackgroundColour(wx.Colour(0, 0, 0)) self.logwindow.SetForegroundColour(wx.Colour(255, 255, 255)) # create a PaneInfo structure for output window PaneOutputInfo = wx.aui.AuiPaneInfo() PaneOutputInfo.CloseButton(False) PaneOutputInfo.MaximizeButton(True) PaneOutputInfo.MinimizeButton(True) PaneOutputInfo.Caption(_("Output")) PaneOutputInfo.Bottom() # create editor panel editorsize = self.GetSize() - self.logwindow.GetSize() editorsize = (editorsize[0], editorsize[1]) self.EditorPanel = wx.Panel(self, -1, wx.DefaultPosition, wx.Size(400, 100)) self.pinguinobmp = wx.StaticBitmap( self.EditorPanel, -1, wx.Bitmap(sys.path[0] + "/theme/pinguinodesign.png", wx.BITMAP_TYPE_ANY)) self.pinguinobmp.CentreOnParent(wx.BOTH) # create a PaneInfo structure for editor window # this Paneinfo will be switched when loading a file self.PaneEditorInfo = wx.aui.AuiPaneInfo() self.PaneEditorInfo.CloseButton(False) self.PaneEditorInfo.MaximizeButton(True) self.PaneEditorInfo.Caption(_("Editor")) self.PaneEditorInfo.Top() # add the panes to the manager self._mgr.AddPane( self.toolbar, wx.aui.AuiPaneInfo().Name("toolbar").Caption( "Toolbar").ToolbarPane().Top().Row(1).LeftDockable( False).RightDockable(False)) self._mgr.AddPane(self.logwindow, PaneOutputInfo, '') self._mgr.AddPane(self.EditorPanel, wx.CENTER, '') self.editor = editeur.editeur(self.EditorPanel, -1, self.EditorPanel.GetSize()) # tell the manager to 'commit' all the changes just made self._mgr.Update() # ------------------------------------------------------------------------------ # Event Management # ------------------------------------------------------------------------------ self.Bind(wx.EVT_CLOSE, self.OnExit) self.Bind(wx.EVT_SIZE, self.OnResize) self.Bind(wx.aui.EVT_AUI_RENDER, self.OnRender) # file menu self.Bind(wx.EVT_MENU, self.OnNew, self.NEW) self.Bind(wx.EVT_MENU, self.OnOpen, self.OPEN) self.Bind(wx.EVT_MENU_RANGE, self.OnFileHistory, id=wx.ID_FILE1, id2=wx.ID_FILE9) self.Bind(wx.EVT_MENU, self.OnSave, self.SAVE) self.Bind(wx.EVT_MENU, self.OnSaveAs, self.SAVEAS) self.Bind(wx.EVT_MENU, self.OnClose, self.CLOSE) self.Bind(wx.EVT_MENU, self.OnExit, self.EXIT) # edit menu self.Bind(wx.EVT_MENU, self.editor.copy, self.COPY) self.Bind(wx.EVT_MENU, self.editor.paste, self.PASTE) self.Bind(wx.EVT_MENU, self.editor.cut, self.CUT) self.Bind(wx.EVT_MENU, self.editor.clear, self.CLEAR) self.Bind(wx.EVT_MENU, self.editor.undo, self.UNDO) self.Bind(wx.EVT_MENU, self.editor.redo, self.REDO) self.Bind(wx.EVT_MENU, self.OnFind, self.FIND) self.Bind(wx.EVT_MENU, self.editor.selectall, self.SELECTALL) # pref menu self.Bind(wx.EVT_MENU_RANGE, self.OnTheme, id=self.ID_THEME1, id2=self.ID_THEME1 + self.themeNum) # icons bar self.Bind(wx.EVT_TOOL, self.OnVerify, id=self.ID_VERIFY) self.Bind(wx.EVT_TOOL, self.OnClose, id=wx.ID_CLOSE) self.Bind(wx.EVT_TOOL, self.OnNew, id=wx.ID_NEW) self.Bind(wx.EVT_TOOL, self.OnSave, id=wx.ID_SAVE) self.Bind(wx.EVT_TOOL, self.OnOpen, id=wx.ID_OPEN) self.Bind(wx.EVT_TOOL, self.OnUpload, id=self.ID_UPLOAD) self.Bind(wx.EVT_TOOL, self.OnFind, id=wx.ID_FIND) self.Bind(wx.EVT_TOOL, self.OnExit, id=wx.ID_EXIT) self.Bind(wx.EVT_TOOL, self.editor.undo, id=wx.ID_UNDO) self.Bind(wx.EVT_TOOL, self.editor.redo, id=wx.ID_REDO) self.Bind(wx.EVT_TOOL, self.editor.cut, id=wx.ID_CUT) self.Bind(wx.EVT_TOOL, self.editor.copy, id=wx.ID_COPY) self.Bind(wx.EVT_TOOL, self.editor.paste, id=wx.ID_PASTE) self.Bind(wx.EVT_TOOL, self.editor.clear, id=wx.ID_CLEAR) self.Bind(wx.EVT_TOOL, self.editor.selectall, id=wx.ID_SELECTALL) # help menu self.Bind(wx.EVT_TOOL, self.website, id=self.ID_WEBSITE) # website self.Bind(wx.EVT_TOOL, self.website, id=self.ID_BLOG) # blog self.Bind(wx.EVT_TOOL, self.website, id=self.ID_FORUM) # forum self.Bind(wx.EVT_TOOL, self.website, id=self.ID_GROUP) # group self.Bind(wx.EVT_TOOL, self.website, id=self.ID_WIKI) # wiki self.Bind(wx.EVT_TOOL, self.website, id=self.ID_TUTORIAL) # tutorial self.Bind(wx.EVT_MENU, self.OnAbout, self.ABOUT) # initialize all the lib pdl in /lib folder self.readlib() self.displaymsg(_("Welcome to ") + pinguino_version + "\n", 0) # check current theme in menu id = self.theme_menu.FindItem(self.theme) self.menu.Check(id, True)
def __init__(self, *args, **kwds): kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) loc = locale.getdefaultlocale()[0][0:2] lang = gettext.translation('pinguino', './locale', languages=[loc]) lang.install() self.menu = wx.MenuBar() wxglade_tmp_menu = wx.Menu() self.NEW = wx.MenuItem(wxglade_tmp_menu, 20, _("New"), "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendItem(self.NEW) self.OPEN = wx.MenuItem(wxglade_tmp_menu, 21, _("Open"), "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendItem(self.OPEN) self.SAVE = wx.MenuItem(wxglade_tmp_menu, 22, _("Save"), "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendItem(self.SAVE) wxglade_tmp_menu.AppendSeparator() self.CLOSE = wx.MenuItem(wxglade_tmp_menu, 23, _("Close"), "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendItem(self.CLOSE) self.EXIT = wx.MenuItem(wxglade_tmp_menu, 24, _("Exit"), "", wx.ITEM_NORMAL) wxglade_tmp_menu.AppendItem(self.EXIT) self.menu.Append(wxglade_tmp_menu, _("File")) self.LANGUAGE = wx.Menu() self.ENGLISH = wx.MenuItem(self.LANGUAGE, 26, _("English"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.ENGLISH) self.FRENCH = wx.MenuItem(self.LANGUAGE, 27, _("French"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.FRENCH) self.SPANISH = wx.MenuItem(self.LANGUAGE, 28, _("Spanish"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.SPANISH) self.PORTUGUESE = wx.MenuItem(self.LANGUAGE, 29, _("Portuguese"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.PORTUGUESE) self.DANISH = wx.MenuItem(self.LANGUAGE, 30, _("Danish"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.DANISH) self.CROATIAN = wx.MenuItem(self.LANGUAGE, 31, _("Croatian"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.CROATIAN) self.ITALIAN = wx.MenuItem(self.LANGUAGE, 32, _("Italian"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.ITALIAN) self.GERMANY = wx.MenuItem(self.LANGUAGE, 33, _("Germany"), "", wx.ITEM_NORMAL) self.LANGUAGE.AppendItem(self.GERMANY) self.menu.Append(self.LANGUAGE, _("Language")) self.HELP = wx.Menu() self.ABOUT = wx.MenuItem(self.HELP, 25, _("About"), "", wx.ITEM_NORMAL) self.HELP.AppendItem(self.ABOUT) self.menu.Append(self.HELP, _("Help")) self.SetMenuBar(self.menu) self.frame_1_statusbar = self.CreateStatusBar(1, 0) self.frame_1_toolbar = wx.ToolBar(self, -1) self.SetToolBar(self.frame_1_toolbar) self.frame_1_toolbar.AddLabelTool( 100, _("Verify"), wx.Bitmap(sys.path[0] + "/runw5050.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("Verify"), "") self.frame_1_toolbar.AddLabelTool( 101, _("Close"), wx.Bitmap(sys.path[0] + "/stop5050.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("Close"), "") self.frame_1_toolbar.AddSeparator() self.frame_1_toolbar.AddSeparator() self.frame_1_toolbar.AddSeparator() self.frame_1_toolbar.AddLabelTool( 102, _("New"), wx.Bitmap(sys.path[0] + "/new5050.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("New"), "") self.frame_1_toolbar.AddLabelTool( 103, _("Save"), wx.Bitmap(sys.path[0] + "/save5050.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("Save"), "") self.frame_1_toolbar.AddLabelTool( 104, _("Open"), wx.Bitmap(sys.path[0] + "/open5050.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("Open"), "") self.frame_1_toolbar.AddLabelTool( 105, _("Upload"), wx.Bitmap(sys.path[0] + "/dwn5050.png", wx.BITMAP_TYPE_ANY), wx.NullBitmap, wx.ITEM_NORMAL, _("Upload"), "") self.editor = editeur.editeur(self, -1) self.logwindow = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_MENU, self.New, self.NEW) self.Bind(wx.EVT_MENU, self.Open, self.OPEN) self.Bind(wx.EVT_MENU, self.Save, self.SAVE) self.Bind(wx.EVT_MENU, self.Close, self.CLOSE) self.Bind(wx.EVT_MENU, self.Exit, self.EXIT) self.Bind(wx.EVT_MENU, self.About, self.ABOUT) self.Bind(wx.EVT_TOOL, self.Verify, id=100) self.Bind(wx.EVT_TOOL, self.Close, id=101) self.Bind(wx.EVT_TOOL, self.New, id=102) self.Bind(wx.EVT_TOOL, self.Save, id=103) self.Bind(wx.EVT_TOOL, self.Open, id=104) self.Bind(wx.EVT_TOOL, self.Upload, id=105) self.Bind(wx.EVT_SIZE, self.onresize)
def __init__(self, Selected_ID): self.Return_ID = Selected_ID wx.Dialog.__init__(self, None, -1, u"编辑修改商品信息", size=(450, 450)) self.Centre() self.icon = wx.Icon('icon.ico', wx.BITMAP_TYPE_ICO) self.SetIcon(self.icon) self.U_panel = wx.Panel(self) hbox = wx.BoxSizer(wx.HORIZONTAL) fgs = wx.FlexGridSizer(11, 2, 9, 18) U_GoodsID_Label = wx.StaticText(self.U_panel, -1, u"商品编号 : ") U_GoodsName_Label = wx.StaticText(self.U_panel, -1, u"商品名称 : ") U_GoodsColor_Label = wx.StaticText(self.U_panel, -1, u"商品颜色 : ") U_GoodsSize_S_Label = wx.StaticText(self.U_panel, -1, u"S码数量 : ") U_GoodsSize_U_Label = wx.StaticText(self.U_panel, -1, u"M码数量 : ") U_GoodsSize_L_Label = wx.StaticText(self.U_panel, -1, u"L码数量 : ") U_GoodsSize_XL_Label = wx.StaticText(self.U_panel, -1, u"XL码数量 : ") U_GoodsSize_XXL_Label = wx.StaticText(self.U_panel, -1, u"XXL码数量 : ") U_GoodsPrice_Label = wx.StaticText(self.U_panel, -1, u"标准吊牌价 : ") U_GoodsComments_Label = wx.StaticText(self.U_panel, -1, u"备注 : ") dbreader = shelve.open('database.dat', 'r') # print dbreader["%s"%Selected_ID]; self.NameData = dbreader["%s" % Selected_ID]['GName'] self.ColorData = dbreader["%s" % Selected_ID]['GColor'] self.SData = str(int(dbreader["%s" % Selected_ID]["S"])) self.MData = str(int(dbreader["%s" % Selected_ID]["M"])) self.LData = str(int(dbreader["%s" % Selected_ID]["L"])) self.XLData = str(int(dbreader["%s" % Selected_ID]["XL"])) self.XXLData = str(int(dbreader["%s" % Selected_ID]["XXL"])) self.PriceData = dbreader["%s" % Selected_ID]['GPrice'] self.CommentData = dbreader["%s" % Selected_ID]['GComments'] self.TimeData = dbreader["%s" % Selected_ID]['GStoreTime'] self.U_GoodsSelectedID_Label = wx.StaticText(self.U_panel, -1, "%s" % Selected_ID) self.GoodsName = wx.TextCtrl(self.U_panel, -1, "%s" % self.NameData) self.Color = wx.TextCtrl(self.U_panel, -1, "%s" % self.ColorData) self.S = wx.TextCtrl(self.U_panel, -1, "%s" % self.SData, validator=SearchGoods.CharValidator("no-alpha")) self.M = wx.TextCtrl(self.U_panel, -1, "%s" % self.MData, validator=SearchGoods.CharValidator("no-alpha")) self.L = wx.TextCtrl(self.U_panel, -1, "%s" % self.LData, validator=SearchGoods.CharValidator("no-alpha")) self.XL = wx.TextCtrl(self.U_panel, -1, "%s" % self.XLData, validator=SearchGoods.CharValidator("no-alpha")) self.XXL = wx.TextCtrl(self.U_panel, -1, "%s" % self.XXLData, validator=SearchGoods.CharValidator("no-alpha")) self.Price = wx.TextCtrl( self.U_panel, -1, "%s" % self.PriceData, validator=SearchGoods.CharValidator("no-alpha")) self.Comments = wx.TextCtrl(self.U_panel, -1, "%s" % self.CommentData) U_GoodsUpdate_Button = wx.Button(self.U_panel, 60, u"修 改") U_GoodsUpdateReset_Button = wx.Button(self.U_panel, 70, u"重 填") self.Bind(wx.EVT_BUTTON, self.Submit_Update, id=60) self.Bind(wx.EVT_BUTTON, self.Reset_Update, id=70) fgs.AddMany([(U_GoodsID_Label, 1, wx.EXPAND), (self.U_GoodsSelectedID_Label, 1, wx.EXPAND), (U_GoodsName_Label), (self.GoodsName, 1, wx.EXPAND), (U_GoodsColor_Label), (self.Color, 1, wx.EXPAND), (U_GoodsSize_S_Label), (self.S, 1, wx.EXPAND), (U_GoodsSize_U_Label), (self.M, 1, wx.EXPAND), (U_GoodsSize_L_Label), (self.L, 1, wx.EXPAND), (U_GoodsSize_XL_Label), (self.XL, 1, wx.EXPAND), (U_GoodsSize_XXL_Label), (self.XXL, 1, wx.EXPAND), (U_GoodsPrice_Label), (self.Price, 1, wx.EXPAND), (U_GoodsComments_Label), (self.Comments, 1, wx.EXPAND), (U_GoodsUpdateReset_Button), (U_GoodsUpdate_Button, 1, wx.EXPAND)]) fgs.AddGrowableRow(9, 1) fgs.AddGrowableCol(1, 1) hbox.Add(fgs, proportion=1, flag=wx.ALL | wx.EXPAND, border=15) self.U_panel.SetSizer(hbox) self.U_panel.Layout() dbreader.close()
def __init__(self, parent, logic, contact={ "type": 11, "id": 0, "name": "未知" }): super(ContentPanel, self).__init__(parent, id=-1, style=wx.SP_LIVE_UPDATE | wx.SP_BORDER | wx.SP_3DSASH) self.logicClient = logic self.contact = contact upper = wx.Panel(self) lower = wx.Panel(self) self.SplitHorizontally(upper, lower, -200) self.SetMinimumPaneSize(120) self.contact_name = wx.StaticText(upper, -1, label=self.contact["name"]) font = wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) self.contact_name.SetFont(font) self.content_text = wx.TextCtrl(upper, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.BORDER_NONE) self.input_text = wx.TextCtrl(lower, style=wx.TE_MULTILINE | wx.BORDER_NONE) self.input_text.SetFont( wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) ctrl_panel = wx.Panel(lower) send_button = wx.Button(ctrl_panel, label='发送') send_button.Bind(wx.EVT_BUTTON, self.OnClick_sendButton) # boxSizer upperbox = wx.BoxSizer(wx.VERTICAL) upper.SetSizer(upperbox) upperbox.Add(self.contact_name, proportion=0, flag=wx.EXPAND | wx.RIGHT | wx.TOP, border=15) upperbox.Add(self.content_text, proportion=1, flag=wx.EXPAND | wx.RIGHT | wx.TOP, border=15) lowerbox = wx.BoxSizer(wx.VERTICAL) lower.SetSizer(lowerbox) lowerbox.Add(self.input_text, proportion=1, flag=wx.EXPAND | wx.RIGHT | wx.BOTTOM, border=15) lowerbox.Add(ctrl_panel, proportion=0, flag=wx.EXPAND | wx.RIGHT, border=20)
def __init__(self, parent, title: str, gui: 'ChatbotGUI', gif_path: str, show_timestamp: bool = False): # init parent wx.Frame.__init__(self, parent, -1, title=title) # a reference to the chatbot GUI self.gui = gui # keeps track of the show_timestamp self.show_timestamp = show_timestamp # grid for splitting the screen into two parts, the gif and I/O elements self.grid = wx.BoxSizer(wx.HORIZONTAL) # user & AI message history self.user_message_history = [] self.ai_message_history = [] # panel for all of the I/O elements self.io_panel = wx.Panel(self) # the sizer for the panel I/O elements self.io_sizer = wx.BoxSizer(wx.VERTICAL) # chat bot animation asset self.chatbot_gif = Animation(gif_path) # animation controller for the chat bot gif self.chatbot_control = AnimationCtrl(self, -1, self.chatbot_gif) # # I/O elements # # input chat label # self.input_chat_top_label = wx.StaticText(self.io_panel, label="Your History:") # Your chat history # self.input_chat = wx.TextCtrl(self.io_panel, size=wx.Size(400, 290), style=wx.TE_READONLY | wx.TE_MULTILINE) # input chat label self.input_chat_label = wx.StaticText(self.io_panel, label="Talk to Reginald:") # input chat text box self.input_box = wx.TextCtrl(self.io_panel, style=wx.TE_PROCESS_ENTER, size=wx.Size(400, 20)) # input chat enter button self.chat_button = wx.Button(self.io_panel, label="Send your Text to Reginald") # input chat label self.output_chat_label = wx.StaticText( self.io_panel, label="Reginald Response History:") # AI chat History self.output_chat = wx.TextCtrl(self.io_panel, size=wx.Size(400, 145), style=wx.TE_READONLY | wx.TE_MULTILINE) # ai status label self.ai_status_label = wx.StaticText( self.io_panel, label="Reginald's Current Status:") # ai status box self.status_box = wx.TextCtrl(self.io_panel, style=wx.TE_READONLY) # # Add and size elements # # add elements to the I/O sizer # self.io_sizer.Add(self.input_chat_top_label, 0, wx.EXPAND | wx.LEFT | wx.TOP, 5) # self.io_sizer.Add(self.input_chat, 0, wx.EXPAND | wx.ALL, 5) self.io_sizer.Add(self.output_chat_label, 0, wx.EXPAND | wx.LEFT | wx.TOP, 5) self.io_sizer.Add(self.output_chat, 0, wx.EXPAND | wx.ALL, 5) self.io_sizer.Add(self.input_chat_label, 0, wx.EXPAND | wx.LEFT | wx.TOP, 5) self.io_sizer.Add(self.input_box, 0, wx.EXPAND | wx.ALL, 5) self.io_sizer.Add(self.chat_button, 0, wx.EXPAND | wx.ALL, 5) self.io_sizer.Add(self.ai_status_label, 0, wx.EXPAND | wx.LEFT | wx.TOP, 5) self.io_sizer.Add(self.status_box, 0, wx.EXPAND | wx.ALL, 5) # add elements to the main grid sizer self.grid.Add(self.io_panel, 0, wx.EXPAND | wx.ALL) self.grid.Add(self.chatbot_control, 0, wx.CENTER) # size and fit the sizers self.io_panel.SetSizerAndFit(self.io_sizer) self.SetSizerAndFit(self.grid) # # Bind buttons to functions # self.Bind(wx.EVT_TEXT_ENTER, self.on_send_press) self.Bind(wx.EVT_BUTTON, self.on_send_press, self.chat_button) # bind the event handler for commands evt_command(self, self.on_command)
def __init__(self, parent, ID, title): "constructor" wx.Frame.__init__(self, parent, ID, title, wx.DefaultPosition, wx.Size(675, 480)) # Create the menu menu = wx.Menu() menu.Append(ID_ABOUT, (localText.getText("TXT_KEY_PITBOSS_ABOUT", ())), (localText.getText("TXT_KEY_PITBOSS_ABOUT_TEXT", ()))) menu.AppendSeparator() menu.Append(ID_SAVE, (localText.getText("TXT_KEY_PITBOSS_SAVE", ())), (localText.getText("TXT_KEY_PITBOSS_SAVE_TEXT", ()))) menu.Append(ID_EXIT, (localText.getText("TXT_KEY_PITBOSS_EXIT", ())), (localText.getText("TXT_KEY_PITBOSS_EXIT_TEXT", ()))) menuBar = wx.MenuBar() strFile = localText.getText("TXT_KEY_PITBOSS_FILE", ()) strFile = localText.stripHTML(strFile) menuBar.Append(menu, strFile); self.SetMenuBar(menuBar) # Create our arrays of information and controls self.nameArray = [] self.pingArray = [] self.scoreArray = [] self.kickArray = [] pageSizer = wx.BoxSizer(wx.VERTICAL) # Add the game name and date self.gameTurn = PB.getGameturn() self.title = wx.StaticText(self, -1, PB.getGamename() + " - " + PB.getGamedate(False)) font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL) self.title.SetFont(font) self.title.SetSize(self.title.GetBestSize()) pageSizer.Add(self.title, 0, wx.ALL, 5) # Add the turn timer if we have one if (PB.getTurnTimer()): timerSizer = wx.BoxSizer(wx.HORIZONTAL) # Add a button to allow turn timer modification timerChangeButton = wx.Button(self, -1, localText.getText("TXT_KEY_MP_OPTION_TURN_TIMER", ())) self.Bind(wx.EVT_BUTTON, self.OnChangeTimer, timerChangeButton) timerSizer.Add(timerChangeButton, 0, wx.ALL, 5) timerPauseButton = wx.Button(self, -1, localText.getText("TXT_KEY_MOD_PAUSE_TIMER", ())) self.Bind(wx.EVT_BUTTON, self.OnChangePause, timerPauseButton) timerSizer.Add(timerPauseButton, 0, wx.ALL, 5) self.timerDisplay = wx.StaticText(self, -1, "") timerStr = self.getTimerString(PB.getTurnTimeLeft()) self.timerDisplay.SetLabel(timerStr) font = wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL) self.timerDisplay.SetFont(font) self.timerDisplay.SetSize(self.timerDisplay.GetBestSize()) timerSizer.Add(self.timerDisplay, 0, wx.ALL, 5) pageSizer.Add(timerSizer, 0, wx.ALL, 5) infoSizer = wx.BoxSizer(wx.HORIZONTAL) leftSizer = wx.BoxSizer(wx.VERTICAL) playerPanel = wx.lib.scrolledpanel.ScrolledPanel(self, -1, size=(370, 280), style = wx.DOUBLE_BORDER) playerSizer = wx.BoxSizer(wx.VERTICAL) # Create a row for each player in the game rowNum = 0 for rowNum in range(gc.getMAX_CIV_PLAYERS()): if (gc.getPlayer(rowNum).isEverAlive()): # Create the border box border = wx.StaticBox(playerPanel, -1, (localText.getText("TXT_KEY_PITBOSS_PLAYER", (rowNum+1, ))), (0,(rowNum*30))) # Create the layout mgr rowSizer = wx.StaticBoxSizer(border, wx.HORIZONTAL) # Player name itemSizer = wx.BoxSizer(wx.VERTICAL) lbl = wx.StaticText(playerPanel, -1, (localText.getText("TXT_KEY_PITBOSS_WHO", ()))) txtValue = wx.StaticText(playerPanel, rowNum, "", size = wx.Size(100, 13)) itemSizer.Add(lbl) itemSizer.Add(txtValue) rowSizer.Add(itemSizer, 0, wx.ALL, 5) self.nameArray.append(txtValue) # Ping times itemSizer = wx.BoxSizer(wx.VERTICAL) lbl = wx.StaticText(playerPanel, -1, (localText.getText("TXT_KEY_PITBOSS_PING", ()))) txtValue = wx.StaticText(playerPanel, rowNum, "", size = wx.Size(70, 13)) itemSizer.Add(lbl) itemSizer.Add(txtValue) rowSizer.Add(itemSizer, 0, wx.ALL, 5) self.pingArray.append(txtValue) # Scores itemSizer = wx.BoxSizer(wx.VERTICAL) lbl = wx.StaticText(playerPanel, -1, (localText.getText("TXT_KEY_PITBOSS_SCORE", ()))) txtValue = wx.StaticText(playerPanel, rowNum, "", size = wx.Size(30, 13)) itemSizer.Add(lbl) itemSizer.Add(txtValue) rowSizer.Add(itemSizer, 0, wx.ALL, 5) self.scoreArray.append(txtValue) # Kick buttons kickButton = wx.Button(playerPanel, rowNum, (localText.getText("TXT_KEY_PITBOSS_KICK", ()))) rowSizer.Add(kickButton, 0, wx.ALL, 5) kickButton.Disable() self.Bind(wx.EVT_BUTTON, self.OnKick, kickButton) self.kickArray.append(kickButton) playerSizer.Add(rowSizer, 0, wx.ALL, 5) playerPanel.SetSizer(playerSizer) playerPanel.SetAutoLayout(1) playerPanel.SetupScrolling() leftSizer.Add(playerPanel, 0, wx.ALL, 5) # Add a button row buttonSizer = wx.BoxSizer(wx.HORIZONTAL) # Add the save game button saveButton = wx.Button(self, -1, (localText.getText("TXT_KEY_PITBOSS_SAVE_GAME", ()))) self.Bind(wx.EVT_BUTTON, self.OnSave, saveButton) buttonSizer.Add(saveButton, 0, wx.ALL, 5) # Add the exit game button exitButton = wx.Button(self, -1, (localText.getText("TXT_KEY_MAIN_MENU_EXIT_GAME", ()))) self.Bind(wx.EVT_BUTTON, self.OnExit, exitButton) buttonSizer.Add(exitButton, 0, wx.ALL, 5) leftSizer.Add(buttonSizer, 0, wx.ALL, 5) # Add the left area to the info area infoSizer.Add(leftSizer, 0, wx.ALL, 5) # Now create the message area messageSizer = wx.BoxSizer(wx.VERTICAL) # Create the MotD Panel motdBorder = wx.StaticBox(self, -1, localText.getText("TXT_KEY_PITBOSS_MOTD_TITLE", ())) motdSizer = wx.StaticBoxSizer(motdBorder, wx.VERTICAL) # Check box whether to use MotD or not self.motdCheckBox = wx.CheckBox(self, -1, localText.getText("TXT_KEY_PITBOSS_MOTD_TOGGLE", ())) self.motdCheckBox.SetValue( len(pbSettings.get('MotD','')) > 0 ) motdSizer.Add(self.motdCheckBox, 0, wx.TOP, 5) # Add edit box displaying current MotD self.motdDisplayBox = wx.TextCtrl(self, -1, "", size=(225,50), style=wx.TE_MULTILINE|wx.TE_READONLY) self.motdDisplayBox.SetHelpText(localText.getText("TXT_KEY_PITBOSS_MOTD_HELP", ())) self.motdDisplayBox.SetValue(pbSettings.get('MotD','')) motdSizer.Add(self.motdDisplayBox, 0, wx.ALL, 5) # Add a button to allow motd modification motdChangeButton = wx.Button(self, -1, localText.getText("TXT_KEY_PITBOSS_MOTD_CHANGE", ())) motdChangeButton.SetHelpText(localText.getText("TXT_KEY_PITBOSS_MOTD_CHANGE_HELP", ())) self.Bind(wx.EVT_BUTTON, self.OnChangeMotD, motdChangeButton) motdSizer.Add(motdChangeButton, 0, wx.ALL, 5) # Add the motd area to the message area messageSizer.Add(motdSizer, 0, wx.ALL, 5) # Create the dialog panel dialogBorder = wx.StaticBox(self, -1, localText.getText("TXT_KEY_PITBOSS_CHAT_TITLE", ())) dialogSizer = wx.StaticBoxSizer(dialogBorder, wx.VERTICAL) # Chat log self.chatLog = wx.TextCtrl(self, -1, "", size=(225,100), style=wx.TE_MULTILINE|wx.TE_READONLY) self.chatLog.SetHelpText(localText.getText("TXT_KEY_PITBOSS_CHAT_LOG_HELP", ())) dialogSizer.Add(self.chatLog, 0, wx.ALL, 5) # Chat edit self.chatEdit = wx.TextCtrl(self, -1, "", size=(225,-1), style=wx.TE_PROCESS_ENTER) self.chatEdit.SetHelpText(localText.getText("TXT_KEY_PITBOSS_CHAT_EDIT_HELP", ())) dialogSizer.Add(self.chatEdit, 0, wx.ALL, 5) self.Bind(wx.EVT_TEXT_ENTER, self.OnSendChat, self.chatEdit) # Add the dialog area to the message area messageSizer.Add(dialogSizer, 0, wx.ALL, 5) # Add the message area to our info area infoSizer.Add(messageSizer, 0, wx.ALL, 5) # Add the info area to the page pageSizer.Add(infoSizer, 0, wx.ALL, 5) self.SetSizer(pageSizer) # Register the event handlers wx.EVT_MENU(self, ID_ABOUT, self.OnAbout) wx.EVT_MENU(self, ID_SAVE, self.OnSave) wx.EVT_MENU(self, ID_EXIT, self.OnExit) # Other handlers self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) #Webserver self.webserver = Webserver.ThreadedHTTPServer((pbSettings['webserver']['host'],pbSettings['webserver']['port']), Webserver.HTTPRequestHandler) self.t = Thread(target=self.webserver.serve_forever) self.t.setDaemon(True) self.t.start() #Periodical game data upload if( pbSettings['webfrontend']['sendPeriodicalData'] != 0 ): self.webupload = Webserver.PerpetualTimer(pbSettings['webfrontend'], self.webserver, True) self.t2 = Thread(target=self.webupload.start) self.t2.setDaemon(True) self.t2.start()
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"注册界面", pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) bSizer4 = wx.BoxSizer(wx.VERTICAL) bSizer4.AddSpacer(30) gSizer3 = wx.GridSizer(0, 2, 0, 0) self.m_staticText10 = wx.StaticText(self, wx.ID_ANY, u"用户名", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText10.Wrap(-1) self.m_staticText10.SetFont( wx.Font(14, 70, 90, 90, False, wx.EmptyString)) gSizer3.Add(self.m_staticText10, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_BOTTOM, 5) self.username = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) self.username.SetMaxLength(6) self.username.SetMinSize(wx.Size(150, -1)) gSizer3.Add(self.username, 0, wx.ALL | wx.ALIGN_BOTTOM, 5) self.m_staticText11 = wx.StaticText(self, wx.ID_ANY, u"密 码", wx.DefaultPosition, wx.DefaultSize, 0) self.m_staticText11.Wrap(-1) self.m_staticText11.SetFont( wx.Font(14, 70, 90, 90, False, wx.EmptyString)) gSizer3.Add( self.m_staticText11, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 5) self.password = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(150, -1), wx.TE_PASSWORD) self.password.SetMaxLength(6) gSizer3.Add(self.password, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) bSizer4.Add(gSizer3, 1, wx.EXPAND, 5) bSizer4.AddSpacer(20) ok_cancel_help = wx.StdDialogButtonSizer() self.ok_cancel_helpOK = wx.Button(self, wx.ID_OK) ok_cancel_help.AddButton(self.ok_cancel_helpOK) self.ok_cancel_helpCancel = wx.Button(self, wx.ID_CANCEL) ok_cancel_help.AddButton(self.ok_cancel_helpCancel) self.ok_cancel_helpHelp = wx.Button(self, wx.ID_HELP) ok_cancel_help.AddButton(self.ok_cancel_helpHelp) ok_cancel_help.Realize() bSizer4.Add(ok_cancel_help, 0, wx.ALIGN_CENTER_HORIZONTAL, 5) bSizer4.AddSpacer(50) self.SetSizer(bSizer4) self.Layout() self.Centre(wx.BOTH) # Connect Events self.ok_cancel_helpCancel.Bind(wx.EVT_BUTTON, self.cancel_event) self.ok_cancel_helpHelp.Bind(wx.EVT_BUTTON, self.help_event) self.ok_cancel_helpOK.Bind(wx.EVT_BUTTON, self.ok_event)
def __init__(self, word, parent, id, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE): wx.Frame.__init__(self, parent, id, title, pos, size, style) vboxMain = wx.BoxSizer(wx.VERTICAL) hboxButtons = wx.BoxSizer(wx.HORIZONTAL) self.boxInfo = RowColSizer() self.boxInfo.Add(wx.StaticText(self, -1, _("Word: "), pos=(-1, -1)), flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, row=0, col=0, border=1) self.entryWord = wx.TextCtrl(self, -1, word) self.entryWord.Disable() self.boxInfo.Add(self.entryWord, flag=wx.EXPAND, row=0, col=1, border=1) self.transLabels = {} self.textEntries = {} unit = parent.editor.getUnit(word) if unit: translations = unit.getTranslations() for trans in translations: comment = translations[trans] if comment: transcomm = u"%s // %s" % (trans, comment) else: transcomm = trans transcomm = enc.toWX(transcomm) self.onAddEmptyField(None) entry = self.textEntries.get(max(self.textEntries.keys())) if entry: entry.SetValue(transcomm) self.boxInfo.AddGrowableCol(1) vboxMain.Add(self.boxInfo, 1, wx.ALL | wx.EXPAND, 2) idAdd = wx.NewId() self.buttonAdd = wx.Button(self, idAdd, _("Add translation field")) vboxMain.Add(self.buttonAdd, 0, wx.ALL | wx.ALIGN_RIGHT, 2) self.buttonOK = wx.Button(self, 6050, _("OK")) hboxButtons.Add(self.buttonOK, 0, wx.ALL, 1) self.buttonCancel = wx.Button(self, 6051, _("Cancel")) hboxButtons.Add(self.buttonCancel, 0, wx.ALL, 1) vboxMain.Add(hboxButtons, 0, wx.ALL | wx.ALIGN_RIGHT, 2) self.SetSizer(vboxMain) self.Fit() self.SetSize((500, -1)) self.Bind(wx.EVT_BUTTON, self.onAddEmptyField, self.buttonAdd) self.Bind(wx.EVT_BUTTON, self.onSave, self.buttonOK) self.Bind(wx.EVT_BUTTON, self.onClose, self.buttonCancel)
def __init__(self, parent, release): wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Pyfa Update", pos=wx.DefaultPosition, size=wx.Size(400, 300), style=wx.DEFAULT_DIALOG_STYLE) self.UpdateSettings = svc_UpdateSettings.getInstance() self.releaseInfo = release self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) mainSizer = wx.BoxSizer(wx.VERTICAL) headSizer = wx.BoxSizer(wx.HORIZONTAL) self.headingText = wx.StaticText(self, wx.ID_ANY, "Pyfa Update Available!", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE) self.headingText.Wrap(-1) self.headingText.SetFont(wx.Font(14, 74, 90, 92, False)) headSizer.Add(self.headingText, 1, wx.ALL, 5) mainSizer.Add(headSizer, 0, wx.EXPAND, 5) mainSizer.Add( wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND | wx.ALL, 5) versionSizer = wx.BoxSizer(wx.HORIZONTAL) if self.releaseInfo['prerelease']: self.releaseText = wx.StaticText(self, wx.ID_ANY, "Pre-release", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT) self.releaseText.SetFont(wx.Font(12, 74, 90, 92, False)) self.releaseText.SetForegroundColour(wx.Colour(230, 0, 0)) else: self.releaseText = wx.StaticText(self, wx.ID_ANY, "Stable", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT) self.releaseText.SetFont(wx.Font(12, 74, 90, 90, False)) self.releaseText.Wrap(-1) versionSizer.Add(self.releaseText, 1, wx.ALL, 5) self.versionText = wx.StaticText(self, wx.ID_ANY, self.releaseInfo['tag_name'], wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_LEFT) self.versionText.Wrap(-1) self.versionText.SetFont(wx.Font(12, 74, 90, 90, False)) versionSizer.Add(self.versionText, 1, wx.ALL, 5) versionSizer.AddSpacer((15, 5), 0, wx.EXPAND, 5) mainSizer.Add(versionSizer, 0, wx.EXPAND, 5) mainSizer.AddSpacer((0, 5), 0, wx.EXPAND, 5) releaseDate = dateutil.parser.parse(self.releaseInfo['published_at']) notesSizer = wx.BoxSizer(wx.HORIZONTAL) self.notesTextCtrl = wx.TextCtrl( self, wx.ID_ANY, str(releaseDate.date()) + ":\n\n" + self.releaseInfo['body'], wx.DefaultPosition, wx.DefaultSize, wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY | wx.DOUBLE_BORDER | wx.TRANSPARENT_WINDOW) notesSizer.Add(self.notesTextCtrl, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) mainSizer.Add(notesSizer, 1, wx.EXPAND, 5) self.supressCheckbox = wx.CheckBox( self, wx.ID_ANY, "Don't remind me again for this release", wx.DefaultPosition, wx.DefaultSize, 0) self.supressCheckbox.Bind(wx.EVT_CHECKBOX, self.SuppressChange) mainSizer.Add(self.supressCheckbox, 0, wx.ALL, 5) mainSizer.Add( wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND | wx.ALL, 5) actionSizer = wx.BoxSizer(wx.HORIZONTAL) goSizer = wx.BoxSizer(wx.VERTICAL) self.downloadButton = wx.Button(self, wx.ID_ANY, "Download", wx.DefaultPosition, wx.DefaultSize, 0) self.downloadButton.Bind(wx.EVT_BUTTON, self.OnDownload) goSizer.Add(self.downloadButton, 0, wx.ALL, 5) actionSizer.Add(goSizer, 1, wx.EXPAND, 5) self.closeButton = wx.Button(self, wx.ID_CLOSE) self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose) actionSizer.Add(self.closeButton, 0, wx.ALL, 5) mainSizer.Add(actionSizer, 0, wx.EXPAND, 5) self.SetSizer(mainSizer) self.Layout() # Handle use-case of suppressing a release, then a new version becoming available. # If that new version is not suppressed, the old version will remain in the preferences and # may cause confusion. If this dialog box is popping up for any reason, that mean we can # safely reset this setting self.UpdateSettings.set('version', None) self.Centre(wx.BOTH)