class LM_TextControl

The LM_TextControl class displays a box where the user can enter text or numbers. To create a new button, you would use the following function:


LM_TextControl LM.GUI.TextControl(width, text, msg, fieldType)

Creates a new LM_TextControl object that can then be added to a dialog or toolbar.

Return value (LM_TextControl): the newly-created text control
width (int): the width of the text control in pixels (enter 0 for automatic sizing)
text (string): the initial text to display
msg (int): a message value to be triggered when the user changes the text in the box
fieldType (int): the type of text allowed - see the constants for this option

Member Functions

void SetValue(text)

Set the box's text as a string.

Return value: none
text (string): a text string to put in the box

void SetValue(i)

Set the box's text as an integer.

Return value: none
i (int): a number to put in the box

void SetValue(f)

Set the box's text as a floating-point number.

Return value: none
f (float): a number to put in the box

void SetWheelInc(f)

When a text control contains a numerical value, the user can adjust this value by holding the mouse over the box and rolling the scroll wheel up and down. Use this function to set how much the numerical value should change with each movement of the scroll wheel.

Return value: none
f (float): the increment to add or subtract for each scroll wheel "click"

string Value()

Returns the text string contained in the control.

Return value (string): the control's text

int IntValue()

Returns the text string contained in the control as an integer.

Return value (int): the number contained in the control

float FloatValue()

Returns the text string contained in the control as a floating-point number.

Return value (float): the number contained in the control

void SetConstantMessages(b)

Normally, a text control will send a message when the user presses tab to move to the next text field. This function tells the control to send messages whenever the text changes at all, even if the user is still typing away.

Return value: none
b (bool): true to send a message for every change, false to send messages only when the user leaves the text control's focus
class LM_TextControl : public LM_BaseWidget {
  void SetValue(const char *text);
  void SetValue(int32 i);
  void SetValue(real f);
  void SetWheelInc(real f);
  const char *Value();
  int32 IntValue();
  real FloatValue();
 
  void SetConstantMessages(bool b);
};