ISelectHandler

The ISelectHandler-derived classes handle events resulting from a user interacting with a selectable item, such as clicking a radio button. ISelectHandler objects process item selection events for the following controls:

You can create a handler derived from ISelectHandler and attach it to a control that generates a selection event or to the control's owner window by calling IHandler::handleEventsFor.

When the selection handler receives a selection event, it creates an IControlEvent object and routes that object to the appropriate ISelectHandler virtual function. You override these "Event Processing" virtual functions to supply customized processing of a selection event.

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

true
The selection event requires no additional processing. The IWindow event dispatcher should not pass the event to another handler.
false
Pass the selection event to the next handler for additional processing, as follows:
  • If there is another handler for the control, pass the selection event to the next handler.
  • For Presentation Manager applications, if this is the last handler for the control, call IWindow::dispatch to dispatch the selection event to the control's owner window.
  • If this is the last handler for the owner window, call IWindow::defaultProcedure to process the selection event.

AIX Considerations

The ISelectHandler is called when ISettingButton::select and IButton::click are called for radio button and check box controls.

OS/2 Considerations

The ISelectHandler is called when you call IButton::click. Calling ISettingButton::select does not cause an ISelectHandler to be called.


ISelectHandler - Member Functions and Data by Group

Constructors & Destructor

Only derived classes can construct objects of this class.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
ISelectHandler
protected:
ISelectHandler()

Derived classes call this default constructor to create objects of this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Dispatching

The Open Class Library dispatches events that have been sent or posted to a window to the handlers attached to that window. It does this by calling the event-dispatching function of the handler objects. An ISelectHandler object processes only selection events.


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

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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Processing Functions

A select handler allows you to process a selection or enter action through its event-processing members. You should override at least one of these virtual functions in a derived class.


[view class]
enter
protected:
virtual bool enter(IControlEvent& event)

Implemented by derived classes to process an enter action. An enter action is caused by the user double clicking on a button, double clicking or pressing the Enter key on a list box, container, or combination box, or selecting an item from the drop-down list box of a combination box.

For buttons, this function calls the function selected.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
selected
protected:
virtual bool selected(IControlEvent& event)

Implemented by derived classes to process a selection action.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


ISelectHandler - Inherited Member Functions and Data

Inherited Public Functions

IHandler

Inherited Public Data

Inherited Protected Functions

IHandler

Inherited Protected Data