1
2
3
4
5 import wx
6
9
10 kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME
11 wx.Dialog.__init__(self, *args, **kwds)
12 self._TCTRL_message = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.HSCROLL)
13 self._BTN_save = wx.Button(self, wx.ID_SAVE, "")
14 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
15
16 self.__set_properties()
17 self.__do_layout()
18
19 self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._BTN_save)
20
21
23
24 self.SetTitle(_("Database welcome message editor"))
25 self.SetSize((400, 300))
26
27
29
30 __szr_main = wx.BoxSizer(wx.VERTICAL)
31 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
32 _lbl_instructions = wx.StaticText(self, -1, _("Below you can edit the database welcome message shown at startup\nwhich allows you to identify the database you are connected to.\n\nTo disable that popup leave the message empty."), style=wx.ALIGN_CENTRE)
33 __szr_main.Add(_lbl_instructions, 0, wx.ALL|wx.EXPAND, 5)
34 __szr_main.Add(self._TCTRL_message, 1, wx.ALL|wx.EXPAND, 5)
35 __szr_buttons.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
36 __szr_buttons.Add(self._BTN_save, 0, wx.RIGHT|wx.EXPAND, 3)
37 __szr_buttons.Add(self._BTN_cancel, 0, wx.LEFT|wx.EXPAND, 3)
38 __szr_buttons.Add((20, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
39 __szr_main.Add(__szr_buttons, 0, wx.ALL|wx.EXPAND, 4)
40 self.SetSizer(__szr_main)
41 self.Layout()
42 self.Centre()
43
44
46 print "Event handler `_on_save_button_pressed' not implemented!"
47 event.Skip()
48
49
50
51
52 if __name__ == "__main__":
53 import gettext
54 gettext.install("app")
55
56 app = wx.PySimpleApp(0)
57 wx.InitAllImageHandlers()
58 dialog_1 = wxgGreetingEditorDlg(None, -1, "")
59 app.SetTopWindow(dialog_1)
60 dialog_1.Show()
61 app.MainLoop()
62