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
python类Dialog()的实例源码
def buildDialog(filePath, resourceName, mayCancel, **defaults):
"""Return a configured wx.Dialog.
Assumes that the OK and Cancel buttons are named ID_OK & ID_CANCEL.
"""
res = loadXrc(filePath)
insureWxApp()
dlg = res.LoadDialog(None, resourceName)
assert isinstance(dlg, wx.Dialog)
dlg.Fit()
fetchWidget = dlg.FindWindowByName
bOk = dlg.FindWindowByName('ID_OK')
bCancel = dlg.FindWindowByName('ID_CANCEL')
bOk.SetId(wx.ID_OK)
bCancel.SetId(wx.ID_CANCEL)
if not mayCancel:
bCancel.Disable()
bCancel.Hide()
for name, value in defaults.items():
dlg.FindWindowByName(name).SetValue(value)
if not mayCancel:
dlg.Bind(wx.EVT_CHAR_HOOK, escapeSuppressor)
return dlg
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 __init__(self, parent, message, caption, choices=[]):
wx.Dialog.__init__(self, parent, -1)
self.SetTitle(caption)
sizer = wx.BoxSizer(wx.VERTICAL)
self.message = wx.StaticText(self, -1, message)
self.clb = wx.CheckListBox(self, -1, choices=choices)
self.chbox = wx.CheckBox(self, -1, 'Select all')
self.btns = self.CreateSeparatedButtonSizer(wx.OK | wx.CANCEL)
self.Bind(wx.EVT_CHECKBOX, self.EvtChBox, self.chbox)
sizer.Add(self.message, 0, wx.ALL | wx.EXPAND, 5)
sizer.Add(self.clb, 1, wx.ALL | wx.EXPAND, 5)
sizer.Add(self.chbox, 0, wx.ALL | wx.EXPAND, 5)
sizer.Add(self.btns, 0, wx.ALL | wx.EXPAND, 5)
self.SetSizer(sizer)
# self.Fit()
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, *args, **kwds):
# begin wxGlade: LogicalVolumeDialog.__init__
wx.Dialog.__init__(self, *args, **kwds)
self.panel_1 = wx.Panel(self, wx.ID_ANY)
self.panel_4 = wx.Panel(self, wx.ID_ANY)
self.label_1 = wx.StaticText(self, wx.ID_ANY, _("Select Logical Volume: "), style=wx.ALIGN_CENTER_HORIZONTAL)
self.panel_7 = wx.Panel(self, wx.ID_ANY)
self.combo_logical_volumes = wx.ComboBox(self, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN)
self.panel_8 = wx.Panel(self, wx.ID_ANY)
self.panel_3 = wx.Panel(self, wx.ID_ANY)
self.panel_5 = wx.Panel(self, wx.ID_ANY)
self.button_select = wx.Button(self, wx.ID_OK, _("Select"))
self.panel_9 = wx.Panel(self, wx.ID_ANY)
self.button_cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel"))
self.panel_6 = wx.Panel(self, wx.ID_ANY)
self.panel_2 = wx.Panel(self, wx.ID_ANY)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.button_select_click, id=wx.ID_OK)
self.Bind(wx.EVT_BUTTON, self.button_cancel_click, id=wx.ID_CANCEL)
# end wxGlade
self.PopulateVolumes()
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 __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: Add_Student.__init__
kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.STAY_ON_TOP
wx.Dialog.__init__(self, *args, **kwds)
self.text_ctrl_1 = wx.TextCtrl(self, -1, "")
self.text_ctrl_2 = wx.TextCtrl(self, -1, "")
self.text_ctrl_3 = wx.TextCtrl(self, -1, "")
self.button_1 = wx.Button(self, -1, "Add")
self.Bind(wx.EVT_CLOSE,self.OnClose,self)
self.__set_properties()
self.__do_layout()
self.DB=db_operations()
self.success=False
self.STUDENT_INFO=[]
# end wxGlade
def __init__(self, parent):
# begin wxGlade: CE_TE.__init__
#kwds["style"] = wx.CLOSE_BOX|wx.MINIMIZE_BOX
wx.Dialog.__init__(self, parent,id=-1,title="CE and TE")
self.parent=parent
self.label_1 = wx.StaticText(self, -1, "Max_CE")
self.text_ctrl_1 = wx.TextCtrl(self, -1, "")
self.label_2 = wx.StaticText(self, -1, "Max_TE")
self.text_ctrl_2 = wx.TextCtrl(self, -1, "")
self.button_1 = wx.Button(self, -1, "OK")
self.button_2 = wx.Button(self, -1, "Cancel")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_TEXT_ENTER, self.On_TE_Enter, self.text_ctrl_1)
self.Bind(wx.EVT_TEXT, self.On_CE_Text, self.text_ctrl_1)
self.Bind(wx.EVT_TEXT_ENTER, self.On_TE_Enter, self.text_ctrl_2)
self.Bind(wx.EVT_TEXT, self.On_TE_Text, self.text_ctrl_2)
self.Bind(wx.EVT_BUTTON, self.On_Ok, self.button_1)
self.Bind(wx.EVT_BUTTON, self.On_Cancel, self.button_2)
# end wxGlade
def __init__(self, *args, **kwds):
# begin wxGlade: disclaimer_win.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Dialog.__init__(self, *args, **kwds)
self.label_1 = wx.StaticText(self, wx.ID_ANY, ("Disclaimer"))
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP)
self.button_disagree = wx.Button(self, wx.ID_ANY, ("Disagree"))
self.button_agree = wx.Button(self, wx.ID_ANY, ("I agree"))
self.text='''
This SOFTWARE PRODUCT is a an open source free software distributed with GPL 3 License. Your are free to modify it subject to the
conditions laid in the license. It is also stated that the software is provided "as is" and "with all faults."
THE developer makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of this SOFTWARE PRODUCT.
There are inherent dangers in the use of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT is compatible with your equipment and and suits your needs.
You are also solely responsible for the protection of your equipment and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, modifying, or distributing this SOFTWARE PRODUCT.'''
self.__set_properties()
self.__do_layout()
self.agree=False
self.Bind(wx.EVT_BUTTON, self.on_disagree, self.button_disagree)
self.Bind(wx.EVT_BUTTON, self.on_agree, self.button_agree)
# end wxGlade
def __init__(self, *args, **kwds):
# begin wxGlade: help_window.__init__
kwds["style"] = wx.MAXIMIZE | wx.CLOSE_BOX | wx.THICK_FRAME|wx.CAPTION
wx.Dialog.__init__(self, *args, **kwds)
self.window_1 = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_3D | wx.SP_BORDER)
self.window_1_pane_left = wx.Panel(self.window_1, wx.ID_ANY)
self.html_left = html.HtmlWindow(self.window_1_pane_left, wx.ID_ANY, size=(1, 1))
self.window_1_pane_right = wx.Panel(self.window_1, wx.ID_ANY)
self.html_right = html.HtmlWindow(self.window_1_pane_right, wx.ID_ANY, size=(1, 1))
#self.Bind(wx.EVT_COself.on_hyperlink,self.html_left)
self.Bind(wx.html.EVT_HTML_LINK_CLICKED,self.on_hyperlink,self.html_left)
#self.Bind(wx.EVT_SIZE,self.on_resize)
self.__set_properties()
self.__do_layout()
#self.on_resize(None)
self.load_htmlpage()
# 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, parent, id, titlemsg ):
wx.Dialog.__init__( self, parent, id, title=titlemsg )
MechList = []
for m in parent.ScoreServer.MechList.List:
MechList.append( str(m.ID) + ": " + str(m.Name) )
self.MechText = wx.StaticText( self, -1, "Mech Selection:" )
self.MechChoice = wx.ListBox( self, -1, style=wx.LB_EXTENDED, choices=MechList )
self.CancelButton = wx.Button( self, wx.ID_CANCEL, "Cancel" )
self.OKButton = wx.Button( self, wx.ID_OK, "OK" )
TopSizer = wx.BoxSizer( wx.VERTICAL )
BtnSizer = wx.BoxSizer( wx.HORIZONTAL )
BtnSizer.Add( self.CancelButton, 0, wx.ALL, 5 )
BtnSizer.Add( self.OKButton, 0, wx.ALL, 5 )
TopSizer.Add( self.MechText, 0, wx.ALL, 5 )
TopSizer.Add( self.MechChoice, 0, wx.ALL, 5 )
TopSizer.Add( BtnSizer, 0, wx.ALL|wx.CENTER, 5 )
self.SetSizer( TopSizer )
TopSizer.Fit( self )
def place(self, e):
if not hasattr(self, "brackets"):
errortext = "Make bracket before doing that"
w = wx.MessageDialog(self.parent, errortext,
"Error", wx.ICON_ERROR)
w.ShowModal()
w.Destroy()
return
placel = bracketfuncs.placing(self.brackets)
d = wx.Dialog(None)
d.SetTitle("Results")
a = wx.TextCtrl(d, style=wx.TE_MULTILINE)
a.SetEditable(False)
ptxt = ""
for p in placel:
if not p.isbye():
ptxt += str(placel[p]) + ". " + p.tag + "\n"
a.SetValue(ptxt)
d.SetSize((250, 320))
d.Show(True)
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, id, title):
wx.Dialog.__init__(self, parent, id, title)
self.selection_idx = None
self.selection_text = None
vbox = wx.BoxSizer(wx.VERTICAL)
stline = wx.StaticText(
self,
11,
'Duplicate Component values found!'
'\n\nPlease select which format to follow:')
vbox.Add(stline, 0, wx.ALIGN_CENTER|wx.TOP)
self.comp_list = wx.ListBox(self, 331, style=wx.LB_SINGLE)
vbox.Add(self.comp_list, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND)
self.SetSizer(vbox)
self.comp_list.Bind(wx.EVT_LISTBOX_DCLICK, self.on_selection, id=wx.ID_ANY)
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, controller_uid):
TopLevel.__init__(self, controller_uid)
UIM = UIManager()
controller = UIM.get(self._controller_uid)
wx.Dialog.__init__(self, None, wx.ID_ANY, controller.model.title,
pos=controller.model.pos, size=controller.model.size,
style=controller.model.style
)
self._objects = {}
if controller.model.icon:
self.icon = wx.Icon(controller.model.icon, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
if controller.model.maximized:
self.Maximize()
self.Bind(wx.EVT_MAXIMIZE, self.on_maximize)
self.Bind(wx.EVT_SIZE, self.on_size)
self.Bind(wx.EVT_MOVE, self.on_move)
dialog_box = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(dialog_box)
self.mainpanel = self.AddCreateContainer('BoxSizer', self, proportion=1,
flag=wx.TOP|wx.LEFT|wx.RIGHT|wx.EXPAND, border=10
)
button_sizer = self.CreateButtonSizer(controller.model.flags)
dialog_box.Add(button_sizer, flag=wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, border=10)
dialog_box.Layout()
def __init__(self, *args, **kwargs):
if 'on_ok_callback' in kwargs:
self.on_ok_callback = kwargs.pop('on_ok_callback')
else:
self.on_ok_callback = None
if 'on_cancel_callback' in kwargs:
self.on_cancel_callback = kwargs.pop('on_cancel_callback')
else:
self.on_cancel_callback = None
super(Dialog, self).__init__(*args, **kwargs)
self.header_panel = Panel(self)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
self.Bind(wx.EVT_BUTTON, self.on_button)
vbox = wx.BoxSizer(wx.VERTICAL)
vbox.Add(self.header_panel, proportion=1, flag=wx.ALL | wx.EXPAND)
vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT)
self.SetSizer(vbox)
self.SetSize((800, 600))
self.SetTitle(u"Editor de Cabeçalho LAS")
def __init__(self, *args, **kwargs):
if 'on_ok_callback' in kwargs:
self.on_ok_callback = kwargs.pop('on_ok_callback')
else:
self.on_ok_callback = None
if 'on_cancel_callback' in kwargs:
self.on_cancel_callback = kwargs.pop('on_cancel_callback')
else:
self.on_cancel_callback = None
super(Dialog, self).__init__(*args, **kwargs)
self.header_panel = Panel(self)
button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
self.Bind(wx.EVT_BUTTON, self.on_button)
vbox = wx.BoxSizer(wx.VERTICAL)
vbox.Add(self.header_panel, proportion=1, flag=wx.ALL | wx.EXPAND)
vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT)
self.SetSizer(vbox)
self.SetSize((800, 600))
self.SetTitle(u"Editor de Cabeçalho ODT")
def useTemporaryDialog(filePath, resourceName, mayCancel,
*itemNames, **defaults):
"""Create a dialog, run it, capture the results, destroy the dialog,
and return the results.
Return None if the user cancels.
"""
dlg = buildDialog(filePath, resourceName, mayCancel, **defaults)
try:
result = runDialog(dlg, mayCancel, *itemNames)
finally:
dlg.Destroy()
return result
# --- Sample Dialog ---
def __init__(self, parent):
wx.Dialog.__init__(self, parent, wx.ID_ANY, "About NodeMCU PyFlasher")
html = HtmlWindow(self, wx.ID_ANY, size=(420, -1))
if "gtk2" in wx.PlatformInfo or "gtk3" in wx.PlatformInfo:
html.SetStandardFonts()
txt = self.text.format(self._get_bundle_dir(), __version__)
html.SetPage(txt)
ir = html.GetInternalRepresentation()
html.SetSize((ir.GetWidth() + 25, ir.GetHeight() + 25))
self.SetClientSize(html.GetSize())
self.CentreOnParent(wx.BOTH)
def __init__(self, parent=None, message='Message:',
caption='Message', style=wx.OK|wx.CANCEL,pos=wx.DefaultPosition):
wx.Dialog.__init__(self, parent, -1, caption, size=wx.DefaultSize,
style=wx.CAPTION, pos=pos)
self._build(message, style)
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)