/*
 * A dialog which has been automatically generated by gendialog
 *
 *   Copyright (C) Michael Still                    2003
 *   Generated: %GENTIME%
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc., 675
 * Mass Ave, Cambridge, MA 02139, USA.
 */

#include "%CLASSNAME%.h"
#include "configuration.h"

BEGIN_EVENT_TABLE (%CLASSNAME%, wxDialog) 
EVT_BUTTON (wxID_OK, %CLASSNAME%::OnOK) 
EVT_BUTTON (wxID_CANCEL, %CLASSNAME%::OnQuit) 
EVT_CLOSE (%CLASSNAME%::OnQuit) 
END_EVENT_TABLE ()

%CLASSNAME%::%CLASSNAME% ():
  wxDialog ((wxDialog *) NULL, -1, "%TITLE%", wxPoint (100, 100),
	    wxSize (%WIDTH%, %HEIGHT%))
{
  // We store the previous values in the config file so that the user gets
  // presented with that as a default
  configuration *config;
  config = (configuration *) & configuration::getInstance ();
  string confstr;

  m_panel = new wxPanel (this, -1, wxPoint (100, 100), wxSize (%WIDTH%, %HEIGHT%));

%SETUP%

  Center ();
  ShowModal ();
}

// Cancel button hit
void
%CLASSNAME%::OnQuit (wxCommandEvent & WXUNUSED (event))
{
  EndModal (1);
  Destroy ();
}

// Ok button hit
void
%CLASSNAME%::OnOK (wxCommandEvent & WXUNUSED (event))
{
  // We store the previous values in the config file so that the user gets
  // presented with that as a default. This is also used as a simple message
  // passing scheme for the caller to find out what values were set
  configuration *config;
  config = (configuration *) & configuration::getInstance ();
  string confstr;

%SAVE%

  EndModal (0);
  Destroy ();
}
