"""Subclass of NewHelpItem, which is generated by wxFormBuilder."""

import wx
import wxx
import app

# Implementing NewHelpItem
class HelpItem( app.NewHelpItem ):
	"""
	This dialog allows to setup a help item.
	Help items are displayed in help menu.
	"""
	@wxx.SetInfo(__doc__)
	def __init__( self, parent ):
		super(HelpItem, self).__init__(parent)
	
	# Handlers for NewHelpItem events.
	def OnOK( self, event ):
		self._label = self.m_textCtrl56.GetValue()
		self._url = self.m_textCtrl29.GetValue()
		self._help = self.m_textCtrl30.GetValue()
		self.EndModal(wx.ID_OK)
			
	def SetAttributes(self, label, url, help):
		"""Transfer attributes from existing constructor"""
		self._label = label
		self._url = url
		self._help = help
		self.m_textCtrl56.SetValue(self._label)
		self.m_textCtrl29.SetValue(self._url)
		self.m_textCtrl30.SetValue(self._help)
		self.SetTitle("Edit help item")
