1
2
3
4
5
6 import wx
7
8
9 import gettext
10
11
12
13
14
15
18
19 kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
20 wx.Dialog.__init__(self, *args, **kwds)
21 self.SetSize((400, 300))
22 self._TCTRL_message = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.HSCROLL | wx.TE_MULTILINE)
23 self._BTN_save = wx.Button(self, wx.ID_SAVE, "")
24 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
25
26 self.__set_properties()
27 self.__do_layout()
28
29 self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._BTN_save)
30
31
33
34 self.SetTitle(_("Database welcome message editor"))
35 self.SetSize((400, 300))
36
37
39
40 __szr_main = wx.BoxSizer(wx.VERTICAL)
41 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
42 _lbl_instructions = wx.StaticText(self, wx.ID_ANY, _("Below you can edit the database welcome message shown at startup which allows you to identify the database you are connected to.\n\nTo disable that popup leave the message empty."), style=wx.ALIGN_CENTER)
43 __szr_main.Add(_lbl_instructions, 0, wx.ALL | wx.EXPAND, 5)
44 __szr_main.Add(self._TCTRL_message, 1, wx.ALL | wx.EXPAND, 5)
45 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
46 __szr_buttons.Add(self._BTN_save, 0, wx.EXPAND | wx.RIGHT, 3)
47 __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND | wx.LEFT, 3)
48 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
49 __szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 4)
50 self.SetSizer(__szr_main)
51 self.Layout()
52 self.Centre()
53
54
56 print("Event handler '_on_save_button_pressed' not implemented!")
57 event.Skip()
58
59
60