Objects of the ITextChangeHandler class process text change events for the following controls:
Text-change events describe a proposed change to the data in an editable text control. Such events result from a user attempting to change an input text value, by one of the following actions:
In short, you can verify any change to the text data of these controls in this handler.
This handler is called after IKeyboardHandlers, but before IEditHandlers and before any of the changes in the text values show up on the screen.
You can create a handler derived from ITextChangeHandler and attach it to either the control whose input users can change or to the control's owner window. You do this by calling IHandler::handleEventsFor to pass the appropriate control window or owner window to the text-change handler.
When the text-change handler receives a text-change event, it creates an ITextChangeEvent object and routes that object to the textChange virtual function. You must override this virtual function to supply your own specialized processing of a text-change event. In your processing, you decide whether the proposed change is:
When processing, you can do the following:
The return value from the virtual function (which is not the same thing as allowChange) specifies whether the control event is passed on for additional processing, as follows:
Constructors & Destructor![]() |
public:
virtual ~ITextChangeHandler()
| Windows | OS/2 | AIX |
| Yes | No | Yes |
Event Dispatching![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
IWindow calls this function when a window event occurs. If this function returns true, the event is not processed by additional handlers. In such cases, a result must be placed in the specified IEvent object.
| Windows | OS/2 | AIX |
| Yes | No | Yes |
Event Processing![]() |
protected:
virtual bool textChange(ITextChangeEvent& event) = 0
Implemented by derived classes to process a text-change event. If you do not override this function, you can not create a derived class.
| Windows | OS/2 | AIX |
| Yes | No | Yes |
virtual ~IHandler()
virtual IString asDebugInfo() const
virtual IString asString() const
virtual IHandler& disable()
virtual IHandler& enable(bool enable = true)
virtual IHandler& handleEventsFor(IWindow* window)
IHandler()
bool isEnabled() const
virtual IHandler& stopHandlingEventsFor(IWindow* window)
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0