我们从Python开源项目中,提取了以下49个代码示例,用于说明如何使用wx.DEFAULT_DIALOG_STYLE。
def __init__(self, *args, **kwds): # begin wxGlade: Dialogo_acceso_vcenter.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX wx.Dialog.__init__(self, *args, **kwds) self.label_7 = wx.StaticText(self, wx.ID_ANY, "Vcenter / esxi:") self.nombre_vcenter = wx.TextCtrl(self, wx.ID_ANY, "") self.label_9 = wx.StaticText(self, wx.ID_ANY, "Login:") self.login_vcenter = wx.TextCtrl(self, wx.ID_ANY, "") self.label_10 = wx.StaticText(self, wx.ID_ANY, "Password:") self.passwor_vcenter = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PASSWORD) self.label_8 = wx.StaticText(self, wx.ID_ANY, "Puerto:") self.puert_vcenter = wx.TextCtrl(self, wx.ID_ANY, "") self.button_Exit = wx.Button(self, wx.ID_CANCEL, "Exit") self.button_Connect = wx.Button(self, wx.ID_OK, "Conectar") self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, parent): self.parent = parent wxskinDialog.__init__(self, parent, -1, "Select card reader", wx.DefaultPosition, wx.DefaultSize, wx.DEFAULT_DIALOG_STYLE) self.state = SIM_STATE_DISCONNECTED self.serialport = None self.readerName = "" self.chv1_enabled = 0 self.chv1_tries_left = 0 self.chv1 = "" self.chv2_enabled = 0 self.chv2_tries_left = 0 self.chv2 = "" self.FDN_available = 0 self.phonebook = {} self.createLayout() # Don't show the select reader dialog yet self.Show(0)
def __init__(self, parent): self.parent = parent wxskinDialog.__init__(self, parent, -1, "Select card reader", wx.DefaultPosition, wx.DefaultSize, wx.DEFAULT_DIALOG_STYLE) self.state = SIM_STATE_DISCONNECTED self.readerName = "" self.chv1_enabled = 0 self.chv1_tries_left = 0 self.chv1 = "" self.chv2_enabled = 0 self.chv2_tries_left = 0 self.chv2 = "" self.FDN_available = 0 self.phonebook = {} if PCSCImportError: self.pcsc = None else: self.pcsc = PCSCHandle.PCSCHandle() self.createLayout() # Don't show the select reader dialog yet self.Show(0)
def __init__(self, parent, id, title, message, download_url, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE, name='dialog'): wx.Dialog.__init__(self, parent, id, title, pos, size, style, name) label = wx.StaticText(self, label=message) button = wx.Button(self, id=wx.ID_OK, label="Close") button.SetDefault() line = wx.StaticLine(self, wx.ID_ANY, size=(20, -1), style=wx.LI_HORIZONTAL) download_ctrl = hl.HyperLinkCtrl(self, wx.ID_ANY, download_url, URL=download_url) sizer = wx.BoxSizer(wx.VERTICAL) button_sizer = wx.StdDialogButtonSizer() button_sizer.AddButton(button) button_sizer.Realize() sizer.Add(label, 0, wx.ALIGN_CENTER|wx.ALL, 5) sizer.Add(download_ctrl, 0, wx.ALL, 10) sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5) sizer.Add(button_sizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5) self.SetSizer(sizer) sizer.Fit(self)
def __init__(self, parent=None, first_run=False): wx.Dialog.__init__(self, parent, title="Settings", style=wx.DEFAULT_DIALOG_STYLE) self._first_run = first_run self._sizer = wx.BoxSizer(wx.VERTICAL) self._defaults = {} self._sizer.Add(URLEntryPanel(self, default_url=read_config_option("baseurl")), flag=wx.EXPAND | wx.ALL, border=5) authorization_sizer = wx.BoxSizer(wx.HORIZONTAL) authorization_sizer.Add(ClientDetailsPanel(self, default_client_id=read_config_option("client_id"), default_client_secret=read_config_option("client_secret")), flag=wx.EXPAND | wx.RIGHT, border=2, proportion=1) authorization_sizer.Add(UserDetailsPanel(self, default_user=read_config_option("username"), default_pass=read_config_option("password")), flag=wx.EXPAND | wx.LEFT, border=2, proportion=1) self._sizer.Add(authorization_sizer, flag=wx.EXPAND | wx.ALL, border=5) self._sizer.Add(PostProcessingTaskPanel(self, default_post_process=read_config_option("completion_cmd")), flag=wx.EXPAND | wx.ALL, border=5) self._sizer.Add(DefaultDirectoryPanel(self, default_directory=read_config_option("default_dir"), monitor_directory=read_config_option("monitor_default_dir", expected_type=bool)), flag=wx.EXPAND | wx.ALL, border=5) self._sizer.Add(self.CreateSeparatedButtonSizer(flags=wx.OK), flag=wx.EXPAND | wx.ALL, border=5) self.SetSizerAndFit(self._sizer) self.Layout() pub.subscribe(self._field_changed, SettingsDialog.field_changed_topic) self.Bind(wx.EVT_CLOSE, self._on_close) self.Bind(wx.EVT_BUTTON, self._on_close, id=wx.ID_OK) threading.Thread(target=connect_to_irida).start()
def do_input(Class, parent, title, fields, data): dlg = Class(parent, -1, title, size=(350, 200), style=wx.DEFAULT_DIALOG_STYLE, # & ~wx.CLOSE_BOX, fields=fields, data=data ) dlg.CenterOnScreen() while 1: val = dlg.ShowModal() if val == wx.ID_OK: values = {} for field in fields: try: values[field] = eval(dlg.textctrls[field].GetValue()) except Exception, e: msg = wx.MessageDialog(parent, unicode(e), "Error in field %s" % field, wx.OK | wx.ICON_INFORMATION ) msg.ShowModal() msg.Destroy() break else: return dict([(field, values[field]) for field in fields]) else: return None
def __init__(self, *args, **kwds): # begin wxGlade: Dialog_snapshot.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, wx.ID_ANY, "Nombre:") self.nombre_snap = wx.TextCtrl(self, wx.ID_ANY, "") self.label_2 = wx.StaticText(self, wx.ID_ANY, u"Descripci\u00f3n:") self.descripcion_snap = wx.TextCtrl(self, wx.ID_ANY, "") self.checkbox_memory = wx.CheckBox(self, wx.ID_ANY, "memory") self.checkbox_quiesce = wx.CheckBox(self, wx.ID_ANY, "quiesce") self.snap_ok = wx.Button(self, wx.ID_OK, "OK") self.snap_cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("License"), size=(500, 400), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) if parent and parent.GetIcon(): self.SetIcon(parent.GetIcon()) self.SetMinSize((400, 300)) close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close")) ctrl = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_MULTILINE) ctrl.SetValue(info.License) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(close) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(ctrl, 1, wx.EXPAND | wx.ALL, 10) sizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Layout() self.Show() self.SetEscapeId(close.GetId()) close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
def __init__(self, parent, enable_required=True): wx.Dialog.__init__(self, parent, title=_('Project properties'), style=wx.DEFAULT_DIALOG_STYLE) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(0) self.ProjectProperties = ProjectPropertiesPanel( self, enable_required=enable_required) main_sizer.AddWindow(self.ProjectProperties, flag=wx.GROW) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, self.ButtonSizer.GetAffirmativeButton()) main_sizer.AddSizer(self.ButtonSizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.SetSizer(main_sizer) self.ProjectProperties.Fit() self.Fit()
def AddNewJump(self, bbox, wire=None): choices = [] for block in self.Blocks.itervalues(): if isinstance(block, SFC_Step): choices.append(block.GetName()) dialog = wx.SingleChoiceDialog(self.ParentWindow, _("Add a new jump"), _("Please choose a target"), choices, wx.DEFAULT_DIALOG_STYLE | wx.OK | wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: id = self.GetNewId() jump = SFC_Jump(self, dialog.GetStringSelection(), id) self.Controler.AddEditedElementJump(self.TagName, id) self.AddNewElement(jump, bbox, wire) dialog.Destroy()
def __init__( self, parent, title): wx.Dialog.__init__ (self, parent, -1, title, style = wx.DEFAULT_DIALOG_STYLE) self.lst = wx.BoxSizer( wx.VERTICAL ) self.tus = [] self.funcs = {'ctrl':self.add_ctrl, 'slide':self.add_slide, int:self.add_num, float:self.add_num, 'lab':self.add_lab, bool:self.add_check, str:self.add_txt, list:self.add_choice, 'img':self.add_img, 'tab':self.add_tab, 'color':self.add_color} self.on_ok, self.on_cancel = None, None self.ctrl_dic = {} boxBack = wx.BoxSizer() boxBack.Add(self.lst, 0, wx.ALL, 10) self.SetSizer( boxBack ) self.Layout() self.handle = self.handle_
def __init__(self, *args, **kwds): # begin wxGlade: sms_dialoge.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.THICK_FRAME wx.Frame.__init__(self, *args, **kwds) self.panel_5 = wx.Panel(self, wx.ID_ANY) self.label_7 = wx.StaticText(self.panel_5, wx.ID_ANY, ("Username")) self.combo_box_1 = wx.ComboBox(self.panel_5, wx.ID_ANY, choices=[("Select"), ("admin"), ("teacher")], style=wx.CB_READONLY|wx.CB_DROPDOWN) self.label_8 = wx.StaticText(self.panel_5, wx.ID_ANY, ("Password")) self.text_ctrl_1 = wx.TextCtrl(self.panel_5, wx.ID_ANY, "", style=wx.TE_PASSWORD) self.button_1 = wx.Button(self.panel_5, wx.ID_ANY, ("Cancel")) self.button_2 = wx.Button(self.panel_5, wx.ID_ANY, ("Login")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.on_user, self.combo_box_1) self.Bind(wx.EVT_TEXT, self.on_text, self.text_ctrl_1) self.Bind(wx.EVT_BUTTON, self.on_cancel, self.button_1) self.Bind(wx.EVT_BUTTON, self.on_login, self.button_2) self.text_ctrl_1.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress) self.Bind(wx.EVT_CLOSE,self.on_close,self) self.UO=user_operations(self) # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: add_academic_year.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_3 = wx.StaticText(self, wx.ID_ANY, ("Academic Year")) self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "") self.label_4 = wx.StaticText(self, wx.ID_ANY, ("-")) self.text_ctrl_2 = wx.TextCtrl(self, wx.ID_ANY, "") self.button_close = wx.Button(self, wx.ID_ANY, ("Close")) self.button_add = wx.Button(self, wx.ID_ANY, ("Add")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_TEXT, self.on_enter, self.text_ctrl_1) self.Bind(wx.EVT_BUTTON, self.on_close, self.button_close) self.Bind(wx.EVT_BUTTON, self.on_add, self.button_add) self.text_ctrl_1.Bind(wx.EVT_KEY_DOWN, self.handle_keypress) self.NEW_YEAR='' # end wxGlade
def __init__(self, *args, **kwds): self.settings = kwds['settings'] del kwds['settings'] # begin wxGlade: TerminalSettingsDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.checkbox_echo = wx.CheckBox(self, -1, "Local Echo") self.checkbox_unprintable = wx.CheckBox(self, -1, "Show unprintable characters") self.radio_box_newline = wx.RadioBox(self, -1, "Newline Handling", choices=["CR only", "LF only", "CR+LF"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.sizer_4_staticbox = wx.StaticBox(self, -1, "Input/Output") self.button_ok = wx.Button(self, wx.ID_OK, "") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade self.__attach_events() self.checkbox_echo.SetValue(self.settings.echo) self.checkbox_unprintable.SetValue(self.settings.unprintable) self.radio_box_newline.SetSelection(self.settings.newline)
def __init__(self, *args, **kwds): self.settings = kwds['settings'] del kwds['settings'] # begin wxGlade: TerminalSettingsDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.checkbox_echo = wx.CheckBox(self, -1, "Local Echo") self.checkbox_unprintable = wx.CheckBox(self, -1, "Show unprintable characters") self.radio_box_newline = wx.RadioBox(self, -1, "Newline Handling", choices=["CR only", "LF only", "CR+LF"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.button_ok = wx.Button(self, -1, "OK") self.button_cancel = wx.Button(self, -1, "Cancel") self.__set_properties() self.__do_layout() # end wxGlade self.__attach_events() self.checkbox_echo.SetValue(self.settings.echo) self.checkbox_unprintable.SetValue(self.settings.unprintable) self.radio_box_newline.SetSelection(self.settings.newline)
def __init__(self, parent): wx.Dialog.__init__(self, parent, -1, title=u"Logon", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) vsizer = wx.BoxSizer(orient=wx.VERTICAL) gb = wx.GridBagSizer() gb.Add(wx.StaticText(self, -1, u"Username"), flag=wx.ALL|wx.EXPAND, border=10, pos=(0,0)) self._name = wx.TextCtrl(self, -1) gb.Add(self._name, flag=wx.ALL|wx.EXPAND, border=10, pos=(0,1)) gb.Add(wx.StaticText(self, -1, u"Password"), flag=wx.ALL|wx.EXPAND, pos=(1,0), border=10) self._pass = wx.TextCtrl(self, -1, style=wx.TE_PASSWORD) gb.Add(self._pass, border=10, flag=wx.EXPAND|wx.ALL, pos=(1,1)) gb.AddGrowableCol(1) butsz = wx.StdDialogButtonSizer() okbut = wx.Button(self, wx.ID_OK, u"OK") butsz.AddButton(okbut) cbut = wx.Button(self, wx.ID_CANCEL, u"Cancel") butsz.AddButton(cbut) insp = wx.Button(self, wx.ID_HELP, u"Help") butsz.AddButton(insp) insp.Bind(wx.EVT_BUTTON, InspectionTool().Show) butsz.Realize() okbut.SetDefault() vsizer.Add(gb, 0, wx.EXPAND) vsizer.Add(butsz, 0, wx.EXPAND) self.SetSizer(vsizer) self.Fit()
def __init__(self, parent): with iz.Dialog(init=self, title=u"Logon", orient=wx.VERTICAL, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER): with iz.GridBagSizer(orient=wx.HORIZONTAL, proportion=1) as gb: # Defaults for StaticText and TextCtrl are normally border=0,proportion=0,flag=0. Change them temporarily # to avoid repeating the same options for each and every control: with iz.StaticText.Default(border=10), iz.TextCtrl.Default(border=10, proportion=1, flag=wx.EXPAND): # Now the sizer parameters can be omitted in the control definitions, since the defaults are # now appropriate. iz.StaticText(u"Username") self._name = iz.TextCtrl().wx iz.StaticText(u"Password", x=0) self._pass = iz.TextCtrl(style=wx.TE_PASSWORD).wx gb.AddGrowableCol(1) with iz.StdDialogButtonSizer(): okbut = iz.Button(u"OK", id=wx.ID_OK).wx iz.Button(u"Cancel", id=wx.ID_CANCEL) insp = iz.Button(u"Help", id=wx.ID_HELP,border=10, EVT_BUTTON=InspectionTool().Show).wx okbut.SetDefault() self.Fit()
def __init__(self, parent=None,id=-1,title="Checking Spelling..."): wx.Dialog.__init__(self, parent, id, title, size=wxSpellCheckerDialog.sz, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) self._numContext = 40 self._checker = None self._buttonsEnabled = True self.error_text = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH) self.replace_text = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER) self.replace_list = wx.ListBox(self, -1, style=wx.LB_SINGLE) self.InitLayout() wx.EVT_LISTBOX(self,self.replace_list.GetId(),self.OnReplSelect) wx.EVT_LISTBOX_DCLICK(self,self.replace_list.GetId(),self.OnReplace)
def __init__(self, parent, id=-1, title="Dialog", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE): wx.Dialog.__init__(self, parent, id, title) self.SetBackgroundColour(backgroundColour)
def __init__(self, parent): wx.Dialog.__init__(self, parent, title="FestEngine Log", style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) main_sizer = wx.BoxSizer(wx.VERTICAL) self.text_ctrl = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_MULTILINE) main_sizer.Add(self.text_ctrl, 1, wx.EXPAND) self.pending_messages = list() self.timer = wx.Timer() self.timer.Bind(wx.EVT_TIMER, self.append_pending_messages) self.timer.Start(500) self.SetSizer(main_sizer)
def __init__(self, *args, **kwds): # begin wxGlade: Dialogo_texto.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) self.salida_texto = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB) self.bnt_salida_ok = wx.Button(self, wx.ID_OK, "OK", style=wx.BU_BOTTOM) self.sizer_1_staticbox = wx.StaticBox(self, wx.ID_ANY, "Information") self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: Dialogo_user_pass.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) self.label_3 = wx.StaticText(self, wx.ID_ANY, "Usuario:") self.usuario = wx.TextCtrl(self, wx.ID_ANY, "") self.label_4 = wx.StaticText(self, wx.ID_ANY, "Password:") self.password = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PASSWORD) self.button_OK = wx.Button(self, wx.ID_OK, "OK") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: Dialogo_ejecutando.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.titulo = wx.StaticText(self, wx.ID_ANY, "Accediendo al sistema: ", style=wx.ALIGN_CENTER) self.elementos = wx.StaticText(self, wx.ID_ANY, "000000", style=wx.ALIGN_CENTER) self.__set_properties() self.__do_layout() # end wxGlade
def __init__(self, parent, subpanel): wx.Dialog.__init__(self, parent, title="Calculate Q-vector", size=(300, 180),style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) self.subpanel = subpanel vbox = wx.BoxSizer(wx.VERTICAL) self.ttheta = NumberObject(self,"2 theta:",self.subpanel.ttheta,80) self.ttheta.label.SetToolTipNew("2 theta angle (radians). "+os.linesep+"Note: Diffraction pattern is assumed "+os.linesep+"to be co-ordinate corrected.") self.phi = NumberObject(self,"phi:",self.subpanel.phi,80) self.phi.label.SetToolTipNew("phi angle (radians). "+os.linesep+"Note: Diffraction pattern is assumed "+os.linesep+"to be co-ordinate corrected.") self.waveln = NumberObject(self,"lambda:",self.subpanel.waveln,80) self.waveln.label.SetToolTipNew("wavelength (nanometers),") vbox.Add(self.ttheta ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add(self.phi ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add(self.waveln ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.rb = RadioBoxNew(self, label="Coordinate system", choices=['Global','Detector'], majorDimension=2, style=wx.RA_SPECIFY_COLS) self.rb.SetToolTipNew("Select co-ordinate system for Q-vector. "+os.linesep+"If the Diffraction data is co-ordinate corrected,"+os.linesep+"the global system is appropriate."+os.linesep+"If not, the detector system should be used."+os.linesep+"(i.e. normal to the reflected wave.)") vbox.Add(self.rb ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1,10)) hbox = wx.BoxSizer(wx.HORIZONTAL) self.ok = wx.Button(self, label='Ok', size=(70, 30)) self.cancel = wx.Button(self, label='Cancel', size=(70, 30)) hbox.Add(self.ok, 1,flag=wx.EXPAND) hbox.Add(self.cancel, 1, flag=wx.EXPAND) vbox.Add(hbox ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetSizer(vbox) self.ok.Bind(wx.EVT_BUTTON, self.OnOk) self.cancel.Bind(wx.EVT_BUTTON, self.OnCancel) self.Fit() self.Layout() self.Show()
def __init__(self, parent): wx.Dialog.__init__(self, parent, title="Measure Scene", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) self.SetSizeHints(640,480,-1,-1) self.Bind(wx.EVT_CLOSE, self.OnExit) self.panelvisual = self.GetParent() self.nb = wx.Notebook(self) self.nb.AddPage(MeasureLine(self.nb), "Line Scan") self.nb.AddPage(MeasureAngle(self.nb), "Angle") self.nb.AddPage(OrientXYZ(self.nb), "Orientation") sizer = wx.BoxSizer() sizer.Add(self.nb, 1, wx.EXPAND) self.SetSizer(sizer) self.Fit() self.Layout() self.Show()
def __init__(self, parent, file): super(WaveformPlot, self).__init__(parent=parent, title="pyjam Waveform Viewer", style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) self.file = file self.plot = plot.PlotCanvas(self) self.plot.canvas.Bind(wx.EVT_LEFT_DOWN, self.lmb_down) self.plot.canvas.Bind(wx.EVT_LEFT_UP, self.lmb_up) self.plot.canvas.Bind(wx.EVT_MOTION, self.mouse_motion) self.plot.EnableAxesValues = (True, False, False, False) self.plot.EnableGrid = (True, False) self.plot.AbsScale = (True, False) self.plot.EnableAntiAliasing = True self.panel = WaveformPanel(self) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.plot, 1, wx.EXPAND, 0) sizer.Add(self.panel, 0, wx.EXPAND, 0) self.SetSizerAndFit(sizer) self.SetSize(800, self.GetSize()[1]) self.SetMinSize(self.GetSize()) self.player = wx.media.MediaCtrl(parent=self, style=wx.SIMPLE_BORDER) self.volume = 25 self.selected = np.array([0.0, 0.0]) self.maximum = 0.0 self.minimum = 0.0 self.selection_drawn = False self.resized = False self.timer = wx.Timer(self) self.Bind(wx.EVT_SIZE, self.on_size) self.Bind(wx.EVT_TIMER, self.on_timer) self.Bind(wx.EVT_IDLE, self.on_idle) self.Bind(wx.EVT_CLOSE, self.on_exit) self.load()
def __init__(self, title='Temp', log="Temp"): """Constructor""" wx.Dialog.__init__(self, None, title=title, style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) self.log = "\n".join(log) self.InitUI() self.SetSize((640, 480))
def __init__(self, parent, name, library, default=None): wx.Dialog.__init__(self, name='BrowseValueDialog', parent=parent, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, title=_('Browse %s values library') % name) self.staticText1 = wx.StaticText( label=_('Choose a value for %s:') % name, name='staticText1', parent=self, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) self.ValuesLibrary = wx.TreeCtrl( name='ValuesLibrary', parent=self, pos=wx.Point(0, 0), size=wx.Size(400, 200), style=wx.TR_HAS_BUTTONS | wx.TR_SINGLE | wx.SUNKEN_BORDER | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId()) self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10) self.flexGridSizer1.AddWindow(self.staticText1, 0, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) self.flexGridSizer1.AddWindow(self.ValuesLibrary, 0, border=20, flag=wx.GROW | wx.LEFT | wx.RIGHT) self.flexGridSizer1.AddSizer(self.ButtonSizer, 0, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.flexGridSizer1.AddGrowableCol(0) self.flexGridSizer1.AddGrowableRow(1) self.SetSizer(self.flexGridSizer1) self.Fit() root = self.ValuesLibrary.AddRoot("") self.GenerateValuesLibraryBranch(root, library, default)
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("Credits"), size=(475, 320), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) if parent and parent.GetIcon(): self.SetIcon(parent.GetIcon()) self.SetMinSize((300, 200)) notebook = wx.Notebook(self) close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close")) close.SetDefault() developer = wx.TextCtrl(notebook, style=wx.TE_READONLY | wx.TE_MULTILINE) translators = wx.TextCtrl(notebook, style=wx.TE_READONLY | wx.TE_MULTILINE) developer.SetValue(u'\n'.join(info.Developers)) translators.SetValue(u'\n'.join(info.Translators)) notebook.AddPage(developer, text=_("Written by")) notebook.AddPage(translators, text=_("Translated by")) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(close) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(notebook, 1, wx.EXPAND | wx.ALL, 10) sizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Layout() self.Show() self.SetEscapeId(close.GetId()) close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
def OnBrowseButtonClick(self, event): # pop up the location browser dialog dialog = BrowseLocationsDialog(self, self.VarType, self.Controller) if dialog.ShowModal() == wx.ID_OK: infos = dialog.GetValues() else: infos = None dialog.Destroy() if infos is not None: location = infos["location"] # set the location if not infos["location"].startswith("%"): dialog = wx.SingleChoiceDialog( self, _("Select a variable class:"), _("Variable class"), [_("Input"), _("Output"), _("Memory")], wx.DEFAULT_DIALOG_STYLE | wx.OK | wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: selected = dialog.GetSelection() else: selected = None dialog.Destroy() if selected is None: self.Location.SetFocus() return if selected == 0: location = "%I" + location elif selected == 1: location = "%Q" + location else: location = "%M" + location self.Location.SetValue(location) self.VarType = infos["IEC_type"] self.Location.SetFocus()
def AddJump(self): if isinstance(self.SelectedElement, SFC_Step) and not self.SelectedElement.Output: choices = [] for block in self.Blocks: if isinstance(block, SFC_Step): choices.append(block.GetName()) dialog = wx.SingleChoiceDialog(self.ParentWindow, _("Add a new jump"), _("Please choose a target"), choices, wx.DEFAULT_DIALOG_STYLE | wx.OK | wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: value = dialog.GetStringSelection() self.SelectedElement.AddOutput() self.RefreshStepModel(self.SelectedElement) step_connectors = self.SelectedElement.GetConnectors() transition = self.CreateTransition(step_connectors["output"]) transition_connectors = transition.GetConnectors() id = self.GetNewId() jump = SFC_Jump(self, value, id) pos = transition_connectors["output"].GetPosition(False) jump.SetPosition(pos.x, pos.y + SFC_WIRE_MIN_SIZE) self.AddBlock(jump) self.Controler.AddEditedElementJump(self.TagName, id) jump_connector = jump.GetConnector() wire = self.ConnectConnectors(jump_connector, transition_connectors["output"]) transition.RefreshOutputPosition() wire.SetPoints([wx.Point(pos.x, pos.y + SFC_WIRE_MIN_SIZE), wx.Point(pos.x, pos.y)]) self.RefreshJumpModel(jump) self.RefreshBuffer() self.RefreshScrollBars() self.Refresh(False) dialog.Destroy()
def EditJumpContent(self, jump): choices = [] for block in self.Blocks.itervalues(): if isinstance(block, SFC_Step): choices.append(block.GetName()) dialog = wx.SingleChoiceDialog(self.ParentWindow, _("Edit jump target"), _("Please choose a target"), choices, wx.DEFAULT_DIALOG_STYLE | wx.OK | wx.CANCEL) try: indx = choices.index(jump.GetTarget()) dialog.SetSelection(indx) except ValueError: pass if dialog.ShowModal() == wx.ID_OK: value = dialog.GetStringSelection() rect = jump.GetRedrawRect(1, 1) jump.SetTarget(value) rect = rect.Union(jump.GetRedrawRect()) self.RefreshJumpModel(jump) self.RefreshBuffer() self.RefreshScrollBars() self.RefreshVisibleElements() jump.Refresh(rect) dialog.Destroy()
def __init__(self, parent, title, hist): wx.Frame.__init__(self, parent, title=title, style = wx.DEFAULT_DIALOG_STYLE) logopath = os.path.join(root_dir, 'data/logo.ico') self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO)) if len(hist)==3:self.rgb(hist) else: self.gray(hist)
def __init__(self, *args, **kwds): # begin wxGlade: update_win.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_installed_version = wx.StaticText(self, wx.ID_ANY, ("Installed Version:")) self.label_latest_version = wx.StaticText(self, wx.ID_ANY, ("Latest Version")) self.label_is_update = wx.StaticText(self, wx.ID_ANY, ("If Update available")) self.progress_bar = wx.Gauge(self, wx.ID_ANY, range=100) self.animation_panel = wx.Panel(self, wx.ID_ANY) self.label_status = wx.StaticText(self, wx.ID_ANY, ("")) self.button_close = wx.Button(self, wx.ID_ANY, ("Cancel")) self.button_install = wx.Button(self, wx.ID_ANY, ("Check for Update")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.on_cancel, self.button_close) self.Bind(wx.EVT_BUTTON, self.on_install, self.button_install) self.Bind(wx.EVT_CLOSE, self.on_close) self.animation_panel.gif = None # create a pubsub receiver Publisher().subscribe(self.update, "update") Publisher().subscribe(self.error_report, "error_report") Publisher().subscribe(self.update_progress_bar, "progress_bar") Publisher().subscribe(self.get_versions, "update_versions") Publisher().subscribe(self.is_update, "is_update") Publisher().subscribe(self.play_animation, "play_animation") Publisher().subscribe(self.stop_animation, "stop_animation") Publisher().subscribe(self.updation_successful, "updation_successful") #self.play_animation('') #wx.FutureCall(10, self.start_thread) # end wxGlade
def __init__(self, *args, **kwds): # grab the serial keyword and remove it from the dict self.serial = kwds['serial'] del kwds['serial'] self.show = SHOW_ALL if 'show' in kwds: self.show = kwds.pop('show') # begin wxGlade: SerialConfigDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_2 = wx.StaticText(self, -1, "Port") self.choice_port = wx.Choice(self, -1, choices=[]) self.label_1 = wx.StaticText(self, -1, "Baudrate") self.combo_box_baudrate = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.sizer_1_staticbox = wx.StaticBox(self, -1, "Basics") self.panel_format = wx.Panel(self, -1) self.label_3 = wx.StaticText(self.panel_format, -1, "Data Bits") self.choice_databits = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.label_4 = wx.StaticText(self.panel_format, -1, "Stop Bits") self.choice_stopbits = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.label_5 = wx.StaticText(self.panel_format, -1, "Parity") self.choice_parity = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.sizer_format_staticbox = wx.StaticBox(self.panel_format, -1, "Data Format") self.panel_timeout = wx.Panel(self, -1) self.checkbox_timeout = wx.CheckBox(self.panel_timeout, -1, "Use Timeout") self.text_ctrl_timeout = wx.TextCtrl(self.panel_timeout, -1, "") self.label_6 = wx.StaticText(self.panel_timeout, -1, "seconds") self.sizer_timeout_staticbox = wx.StaticBox(self.panel_timeout, -1, "Timeout") self.panel_flow = wx.Panel(self, -1) self.checkbox_rtscts = wx.CheckBox(self.panel_flow, -1, "RTS/CTS") self.checkbox_xonxoff = wx.CheckBox(self.panel_flow, -1, "Xon/Xoff") self.sizer_flow_staticbox = wx.StaticBox(self.panel_flow, -1, "Flow Control") self.button_ok = wx.Button(self, wx.ID_OK, "") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade # attach the event handlers self.__attach_events()
def __init__(self, parent, filetypes, fileLimit = None): wx.Dialog.__init__(self, parent, -1, title = 'Select Input Files', style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) self.filetypes = {} self.fileArray = wx.ListCtrl(self, -1, style = wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_HRULES | wx.LC_VRULES) for i, (filetype, ext) in enumerate(filetypes): self.fileArray.InsertColumn(i, filetype) assert filetype not in self.filetypes, "Non-unique file identifiers! %s" % filetype self.filetypes[filetype] = ext self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.getFile, self.fileArray) self.goButton = wx.Button(self, -1, "Use Selected Files") self.Bind(wx.EVT_BUTTON, self.complete, self.goButton) self.Bind(wx.EVT_CLOSE, self.abort) box = wx.BoxSizer(wx.VERTICAL) box.Add(self.fileArray, 1, wx.ALL | wx.EXPAND, 10) box.Add(self.goButton, 0, wx.ALL | wx.EXPAND, 10) self.SetSizerAndFit(box) self.SetSize(wx.Size(1200, 300)) self.Bind(wx.EVT_SIZE, self.resize) for i in range(0, 10): self.fileArray.Append([''] * self.fileArray.GetColumnCount()) self.resize(None) self.CentreOnScreen()
def __init__(self, parent): with iz.Dialog(init=self, title=u"Logon", orient=wx.VERTICAL, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER): with iz.GridBagSizer(orient=wx.HORIZONTAL, proportion=1) as gb: iz.StaticText(u"Username", border=10) self._name = iz.TextCtrl(border=10, proportion=1, flag=wx.EXPAND).wx iz.StaticText(u"Password", x=0, border=10) self._pass = iz.TextCtrl(style=wx.TE_PASSWORD, border=10, proportion=1, flag=wx.EXPAND).wx gb.AddGrowableCol(1) with iz.StdDialogButtonSizer(): okbut = iz.Button(u"OK", id=wx.ID_OK).wx iz.Button(u"Cancel", id=wx.ID_CANCEL) insp = iz.Button(u"Help", id=wx.ID_HELP,border=10, EVT_BUTTON=InspectionTool().Show).wx okbut.SetDefault() self.Fit()
def __init__( self, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE, fields=None, data=None, ): wx.Dialog.__init__ (self, parent, ID, title, pos, size, style) sizer = wx.BoxSizer(wx.VERTICAL) self.textctrls = {} for field in fields: box = wx.BoxSizer(wx.HORIZONTAL) label = wx.StaticText(self, -1, field) label.SetHelpText("This is the help text for the label") box.Add(label, 1, wx.ALIGN_CENTRE|wx.ALL, 5) text = wx.TextCtrl(self, -1, "", size=(80,-1)) text.SetHelpText("Here's some help text for field #1") if field in data: text.SetValue(repr(data[field])) box.Add(text, 1, wx.ALIGN_CENTRE|wx.ALL, 1) sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 1) self.textctrls[field] = text line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL) sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5) btnsizer = wx.StdDialogButtonSizer() btn = wx.Button(self, wx.ID_OK) btn.SetHelpText("The OK button completes the dialog") btn.SetDefault() btnsizer.AddButton(btn) btn = wx.Button(self, wx.ID_CANCEL) btn.SetHelpText("The Cancel button cancels the dialog. (Cool, huh?)") btnsizer.AddButton(btn) btnsizer.Realize() sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5) self.SetSizer(sizer) sizer.Fit(self)
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"About", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer8 = wx.BoxSizer( wx.VERTICAL ) self.m_notebookAbout = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_panelAbout = wx.Panel( self.m_notebookAbout, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) bSizer10 = wx.BoxSizer( wx.VERTICAL ) bSizer10.AddSpacer( ( 0, 0), 1, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticTextAppNameVersion = wx.StaticText( self.m_panelAbout, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) self.m_staticTextAppNameVersion.Wrap( -1 ) bSizer10.Add( self.m_staticTextAppNameVersion, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticTextCopyright = wx.StaticText( self.m_panelAbout, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) self.m_staticTextCopyright.Wrap( -1 ) bSizer10.Add( self.m_staticTextCopyright, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_hyperlinkURL = wx.HyperlinkCtrl( self.m_panelAbout, wx.ID_ANY, u"wxFB Website", u"http://www.wxformbuilder.org", wx.DefaultPosition, wx.DefaultSize, wx.HL_ALIGN_CENTRE|wx.HL_DEFAULT_STYLE ) bSizer10.Add( self.m_hyperlinkURL, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer10.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.m_panelAbout.SetSizer( bSizer10 ) self.m_panelAbout.Layout() bSizer10.Fit( self.m_panelAbout ) self.m_notebookAbout.AddPage( self.m_panelAbout, u"About", True ) bSizer8.Add( self.m_notebookAbout, 1, wx.EXPAND |wx.ALL, 5 ) self.m_buttonClose = wx.Button( self, wx.ID_ANY, u"Close", wx.DefaultPosition, wx.DefaultSize, 0 ) bSizer8.Add( self.m_buttonClose, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.SetSizer( bSizer8 ) self.Layout() bSizer8.Fit( self ) self.Centre( wx.BOTH )
def __init__(self, parent, raw_header_str, caption, pos=wx.DefaultPosition, size=(500,300), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER): self.parent = parent wx.Dialog.__init__(self, parent, -1, caption, pos, size, style) x, y = pos if x == -1 and y == -1: self.CenterOnScreen(wx.BOTH) self.cur_selection = (0, 0) self.raw_header_str = raw_header_str self.raw_header_str_lower = raw_header_str.lower() self.text = text = wx.TextCtrl(self, -1, raw_header_str, style=wx.TE_MULTILINE | wx.TE_READONLY) font1 = wx.Font(12, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.FONTWEIGHT_LIGHT, False) self.text.SetFont(font1) self.text.SetInitialSize((600,400)) main_sizer = wx.BoxSizer(wx.VERTICAL) main_sizer.Add(self.text, 1, wx.EXPAND | wx.ALL, border=5) ok = wx.Button(self, wx.ID_OK, "OK") ok.SetDefault() ok.Bind(wx.EVT_BUTTON, self.on_close) buttons_sizer = wx.BoxSizer(wx.HORIZONTAL) self.search = wx.SearchCtrl(self, size=(200, -1), style=wx.TE_PROCESS_ENTER) self.search.ShowSearchButton(True) self.search.ShowCancelButton(True) # TODO: make layout of search & OK button prettier (OK should be right-aligned properly) buttons_sizer.Add(self.search, 0, wx.ALL | wx.EXPAND) buttons_sizer.Add((315, 0), 1, wx.EXPAND) buttons_sizer.Add(ok, 0, wx.ALL) main_sizer.Add(buttons_sizer, 0, wx.ALL, border=4) self.SetSizerAndFit(main_sizer) self.set_cur_selection() self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.on_search, self.search) self.Bind(wx.EVT_TEXT_ENTER, self.on_search, self.search) self.last_search_str = '' self.last_find_index = 0 self.is_dialog_still_open = True self.Bind(wx.EVT_CLOSE, self.on_close) new_id = wx.NewId() self.Bind(wx.EVT_MENU, self.on_cmd_w, id=new_id) self.SetAcceleratorTable(wx.AcceleratorTable([(wx.ACCEL_CMD, ord(str('w')), new_id)]))
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Teardrops", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.CAPTION|wx.CLOSE_BOX|wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bvs_main = wx.BoxSizer( wx.VERTICAL ) rbx_actionChoices = [ u"Set Teardrops", u"Remove All Teardrops" ] self.rbx_action = wx.RadioBox( self, wx.ID_ANY, u"Action", wx.DefaultPosition, wx.DefaultSize, rbx_actionChoices, 1, wx.RA_SPECIFY_ROWS ) self.rbx_action.SetSelection( 0 ) bvs_main.Add( self.rbx_action, 0, wx.ALL, 5 ) gs_params = wx.GridSizer( 0, 2, 0, 0 ) self.st_hpercent = wx.StaticText( self, wx.ID_ANY, u"Horizontal percent", wx.DefaultPosition, wx.DefaultSize, 0 ) self.st_hpercent.Wrap( -1 ) gs_params.Add( self.st_hpercent, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) self.sp_hpercent = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 30 ) gs_params.Add( self.sp_hpercent, 0, wx.ALL|wx.SHAPED, 5 ) self.st_vpercent = wx.StaticText( self, wx.ID_ANY, u"Vertical percent", wx.DefaultPosition, wx.DefaultSize, 0 ) self.st_vpercent.Wrap( -1 ) gs_params.Add( self.st_vpercent, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) self.sp_vpercent = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 70 ) gs_params.Add( self.sp_vpercent, 0, wx.ALL|wx.SHAPED, 5 ) self.st_nbseg = wx.StaticText( self, wx.ID_ANY, u"Number of segments", wx.DefaultPosition, wx.DefaultSize, 0 ) self.st_nbseg.Wrap( -1 ) gs_params.Add( self.st_nbseg, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) self.sp_nbseg = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 100, 10 ) gs_params.Add( self.sp_nbseg, 0, wx.ALL|wx.SHAPED, 5 ) bvs_main.Add( gs_params, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND|wx.SHAPED, 5 ) bhs_modal = wx.BoxSizer( wx.HORIZONTAL ) bhs_modal.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.but_cancel = wx.Button( self, wx.ID_ANY, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0 ) bhs_modal.Add( self.but_cancel, 0, wx.ALIGN_RIGHT|wx.EXPAND, 5 ) self.but_ok = wx.Button( self, wx.ID_ANY, u"Ok", wx.DefaultPosition, wx.DefaultSize, 0 ) bhs_modal.Add( self.but_ok, 0, 0, 5 ) bvs_main.Add( bhs_modal, 0, wx.EXPAND, 5 ) self.SetSizer( bvs_main ) self.Layout() bvs_main.Fit( self ) self.Centre( wx.BOTH )
def __init__(self, parent): wx.Dialog.__init__(self, parent, title="Lookup Table", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) self.SetSizeHints(720,480,-1,-1) self.parent = parent self.Bind(wx.EVT_CLOSE, self.OnExit) self.panelphase = parent.GetParent().GetPage(0) self.panelvisual = self.GetParent() self.actor_list3D = ["vtkOpenGLActor", "vtkActor", "vtkMesaActor"] self.actor_list2D = ["vtkOpenGLImageActor", "vtkImageActor"] self.sizer = wx.BoxSizer(wx.VERTICAL) self.hbox = wx.BoxSizer(wx.HORIZONTAL) self.vbox1 = wx.BoxSizer(wx.VERTICAL) self.vbox2 = wx.BoxSizer(wx.VERTICAL) self.font = self.panelvisual.font self.panels = [] self.listtitles = ["Real Amp","Real Phase", "Fourier Amp","Fourier Phase"] self.list = wx.ListCtrl(self,wx.ID_ANY,style=wx.LC_REPORT|wx.LC_NO_HEADER|wx.LC_HRULES|wx.SUNKEN_BORDER, size=(200,-1)) self.list.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelectListItem) self.list.InsertColumn(0,'Settings', width = 200) self.list.SetFont(self.font) for i in range(len(self.listtitles)): if IsNotWX4(): self.list.InsertStringItem(i,self.listtitles[i],i) else: self.list.InsertItem(i,self.listtitles[i],i) self.list.SetItemFont(i, self.font) self.panels.append(ColourDialog(self)) self.panels[-1].Hide() self.panels[-1].Layout() self.GetRadioChoice(i) self.vbox2.Add(self.panels[-1], 1, wx.EXPAND) self.vbox1.Add(self.list, 1, wx.EXPAND) self.panel_hld = wx.StaticText(self, label='') self.vbox2.Add(self.panel_hld, 1, wx.EXPAND) self.hbox.Add(self.vbox1, 0, wx.EXPAND,2) self.hbox.Add(self.vbox2, 1, wx.EXPAND,2) self.sizer.Add(self.hbox, 1, wx.EXPAND,2) self.button_update = wx.Button(self, label="Update Scale", size=(720, 30)) self.sizer.Add(self.button_update, 0, wx.EXPAND, 2) self.Bind(wx.EVT_BUTTON, self.OnClickUpdate,self.button_update) self.SetSizer(self.sizer) self.Fit() self.Layout() self.Show()
def __init__(self, images, parent=None, id=wx.ID_ANY, title='CellStar explorer', x=900, y=600): """ @type images: ImageRepo """ style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX wx.Dialog.__init__(self, parent, id, title, style=style) self.Size = (x, y) self.figure = mpl.figure.Figure(dpi=300, figsize=(1, 1)) self.axes = self.figure.add_subplot(111) self.axes.margins(0, 0) self.canvas = Canvas(self, -1, self.figure) self.toolbar = Toolbar(self.canvas) self.toolbar.Realize() self.abort = False sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.canvas, 1, wx.EXPAND) sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND) self.SetSizer(sizer) self.layer0 = self.axes.imshow(images.image, cmap=mpl.cm.gray) def onclick_internal(event): if event.ydata is None: return print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f' % ( event.button, event.x, event.y, event.xdata, event.ydata) if event.button != 1: self.onclick(event.button, event.xdata, event.ydata) self.figure.canvas.draw() def press_internal(event): print('press', event.key) if event.key == 'b': # abort self.EndModal(ExplorerFrame.ABORTED) if event.key in 'qwerxcv': self.layer0.remove() if event.key == 'q': # input self.layer0 = self.axes.imshow(images.image, cmap=mpl.cm.gray) elif event.key == 'w': # image clean self.layer0 = self.axes.imshow(images.image_back_difference, cmap=mpl.cm.gray) elif event.key == 'x': # image clean self.layer0 = self.axes.imshow(images.image_back_difference_blurred, cmap=mpl.cm.gray) elif event.key == 'c': # image clean self.layer0 = self.axes.imshow(images.foreground_mask, cmap=mpl.cm.gray) elif event.key == 'v': # image clean self.layer0 = self.axes.imshow(images.background_mask, cmap=mpl.cm.gray) elif event.key == 'e': # brighter self.layer0 = self.axes.imshow(images.brighter, cmap=mpl.cm.gray) elif event.key == 'r': # darker self.layer0 = self.axes.imshow(images.darker, cmap=mpl.cm.gray) self.figure.canvas.draw() else: self.press(event.key) self.figure.canvas.draw() self.figure.canvas.mpl_connect('button_press_event', onclick_internal) self.figure.canvas.mpl_connect('key_press_event', press_internal) self.Show(True)
def __init__(self, parent): super(DownloaderDialog, self).__init__(parent, title="pyjam Downloader", style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) self.parent = parent self.audio_links = wx.TextCtrl(self) audio_link_text = wx.StaticText(self, label="URL(s) (Separate with commas)") self.out_dir = wx.DirPickerCtrl(self, path=os.path.abspath("downloads")) out_dir_text = wx.StaticText(self, label="Output directory") warning_text = wx.StaticText(self, style=wx.ALIGN_CENTRE_HORIZONTAL, label=("Note: The program will freeze for a bit while it processes the URL " "before downloading")) warning_text.Wrap(self.GetSize()[0]) search_button = wx.Button(self, label="Search") top_sizer = wx.BoxSizer(wx.VERTICAL) control_sizer = wx.BoxSizer(wx.VERTICAL) text_sizer = wx.BoxSizer(wx.VERTICAL) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) control_sizer.Add(audio_link_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3) control_sizer.Add(self.audio_links, 0, wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5) control_sizer.Add(out_dir_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3) control_sizer.Add(self.out_dir, 0, wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5) text_sizer.Add(warning_text, 0, wx.ALL | wx.ALIGN_CENTER, 5) button_sizer.Add(search_button) top_sizer.Add(control_sizer, 1, wx.ALL | wx.EXPAND | wx.ALIGN_TOP, 5) top_sizer.Add(text_sizer, 0, wx.ALL | wx.ALIGN_CENTER, 5) top_sizer.Add(button_sizer, 0, wx.ALL | wx.ALIGN_CENTER, 5) self.Bind(wx.EVT_BUTTON, handler=self.on_ok, id=wx.ID_OK) self.Bind(wx.EVT_BUTTON, handler=lambda x: SearchDialog(self), source=search_button) self.downloader = None self.progress_dialog = None self.num_songs = 0 self.SetSizerAndFit(top_sizer) self.Center() self.ShowModal()
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"About", pos = wx.DefaultPosition, size = wx.Size( 800,512 ), style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) Sizer = wx.BoxSizer( wx.VERTICAL ) self.Panel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) SizerC1 = wx.BoxSizer( wx.VERTICAL ) SizerText = wx.BoxSizer( wx.VERTICAL ) self.AppName = wx.StaticText( self.Panel, wx.ID_ANY, u"Turrican 2 Editor", wx.DefaultPosition, wx.DefaultSize, 0 ) self.AppName.Wrap( -1 ) self.AppName.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 70, 90, 92, False, wx.EmptyString ) ) SizerText.Add( self.AppName, 0, wx.LEFT|wx.RIGHT|wx.TOP, 8 ) self.AppVersion = wx.StaticText( self.Panel, wx.ID_ANY, u"Version 1.0.2", wx.DefaultPosition, wx.DefaultSize, 0 ) self.AppVersion.Wrap( -1 ) SizerText.Add( self.AppVersion, 0, wx.BOTTOM|wx.LEFT|wx.RIGHT, 8 ) self.License = wx.TextCtrl( self.Panel, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY|wx.NO_BORDER ) self.License.SetFont( wx.Font( 9, 75, 90, 90, False, "Courier New" ) ) self.License.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) SizerText.Add( self.License, 1, wx.ALL|wx.EXPAND, 8 ) SizerC1.Add( SizerText, 1, wx.EXPAND, 5 ) SizerButton = wx.BoxSizer( wx.HORIZONTAL ) SizerButton.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) self.Ok = wx.Button( self.Panel, wx.ID_ANY, u"Ok", wx.DefaultPosition, wx.DefaultSize, 0 ) self.Ok.SetDefault() SizerButton.Add( self.Ok, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) SizerC1.Add( SizerButton, 0, wx.EXPAND, 5 ) self.Panel.SetSizer( SizerC1 ) self.Panel.Layout() SizerC1.Fit( self.Panel ) Sizer.Add( self.Panel, 1, wx.EXPAND |wx.ALL, 8 ) self.SetSizer( Sizer ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.Ok.Bind( wx.EVT_BUTTON, self.ok )
def _init_ctrls(self, prnt): wx.Dialog.__init__( self, id=ID_DISCOVERYDIALOG, name='DiscoveryDialog', parent=prnt, style=wx.DEFAULT_DIALOG_STYLE, title=_('Service Discovery')) self.staticText1 = wx.StaticText( id=ID_DISCOVERYDIALOGSTATICTEXT1, label=_('Services available:'), name='staticText1', parent=self, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) # Set up list control self.ServicesList = AutoWidthListCtrl( id=ID_DISCOVERYDIALOGSERVICESLIST, name='ServicesList', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING | wx.LC_SINGLE_SEL) self.ServicesList.InsertColumn(0, _('NAME')) self.ServicesList.InsertColumn(1, _('TYPE')) self.ServicesList.InsertColumn(2, _('IP')) self.ServicesList.InsertColumn(3, _('PORT')) self.ServicesList.SetColumnWidth(0, 150) self.ServicesList.SetColumnWidth(1, 150) self.ServicesList.SetColumnWidth(2, 150) self.ServicesList.SetColumnWidth(3, 150) self.ServicesList.SetInitialSize(wx.Size(-1, 300)) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST) self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST) listmix.ColumnSorterMixin.__init__(self, 4) self.RefreshButton = wx.Button( id=ID_DISCOVERYDIALOGREFRESHBUTTON, label=_('Refresh'), name='RefreshButton', parent=self, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) self.Bind(wx.EVT_BUTTON, self.OnRefreshButton, id=ID_DISCOVERYDIALOGREFRESHBUTTON) self.LocalButton = wx.Button( id=ID_DISCOVERYDIALOGLOCALBUTTON, label=_('Local'), name='LocalButton', parent=self, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) self.Bind(wx.EVT_BUTTON, self.OnLocalButton, id=ID_DISCOVERYDIALOGLOCALBUTTON) self.IpButton = wx.Button( id=ID_DISCOVERYDIALOGIPBUTTON, label=_('Add IP'), name='IpButton', parent=self, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) self.Bind(wx.EVT_BUTTON, self.OnIpButton, id=ID_DISCOVERYDIALOGIPBUTTON) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTER) self._init_sizers() self.Fit()
def __init__(self, parent, rate=None, out_dir=None, in_dir=None): super(FFmpegConvertDialog, self).__init__(parent=parent, title="pyjam Audio Converter", style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) self.in_dir = in_dir self.game_rate = intctrl.IntCtrl(self) game_rate_text = wx.StaticText(self, label="Audio rate") if rate is not None: self.game_rate.SetValue(rate) self.volume = wx.SpinCtrl(self, initial=85) volume_text = wx.StaticText(self, label="Volume %") self.in_picker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL) in_picker_text = wx.StaticText(self, label="Input file names (manually changing them has no effect)") self.in_files = [] # the dumbest thing i've done all year (i'm overriding the controls of the PickerBase) for child in self.in_picker.GetChildren(): if isinstance(child, wx.Button): child.Bind(wx.EVT_BUTTON, self.browse) self.out_dir = wx.DirPickerCtrl(self, name="Output directory") out_dir_text = wx.StaticText(self, label="Output directory") if out_dir is not None: self.out_dir.SetPath(out_dir) top_sizer = wx.BoxSizer(wx.VERTICAL) top_row = wx.BoxSizer(wx.HORIZONTAL) rate_sizer = wx.BoxSizer(wx.VERTICAL) vol_sizer = wx.BoxSizer(wx.VERTICAL) dir_sizer = wx.BoxSizer(wx.VERTICAL) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) rate_sizer.Add(game_rate_text, 0, wx.ALL ^ wx.BOTTOM | wx.ALIGN_LEFT, 5) rate_sizer.Add(self.game_rate, 0, wx.ALL | wx.ALIGN_LEFT, 5) vol_sizer.Add(volume_text, 0, wx.ALL ^ wx.BOTTOM | wx.ALIGN_LEFT, 5) vol_sizer.Add(self.volume, 0, wx.ALL | wx.ALIGN_LEFT, 5) top_row.Add(rate_sizer) top_row.Add(vol_sizer) dir_sizer.Add(in_picker_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3) dir_sizer.Add(self.in_picker, 0, wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5) dir_sizer.Add(out_dir_text, 0, wx.ALL ^ wx.LEFT | wx.ALIGN_LEFT, 3) dir_sizer.Add(self.out_dir, 0, wx.ALL ^ wx.LEFT ^ wx.TOP | wx.ALIGN_LEFT | wx.EXPAND, 5) top_sizer.Add(top_row) top_sizer.Add(dir_sizer, 1, wx.ALL | wx.EXPAND | wx.ALIGN_TOP, 5) top_sizer.Add(button_sizer, 0, wx.ALL | wx.ALIGN_CENTER, 5) self.Bind(wx.EVT_BUTTON, self.on_ok, id=wx.ID_OK) self.Bind(wx.EVT_BUTTON, self.on_cancel, id=wx.ID_CANCEL) self.converter = None self.progress_dialog = None self.num_songs = 0 self.SetSizer(top_sizer) # self.SetSize(400, 250) self.Center() self.ShowModal()