Gnumed.wxGladeWidgets.wxgReceiverSelectionDlg

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

# Source Code for Module Gnumed.wxGladeWidgets.wxgReceiverSelectionDlg

      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 wxgReceiverSelectionDlg(wx.Dialog):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgReceiverSelectionDlg.__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.SetSize(wx.DLG_UNIT(self, wx.Size(360, 255)))
     22                  self._LBL_message_top = wx.StaticText(self, wx.ID_ANY, _("Select the paperwork receiver:"))
     23                  from Gnumed.wxpython.gmTextCtrl import cTextCtrl
     24                  self._TCTRL_final_name = cTextCtrl(self, wx.ID_ANY, "")
     25                  from Gnumed.wxpython.gmAddressWidgets import cAddressPhraseWheel
     26                  self._PRW_other_address = cAddressPhraseWheel(self, wx.ID_ANY, "")
     27                  self._BTN_manage_addresses = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
     28                  self._LBL_address_details = wx.StaticText(self, wx.ID_ANY, "")
     29                  self._TCTRL_org_unit_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
     30                  self._LBL_final_name = wx.StaticText(self, wx.ID_ANY, "")
     31                  self._LBL_final_country = wx.StaticText(self, wx.ID_ANY, "")
     32                  self._LBL_final_region = wx.StaticText(self, wx.ID_ANY, "")
     33                  self._LBL_final_zip = wx.StaticText(self, wx.ID_ANY, "")
     34                  self._LBL_final_location = wx.StaticText(self, wx.ID_ANY, "")
     35                  self._LBL_final_street = wx.StaticText(self, wx.ID_ANY, "")
     36                  self._LBL_final_number = wx.StaticText(self, wx.ID_ANY, "")
     37                  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     38                  self._LCTRL_candidates = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT | wx.LC_SINGLE_SEL)
     39                  from Gnumed.wxpython.gmOrganizationWidgets import cOrgUnitPhraseWheel
     40                  self._PRW_org_unit = cOrgUnitPhraseWheel(self, wx.ID_ANY, "")
     41                  self._BTN_manage_orgs = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
     42                  self._LCTRL_addresses = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT | wx.LC_SINGLE_SEL)
     43                  self._BTN_OK = wx.Button(self, wx.ID_OK, _("&OK"))
     44                  self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
     45
     46                  self.__set_properties()
     47                  self.__do_layout()
     48
     49                  self.Bind(wx.EVT_BUTTON, self._on_manage_addresses_button_pressed, self._BTN_manage_addresses)
     50                  self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_candidate_selected, self._LCTRL_candidates)
     51                  self.Bind(wx.EVT_BUTTON, self._on_manage_orgs_button_pressed, self._BTN_manage_orgs)
     52                  self.Bind(wx.EVT_BUTTON, self._on_ok_button_pressed, id=wx.ID_OK)
     53                  # end wxGlade
     54
     55 -        def __set_properties(self):
     56                  # begin wxGlade: wxgReceiverSelectionDlg.__set_properties
     57                  self.SetTitle(_("Letter receiver selection"))
     58                  self.SetSize(wx.DLG_UNIT(self, wx.Size(360, 255)))
     59                  self._TCTRL_final_name.SetToolTip(_("This name will be used.\n\nYou can edit the (or type another) name here, too."))
     60                  self._PRW_other_address.SetToolTip(_("This address will be used.\n\nYou can also search for an arbitrary address in this field."))
     61                  self._BTN_manage_addresses.SetToolTip(_("Manage generic list of all addresses."))
     62                  self._TCTRL_org_unit_details.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     63                  self._PRW_org_unit.SetToolTip(_("Select the organizational unit you want to write to."))
     64                  self._BTN_manage_orgs.SetToolTip(_("Manage known organizations and units thereof."))
     65                  self._BTN_OK.SetToolTip(_("Use the above name and address."))
     66                  self._BTN_cancel.SetToolTip(_("Abort the receiver selection."))
     67                  # end wxGlade
     68
     69 -        def __do_layout(self):
     70                  # begin wxGlade: wxgReceiverSelectionDlg.__do_layout
     71                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     72                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     73                  __szr_middle = wx.BoxSizer(wx.HORIZONTAL)
     74                  __szr_selections = wx.BoxSizer(wx.VERTICAL)
     75                  __szr_org_unit = wx.BoxSizer(wx.HORIZONTAL)
     76                  __szr_final_address = wx.BoxSizer(wx.VERTICAL)
     77                  __fgszr_final = wx.FlexGridSizer(7, 2, 2, 3)
     78                  __fgszr_selected = wx.FlexGridSizer(3, 2, 2, 3)
     79                  __szr_main.Add(self._LBL_message_top, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.LEFT | wx.RIGHT, 3)
     80                  __lbl_name = wx.StaticText(self, wx.ID_ANY, _("Name"))
     81                  __fgszr_selected.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     82                  __fgszr_selected.Add(self._TCTRL_final_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 3)
     83                  __lbl_address_search = wx.StaticText(self, wx.ID_ANY, _("Address"))
     84                  __fgszr_selected.Add(__lbl_address_search, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     85                  __fgszr_selected.Add(self._PRW_other_address, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 3)
     86                  __fgszr_selected.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     87                  __fgszr_selected.Add(self._BTN_manage_addresses, 0, wx.ALIGN_CENTER, 3)
     88                  __fgszr_selected.AddGrowableCol(1)
     89                  __szr_final_address.Add(__fgszr_selected, 0, wx.BOTTOM | wx.EXPAND, 5)
     90                  __szr_final_address.Add(self._LBL_address_details, 0, wx.EXPAND, 0)
     91                  __szr_final_address.Add(self._TCTRL_org_unit_details, 1, wx.BOTTOM | wx.EXPAND, 5)
     92                  __LBL_receiver_heading = wx.StaticText(self, wx.ID_ANY, _("Selected Receiver"))
     93                  __szr_final_address.Add(__LBL_receiver_heading, 0, wx.ALIGN_CENTER, 0)
     94                  __lbl_final_name = wx.StaticText(self, wx.ID_ANY, _("Name"))
     95                  __lbl_final_name.SetToolTip(_("$<receiver_name::::>$"))
     96                  __fgszr_final.Add(__lbl_final_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     97                  __fgszr_final.Add(self._LBL_final_name, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     98                  __lbl_final_country = wx.StaticText(self, wx.ID_ANY, _("Country"))
     99                  __lbl_final_country.SetToolTip(_(u"address['l10n_country'] \u2192 $<receiver_country::::>$"))
    100                  __fgszr_final.Add(__lbl_final_country, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    101                  __fgszr_final.Add(self._LBL_final_country, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    102                  __lbl_final_region = wx.StaticText(self, wx.ID_ANY, _("Region"))
    103                  __lbl_final_region.SetToolTip(_(u"address['l10n_region'] \u2192 $<receiver_region::::>$"))
    104                  __fgszr_final.Add(__lbl_final_region, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    105                  __fgszr_final.Add(self._LBL_final_region, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    106                  __lbl_final_zip = wx.StaticText(self, wx.ID_ANY, _("ZIP"))
    107                  __lbl_final_zip.SetToolTip(_(u"address['postcode'] \u2192 $<receiver_postcode::::>$"))
    108                  __fgszr_final.Add(__lbl_final_zip, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    109                  __fgszr_final.Add(self._LBL_final_zip, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    110                  __lbl_final_location = wx.StaticText(self, wx.ID_ANY, _("Location"))
    111                  __lbl_final_location.SetToolTip(_(u"address['urb'] \u2192 $<receiver_urb::::>$\naddress['suburb'] \u2192 $<receiver_suburb::::>$"))
    112                  __fgszr_final.Add(__lbl_final_location, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    113                  __fgszr_final.Add(self._LBL_final_location, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    114                  __lbl_final_street = wx.StaticText(self, wx.ID_ANY, _("Street"))
    115                  __lbl_final_street.SetToolTip(_(u"address['street'] \u2192 $<receiver_street::::>$"))
    116                  __fgszr_final.Add(__lbl_final_street, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    117                  __fgszr_final.Add(self._LBL_final_street, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    118                  __lbl_final_number = wx.StaticText(self, wx.ID_ANY, _("Number"))
    119                  __lbl_final_number.SetToolTip(_(u"address['number'] \u2192 $<receiver_number::::>$\naddress['subunit'] \u2192 $<receiver_subunit::::>$"))
    120                  __fgszr_final.Add(__lbl_final_number, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    121                  __fgszr_final.Add(self._LBL_final_number, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    122                  __fgszr_final.AddGrowableCol(1)
    123                  __szr_final_address.Add(__fgszr_final, 1, 0, 0)
    124                  __szr_middle.Add(__szr_final_address, 2, wx.EXPAND, 5)
    125                  __lbl_quick_picks = wx.StaticText(self, wx.ID_ANY, _("Quick picks"))
    126                  __szr_selections.Add(__lbl_quick_picks, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 3)
    127                  __szr_selections.Add(self._LCTRL_candidates, 2, wx.BOTTOM | wx.EXPAND, 2)
    128                  __lbl_org_unit = wx.StaticText(self, wx.ID_ANY, _("Org:"))
    129                  __szr_org_unit.Add(__lbl_org_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    130                  __szr_org_unit.Add(self._PRW_org_unit, 1, wx.ALIGN_CENTER_VERTICAL, 0)
    131                  __szr_org_unit.Add(self._BTN_manage_orgs, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    132                  __szr_selections.Add(__szr_org_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.EXPAND, 3)
    133                  __szr_selections.Add(self._LCTRL_addresses, 1, wx.EXPAND, 3)
    134                  __szr_middle.Add(__szr_selections, 3, wx.EXPAND | wx.LEFT, 5)
    135                  __szr_main.Add(__szr_middle, 1, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
    136                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    137                  __szr_buttons.Add(self._BTN_OK, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    138                  __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
    139                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    140                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
    141                  self.SetSizer(__szr_main)
    142                  self.Layout()
    143                  # end wxGlade
    144
    145 -        def _on_manage_addresses_button_pressed(self, event):  # wxGlade: wxgReceiverSelectionDlg.<event_handler>
    146                  print("Event handler '_on_manage_addresses_button_pressed' not implemented!")
    147                  event.Skip()
    148
    149 -        def _on_candidate_selected(self, event):  # wxGlade: wxgReceiverSelectionDlg.<event_handler>
    150                  print("Event handler '_on_candidate_selected' not implemented!")
    151                  event.Skip()
    152
    153 -        def _on_manage_orgs_button_pressed(self, event):  # wxGlade: wxgReceiverSelectionDlg.<event_handler>
    154                  print("Event handler '_on_manage_orgs_button_pressed' not implemented!")
    155                  event.Skip()
    156
    157 -        def _on_ok_button_pressed(self, event):  # wxGlade: wxgReceiverSelectionDlg.<event_handler>
    158                  print("Event handler '_on_ok_button_pressed' not implemented!")
    159                  event.Skip()
    160
    161  # end of class wxgReceiverSelectionDlg
    162