4.1.1.2.8 Handling Tabbed Dialog and Wizard Events

The following table summarizes event macros for tabbed dialogs, tabs, wizards, and wizard pages used when the Origin C dialog implementation is encapsulated within user-defined classes. When user-defined classes are used to programmatically control tabbed dialogs and wizards the Origin Dialog AppWizard creates template code containing a Dialog derived class for the main dialog, a PropertySheet derived class for the tab or page placeholder, and a PropertyPage derived class for each tab or page in the dialog or wizard. The Dialog derived object contains a PropertySheet derived data member which in turn contains a PropertyPage derived data member for each tab or page. In addition, the Dialog derived class and each PropertyPage derived class contains a message map for mapping resource events from controls on the dialog and on each tab or page to an event handler function.

Macro Description
PAGE_ON_INIT(_ocHandler) When the tabbed dialog, tab, wizard, or wizard page is shown the first time the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler();
PAGE_ON_IS_SHOW(_ocHandler) When a wizard page is activated (but before it is shown) the function _ocHandler is run. If the function _ocHandler returns TRUE the page is shown otherwise the next sequential page is activated. _ocHandler has the prototype:
BOOL _ocHandler(DWORD dwPageID, DWORD lParam);
PAGE_ON_ACTIVE(_ocHandler) When the tab or wizard page becomes active the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_KILLACTIVE(_ocHandler) When the tab or wizard page becomes inactive the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_RESET(_ocHandler) When the tab or wizard page is reset the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_NEXT(_ocHandler) When the Next button on a wizard is clicked the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_BACK(_ocHandler) When the Back button on a wizard is clicked the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_OK(_ocHandler) When the OK button is clicked the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_CANCEL(_ocHandler) When the Cancel button is clicked the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()
PAGE_ON_FINISH(_ocHandler) When the Finish button on a wizard is clicked the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler()

The [javascript:kadovTextPopup(this) table below] summarizes event macros for tabbed dialogs, tabs, wizards, and wizard pages used when the Origin C dialog implementation is encapsulated within user-defined classes. When user-defined classes are used to programmatically control tabbed dialogs and wizards the Origin Dialog AppWizard creates template code containing a Dialog derived class for the main dialog, a PropertySheet derived class for the tab or page placeholder, and a PropertyPage derived class for each tab or page in the dialog or wizard. The Dialog derived object contains a PropertySheet derived data member which in turn contains a PropertyPage derived data member for each tab or page. In addition, the Dialog derived class and each PropertyPage derived class contains a message map for mapping resource events from controls on the dialog and on each tab or page to an event handler function.

It is recommended that you encapsulate the implementation of your tabbed dialog or wizard within a class structure (for information on why and how to do this see the topic Choosing the Programming Language to Control your Dialog in the section Creating A Microsoft Visual C++ Resource-only DLL). However, a corollary set of event macros for tabbed dialogs, tabs, wizards, and wizard pages used when the Origin C dialog implementation is not encapsulated within a class structure is also provided in the table below.

Macro Description
PAGE_ON_INIT(_ocHandler) When the tabbed dialog, tab, wizard, or wizard page is shown the first time the function _ocHandleris run. _ocHandler has the prototype:
BOOL _ocHandler();
PAGE_ON_IS_SHOW(_ocHandler) When a wizard page is activated (but before it is shown) the function _ocHandleris run. If the function _ocHandlerreturns TRUE the page is shown otherwise the next sequential page is activated. _ocHandlerhas the prototype:
BOOL _ocHandler (DWORD dwPageID, DWORD lParam);
PAGE_ON_ACTIVE(_ocHandler) When the tab or wizard page becomes active the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();
PAGE_ON_KILLACTIVE(_ocHandler) When the tab or wizard page becomes inactive the function_ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();
PAGE_ON_RESET(_ocHandler) When the tab or wizard page is reset the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();
PAGE_ON_NEXT(_ocHandler) When the Next button on a wizard is clicked the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();
|- 
|PAGE_ON_BACK(_''ocHandler'')
|When the Back button on a wizard is clicked the function ''_ocHandler'' is run. ''_ocHandler''has the prototype:</span>''
<pre>
BOOL _ocHandler();
PAGE_ON_OK(_ocHandler) When the OK button is clicked the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();
PAGE_ON_CANCEL(_ocHandler) When the Cancel button is clicked the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();
PAGE_ON_FINISH(_ocHandler) When the Finish button on a wizard is clicked the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler();


For detailed examples demonstrating how to handle tabbed dialog and wizard events see the topics Accessing the Tabs of a Tabbed Dialog with Origin C and Accessing the Pages of a Wizard with Origin C.