1
2
3
4
5
6 import wx
7
8
9 import gettext
10
11
12
13
14
15
17 - def __init__(self, *args, **kwds):
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((600, 641))
22 self._LBL_msg = wx.StaticText(self, wx.ID_ANY, "")
23 self._TCTRL_data = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP)
24 from Gnumed.wxpython.gmTextCtrl import cTextCtrl
25 self._TCTRL_text = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_WORDWRAP)
26 self._CHBOX_is_already_formatted = wx.CheckBox(self, wx.ID_ANY, _("Do not reformat text"))
27 self._BTN_save = wx.Button(self, wx.ID_SAVE, "")
28 self._BTN_clear = wx.Button(self, wx.ID_CLEAR, "")
29 self._BTN_restore = wx.Button(self, wx.ID_REVERT_TO_SAVED, "")
30 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
31
32 self.__set_properties()
33 self.__do_layout()
34
35 self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._BTN_save)
36 self.Bind(wx.EVT_BUTTON, self._on_clear_button_pressed, self._BTN_clear)
37 self.Bind(wx.EVT_BUTTON, self._on_restore_button_pressed, self._BTN_restore)
38
39
41
42 self.SetTitle(_("Generic multi line text entry dialog"))
43 self.SetSize((600, 641))
44 self._TCTRL_data.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
45 self._CHBOX_is_already_formatted.SetToolTip(_("Leave this unchecked so that GNUmed can check for characters that need escaping or transforming.\n\nUse this option when you have put in raw formatting, like HTML or LaTeX, that you are confident should be left untouched."))
46 self._CHBOX_is_already_formatted.Enable(False)
47 self._BTN_restore.Enable(False)
48
49
50 - def __do_layout(self):
51
52 __szr_main = wx.BoxSizer(wx.VERTICAL)
53 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
54 __szr_options = wx.BoxSizer(wx.HORIZONTAL)
55 __szr_main.Add(self._LBL_msg, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5)
56 __szr_main.Add(self._TCTRL_data, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, 5)
57 __szr_main.Add(self._TCTRL_text, 4, wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, 5)
58 __szr_options.Add(self._CHBOX_is_already_formatted, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
59 __szr_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
60 __szr_main.Add(__szr_options, 0, wx.ALL | wx.EXPAND, 5)
61 __szr_buttons.Add(self._BTN_save, 0, wx.EXPAND, 5)
62 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
63 __szr_buttons.Add(self._BTN_clear, 0, wx.EXPAND | wx.RIGHT, 5)
64 __szr_buttons.Add(self._BTN_restore, 0, wx.EXPAND, 3)
65 __szr_buttons.Add((20, 20), 3, wx.EXPAND, 0)
66 __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND, 3)
67 __szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 4)
68 self.SetSizer(__szr_main)
69 self.Layout()
70 self.Centre()
71
72
74 print("Event handler '_on_save_button_pressed' not implemented!")
75 event.Skip()
76
78 print("Event handler '_on_clear_button_pressed' not implemented!")
79 event.Skip()
80
82 print("Event handler '_on_restore_button_pressed' not implemented!")
83 event.Skip()
84
85
86