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

# Source Code for Module Gnumed.wxGladeWidgets.wxgOrgUnitAddressPnl

     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 wxgOrgUnitAddressPnl(wx.ScrolledWindow):
    17 -        def __init__(self, *args, **kwds):
    18                  # begin wxGlade: wxgOrgUnitAddressPnl.__init__
    19                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
    20                  wx.ScrolledWindow.__init__(self, *args, **kwds)
    21                  self._LBL_message = wx.StaticText(self, wx.ID_ANY, "", style=wx.ALIGN_CENTER)
    22                  from Gnumed.wxpython.gmAddressWidgets import cAddressPhraseWheel
    23                  self._PRW_address_searcher = cAddressPhraseWheel(self, wx.ID_ANY, "")
    24                  self._BTN_save_picked_address = wx.Button(self, wx.ID_ANY, _("&Link"), style=wx.BU_EXACTFIT)
    25                  self._BTN_add_new_address = wx.Button(self, wx.ID_ANY, _("Link &new"), style=wx.BU_EXACTFIT)
    26                  self._BTN_manage_addresses = wx.Button(self, wx.ID_ANY, _("Browse"), style=wx.BU_EXACTFIT)
    27
    28                  self.__set_properties()
    29                  self.__do_layout()
    30
    31                  self.Bind(wx.EVT_BUTTON, self._on_save_picked_address_button_pressed, self._BTN_save_picked_address)
    32                  self.Bind(wx.EVT_BUTTON, self._on_add_new_address_button_pressed, self._BTN_add_new_address)
    33                  self.Bind(wx.EVT_BUTTON, self._on_manage_addresses_button_pressed, self._BTN_manage_addresses)
    34                  # end wxGlade
    35
    36 -        def __set_properties(self):
    37                  # begin wxGlade: wxgOrgUnitAddressPnl.__set_properties
    38                  self.SetScrollRate(10, 10)
    39                  self._LBL_message.Hide()
    40                  self._PRW_address_searcher.SetToolTip(_("Search for matches among existing addresses and [Link] a selection, or [Link (a) new] address."))
    41                  self._BTN_save_picked_address.SetToolTip(_("Link the selected address with the organizational unit."))
    42                  self._BTN_save_picked_address.Enable(False)
    43                  self._BTN_add_new_address.SetToolTip(_("Enter a new address and link it to the organizational unit."))
    44                  self._BTN_manage_addresses.SetToolTip(_("Browse all known addresses (loading can be slow)."))
    45                  # end wxGlade
    46
    47 -        def __do_layout(self):
    48                  # begin wxGlade: wxgOrgUnitAddressPnl.__do_layout
    49                  __szr_main = wx.BoxSizer(wx.VERTICAL)
    50                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
    51                  __szr_address_search = wx.BoxSizer(wx.HORIZONTAL)
    52                  __szr_main.Add(self._LBL_message, 0, wx.ALIGN_CENTER, 0)
    53                  __lbl_searcher = wx.StaticText(self, wx.ID_ANY, _("Address"))
    54                  __szr_address_search.Add(__lbl_searcher, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
    55                  __szr_address_search.Add(self._PRW_address_searcher, 1, wx.ALIGN_CENTER_VERTICAL, 5)
    56                  __szr_main.Add(__szr_address_search, 0, wx.EXPAND, 0)
    57                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL, 0)
    58                  __szr_buttons.Add(self._BTN_save_picked_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    59                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL, 0)
    60                  __szr_buttons.Add(self._BTN_add_new_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    61                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL, 0)
    62                  __szr_buttons.Add(self._BTN_manage_addresses, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    63                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL, 0)
    64                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND | wx.TOP, 3)
    65                  self.SetSizer(__szr_main)
    66                  __szr_main.Fit(self)
    67                  self.Layout()
    68                  # end wxGlade
    69
    70 -        def _on_save_picked_address_button_pressed(self, event):  # wxGlade: wxgOrgUnitAddressPnl.<event_handler>
    71                  print("Event handler '_on_save_picked_address_button_pressed' not implemented!")
    72                  event.Skip()
    73
    74 -        def _on_add_new_address_button_pressed(self, event):  # wxGlade: wxgOrgUnitAddressPnl.<event_handler>
    75                  print("Event handler '_on_add_new_address_button_pressed' not implemented!")
    76                  event.Skip()
    77
    78 -        def _on_manage_addresses_button_pressed(self, event):  # wxGlade: wxgOrgUnitAddressPnl.<event_handler>
    79                  print("Event handler '_on_manage_addresses_button_pressed' not implemented!")
    80                  event.Skip()
    81
    82  # end of class wxgOrgUnitAddressPnl
    83