/*
 * File:			sample.h
 * Purpose:		Sample WXR usage program - Header file
 *
 * Author:		George Tasker
 * Mods:			
 *
 * Created:		March, 1998
 * Updated: 
 *
 * Copyright:	(c)None
 */

/*
   SYNOPSIS START

   SYNOPSIS STOP
*/


/* static const char sccsid[] = "%W% %G%"; */


#ifndef SAMPLE_DOT_H
#define SAMPLE_DOT_H


typedef enum Genre
	{
		genreACTION = 0,
		genreARCADE,
		genreRPG,
		genreSIMULATION,
		genreOTHER
	};


typedef enum AgeRange
	{
		age1_20 = 0,
		age21_30,
		age31_40,
		age41_50,
		age51plus
	};



//
// Used for constructing menus
//
/********************************************/
#define SAMPLE_ROOT_MENU					0x0000
/********************************************/
#define SAMPLE_FILE_MENU					0x1000
#define		SAMPLE_FILE_DIALOG			0x1100
#define		SAMPLE_FILE_EXIT				0x1F00
/********************************************/
#define SAMPLE_HELP_MENU					0xF000
#define		SAMPLE_HELP_ACKNOWLEDGE		0xF900
/********************************************/


// Define a new frame type
class CsampleFrame: public wxFrame
{
	public:
		CsampleFrame(wxFrame *frame, char *title, int x, int y, int w, int h, long Style=wxSDI|wxDEFAULT_FRAME);

		void		OnMenuCommand(int id);
		Bool		OnClose(void);
		void		OnActivate(Bool) {};  // necessary for accelerators to work
		void		OnSize(int w, int h);

};  // CsampleFrame



// Define a new application type
class CsampleApp: public wxApp
{ 
	public:
		CsampleFrame	*Frame;
		wxPanel			*Panel;

		wxFrame			*OnInit(void);

		void				 BuildMenu();
};  // CsampleApp



class CsampleDlg : public wxDialogBox
{
	private:
		Bool			 widgetPtrsSet;	// Has a successful call to SetWidgetPtrs() been performed

		// Indicates that an event was generated which has a callback function to be
		// executed, which needs to prevent any other widget on the dialog from generating
		// another event until the current event being processed is complete.
		// Otherwise things like double clicking a button can have undesirable effects
		Bool			 busyProcessingWidget;

		// Widget pointers
		wxMessage	*pSampleNameMsg;
		wxText		*pSampleNameTxt;
		wxMessage	*pSampleGenreMsg;
		wxChoice		*pSampleGenreChoice;
		wxRadioBox	*pSampleAgeRangeRadio;
		wxMessage	*pSampleGameListMsg;
		wxListBox	*pSampleGameList;
		wxMessage	*pSampleLaunchGameMsg;
		wxCheckBox	*pSampleLaunchGameCheck;
		wxButton		*pSampleDoneBtn;

		// The following variables have nothing to do with the GUI, they
		// are just used for storing the data obtained from the GUI widgets
		wxString					userName;
		enum Genre	Genre;
		enum AgeRange			ageRange;
		wxString					favoriteGame;
		Bool						launchGame;

	public:
		CsampleDlg(wxWindow *parent); // Primary constructor
		Bool			 OnClose(void);
		void			 OnCommand(wxWindow& win, wxCommandEvent& event);
		void			 OnActivate(Bool) {};  // necessary for hot keys

		Bool			 SetWidgetPtrs();

		// Callback functions for widgets
		Bool			cbSampleNameTxt(wxCommandEvent& event);
		Bool			cbSampleGenreChoice();
		Bool			cbSampleAgeRangeRadio();
		Bool			cbSampleGameList();
		Bool			cbSampleLaunchGameCheck();
		Bool			cbSampleDoneBtn();

};	// CsampleDlg



// Dialog for displaying the wxWindows acknowledgement dialog
class CwxWinDlg : public wxDialogBox
{
	public:
		void OnCommand(wxWindow& win, wxCommandEvent& event);
		Bool OnClose();
		void OnActivate(Bool) {};  // necessary for hot keys
		
		void Initialize();
};


// Loads any/all WXR resource files into the resource table
Bool LoadScreenForms();

#endif  // SAMPLE_DOT_H

// ********************************** sample.h *************************************
