The ICnrEditHandler class supports direct editing of data in the container.
Create a handler derived from ICnrEditHandler and attach it to the container whose data is to be edited. You can do this by calling ICnrEditHandler::handleEventsFor to pass the container or the container's owner window to the container edit handler.
ICnrEditHandler processes the following events from the container:
When the container edit handler receives one of these container edit events, it creates a corresponding event object and routes that object to the appropriate ICnrEditHandler virtual function. You must override these virtual functions to supply your own specialized processing of a container edit event. Note that when overriding beginEdit, you must call the base class function ICnrEditHandler::beginEdit before adding your own behavior. If you override endEdit, you must call the base class function ICnrEditHandler::endEdit after you complete your processing.
The return value from the virtual functions specifies whether the container edit event should be passed on for additional processing, as follows:
You can construct and destruct objects of this class.
![]() |
public:
virtual ~ICnrEditHandler()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
ICnrEditHandler(StringType stringType = isIString)
You can only construct instances of this class by providing the type of the user data that needs to be edited. The data can be one of the types specified by the StringType enumeration.
The default behavior of this class provides for the reallocation of the user data. The default behavior of this class also manages the allocation of other types of editable data, such as the following:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to implement the class.
![]() |
public:
virtual ICnrEditHandler& handleEventsFor( IContainerControl* container )
Attaches the handler to the specified container control.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual ICnrEditHandler& stopHandlingEventsFor( IContainerControl* container )
Detaches the handler from the specified container control.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
If a container edit event is found, the appropriate event processing virtual function is called.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Event-processing members must be supplied by a derived class to provide additional processing for an edit event.
![]() |
public:
virtual bool beginEdit(ICnrBeginEditEvent& event)
Called when an edit window has been opened in the container. The default behavior creates an IMultiLineEdit object by calling ICnrEditHandler::multiLineEdit. If ICnrEditHandler::setMLEHandler has been previously called to store an edit handler, the handler is added to the IMultiLineEdit object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool endEdit(ICnrEndEditEvent& event)
Called when editing has ended. This is received after reallocateString is called.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isDataIString() const
If the user data is type IString, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool reallocateString( ICnrReallocStringEvent& event )
Called when text has been modified in the container and storage needs to be reallocated. If the data is an IString, the reallocation is provided by calling ICnrReallocStringEvent::reallocateString. If the data is of the type isCharacterPointer, the reallocation is provided by calling ICnrReallocStringEvent::reallocateText.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to enable processing of events to the container's edit field.
![]() |
public:
IHandler* mleHandler() const
Called to return the handler for a multiline entry field. If a handler has not been provided, 0 is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IMultiLineEdit* multiLineEdit( const IWindowHandle& handleMultiLineEdit )
Called to return an IMultiLineEdit "wrapper." You can override this function to specialize the edit control.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
![]() |
public:
virtual void setMLEHandler(IHandler* anMLEHandler)
Stores a handler to be added to the IMultiLineEdit control when that control is created.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
enum StringType { isIString, isCharacterPointer }
Enumeration identifying the type of user data in the details view of the container:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0