#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.6.8
#

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
from Gnumed.wxpython.gmAddressWidgets import cAddressPhraseWheel
# end wxGlade


class wxgAddressSelectionDlg(wx.Dialog):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgAddressSelectionDlg.__init__
		kwds["style"] = wx.DEFAULT_DIALOG_STYLE
		wx.Dialog.__init__(self, *args, **kwds)
		self._LBL_msg = wx.StaticText(self, wx.ID_ANY, _("Select the address you want to use:"))
		self._PRW_address_searcher = cAddressPhraseWheel(self, wx.ID_ANY, "")
		self._BTN_manage_addresses = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
		self._BTN_OK = wx.Button(self, wx.ID_OK, "")
		self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_BUTTON, self._on_manage_addresses_button_pressed, self._BTN_manage_addresses)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgAddressSelectionDlg.__set_properties
		self.SetTitle(_("Address selection"))
		self._BTN_manage_addresses.SetToolTipString(_("Manage addresses."))
		self._BTN_OK.SetToolTipString(_("Use the selected address."))
		self._BTN_OK.SetDefault()
		self._BTN_cancel.SetToolTipString(_("Abort address selection."))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgAddressSelectionDlg.__do_layout
		__szr_main = wx.BoxSizer(wx.VERTICAL)
		__szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
		__szr_middle = wx.BoxSizer(wx.HORIZONTAL)
		__szr_main.Add(self._LBL_msg, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 3)
		__szr_middle.Add(self._PRW_address_searcher, 1, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
		__szr_middle.Add(self._BTN_manage_addresses, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_main.Add(__szr_middle, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 3)
		__szr_buttons.Add((20, 20), 2, wx.EXPAND, 0)
		__szr_buttons.Add(self._BTN_OK, 0, 0, 0)
		__szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
		__szr_buttons.Add(self._BTN_cancel, 0, 0, 0)
		__szr_buttons.Add((20, 20), 2, wx.EXPAND, 0)
		__szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
		self.SetSizer(__szr_main)
		__szr_main.Fit(self)
		self.Layout()
		self.Centre()
		# end wxGlade

	def _on_manage_addresses_button_pressed(self, event):  # wxGlade: wxgAddressSelectionDlg.<event_handler>
		print "Event handler '_on_manage_addresses_button_pressed' not implemented!"
		event.Skip()

# end of class wxgAddressSelectionDlg
if __name__ == "__main__":
	gettext.install("app") # replace with the appropriate catalog name

	app = wx.PySimpleApp(0)
	wx.InitAllImageHandlers()
	dialog_1 = wxgAddressSelectionDlg(None, wx.ID_ANY, "")
	app.SetTopWindow(dialog_1)
	dialog_1.Show()
	app.MainLoop()