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

# Source Code for Module Gnumed.wxGladeWidgets.wxgTextExpansionFillInDlg

     1  # -*- coding: UTF-8 -*-
     2  #
     3  # generated by wxGlade
     4  #
     5
     6  import wx
     7
     8  # begin wxGlade: dependencies
     9  import gettext
    10  # end wxGlade
    11
    12  # begin wxGlade: extracode
    13  # end wxGlade
    14
    15
    16 -class wxgTextExpansionFillInDlg(wx.Dialog):
    17 -        def __init__(self, *args, **kwds):
    18                  # begin wxGlade: wxgTextExpansionFillInDlg.__init__
    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._LBL_top_part = wx.StaticText(self, wx.ID_ANY, "")
    22                  self._LBL_left_part = wx.StaticText(self, wx.ID_ANY, "")
    23                  self._TCTRL_fillin = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER)
    24                  self._LBL_right_part = wx.StaticText(self, wx.ID_ANY, "")
    25                  self._LBL_bottom_part = wx.StaticText(self, wx.ID_ANY, "")
    26                  self._BTN_OK = wx.Button(self, wx.ID_OK, "")
    27                  self._BTN_forward = wx.Button(self, wx.ID_FORWARD, "")
    28                  self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
    29                  self._LBL_hint = wx.StaticText(self, wx.ID_ANY, "")
    30
    31                  self.__set_properties()
    32                  self.__do_layout()
    33
    34                  self.Bind(wx.EVT_BUTTON, self._on_forward_button_pressed, self._BTN_forward)
    35                  # end wxGlade
    36
    37 -        def __set_properties(self):
    38                  # begin wxGlade: wxgTextExpansionFillInDlg.__set_properties
    39                  self.SetTitle(_("Filling in text expansion"))
    40                  self._BTN_OK.SetToolTip(_("Finish filling in text macro."))
    41                  self._BTN_OK.Enable(False)
    42                  self._BTN_forward.SetToolTip(_("Go to the next fill-in position."))
    43                  self._BTN_forward.SetDefault()
    44                  self._BTN_cancel.SetToolTip(_("Cancel filling in the text expansion."))
    45                  # end wxGlade
    46
    47 -        def __do_layout(self):
    48                  # begin wxGlade: wxgTextExpansionFillInDlg.__do_layout
    49                  __szr_main = wx.BoxSizer(wx.VERTICAL)
    50                  __szr_hint = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, ""), wx.HORIZONTAL)
    51                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
    52                  __szr_single_line_replacement = wx.BoxSizer(wx.HORIZONTAL)
    53                  __lbl_message = wx.StaticText(self, wx.ID_ANY, _("\nPlease fill in an appropriate value below.\n"))
    54                  __szr_main.Add(__lbl_message, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.LEFT | wx.RIGHT | wx.TOP, 3)
    55                  __hline_top = wx.StaticLine(self, wx.ID_ANY)
    56                  __szr_main.Add(__hline_top, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, 3)
    57                  __szr_main.Add(self._LBL_top_part, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
    58                  __szr_single_line_replacement.Add(self._LBL_left_part, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
    59                  __szr_single_line_replacement.Add(self._TCTRL_fillin, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    60                  __szr_single_line_replacement.Add(self._LBL_right_part, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 3)
    61                  __szr_single_line_replacement.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    62                  __szr_main.Add(__szr_single_line_replacement, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
    63                  __szr_main.Add(self._LBL_bottom_part, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
    64                  __szr_main.Add((20, 20), 1, wx.EXPAND, 0)
    65                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    66                  __szr_buttons.Add(self._BTN_OK, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10)
    67                  __szr_buttons.Add(self._BTN_forward, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10)
    68                  __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    69                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    70                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
    71                  __szr_hint.Add(self._LBL_hint, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    72                  __szr_main.Add(__szr_hint, 0, wx.ALL | wx.EXPAND, 3)
    73                  self.SetSizer(__szr_main)
    74                  __szr_main.Fit(self)
    75                  self.Layout()
    76                  self.Centre()
    77                  # end wxGlade
    78
    79 -        def _on_forward_button_pressed(self, event):  # wxGlade: wxgTextExpansionFillInDlg.<event_handler>
    80                  print("Event handler '_on_forward_button_pressed' not implemented!")
    81                  event.Skip()
    82
    83  # end of class wxgTextExpansionFillInDlg
    84