# -*- coding: UTF-8 -*-
#
# generated by wxGlade
#

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class wxgTextExpansionEditAreaPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgTextExpansionEditAreaPnl.__init__
		kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._TCTRL_keyword = wx.TextCtrl(self, wx.ID_ANY, "")
		self._LBL_data = wx.StaticText(self, wx.ID_ANY, _("File"))
		self._BTN_select_data_file = wx.Button(self, wx.ID_ANY, _("Se&lect"), style=wx.BU_EXACTFIT)
		self._TCTRL_data_file = wx.TextCtrl(self, wx.ID_ANY, "")
		self._CHBOX_is_encrypted = wx.CheckBox(self, wx.ID_ANY, _("Encrypted"))
		self._LBL_text = wx.StaticText(self, wx.ID_ANY, _("Text"))
		self._TCTRL_expansion = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
		self._RBTN_private = wx.RadioButton(self, wx.ID_ANY, _("&Me only"), style=wx.RB_GROUP)
		self._RBTN_public = wx.RadioButton(self, wx.ID_ANY, _("&All users"))

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_BUTTON, self._on_select_data_file_button_pressed, self._BTN_select_data_file)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgTextExpansionEditAreaPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._TCTRL_keyword.SetToolTip(_("The keyword you want to trigger this text expansion.\n\nTry to avoid words or abbreviations in their day-to-day form as you may want to use them verbatim. Rather prefix or suffix your keywords with, say, \"*\" or \"$\". It is wise to not suffix keywords with typical word separators, such as:\n\n       ! ? . , : ; ) ] } / ' \" SPACE TAB LINEBREAK\n\nas those are needed to detect when to trigger keyword expansion."))
		self._LBL_data.SetForegroundColour(wx.Colour(255, 127, 0))
		self._BTN_select_data_file.SetToolTip(_("Select a file from which to load the binary data."))
		self._BTN_select_data_file.Enable(False)
		self._TCTRL_data_file.SetToolTip(_("File from which to load the binary data."))
		self._TCTRL_data_file.Enable(False)
		self._CHBOX_is_encrypted.SetToolTip(_("Check this if the data file is encrypted and needs decryption before use."))
		self._CHBOX_is_encrypted.Enable(False)
		self._LBL_text.SetForegroundColour(wx.Colour(255, 127, 0))
		self._TCTRL_expansion.SetToolTip(_("This is the text the keyword will expand to. You can use any text-based punctuation and formatting.\n\nAny $[HINT]$ will make GNUmed prompt the user for input while displaying HINT for guidance."))
		self._TCTRL_expansion.Enable(False)
		self._RBTN_private.SetToolTip(_("Select this if you want to use this text expansion just for yourself."))
		self._RBTN_private.Enable(False)
		self._RBTN_public.SetToolTip(_("Select this if you want to enable all GNUmed users to invoke this expansion (unless they have defined their own expansion with the same keyword)."))
		self._RBTN_public.Enable(False)
		self._RBTN_public.SetValue(1)
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgTextExpansionEditAreaPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
		__szr_scope = wx.BoxSizer(wx.HORIZONTAL)
		__szr_file = wx.BoxSizer(wx.HORIZONTAL)
		__lbl_keyword = wx.StaticText(self, wx.ID_ANY, _("Keyword"))
		__lbl_keyword.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_keyword, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_keyword, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_expands_to = wx.StaticText(self, wx.ID_ANY, _("Expansion"))
		_gszr_main.Add(__lbl_expands_to, 0, wx.ALIGN_CENTER, 0)
		_gszr_main.Add(self._LBL_data, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_file.Add(self._BTN_select_data_file, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_file.Add(self._TCTRL_data_file, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
		__szr_file.Add(self._CHBOX_is_encrypted, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(__szr_file, 1, wx.EXPAND, 0)
		_gszr_main.Add(self._LBL_text, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(self._TCTRL_expansion, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_scope = wx.StaticText(self, wx.ID_ANY, _("Scope"))
		_gszr_main.Add(__lbl_scope, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_scope.Add(self._RBTN_private, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
		__szr_scope.Add(self._RBTN_public, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__szr_scope.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(__szr_scope, 1, wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableRow(3)
		_gszr_main.AddGrowableCol(1)
		self.Layout()
		# end wxGlade

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

# end of class wxgTextExpansionEditAreaPnl
