当前位置: 首页>>代码示例>>Python>>正文


Python wx.Dialog方法代码示例

本文整理汇总了Python中wx.Dialog方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Dialog方法的具体用法?Python wx.Dialog怎么用?Python wx.Dialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.Dialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent, text, title):
        wx.Dialog.__init__(self, parent, -1, title,
                           style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        vsizer = wx.BoxSizer(wx.VERTICAL)

        tc = wx.TextCtrl(self, -1, size = wx.Size(400, 200),
                         style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_LINEWRAP)
        tc.SetValue(text)
        vsizer.Add(tc, 1, wx.EXPAND);

        vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        okBtn = gutil.createStockButton(self, "OK")
        vsizer.Add(okBtn, 0, wx.ALIGN_CENTER)

        util.finishWindow(self, vsizer)

        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)

        okBtn.SetFocus() 
开发者ID:trelby,项目名称:trelby,代码行数:23,代码来源:misc.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent):
    wx.Dialog.__init__(self, parent)

    self.SetBackgroundColour('#ffffff')

    self.ok_button = wx.Button(self, wx.ID_OK, label='Ok')
    self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROPDOWN)

    vertical_container = wx.BoxSizer(wx.VERTICAL)
    vertical_container.AddSpacer(10)
    vertical_container.Add(wx_util.h1(self, label='Select a Date'), 0, wx.LEFT | wx.RIGHT, 15)
    vertical_container.AddSpacer(10)
    vertical_container.Add(self.datepicker, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)

    vertical_container.AddSpacer(10)
    button_sizer = wx.BoxSizer(wx.HORIZONTAL)
    button_sizer.AddStretchSpacer(1)
    button_sizer.Add(self.ok_button, 0)

    vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT, 15)
    vertical_container.AddSpacer(20)
    self.SetSizerAndFit(vertical_container)

    self.Bind(wx.EVT_BUTTON, self.OnOkButton, self.ok_button) 
开发者ID:ME-ICA,项目名称:me-ica,代码行数:26,代码来源:calender_dialog.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent, ctrl):
        wx.Dialog.__init__(self, parent, -1, "Character map")

        self.ctrl = ctrl

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        self.charMap = MyCharMap(self)
        hsizer.Add(self.charMap)

        self.insertButton = wx.Button(self, -1, " Insert character ")
        hsizer.Add(self.insertButton, 0, wx.ALL, 10)
        wx.EVT_BUTTON(self, self.insertButton.GetId(), self.OnInsert)
        gutil.btnDblClick(self.insertButton, self.OnInsert)

        util.finishWindow(self, hsizer, 0) 
开发者ID:trelby,项目名称:trelby,代码行数:18,代码来源:charmapdlg.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:26,代码来源:backend_wx.py

示例5: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent, title, current_language):
        style = wx.DEFAULT_DIALOG_STYLE
        vbox = wx.BoxSizer(wx.VERTICAL)
        wx.Dialog.__init__(self, parent, -1, title, style=style)
        self.lbl = wx.StaticText(self, -1,
            _("Choose language (requires restart to take full effect)"))
        vbox.Add(self.lbl, 0, wx.ALL, 10)
        self.language_choices = wx.ComboBox(self, -1,
                                            choices=sorted(LANGUAGES.keys()),
                                            style=wx.CB_READONLY)

        self.language_choices.SetStringSelection(LANGUAGES_REVERSE[current_language])

        vbox.Add(self.language_choices, 0, wx.ALL, 10)
        buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        vbox.Add(buttons, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 10)
        self.SetSizerAndFit(vbox) 
开发者ID:theRealTacoTime,项目名称:poclbm,代码行数:19,代码来源:guiminer.py

示例6: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent):
    wx.Dialog.__init__(self, parent)

    self.SetBackgroundColour('#ffffff')

    self.ok_button = wx.Button(self, label='Ok')
    self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROPDOWN)

    vertical_container = wx.BoxSizer(wx.VERTICAL)
    vertical_container.AddSpacer(10)
    vertical_container.Add(wx_util.h1(self, label='Select a Date'), 0, wx.LEFT | wx.RIGHT, 15)
    vertical_container.AddSpacer(10)
    vertical_container.Add(self.datepicker, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)

    vertical_container.AddSpacer(10)
    button_sizer = wx.BoxSizer(wx.HORIZONTAL)
    button_sizer.AddStretchSpacer(1)
    button_sizer.Add(self.ok_button, 0)

    vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT, 15)
    vertical_container.AddSpacer(20)
    self.SetSizerAndFit(vertical_container)

    self.Bind(wx.EVT_BUTTON, self.OnOkButton, self.ok_button) 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:26,代码来源:calender_dialog.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: webcamConfigDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.testwebcambutton = wx.Button(self, wx.ID_ANY, _("Test Webcam"))
        self.webcamtimestampcheck = wx.CheckBox(self, wx.ID_ANY, _("Show Timestamp"))
        self.label_16 = wx.StaticText(self, wx.ID_ANY, _("Format:"))
        self.webcam_timestamp_format = wx.TextCtrl(self, wx.ID_ANY, _("%Y-%m-%d %H:%M:%S"))
        self.label_9 = wx.StaticText(self, wx.ID_ANY, _("File Prefix:"))
        self.webcamprefixtext = wx.TextCtrl(self, wx.ID_ANY, _("cam_"))
        self.label_10 = wx.StaticText(self, wx.ID_ANY, _("Save Folder:"))
        self.webcamsavefoldertext = wx.TextCtrl(self, wx.ID_ANY, "")
        self.webcamsavefolderbrowse = wx.Button(self, wx.ID_ANY, _("..."))
        self.label_11 = wx.StaticText(self, wx.ID_ANY, _("File Format:"))
        self.webcamformatcombo = wx.ComboBox(self, wx.ID_ANY, choices=[_("jpg"), _("png"), _("gif")], style=wx.CB_DROPDOWN | wx.CB_DROPDOWN)
        self.webcamsavebutton = wx.Button(self, wx.ID_OK, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.testWebcamPressed, self.testwebcambutton)
        self.Bind(wx.EVT_BUTTON, self.webcamSaveFolderBrowse, self.webcamsavefolderbrowse)
        # end wxGlade 
开发者ID:collingreen,项目名称:chronolapse,代码行数:25,代码来源:chronolapsegui.py

示例8: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent):

        wx.Dialog.__init__(self, parent, wx.ID_ANY, "Manual Entry", size=(650, 600))
        self.panel = wx.Panel(self, wx.ID_ANY)

        self.mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.folios = self.fetchFolios()

        self.lblFolioD = wx.StaticText(self.panel, label="Folio (Debit)")
        self.folioComboD = wx.ComboBox(self.panel, choices=list(self.folios.keys()))

        self.mainSizer.Add(self.lblFolioD)
        self.mainSizer.Add(self.folioComboD)

        self.SetSizer(self.mainSizer)
        self.Layout()
        self.mainSizer.Fit(self.panel)
        self.Centre(wx.BOTH)

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

        self.Show() 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:25,代码来源:testingManualEntryPanel.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent):
        # TODO: try to use MessageBox instead, as they already include buttons, icons, etc.
        wx.Dialog.__init__(self, parent, title="SCT Processing")
        self.SetSize((300, 120))

        vbox = wx.BoxSizer(wx.VERTICAL)
        lbldesc = wx.StaticText(self, id=wx.ID_ANY, label="Processing, please wait...")
        vbox.Add(lbldesc, 0, wx.ALIGN_LEFT | wx.ALL, 10)

        btns = self.CreateSeparatedButtonSizer(wx.CANCEL)
        vbox.Add(btns, 0, wx.ALIGN_LEFT | wx.ALL, 5)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        # TODO: use a nicer image, showing two gears (similar to ID_EXECUTE)
        save_ico = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR, (50, 50))
        img_info = wx.StaticBitmap(self, -1, save_ico, wx.DefaultPosition, (save_ico.GetWidth(), save_ico.GetHeight()))

        hbox.Add(img_info, 0, wx.ALL, 10)
        hbox.Add(vbox, 0, wx.ALL, 0)

        self.SetSizer(hbox)
        self.Centre()
        self.CenterOnParent()
        # TODO: retrieve action from the cancel button 
开发者ID:neuropoly,项目名称:spinalcordtoolbox,代码行数:27,代码来源:sct_plugin.py

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, parent, pickerClass, pickerGetter, localizedPickerLabel):
    wx.Dialog.__init__(self, parent, title=localizedPickerLabel)

    self.SetBackgroundColour('#ffffff')

    self.ok_button = wx.Button(self, wx.ID_OK, label=_('ok'))
    self.picker = pickerClass(self, style=Constants.WX_DP_DROPDOWN)
    self.pickerGetter = pickerGetter

    vertical_container = wx.BoxSizer(wx.VERTICAL)
    vertical_container.AddSpacer(10)
    vertical_container.Add(self.picker, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER, 15)

    vertical_container.AddSpacer(10)
    button_sizer = wx.BoxSizer(wx.HORIZONTAL)
    button_sizer.AddStretchSpacer(1)
    button_sizer.Add(self.ok_button, 0)

    vertical_container.Add(button_sizer, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER, 15)
    vertical_container.AddSpacer(20)
    self.SetSizerAndFit(vertical_container)

    self.Bind(wx.EVT_BUTTON, self.onOkButton, self.ok_button) 
开发者ID:chriskiehl,项目名称:Gooey,代码行数:25,代码来源:base_dialog.py

示例11: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
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)
        self.Show(True) 
开发者ID:Jeff-Ciesielski,项目名称:Boms-Away,代码行数:20,代码来源:bomsaway.py

示例12: OnProfileChoice

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def OnProfileChoice(self, event):
        if self.Profile.GetStringSelection() == _("Other"):
            dialog = wx.FileDialog(self, _("Choose a file"), self.Directory, "",  _("OD Profile files (*.prf)|*.prf|All files|*.*"), wx.OPEN|wx.CHANGE_DIR)
            dialog.ShowModal()
            filepath = dialog.GetPath()
            dialog.Destroy()
            if os.path.isfile(filepath):
                name = os.path.splitext(os.path.basename(filepath))[0]
                self.ListProfile[name] = filepath
                length = self.Profile.GetCount()
                self.Profile.Insert(name, length - 2)
                self.Profile.SetStringSelection(name)
            else:
                self.Profile.SetStringSelection(_("None"))
        event.Skip()


#-------------------------------------------------------------------------------
#                            ADD Slave to NodeList Dialog
#------------------------------------------------------------------------------- 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:22,代码来源:commondialogs.py

示例13: getint

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def getint(v):
    try:
        return int(v)
    except:
        pass
    if type(v) not in stringtypes:
        return 0
    a = "0"
    for d in v:
        if d in "0123456789":
            a += d
    return int(a)

# abbreviations to get rid of those long pesky names ...
#==============================================================================
# Define our dialog as a subclass of wx.Dialog.
# Only special thing is, that we are being invoked with a filename ...
#============================================================================== 
开发者ID:pymupdf,项目名称:PyMuPDF-Utilities,代码行数:20,代码来源:PDFdisplay.py

示例14: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self,*args, **kwds):
        # begin wxGlade: MyDialog.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self,*args, **kwds)
        self.config = AppConfig()
        tmdata = eval(self.config.c.get('config', 'multistep'))
        self.text_ctrl_6 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[0][0]))
        self.text_ctrl_7 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[0][1]))
        self.text_ctrl_8 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[1][0]))
        self.text_ctrl_9 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[1][1]))
        self.text_ctrl_10 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[2][0]))
        self.text_ctrl_11 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[2][1]))
        self.text_ctrl_12 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[3][0]))
        self.text_ctrl_13 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[3][1]))
        self.text_ctrl_14 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[4][0]))
        self.text_ctrl_15 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[4][1]))
        self.button_9 = wx.Button(self, wx.ID_ANY, u"提交修改")
        self.button_9.Bind(wx.EVT_BUTTON, self.onButton_9)
        self.button_10 = wx.Button(self, wx.ID_ANY, u"关闭窗口")
        self.button_10.Bind(wx.EVT_BUTTON, self.onButton_10)
        self.ret = 0  # 算数项设置Dialog返回值

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
开发者ID:bosichong,项目名称:PrimarySchoolMathematics,代码行数:27,代码来源:App.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import Dialog [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.text_ctrl_6 = wx.TextCtrl(self, wx.ID_ANY, "0")
        self.text_ctrl_7 = wx.TextCtrl(self, wx.ID_ANY, "20")
        self.text_ctrl_8 = wx.TextCtrl(self, wx.ID_ANY, "0")
        self.text_ctrl_9 = wx.TextCtrl(self, wx.ID_ANY, "20")
        self.text_ctrl_10 = wx.TextCtrl(self, wx.ID_ANY, "0")
        self.text_ctrl_11 = wx.TextCtrl(self, wx.ID_ANY, "20")
        self.text_ctrl_12 = wx.TextCtrl(self, wx.ID_ANY, "0")
        self.text_ctrl_13 = wx.TextCtrl(self, wx.ID_ANY, "20")
        self.text_ctrl_14 = wx.TextCtrl(self, wx.ID_ANY, "0")
        self.text_ctrl_15 = wx.TextCtrl(self, wx.ID_ANY, "20")
        self.button_9 = wx.Button(self, wx.ID_ANY, u"提交修改")
        self.button_10 = wx.Button(self, wx.ID_ANY, u"关闭窗口")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
开发者ID:bosichong,项目名称:PrimarySchoolMathematics,代码行数:22,代码来源:wxglade_out.py


注:本文中的wx.Dialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。