Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter NineDialog Functions (continued)

DataControlGetChangingText Function

Overview

The DataControlGetChangingText function retrieves the text of the Edit Control after the user has committed the change.

Syntax/Parameters

Syntax

string = DataControlGetChangingText ( int id );

Parameters

id

An int containing the control ID of the data control.

Return Value

A UTF encoded string containing the edit control’s display text. The string will be empty on error. Since empty strings are invalid data, the GetLastError, IsError or IsNotError function must be used to determine if an error occurred.

Remarks

When a user commits a change, either by pressing Enter, Tab or if the control looses focus, a series of actions will be sent including DCN_EDIT_CHANGING. This function only operates in response to the DCN_EDIT_CHANGING message and allows for data to be validated and potentially rejected. Alternatively, the text can be conditioned, the cell context changed and the current edit action rejected.

Example of limiting the size and case of a cell:

case DCN_EDIT_CHANGING:
  pos = DataControlGetCaretPosition(MY_DATA_CONTROL);
  if (IsError()) { break; }
  // add test for specific cell
  s1 = DataControlGetChangingText(MY_DATA_CONTROL);
  s1 = MakeUpperCase(GetStringSegment(s1, 0, 5));
  DataControlSetCellText(MY_DATA_CONTROL, pos["Row"], pos["Col"], s1);
  DataControlSetActionReturnCode(MY_DATA_CONTROL, ERROR_SOFT);
  break;

Note that if the action return code is not set to cancel, the cell will be set by the data control to the new edit control content.

Related Functions

Platform Support

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

Legato IDE, Legato Basic