#!/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.gmListWidgets import cReportListCtrl
from Gnumed.wxpython.gmAddressWidgets import cAddressPhraseWheel
from Gnumed.wxpython.gmTextCtrl import cTextCtrl
from Gnumed.wxpython.gmOrganizationWidgets import cOrgUnitPhraseWheel
# end wxGlade


class wxgReceiverSelectionDlg(wx.Dialog):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgReceiverSelectionDlg.__init__
		kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.THICK_FRAME
		wx.Dialog.__init__(self, *args, **kwds)
		self._LBL_message_top = wx.StaticText(self, wx.ID_ANY, _("Select the paperwork receiver:"))
		self._TCTRL_final_name = cTextCtrl(self, wx.ID_ANY, "", style=wx.NO_BORDER)
		self._PRW_other_address = cAddressPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
		self._LBL_address_details = wx.StaticText(self, wx.ID_ANY, "")
		self.__szr_info_staticbox = wx.StaticBox(self, wx.ID_ANY, "")
		self._BTN_manage_addresses = wx.Button(self, wx.ID_ANY, _("&Addresses"), style=wx.BU_EXACTFIT)
		self._BTN_manage_orgs = wx.Button(self, wx.ID_ANY, _("Or&Ganizations"), style=wx.BU_EXACTFIT)
		self._LCTRL_candidates = cReportListCtrl(self, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.NO_BORDER)
		self._PRW_org_unit = cOrgUnitPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
		self._LCTRL_addresses = cReportListCtrl(self, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.NO_BORDER)
		self._BTN_OK = wx.Button(self, wx.ID_OK, _("&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)
		self.Bind(wx.EVT_BUTTON, self._on_manage_orgs_button_pressed, self._BTN_manage_orgs)
		self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_candidate_selected, self._LCTRL_candidates)
		self.Bind(wx.EVT_BUTTON, self._on_ok_button_pressed, id=wx.ID_OK)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgReceiverSelectionDlg.__set_properties
		self.SetTitle(_("Letter receiver selection"))
		self.SetSize(wx.DLG_SZE(self, (360, 224)))
		self._TCTRL_final_name.SetToolTipString(_("This name will be used.\n\nYou can edit the (or type another) name here, too."))
		self._PRW_other_address.SetToolTipString(_("This address will be used.\n\nYou can also search for an arbitrary address in this field."))
		self._BTN_manage_addresses.SetToolTipString(_("Manage generic list of all addresses."))
		self._BTN_manage_orgs.SetToolTipString(_("Manage known organizations and units thereof."))
		self._PRW_org_unit.SetToolTipString(_("Select the organizational unit you want to write to."))
		self._BTN_OK.SetToolTipString(_("Use the above name and address."))
		self._BTN_cancel.SetToolTipString(_("Abort the receiver selection."))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgReceiverSelectionDlg.__do_layout
		__szr_main = wx.BoxSizer(wx.VERTICAL)
		__szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
		__szr_middle = wx.BoxSizer(wx.HORIZONTAL)
		__szr_selections = wx.BoxSizer(wx.VERTICAL)
		__szr_org_unit = wx.BoxSizer(wx.HORIZONTAL)
		__szr_final_address = wx.BoxSizer(wx.VERTICAL)
		__szr_mgmt_buttons = wx.BoxSizer(wx.HORIZONTAL)
		self.__szr_info_staticbox.Lower()
		__szr_info = wx.StaticBoxSizer(self.__szr_info_staticbox, wx.HORIZONTAL)
		__fgszr_selected = wx.FlexGridSizer(2, 2, 2, 3)
		__szr_main.Add(self._LBL_message_top, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_HORIZONTAL, 3)
		__lbl_final_address = wx.StaticText(self, wx.ID_ANY, _("Selected receiver"))
		__szr_final_address.Add(__lbl_final_address, 0, wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 3)
		__lbl_name = wx.StaticText(self, wx.ID_ANY, _("Name"))
		__fgszr_selected.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 5)
		__fgszr_selected.Add(self._TCTRL_final_name, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
		__lbl_address_search = wx.StaticText(self, wx.ID_ANY, _("Address"))
		__fgszr_selected.Add(__lbl_address_search, 0, wx.ALIGN_CENTER_VERTICAL, 5)
		__fgszr_selected.Add(self._PRW_other_address, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
		__fgszr_selected.AddGrowableCol(1)
		__szr_final_address.Add(__fgszr_selected, 0, wx.BOTTOM | wx.EXPAND, 3)
		__szr_info.Add(self._LBL_address_details, 1, wx.EXPAND, 0)
		__szr_final_address.Add(__szr_info, 1, wx.LEFT | wx.BOTTOM | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 2)
		__lbl_manage = wx.StaticText(self, wx.ID_ANY, _("Manage:"))
		__szr_mgmt_buttons.Add(__lbl_manage, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
		__szr_mgmt_buttons.Add(self._BTN_manage_addresses, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
		__szr_mgmt_buttons.Add(self._BTN_manage_orgs, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_final_address.Add(__szr_mgmt_buttons, 0, wx.TOP | wx.EXPAND, 3)
		__szr_middle.Add(__szr_final_address, 2, wx.EXPAND, 5)
		__lbl_quick_picks = wx.StaticText(self, wx.ID_ANY, _("Quick picks"))
		__szr_selections.Add(__lbl_quick_picks, 0, wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 3)
		__szr_selections.Add(self._LCTRL_candidates, 1, wx.BOTTOM | wx.EXPAND, 2)
		__lbl_org_unit = wx.StaticText(self, wx.ID_ANY, _("Org:"))
		__szr_org_unit.Add(__lbl_org_unit, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
		__szr_org_unit.Add(self._PRW_org_unit, 1, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_selections.Add(__szr_org_unit, 0, wx.BOTTOM | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
		__szr_selections.Add(self._LCTRL_addresses, 1, wx.EXPAND, 3)
		__szr_middle.Add(__szr_selections, 3, wx.LEFT | wx.EXPAND, 5)
		__szr_main.Add(__szr_middle, 1, wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, 3)
		__szr_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_buttons.Add(self._BTN_OK, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
		__szr_buttons.Add(self._BTN_cancel, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
		__szr_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_main.Add(__szr_buttons, 0, wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, 3)
		self.SetSizer(__szr_main)
		self.Layout()
		# end wxGlade

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

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

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

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

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

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