Programmer's Reference
For simple text editing of cell values, an application need only provide
simple beginEditCallback and endEditCallback
handlers. In some advanced applications, simple text editing of a cell
might not be sufficient. In these situations, the application can
specify an edit policy in the callData of the
beginEditCallback.
The edit policy defines the type of widget to be used for editing and some
other edit semantics. The default edit policy is
EwTextEditPolicy set up to use a single-line CwText as
the edit widget. The application can substitute a more appropriate edit
policy. For example, if the cell contains a day of the week, the
application might wish to use an EwComboBoxEditPolicy.
Applications can define custom edit policies by subclassing
EwEditPolicy as required. The supplied subclasses of
EwEditPolicy serve as good examples of this.
The following edit policies are provided in the Extended Widgets
subsystem:
- EwComboBoxEditPolicy
- A cell is edited using a combo box. An application can specify the
list of items to choose from and the initial value. It can also specify
whether users can edit the value manually or just choose one of the items in
the list.
- EwTextEditPolicy
- A cell is edited using a text widget. An application can specify
whether the widget is to be single or multiple lines, what the initial text
value should be, what the initially selected text should be, and what the
maximum length should be.
- EwToggleButtonEditPolicy
- A cell is edited using a toggle button. An application can specify
the label string for the toggle button, the horizontal alignment of the label
string and whether or not the toggle should be initially selected.
- Note:
- The EwTextEditPolicy and EwComboBoxEditPolicy cancel an
edit operation when the ESC key is pressed. When an edit operation is
cancelled, the endEditCallback is activated using the item's
old value as the edited value.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]