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

# Source Code for Module Gnumed.wxGladeWidgets.wxgGenericEditAreaDlg

     1  #!/usr/bin/env python
     2  # -*- coding: utf8 -*-
     3  # generated by wxGlade 0.6.3 on Sat Aug  1 12:34:36 2009
     4
     5  import wx
     6
     7  # begin wxGlade: extracode
     8  # end wxGlade
     9
    10
    11
    12 -class wxgGenericEditAreaDlg(wx.Dialog):
    13 -    def __init__(self, *args, **kwds):
    14          # begin wxGlade: wxgGenericEditAreaDlg.__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._PNL_ea = wx.Panel(self, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
    18          self._BTN_save = wx.Button(self, wx.ID_SAVE, "")
    19          self._BTN_clear = wx.Button(self, wx.ID_CLEAR, "")
    20          self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
    21
    22          self.__set_properties()
    23          self.__do_layout()
    24
    25          self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._BTN_save)
    26          self.Bind(wx.EVT_BUTTON, self._on_clear_button_pressed, self._BTN_clear)
    27          # end wxGlade
    28
    29 -    def __set_properties(self):
    30          # begin wxGlade: wxgGenericEditAreaDlg.__set_properties
    31          self.SetTitle(_("GNUmed  generic EditArea dialog"))
    32          self.SetSize((450, 280))
    33          self.SetMinSize((450, 280))
    34          self._BTN_save.SetToolTipString(_("Save the entered data into the database."))
    35          self._BTN_clear.SetToolTipString(_("Clear all fields or reset to database values."))
    36          self._BTN_cancel.SetToolTipString(_("Cancel editing the data and discard changes."))
    37          self._BTN_cancel.SetDefault()
    38          # end wxGlade
    39
    40 -    def __do_layout(self):
    41          # begin wxGlade: wxgGenericEditAreaDlg.__do_layout
    42          _szr_main = wx.BoxSizer(wx.VERTICAL)
    43          __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
    44          __szr_pnl_ea = wx.BoxSizer(wx.HORIZONTAL)
    45          __szr_pnl_ea.Add(self._PNL_ea, 1, wx.EXPAND, 0)
    46          _szr_main.Add(__szr_pnl_ea, 1, wx.ALL|wx.EXPAND, 5)
    47          __szr_buttons.Add(self._BTN_save, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    48          __szr_buttons.Add(self._BTN_clear, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    49          __szr_buttons.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    50          __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    51          _szr_main.Add(__szr_buttons, 0, wx.ALL|wx.EXPAND, 5)
    52          self.SetSizer(_szr_main)
    53          self.Layout()
    54          self.Centre()
    55          # end wxGlade
    56
    57 -    def _on_save_button_pressed(self, event): # wxGlade: wxgGenericEditAreaDlg.<event_handler>
    58          print "Event handler `_on_save_button_pressed' not implemented!"
    59          event.Skip()
    60
    61 -    def _on_clear_button_pressed(self, event): # wxGlade: wxgGenericEditAreaDlg.<event_handler>
    62          print "Event handler `_on_clear_button_pressed' not implemented!"
    63          event.Skip()
    64
    65  # end of class wxgGenericEditAreaDlg
    66
    67
    68  if __name__ == "__main__":
    69      import gettext
    70      gettext.install("app") # replace with the appropriate catalog name
    71
    72      app = wx.PySimpleApp(0)
    73      wx.InitAllImageHandlers()
    74      dialog_1 = wxgGenericEditAreaDlg(None, -1, "")
    75      app.SetTopWindow(dialog_1)
    76      dialog_1.Show()
    77      app.MainLoop()
    78