def __init__(self, gui): wx.Dialog.__init__(self, gui, title=_("Send Feedback")) t_lbl = wx.StaticText(self, label=_("Your Feedback:")) email_label = wx.StaticText(self, label=_("E-mail Address")) self.feedback = wx.TextCtrl(self, size=(350, 250), style=wx.TE_MULTILINE) self.email = wx.TextCtrl(self) cancel_b = wx.Button(self, wx.ID_CANCEL, _("&Cancel")) send_b = button(self, wx.ID_OK, _("Send &Feedback"), self.submit) send_b.SetDefault() btnSizer = wx.StdDialogButtonSizer() btnSizer.AddButton(send_b) btnSizer.AddButton(cancel_b) btnSizer.Realize() font = create_bold_font() t_lbl.SetFont(font) email_label.SetFont(font) vsizer = wx.BoxSizer(wx.VERTICAL) vsizer.Add((10, 10)) vsizer.Add(t_lbl, 0, wx.LEFT | wx.RIGHT, 10) vsizer.Add(self.feedback, 0, wx.EXPAND | wx.ALL, 10) vsizer.Add((10, 10)) vsizer.Add(email_label, 0, wx.ALL, 10) vsizer.Add(self.email, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10) vsizer.Add((10, 10)) vsizer.Add(btnSizer, 0, wx.TOP | wx.BOTTOM | wx.ALIGN_CENTRE, 15) self.SetSizerAndFit(vsizer) self.SetFocus() self.SetAutoLayout(True)
def __init__(self, gui, name, method, style, args): wx.Dialog.__init__(self, gui, title=_("Save File?")) self.gui = gui self.method = method self.args = args logger.debug("Prompting for save, with method %s and arguments %s", method, args) warning = wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_CMN_DIALOG) bmp = wx.StaticBitmap(self, bitmap=warning) btnSizer = wx.StdDialogButtonSizer() mainSizer = wx.BoxSizer(wx.VERTICAL) iconSizer = wx.BoxSizer(wx.HORIZONTAL) textSizer = wx.BoxSizer(wx.VERTICAL) container = wx.BoxSizer(wx.HORIZONTAL) top_message = wx.StaticText(self, label=_('Save changes to "%s" before closing?') % name) bottom_message = wx.StaticText(self, label=self.get_time()) font = create_bold_font() font.SetPointSize(font.GetPointSize() + 1) top_message.SetFont(font) if not self.gui.util.filename: saveButton = button(self, wx.ID_SAVE, _("Save &As..."), self.okay) else: saveButton = button(self, wx.ID_SAVE, _("&Save"), self.okay) if style == wx.YES_NO | wx.CANCEL: cancelButton = wx.Button(self, wx.ID_CANCEL, _("&Cancel")) btnSizer.AddButton(cancelButton) noButton = button(self, wx.ID_NO, _("&Don't Save"), self.no) saveButton.SetDefault() btnSizer.AddButton(noButton) btnSizer.AddButton(saveButton) btnSizer.Realize() iconSizer.Add(bmp, 0) textSizer.Add(top_message) textSizer.Add((10, 10)) textSizer.Add(bottom_message) container.Add(iconSizer, 0, wx.LEFT, 15) container.Add((15, -1)) container.Add(textSizer, 1, wx.RIGHT, 15) container.Layout() mainSizer.Add((10, 15)) mainSizer.Add(container, wx.ALL, 30) mainSizer.Add((10, 10)) mainSizer.Add(btnSizer, 0, wx.TOP | wx.BOTTOM | wx.ALIGN_CENTRE, 15) self.SetSizerAndFit(mainSizer) self.SetFocus() self.SetAutoLayout(True) fix_std_sizer_tab_order(btnSizer)
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("About Whyteboard")) image = wx.StaticBitmap(self, bitmap=icon.GetBitmap()) name = wx.StaticText(self, label="%s %s" % (info.Name, info.Version)) description = wx.StaticText(self, label=info.Description) copyright = wx.StaticText(self, label=info.Copyright) url = HyperLinkCtrl(self, label=info.WebSite[0], URL=info.WebSite[1]) font = create_bold_font() font.SetPointSize(18) name.SetFont(font) btnSizer = wx.BoxSizer(wx.HORIZONTAL) buttons = {_("C&redits"): (wx.ID_ABOUT, wx.LEFT | wx.RIGHT, lambda evt: CreditsDialog(self, info)), _("&License"): (wx.ID_ANY, wx.RIGHT, lambda evt: LicenseDialog(self, info.License)), _("&Close"): (wx.ID_CANCEL, wx.RIGHT, lambda evt: self.Destroy())} for label, values in buttons.items(): btn = button(self, values[0], label, values[2]) btnSizer.Add(btn, flag=wx.CENTER | values[1], border=5) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(image, flag=wx.CENTER | wx.TOP | wx.BOTTOM, border=5) sizer.Add(name, flag=wx.CENTER | wx.BOTTOM, border=10) sizer.Add(description, flag=wx.CENTER | wx.BOTTOM, border=10) sizer.Add(copyright, flag=wx.CENTER | wx.BOTTOM, border=10) sizer.Add(url, flag=wx.CENTER | wx.BOTTOM, border=15) sizer.Add(btnSizer, flag=wx.CENTER | wx.BOTTOM, border=5) container = wx.BoxSizer(wx.VERTICAL) container.Add(sizer, flag=wx.ALL, border=10) self.SetSizerAndFit(container) self.Centre() self.Show(True)