IPageHandler

The IPageHandler class processes page change events for the INotebook class. These events result from a user interacting with a notebook page.

You can create a handler derived from IPageHandler and attach it to a notebook or to the notebook's owner window. You attach it by calling IHandler::handleEventsFor to identify the notebook or owner window to the page handler.

This class dispatches the following events:

Drawing a tab
INotebookDrawItemEvent
Requesting help for a page
IPageHelpEvent
Removing a page
IPageRemoveEvent
Resizing a page
IPageEvent
Selecting a page
IPageSelectEvent

When the page handler receives one of these events, it creates a corresponding event object and dispatches that object to the appropriate IPageHandler virtual function. You can override these virtual functions to supply customized processing of a page event.

The return value from the virtual functions specifies whether the page event is passed on for additional processing, as follows:

true
The page event requires no additional processing. Do not pass it to another handler.
false
Pass the page event to the next handler for additional processing, as follows:
  • If there is another handler for the notebook, pass the page event to the next handler.
  • If this is the last handler for the notebook, call IWindow::dispatch to dispatch the page event to the notebook's owner window.
  • If this is the last handler for the owner window, call IWindow::defaultProcedure to process the page event.


IPageHandler - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IPageHandler
public:
virtual ~IPageHandler()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IPageHandler
public:
IPageHandler()

Construct objects of this class using this, the default constructor, which does not accept any parameters.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Dispatching

Event-dispatching members evaluate an event to determine if it is appropriate for this handler object to process. If it is, this function calls the IPageHandler virtual function used to process the event.


[view class]
dispatchHandlerEvent
protected:
virtual bool dispatchHandlerEvent(IEvent& event)

If a page event is received, this calls the appropriate IPageHandler virtual function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Processing

Event-processing members override these functions in a derived class to process the various notebook page-related events. Use the overridden function to supply the customized processing of a page-related event.


[view class]
drawTab
protected:
virtual bool drawTab(INotebookDrawItemEvent& event)

Implemented by derived classes. It draws the notebook page tab.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
help
protected:
virtual bool help(IPageHelpEvent& event)

Implemented by derived classes. It processes a notification that help has been requested for a notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations

You can set up help for individual notebook pages by setting up the help table and IHelpWindow object for each page in exactly the same way as for any other window object.


[view class]
remove
protected:
virtual bool remove(IPageRemoveEvent& event)

Implemented by derived classes. It processes a page remove notification.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations

This member function is never called in the AIX environment.


[view class]
resize
protected:
virtual bool resize(IPageEvent& event)

Implemented by derived classes. It processes a notification that the page size changed.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
select
protected:
virtual bool select(IPageSelectEvent& event)

Implemented by derived classes. It processes the notification that a new page is at the top of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
selectPending
protected:
virtual bool selectPending(IPageSelectEvent& event)

Implemented by derived classes. It processes the notification that selection is pending on another page in the notebook.

Use this member to save the state of the outgoing page. To prevent the selection from changing to another page, set the event result to true via IEvent::setResult and return true on the exit from this member. For example, you might not want to switch from a multicell canvas in which a control has an invalid setting.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored

AIX Considerations

This member function is never called in the AIX environment.


IPageHandler - Inherited Member Functions and Data

Inherited Public Functions

IHandler

Inherited Public Data

Inherited Protected Functions

IHandler

Inherited Protected Data