Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter NineDialog Functions (continued)

DataControlSetLocalEditMode Function

Overview

The DataControlSetLocalEditMode function enables or disables local cell editing.

Syntax/Parameters

Syntax

int = DataControlSetLocalEditMode ( int id, [dword mode] );

Parameters

id

An int containing the control ID of the data control.

mode

An optional dword specifying the edit mode. The default is DCC_EDIT_MODE_ALLOWED. See Remarks below.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure.

Remarks

By default, data or cells within a data control are read-only. Setting the edit mode allows cells to be edited directly on the sheet.

The edit modes are as follows:

  SDK Definition   Bitwise   Description  
  Mode          
    DCC_EDIT_MODE_MASK    0x00000003   Edit Mode Mask  
    DCC_EDIT_MODE_NONE    0x00000000   Not Allowed (default open state)   
    DCC_EDIT_MODE_ALLOWED   0x00000001   Allowed  
    DCC_EDIT_MODE_AUTO   0x00000002   Allowed (auto)   
  Flags          
    DCC_EDIT_OVERWRITE   0x00000010   Overwrite Content on Over-Type  
    DCC_EDIT_CONTROL_SELECT_ALL   0x00000020   Cause Select All on Auto Entry   

 

In DCC_EDIT_MODE_ALLOWED, a user can enter edit mode by double clicking on the cell. If auto mode, tabbing or typing over the select cell. the DCC_EDIT_OVERWRITE mode causes the entire contents to be replaced by the entered character.

When the edit function is activated, the control will send the following notifications (double click):

DCN_DOUBLE_CLICK

DCN_EDIT_CONTROL_ACTIVATE

DCN_GET_EDIT_CONTROL_SIZE

DCN_KILL_FOCUS

The double click is sent and then processed as an edit action. The control is activated, a request is made to limit the size of the edited text and finally, as focus transitions to the internal edit control, the focus of the Data Control is lost (killed).

Tab key transition with in auto enabled:

DCN_SELECT_CHANGE

DCN_EDIT_CONTROL_ACTIVATE

DCN_GET_EDIT_CONTROL_SIZE

DCN_KILL_FOCUS

The tab action moves the caret so a select change is sent, the edit control is activated, size queried and focus changed.

Overtype enabled:

DCN_VK_NOTIFY

DCN_EDIT_CONTROL_ACTIVATE

DCN_GET_EDIT_CONTROL_SIZE

DCN_KILL_FOCUS

In this case the virtual key (VK) indicates a key was pressed (this message will be passed to the action procedure even if the edit option is not enabled). 

If the user accepts the new data either by tab, return or losing focus, two additional notifications are sent:

DCN_EDIT_CHANGING

DCN_EDIT_CHANGE

To abort the cell edit, use the DataControlSetActionReturnCode function during the DCN_EDIT_CHANGING action. Example:

DataControlSetActionReturnCode(MY_CONTROL_ID, ERROR_SOFT);

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic