1
2
3
4
5 import wx
6
7
8
9
10
11
14
15 from Gnumed.wxpython import gmAddressWidgets
16
17
18 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
19 wx.ScrolledWindow.__init__(self, *args, **kwds)
20 self._LBL_type = wx.StaticText(self, -1, _("Type"))
21 self._PRW_type = gmAddressWidgets.cAddressTypePhraseWheel(self, -1, "", style=wx.NO_BORDER)
22 self._LBL_search = wx.StaticText(self, -1, _("Search"))
23 self._PRW_address_searcher = gmAddressWidgets.cAddressPhraseWheel(self, -1, "", style=wx.NO_BORDER)
24 self._PRW_zip = gmAddressWidgets.cZipcodePhraseWheel(self, -1, "", style=wx.NO_BORDER)
25 self._PRW_street = gmAddressWidgets.cStreetPhraseWheel(self, -1, "", style=wx.NO_BORDER)
26 self._TCTRL_notes_street = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
27 self._TCTRL_number = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
28 self._TCTRL_subunit = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
29 self._PRW_urb = gmAddressWidgets.cUrbPhraseWheel(self, -1, "", style=wx.NO_BORDER)
30 self._PRW_suburb = gmAddressWidgets.cSuburbPhraseWheel(self, -1, "", style=wx.NO_BORDER)
31 self._PRW_state = gmAddressWidgets.cStateSelectionPhraseWheel(self, -1, "", style=wx.NO_BORDER)
32 self._PRW_country = gmAddressWidgets.cCountryPhraseWheel(self, -1, "", style=wx.NO_BORDER)
33 self._TCTRL_notes_subunit = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
34
35 self.__set_properties()
36 self.__do_layout()
37
38
40
41 self.SetToolTipString(_("Select the type of address here."))
42 self.SetScrollRate(10, 10)
43 self._LBL_type.SetForegroundColour(wx.Colour(255, 0, 0))
44 self._PRW_type.SetToolTipString(_("The category under which to store this address."))
45 self._PRW_address_searcher.SetToolTipString(_("Here you can enter a postal code or street name fragment to search for an existing address.\n\nThe fields below will be filled with the details of that address which you can edit to create a new address.\n\nYou can also just enter the relevant information into the corresponding fields without searching for an existing address."))
46 self._TCTRL_notes_street.SetToolTipString(_("Enter any additional street level instructions and notes, such as postal box or driving directions."))
47 self._TCTRL_number.SetToolTipString(_("Enter the house number for this address."))
48 self._TCTRL_subunit.SetToolTipString(_("Enter the subunit / apartment / room / level / entrance for this address."))
49 self._TCTRL_notes_subunit.SetToolTipString(_("Enter any additional notes and comments on this address which didn't fit anywhere else."))
50
51
53
54 _gszr_main = wx.FlexGridSizer(10, 2, 3, 5)
55 __szr_urb = wx.BoxSizer(wx.HORIZONTAL)
56 _szr_number = wx.BoxSizer(wx.HORIZONTAL)
57 _gszr_main.Add(self._LBL_type, 0, wx.ALIGN_CENTER_VERTICAL, 0)
58 _gszr_main.Add(self._PRW_type, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
59 _gszr_main.Add(self._LBL_search, 0, wx.ALIGN_CENTER_VERTICAL, 0)
60 _gszr_main.Add(self._PRW_address_searcher, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
61 __LBL_zip = wx.StaticText(self, -1, _("Zip code"))
62 __LBL_zip.SetForegroundColour(wx.Colour(255, 0, 0))
63 _gszr_main.Add(__LBL_zip, 0, wx.ALIGN_CENTER_VERTICAL, 0)
64 _gszr_main.Add(self._PRW_zip, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
65 __LBL_street = wx.StaticText(self, -1, _("Street"))
66 __LBL_street.SetForegroundColour(wx.Colour(255, 0, 0))
67 _gszr_main.Add(__LBL_street, 0, wx.ALIGN_CENTER_VERTICAL, 0)
68 _gszr_main.Add(self._PRW_street, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
69 __LBL_street_notes = wx.StaticText(self, -1, _("... Notes"), style=wx.ALIGN_RIGHT)
70 _gszr_main.Add(__LBL_street_notes, 0, wx.ALIGN_CENTER_VERTICAL, 0)
71 _gszr_main.Add(self._TCTRL_notes_street, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
72 __LBL_number = wx.StaticText(self, -1, _("Number"))
73 __LBL_number.SetForegroundColour(wx.Colour(255, 0, 0))
74 _gszr_main.Add(__LBL_number, 0, wx.ALIGN_CENTER_VERTICAL, 0)
75 _szr_number.Add(self._TCTRL_number, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
76 __LBL_subunit = wx.StaticText(self, -1, _("Unit:"))
77 _szr_number.Add(__LBL_subunit, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
78 _szr_number.Add(self._TCTRL_subunit, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
79 _gszr_main.Add(_szr_number, 1, wx.EXPAND, 0)
80 __LBL_urb = wx.StaticText(self, -1, _("Community"))
81 __LBL_urb.SetForegroundColour(wx.Colour(255, 0, 0))
82 _gszr_main.Add(__LBL_urb, 0, wx.ALIGN_CENTER_VERTICAL, 0)
83 __szr_urb.Add(self._PRW_urb, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
84 __LBL_suburb = wx.StaticText(self, -1, _("Suburb:"))
85 __szr_urb.Add(__LBL_suburb, 0, wx.LEFT|wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
86 __szr_urb.Add(self._PRW_suburb, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
87 _gszr_main.Add(__szr_urb, 1, wx.EXPAND, 0)
88 __LBL_state = wx.StaticText(self, -1, _("Region"))
89 __LBL_state.SetForegroundColour(wx.Colour(255, 0, 0))
90 _gszr_main.Add(__LBL_state, 0, wx.ALIGN_CENTER_VERTICAL, 0)
91 _gszr_main.Add(self._PRW_state, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
92 __LBL_country = wx.StaticText(self, -1, _("Country"))
93 __LBL_country.SetForegroundColour(wx.Colour(255, 0, 0))
94 _gszr_main.Add(__LBL_country, 0, wx.ALIGN_CENTER_VERTICAL, 0)
95 _gszr_main.Add(self._PRW_country, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
96 __LBL_notes_subunit = wx.StaticText(self, -1, _("Comment"))
97 _gszr_main.Add(__LBL_notes_subunit, 0, wx.ALIGN_CENTER_VERTICAL, 0)
98 _gszr_main.Add(self._TCTRL_notes_subunit, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
99 self.SetSizer(_gszr_main)
100 _gszr_main.Fit(self)
101 _gszr_main.AddGrowableCol(1)
102
103
104
105