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

# Source Code for Module Gnumed.wxGladeWidgets.wxgTextExpansionFillInDlg

     1  #!/usr/bin/env python
     2  # -*- coding: utf-8 -*-
     3  # generated by wxGlade 0.6.5 from "/home/ncq/Projekte/gm-git/gnumed/gnumed/client/wxg/wxgTextExpansionFillInDlg.wxg"
     4
     5  import wx
     6
     7  # begin wxGlade: extracode
     8  # end wxGlade
     9
    10
    11 -class wxgTextExpansionFillInDlg(wx.Dialog):
    12 -    def __init__(self, *args, **kwds):
    13          # begin wxGlade: wxgTextExpansionFillInDlg.__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._LBL_top_part = wx.StaticText(self, -1, "")
    17          self._LBL_left_part = wx.StaticText(self, -1, "")
    18          self._TCTRL_fillin = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER)
    19          self._LBL_right_part = wx.StaticText(self, -1, "")
    20          self._LBL_bottom_part = wx.StaticText(self, -1, "")
    21          self._BTN_OK = wx.Button(self, wx.ID_OK, "")
    22          self._BTN_forward = wx.Button(self, wx.ID_FORWARD, "")
    23          self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
    24          self._LBL_hint = wx.StaticText(self, -1, "")
    25          self.__szr_hint_staticbox = wx.StaticBox(self, -1, "")
    26
    27          self.__set_properties()
    28          self.__do_layout()
    29
    30          self.Bind(wx.EVT_BUTTON, self._on_forward_button_pressed, self._BTN_forward)
    31          # end wxGlade
    32
    33 -    def __set_properties(self):
    34          # begin wxGlade: wxgTextExpansionFillInDlg.__set_properties
    35          self.SetTitle(_("Filling in text expansion"))
    36          self._BTN_OK.SetToolTipString(_("Finish filling in text macro."))
    37          self._BTN_OK.Enable(False)
    38          self._BTN_forward.SetToolTipString(_("Go to the next fill-in position."))
    39          self._BTN_forward.SetDefault()
    40          self._BTN_cancel.SetToolTipString(_("Cancel filling in the text expansion."))
    41          # end wxGlade
    42
    43 -    def __do_layout(self):
    44          # begin wxGlade: wxgTextExpansionFillInDlg.__do_layout
    45          __szr_main = wx.BoxSizer(wx.VERTICAL)
    46          self.__szr_hint_staticbox.Lower()
    47          __szr_hint = wx.StaticBoxSizer(self.__szr_hint_staticbox, wx.HORIZONTAL)
    48          __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
    49          __szr_single_line_replacement = wx.BoxSizer(wx.HORIZONTAL)
    50          __lbl_message = wx.StaticText(self, -1, _("\nPlease fill in an appropriate value below.\n"))
    51          __szr_main.Add(__lbl_message, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_HORIZONTAL, 3)
    52          __hline_top = wx.StaticLine(self, -1)
    53          __szr_main.Add(__hline_top, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
    54          __szr_main.Add(self._LBL_top_part, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 3)
    55          __szr_single_line_replacement.Add(self._LBL_left_part, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
    56          __szr_single_line_replacement.Add(self._TCTRL_fillin, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    57          __szr_single_line_replacement.Add(self._LBL_right_part, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 3)
    58          __szr_single_line_replacement.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    59          __szr_main.Add(__szr_single_line_replacement, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 3)
    60          __szr_main.Add(self._LBL_bottom_part, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 3)
    61          __szr_main.Add((20, 20), 1, wx.EXPAND, 0)
    62          __szr_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    63          __szr_buttons.Add(self._BTN_OK, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 10)
    64          __szr_buttons.Add(self._BTN_forward, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 10)
    65          __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    66          __szr_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    67          __szr_main.Add(__szr_buttons, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 3)
    68          __szr_hint.Add(self._LBL_hint, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    69          __szr_main.Add(__szr_hint, 0, wx.ALL | wx.EXPAND, 3)
    70          self.SetSizer(__szr_main)
    71          __szr_main.Fit(self)
    72          self.Layout()
    73          self.Centre()
    74          # end wxGlade
    75
    76 -    def _on_ok_button_pressed(self, event):  # wxGlade: wxgTextExpansionFillInDlg.<event_handler>
    77          print "Event handler `_on_ok_button_pressed' not implemented!"
    78          event.Skip()
    79
    80 -    def _on_forward_button_pressed(self, event):  # wxGlade: wxgTextExpansionFillInDlg.<event_handler>
    81          print "Event handler `_on_forward_button_pressed' not implemented!"
    82          event.Skip()
    83
    84  # end of class wxgTextExpansionFillInDlg
    85  if __name__ == "__main__":
    86      import gettext
    87      gettext.install("app") # replace with the appropriate catalog name
    88
    89      app = wx.PySimpleApp(0)
    90      wx.InitAllImageHandlers()
    91      dialog_1 = (None, -1, "")
    92      app.SetTopWindow(dialog_1)
    93      dialog_1.Show()
    94      app.MainLoop()
    95