SftTree/DLL 6.5

Cell Editing

Softel vdm, Inc.

SftTree/DLL supports editing of cell text using a unique approach.  SftTree/DLL will notify your application of certain events (such as double-clicking on a tree item).  Your application can then create any Windows control at a location specified by SftTree/DLL.  The Windows control is "attached" to the tree control, but your application receives all messages and notifications for the new control, so even owner-drawn controls or custom controls can be used.  SftTree/DLL will notify your application when editing (using your control) should end, either with or without data validation.

The SftTree/DLL Wizard can be used to generate sample code implementing cell editing.  The sample code uses an edit control, but any Windows control can be used instead. 

To simplify handling of special keystrokes such as Escape, Return, arrow keys, which are normally handled by the child window, these can be intercepted by the application using SetKeyHandling.  Once a keystroke for a child window is intercepted during cell editing, the SFTTREEN_KEYINTERCEPTED notification occurs.  The intercepted key can be retrieved using the GetKeyHandling function.  Using SetKeyHandling eliminates the need to subclass the child window, simplifying the implementation of cell editing.

By intercepting the Tab, Return and arrow keys, simple cell navigation while cell editing is possible.  Individual items can be ignored for cell editing using the SetItemEditIgnore function.  Or individual cells can be ignored for cell editing using the SFTTREE_CELL structure's flag2 member (SFTTREECELL_EDITIGNORE).

The CellEditing sample demonstrates the techniques used for cell editing with complete cell navigation using edit controls and combo boxes. 

Information specific to SftTree/DLL Windows Mobile EditionWindows Mobile Edition:  Cell editing mechanisms are not supported. It is possible to position an edit control (for example) on the tree control, but the necessary notifications are not supported. The input focus loss of the edit control can be used to simulate SFTTREEN_VALIDATEEDIT and SFTTREEN_QUITEDIT notifications.

 


Feedback / comments / error reports for this topic
© 2009 - Softel vdm, Inc. - www.softelvdm.com