Gnumed.wxGladeWidgets.wxgGenericEditAreaDlg2

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

# Source Code for Module Gnumed.wxGladeWidgets.wxgGenericEditAreaDlg2

      1  #!/usr/bin/env python
      2  # -*- coding: utf8 -*-
      3  # generated by wxGlade 0.6.5 from "/home/ncq/Projekte/gm-git/gnumed/gnumed/client/wxg/wxgGenericEditAreaDlg2.wxg"
      4
      5  import wx
      6
      7  # begin wxGlade: extracode
      8  # end wxGlade
      9
     10
     11 -class wxgGenericEditAreaDlg2(wx.Dialog):
     12 -    def __init__(self, *args, **kwds):
     13          # begin wxGlade: wxgGenericEditAreaDlg2.__init__
     14          kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.THICK_FRAME
     15          wx.Dialog.__init__(self, *args, **kwds)
     16          self._PNL_ea = wx.ScrolledWindow(self, -1, style=wx.NO_BORDER | wx.TAB_TRAVERSAL)
     17          self._TCTRL_status = wx.TextCtrl(self, -1, _("Info"), style=wx.TE_READONLY | wx.NO_BORDER)
     18          self._BTN_save = wx.Button(self, wx.ID_OK, "")
     19          self._BTN_extra_left = wx.Button(self, -1, _("left extra"), style=wx.BU_EXACTFIT)
     20          self._BTN_forward = wx.Button(self, -1, _("Add &another"))
     21          self._BTN_revert = wx.Button(self, wx.ID_REVERT_TO_SAVED, "")
     22          self._BTN_clear = wx.Button(self, wx.ID_CLEAR, "")
     23          self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
     24          self._BTN_lucky = wx.Button(self, -1, _("Lala !"), style=wx.BU_EXACTFIT)
     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_left_extra_button_pressed, self._BTN_extra_left)
     31          self.Bind(wx.EVT_BUTTON, self._on_forward_button_pressed, self._BTN_forward)
     32          self.Bind(wx.EVT_BUTTON, self._on_revert_button_pressed, self._BTN_revert)
     33          self.Bind(wx.EVT_BUTTON, self._on_clear_button_pressed, self._BTN_clear)
     34          self.Bind(wx.EVT_BUTTON, self._on_lucky_button_pressed, self._BTN_lucky)
     35          # end wxGlade
     36
     37 -    def __set_properties(self):
     38          # begin wxGlade: wxgGenericEditAreaDlg2.__set_properties
     39          self.SetTitle(_("GNUmed generic EditArea dialog"))
     40          self.SetSize(wx.DLG_SZE(self, (393, 201)))
     41          self.SetMinSize((450, 300))
     42          self._PNL_ea.SetScrollRate(10, 10)
     43          self._TCTRL_status.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
     44          self._TCTRL_status.SetForegroundColour(wx.Colour(255, 127, 0))
     45          self._BTN_save.SetToolTipString(_("Save the entered data into the database and close the dialog."))
     46          self._BTN_extra_left.SetToolTipString(_("Programmer forgot tooltip for left extra button."))
     47          self._BTN_extra_left.Hide()
     48          self._BTN_forward.SetToolTipString(_("Save data into database and clear fields for another value."))
     49          self._BTN_revert.SetToolTipString(_("Reset all fields to their previous values."))
     50          self._BTN_revert.Enable(False)
     51          self._BTN_revert.Hide()
     52          self._BTN_clear.SetToolTipString(_("Clear all fields."))
     53          self._BTN_cancel.SetToolTipString(_("Cancel editing the data and discard changes."))
     54          self._BTN_lucky.SetToolTipString(_("Press me !\n\n(This will NOT endanger any data.)"))
     55          # end wxGlade
     56
     57 -    def __do_layout(self):
     58          # begin wxGlade: wxgGenericEditAreaDlg2.__do_layout
     59          _szr_main = wx.BoxSizer(wx.VERTICAL)
     60          __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     61          __szr_pnl_ea = wx.BoxSizer(wx.HORIZONTAL)
     62          __szr_pnl_ea.Add(self._PNL_ea, 1, wx.EXPAND, 0)
     63          _szr_main.Add(__szr_pnl_ea, 1, wx.ALL | wx.EXPAND, 5)
     64          _szr_main.Add(self._TCTRL_status, 0, wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 10)
     65          __szr_buttons.Add(self._BTN_save, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     66          __szr_buttons.Add(self._BTN_extra_left, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     67          __szr_buttons.Add(self._BTN_forward, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     68          __szr_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     69          __szr_buttons.Add(self._BTN_revert, 0, 0, 0)
     70          __szr_buttons.Add(self._BTN_clear, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     71          __szr_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     72          __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     73          __szr_buttons.Add(self._BTN_lucky, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
     74          _szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 5)
     75          self.SetSizer(_szr_main)
     76          self.Layout()
     77          self.Centre()
     78          # end wxGlade
     79
     80 -    def _on_save_button_pressed(self, event):  # wxGlade: wxgGenericEditAreaDlg2.<event_handler>
     81          print "Event handler `_on_save_button_pressed' not implemented!"
     82          event.Skip()
     83
     84 -    def _on_left_extra_button_pressed(self, event):  # wxGlade: wxgGenericEditAreaDlg2.<event_handler>
     85          print "Event handler `_on_left_extra_button_pressed' not implemented!"
     86          event.Skip()
     87
     88 -    def _on_forward_button_pressed(self, event):  # wxGlade: wxgGenericEditAreaDlg2.<event_handler>
     89          print "Event handler `_on_forward_button_pressed' not implemented!"
     90          event.Skip()
     91
     92 -    def _on_revert_button_pressed(self, event):  # wxGlade: wxgGenericEditAreaDlg2.<event_handler>
     93          print "Event handler `_on_revert_button_pressed' not implemented!"
     94          event.Skip()
     95
     96 -    def _on_clear_button_pressed(self, event):  # wxGlade: wxgGenericEditAreaDlg2.<event_handler>
     97          print "Event handler `_on_clear_button_pressed' not implemented!"
     98          event.Skip()
     99
    100 -    def _on_lucky_button_pressed(self, event):  # wxGlade: wxgGenericEditAreaDlg2.<event_handler>
    101          print "Event handler `_on_lucky_button_pressed' not implemented!"
    102          event.Skip()
    103
    104  # end of class wxgGenericEditAreaDlg2
    105  if __name__ == "__main__":
    106      import gettext
    107      gettext.install("app") # replace with the appropriate catalog name
    108
    109      app = wx.PySimpleApp(0)
    110      wx.InitAllImageHandlers()
    111      dialog_1 = wxgGenericEditAreaDlg2(None, -1, "")
    112      app.SetTopWindow(dialog_1)
    113      dialog_1.Show()
    114      app.MainLoop()
    115