%%	options

# __CHANGE__ 001:	Correct copyright owner if necessary.
copyright owner	=	$copyrightowner$

# __CHANGE__ 003:	Correct copyright year(s) if necessary.
copyright year	=	$year$

# __CHANGE__ 002:	Correct license type if necessary.
#			Use "bsd", "gpl", "lgpl", or "commercial".
license		=	bsd



%%	wx-gui

type		= 	frame
contents	=	mainSizer
icon		=	$program$_icon
status bar	=	1 sTexts[8]
menu bar	=	mbMain

[wxMenuBar mbMain]
contents	=	menuFile
contents	=	menuHelp

[wxMenu menuFile]
text		=	sTexts[0]
contents	=	miFileExit

[wxMenuItem miFileExit]
id		=	$frame$_Quit
text		=	sTexts[1]
tip		=	sTexts[2]

[wxMenu menuHelp]
text		=	sTexts[3]
contents	=	miHelpAbout
contents	=	miHelpContents

[wxMenuItem miHelpAbout]
id		=	$frame$_Help_About
text		=	sTexts[4]
tip		=	sTexts[5]

[wxMenuItem miHelpContents]
id		=	$frame$_Help_Contents
text		=	sTexts[6]
tip		=	sTexts[7]

[wxBoxSizer mainSizer]
direction	=	horizontal
contents	=	$space(10)
contents	=	verticalSizer
contents	=	$space(10)

[wxBoxSizer verticalSizer]
direction	=	vertical
grow		=	yes
proportion	=	1
contents	=	$space(10)
contents	=	contentsSizer
contents	=	$space(10)

[wxGridBagSizer contentsSizer]
grid		=	5 5

# __CHANGE__ 015:	The dummy label was added to have at least
#			one GUI element in the sizer.
#			Remove lDummy (next 4 lines) and add the real
#			window contents here.
contents	=	lDummy		 0   0   1   1	left

[wxStaticText lDummy]
text		=	sTexts[13]



%%	header start

%%	class start
class $frame$ : public DkWxFrame
{
  private:

    /**	Event table for frame.
    */
    DECLARE_EVENT_TABLE()

  protected:

    /**	Localized texts.
    */
    wxChar const * const	*sTexts;

    /**	Non-localized texts.
    */
    wxChar const * const	*sNlWx;

    /**	Non-localized texts.
    */
    dkChar const * const	*sNlDk;

    /*	__CHANGE__ 011:	Add further member variables.
    */

%%	class end

  public:

    /**	Constructor.
	@param	wxid			Window ID.
	@param	applicationHelper	Application helper object.
	@param	hc			Help controller for online help.
	@param	argc			Number of command line arguments.
	@param	argv			Command line arguments array.
	@param	localizedTexts		Localized wxChar texts.
	@param	nlWx			Non-localized wxChar texts.
	@param	nlDk			Non-localized dkChar texts.
    */
    $frame$(
      int			  wxid,
      DkWxAppHelper		 *applicationHelper,
      DkWxHelpController	 *hc,
      int			  argc,
      wxChar			**argv,
      wxChar const * const	 *localizedTexts,
      wxChar const * const	 *nlWx,
      dkChar const * const	 *nlDk
    );

    /**	Destructor.
    */
    ~$frame$();

    /**	Check whether we can close the window.
    	@param	isLast	Flag: Last main window to close.
    */
    bool
    canClose(bool isLast);

    /**	Handler for File/Exit.
    	@param	event	Event to process.
    */
    void
    OnQuit(wxCommandEvent & event);

    /**	Handler for Help/About.
    	@param	event	Event to process.
    */
    void
    OnAbout(wxCommandEvent & event);

    /**	Handler for Help/Contents.
    	@param	event	Event to process.
    */
    void
    OnHelpContents(wxCommandEvent & event);

    /*	__CHANGE__ 008:	Remove OnIdle if no idle processing required.
    */
    /**	Handler for idle events.
    */
    void
    OnIdle(wxIdleEvent & event);

    /*	__CHANGE__ 017:	Event handlers for further events.
    */

    /*	__CHANGE__ 014:	Add further methods.
    */

};

%%	header end

%%	module start

#include "$program$.h"


#if !defined(__WXMSW__)
#include "$program$.xpm"
#endif



$!trace-include



/*	__CHANGE__ 017: Add further events. */
/*	__CHANGE__ 008: Remove OnIdle if no idle processing required. */
BEGIN_EVENT_TABLE($frame$, wxFrame)
	EVT_MENU($frame$_Quit, $frame$::OnQuit)
	EVT_MENU($frame$_Help_About, $frame$::OnAbout)
	EVT_MENU($frame$_Help_Contents, $frame$::OnHelpContents)
	EVT_IDLE($frame$::OnIdle)
END_EVENT_TABLE()



%%	constructor start
$frame$::$frame$(
  int			  wxid,
  DkWxAppHelper		 *applicationHelper,
  DkWxHelpController	 *hc,
  int			  argc,
  wxChar		**argv,
  wxChar const * const	 *localizedTexts,
  wxChar const * const	 *nlWx,
  dkChar const * const	 *nlDk
) : DkWxFrame(nlWx[0], applicationHelper, hc, wxid)
{
  /*	__CHANGE__ 012:	Add further local variables.
  */

  /*	__CHANGE__ 012: Initialize further local variables.
  */

  sTexts = localizedTexts;
  sNlWx  = nlWx;
  sNlDk  = nlDk;
#if defined(__WXMSW__)
  wxIcon	$program$_icon(sNlWx[4]);
#else
  wxIcon	$program$_icon($program$_xpm);
#endif
  /*	__CHANGE__ 011:	Initialize further class members.
  */
%%	constructor end
  if(dkctGUILayoutOK) {
    SetTitle(nlWx[0]);
    restorePosition();
  }

  /*	__CHANGE__ 012:	Release resources allocated by local variables.
  */
}

%%	module end



$frame$::~$frame$()
{

  /*	__CHANGE__ 011:	Release resources allocated by further class members.
  */
}



bool
$frame$::canClose(bool isLast)
{
  bool		back	= true;

  /*	__CHANGE__ 013: Check for unsaved data.
  */

  return back;
}


void
$frame$::OnQuit(wxCommandEvent & event)
{
  Close();
}



void
$frame$::OnAbout(wxCommandEvent & event)
{
  wxString	text(wxT(""));
  wxString	title(wxT(""));

  /* Construct message text. */
  text.Append(sNlWx[0]);
  text.Append(sNlWx[7]);
  text.Append(sNlWx[1]);
  text.Append(sNlWx[8]);
  text.Append(sTexts[9]);
  text.Append(sNlWx[2]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[8]);
  text.Append(sTexts[11]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[9]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[8]);
  text.Append(sTexts[12]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[10]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[11]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[12]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[13]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[14]);
  text.Append(sNlWx[8]);
  text.Append(sNlWx[15]);
  text.Append(sNlWx[8]);
  
  /* Construct dialog box title. */
  title.Append(sTexts[10]);
  title.Append(sNlWx[0]);

  /* Show dialog box. */
  wxMessageBox(text, title);

  /*	__CHANGE__ 019:	Create better about box.
  */
}



void
$frame$::OnHelpContents(wxCommandEvent & event)
{
  openHelp();
}

/*	__CHANGE__ 017:	Event handlers for further events.
*/

/*	__CHANGE__ 014:	Implementation of further methods.
*/


/*	__CHANGE__ 008:	Remove OnIdle if no idle processing required.
*/

void
$frame$::OnIdle(wxIdleEvent & event)
{
  /* __CHANGE__
  */
  event.RequestMore();
  event.Skip();
}


