Package Gnumed :: Package wxGladeWidgets :: Module wxgMultilineTextEntryDlg
[frames] | no frames]

Source Code for Module Gnumed.wxGladeWidgets.wxgMultilineTextEntryDlg

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  # generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-cvs/branches/HEAD/gnumed/gnumed/client/wxg/wxgMultilineTextEntryDlg.wxg" 
 4   
 5  import wx 
 6   
 7  # begin wxGlade: extracode 
 8  # end wxGlade 
 9   
10   
11   
12 -class wxgMultilineTextEntryDlg(wx.Dialog):
13 - def __init__(self, *args, **kwds):
14 # begin wxGlade: wxgMultilineTextEntryDlg.__init__ 15 kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME 16 wx.Dialog.__init__(self, *args, **kwds) 17 self._LBL_msg = wx.StaticText(self, -1, "") 18 self._TCTRL_data = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_WORDWRAP|wx.NO_BORDER) 19 self._TCTRL_text = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.HSCROLL) 20 self._CHBOX_is_already_formatted = wx.CheckBox(self, -1, _("Do not reformat text")) 21 self._BTN_save = wx.Button(self, wx.ID_SAVE, "") 22 self._BTN_clear = wx.Button(self, wx.ID_CLEAR, "") 23 self._BTN_restore = wx.Button(self, wx.ID_REVERT_TO_SAVED, "") 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 self.Bind(wx.EVT_BUTTON, self._on_clear_button_pressed, self._BTN_clear) 31 self.Bind(wx.EVT_BUTTON, self._on_restore_button_pressed, self._BTN_restore)
32 # end wxGlade 33
34 - def __set_properties(self):
35 # begin wxGlade: wxgMultilineTextEntryDlg.__set_properties 36 self.SetTitle(_("Generic multi line text entry dialog")) 37 self.SetSize((600, 641)) 38 self._TCTRL_data.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 39 self._CHBOX_is_already_formatted.SetToolTipString(_("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.")) 40 self._CHBOX_is_already_formatted.Enable(False) 41 self._BTN_restore.Enable(False)
42 # end wxGlade 43
44 - def __do_layout(self):
45 # begin wxGlade: wxgMultilineTextEntryDlg.__do_layout 46 __szr_main = wx.BoxSizer(wx.VERTICAL) 47 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL) 48 __szr_options = wx.BoxSizer(wx.HORIZONTAL) 49 __szr_main.Add(self._LBL_msg, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 5) 50 __szr_main.Add(self._TCTRL_data, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5) 51 __szr_main.Add(self._TCTRL_text, 4, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5) 52 __szr_options.Add(self._CHBOX_is_already_formatted, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 53 __szr_options.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 54 __szr_main.Add(__szr_options, 0, wx.ALL|wx.EXPAND, 5) 55 __szr_buttons.Add(self._BTN_save, 0, wx.EXPAND, 5) 56 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 57 __szr_buttons.Add(self._BTN_clear, 0, wx.RIGHT|wx.EXPAND, 5) 58 __szr_buttons.Add(self._BTN_restore, 0, wx.EXPAND, 3) 59 __szr_buttons.Add((20, 20), 3, wx.EXPAND, 0) 60 __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND, 3) 61 __szr_main.Add(__szr_buttons, 0, wx.ALL|wx.EXPAND, 4) 62 self.SetSizer(__szr_main) 63 self.Layout() 64 self.Centre()
65 # end wxGlade 66
67 - def _on_save_button_pressed(self, event): # wxGlade: wxgMultilineTextEntryDlg.<event_handler>
68 print "Event handler `_on_save_button_pressed' not implemented!" 69 event.Skip()
70
71 - def _on_delete_button_pressed(self, event): # wxGlade: wxgMultilineTextEntryDlg.<event_handler>
72 print "Event handler `_on_delete_button_pressed' not implemented" 73 event.Skip() 74
75 - def _on_clear_button_pressed(self, event): # wxGlade: wxgMultilineTextEntryDlg.<event_handler>
76 print "Event handler `_on_clear_button_pressed' not implemented" 77 event.Skip() 78
79 - def _on_restore_button_pressed(self, event): # wxGlade: wxgMultilineTextEntryDlg.<event_handler>
80 print "Event handler `_on_restore_button_pressed' not implemented" 81 event.Skip() 82 83 # end of class wxgMultilineTextEntryDlg 84 85 86 if __name__ == "__main__": 87 import gettext 88 gettext.install("app") # replace with the appropriate catalog name 89 90 app = wx.PySimpleApp(0) 91 wx.InitAllImageHandlers() 92 dialog_1 = wxgMultilineTextEntryDlg(None, -1, "") 93 app.SetTopWindow(dialog_1) 94 dialog_1.Show() 95 app.MainLoop() 96