1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
//----------------------------------------------------------------------------------------
/*!
\file plucker_wizard_base.h
\modified
\copyright (c) Robert O'Connor ( rob@medicalmnemonics.com )
\licence GPL
\brief Describes plucker_wizard_base class
\author Robert O'Connor
\date 2002/01/03
*/
// RCS-ID: $Id: plucker_wizard_base.h,v 1.4 2003/03/17 17:43:20 robertoconnor Exp $
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// Begin single inclusion of this .h file condition
//----------------------------------------------------------------------------------------
#ifndef _PLUCKER_WIZARD_BASE_H_
#define _PLUCKER_WIZARD_BASE_H_
//----------------------------------------------------------------------------------------
// GCC interface
//----------------------------------------------------------------------------------------
#if defined(__GNUG__) && ! defined(__APPLE__)
#pragma interface "plucker_wizard_base.h"
#endif
//----------------------------------------------------------------------------------------
// Shared defines
//----------------------------------------------------------------------------------------
#include "plucker_defines.h"
//----------------------------------------------------------------------------------------
// Begin feature removal condition
//----------------------------------------------------------------------------------------
#if ( setupUSE_WIZARDS )
//----------------------------------------------------------------------------------------
// Headers
//----------------------------------------------------------------------------------------
#include "wx/wizard.h"
// ----------------------------------------------------------------------------------------
// Define an array type for our class (an array of pointers only). Note that
// WX_DEFINE_ARRAY is only for ints/pointers, not objects. This is just an array of the
// child wizardpages that were added, so that we can loop through them to chain them,
// set which is the first page, and set the overall wizard size.
// ----------------------------------------------------------------------------------------
WX_DEFINE_ARRAY( wxWizardPageSimple*, wizardpage_array_type );
//----------------------------------------------------------------------------------------
// Class definition: plucker_wizard_base
//----------------------------------------------------------------------------------------
//! Base class for all the wizards used in Plucker Desktop.
/*!
Cancel buttton shows a dialog with the passed cancel message from the constructor.
*/
class plucker_wizard_base : public wxWizard
{
DECLARE_ABSTRACT_CLASS( plucker_wizard_base );
public:
//! Constructor.
/*!
\param parent The parent window. May be NULL.
\param title The title of the wizard.
\param bitmap The default bitmap used in the wizard. May be overriden by a page.
\param cancel_message The message that appears when user clicks \e Cancel button.
\todo Enclose cancel message in _() if possible.
*/
plucker_wizard_base( wxWindow* parent = NULL,
int id = -1,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxString& cancel_message = _( "Abort the wizard?" )
);
//! Destructor.
virtual ~plucker_wizard_base();
//! Call this in constructor of derived class to add a wizardpagesimple to the wizard.
/*!
\param wizardpage The wizardpage to add to the wizard.
*/
void add_wizardpage_to_wizard( wxWizardPageSimple* wizardpage );
//! Call this after you have created an instance of the wizard.
/*!
\return TRUE if user clicked the \e Finish button.
*/
bool run_wizard();
//! Pure virtuals: what to do when the \e Finish button was done,
virtual void on_finish_button() = 0;
//! Pure virtual: what to do when the \e Help button was pressed.
/*!
param event. The wxWizardEvent, can be queried for GetPage() to know
what page was visible when clicked help.
*/
virtual void on_help_button( wxWizardEvent& event ) = 0;
private:
void on_cancel_button( wxWizardEvent& event );
wxWizardPageSimple* m_first_wizardpage;
wxWindow* m_parent;
wxString m_cancel_message;
wizardpage_array_type m_wizardpages_array;
void chain_wizardpages();
void set_best_wizard_size();
DECLARE_EVENT_TABLE()
};
//----------------------------------------------------------------------------------------
// End feature removal condition
//----------------------------------------------------------------------------------------
#endif // setupUSE_WIZARDS
//----------------------------------------------------------------------------------------
// End single inclusion of this .h file condition
//----------------------------------------------------------------------------------------
#endif //_PLUCKER_WIZARD_BASE_H_
|