MoSync 3.3
Edit box properties

Defines

#define MAW_EDIT_BOX_TEXT   "text"
 Set or get the text entered in the edit box.
#define MAW_EDIT_BOX_PLACEHOLDER   "placeholder"
 Set a text in the edit box that acts as a placeholder when an edit box is empty.
#define MAW_EDIT_BOX_SHOW_KEYBOARD   "showKeyboard"
 Shows or hides the virtual keyboard. If shown the focus will be set to this widget.
#define MAW_EDIT_BOX_EDIT_MODE   "editMode"
 Specifies what editing mode the edit box should have. On iOS this property works only if check box mode is MAW_EDIT_BOX_MODE_SINGLE_LINE.
#define MAW_EDIT_BOX_INPUT_MODE   "inputMode"
 Specifies what editing mode the edit box should have. Those flags are mutual exclusive, so the previous value is always ignored.
#define MAW_EDIT_BOX_INPUT_FLAG   "inputFlag"
 Specifies the editing flags applied to the edit box. Those flags are mutual exclusive, so the previous value is always ignored.
#define MAW_EDIT_BOX_FONT_COLOR   "fontColor"
 Sets the font color of the edit box's text.
#define MAW_EDIT_BOX_LINES_NUMBER   "linesNumber"
 Set the number of lines. Makes the edit box exactly this many lines tall. Note that setting this value overrides any other (minimum / maximum) number of lines or height setting. A single line edit box will set this value to 1. This property will automatically set MAW_EDIT_BOX_TYPE_ANY input mode, so that the edit box will become multiline. Available on Android only.
#define MAW_EDIT_BOX_MAX_LINES   "maxLines"
 Makes the edit box at most this many lines tall. Setting this value overrides any other (maximum) height setting. Available on Android only.
#define MAW_EDIT_BOX_MIN_LINES   "minLines"
 Makes the edit box at least this many lines tall. Setting this value overrides any other (minimum) height setting. Available on Android only.
#define MAW_EDIT_BOX_MAX_LENGTH   "maxLength"
 Sets or gets the maximum input lenght of the edit box. Setting this value enables multiline input mode by default. Available on Android, iOS and Windows Phone.
#define MAW_EDIT_BOX_PLACEHOLDER_FONT_COLOR   "placeholderFontColor"
 Sets the font color of the placeholder text when an edit box is empty.
#define MAW_EDIT_BOX_MODE   "mode"
 Sets or gets the edit box mode. Changing this value on iOS platform will reset all widget's properties, because the widget will be replaced with a new one. It is recommended to set this value after creating the widget, and before adding it to a layout. Platform: iOS.
#define MAW_EDIT_BOX_AUTOCORRECTION_TYPE   "autoCorrectionType"
 Sets or gets the autocorrection type. Enable/disable the auto correction during typing. With auto correction enabled, the text object tracks unknown words and suggests a more suitable replacement candidate to the user, replacing the typed text automatically unless the user explicitly overrides the action. The default value is #MAW_EDIT_BOX_AUTOCORRECTION_TYPE_DEAFULT. Platform: iOS.
#define MAW_EDIT_BOX_TEXT_HORIZONTAL_ALIGNMENT   "textHorizontalAlignment"
 Sets or gets the horizontal alignment of the text inside the edit box. The default value is MAW_ALIGNMENT_LEFT. Platform: iOS.

Detailed Description

The available widget properties for a MAW_EDIT_BOX. See of Widget properties for more properties.


Define Documentation

#define MAW_EDIT_BOX_TEXT   "text"

Set or get the text entered in the edit box.

Valid values
A null-terminated string.
Operations
Set and get.
Example set
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_TEXT, "My label");
Example get
        char textBuffer[BUFFER_SIZE];
        int result = maWidgetGetProperty(editBoxHandle, MAW_EDIT_BOX_TEXT, textBuffer, BUFFER_SIZE);
        if (result > 0)
        {
        // Do something with the edit box text
        }
#define MAW_EDIT_BOX_PLACEHOLDER   "placeholder"

Set a text in the edit box that acts as a placeholder when an edit box is empty.

Valid values
A null-terminated string.
Operations
Set only.
Example
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_PLACEHOLDER, "Enter text...");
#define MAW_EDIT_BOX_SHOW_KEYBOARD   "showKeyboard"

Shows or hides the virtual keyboard. If shown the focus will be set to this widget.

Valid values
A boolean string 'true' or 'false'.
Operations
Set only.
Example
#define MAW_EDIT_BOX_EDIT_MODE   "editMode"

Specifies what editing mode the edit box should have. On iOS this property works only if check box mode is MAW_EDIT_BOX_MODE_SINGLE_LINE.

Deprecated:
use MAW_EDIT_BOX_INPUT_FLAG instead.
Valid values
Either 'password' or 'text'.
Operations
Set only.
Example
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_EDIT_MODE, "password");
#define MAW_EDIT_BOX_INPUT_MODE   "inputMode"

Specifies what editing mode the edit box should have. Those flags are mutual exclusive, so the previous value is always ignored.

Valid values
One of the values MAW_EDIT_BOX_TYPE_ANY, MAW_EDIT_BOX_TYPE_EMAILADDR, MAW_EDIT_BOX_TYPE_NUMERIC, MAW_EDIT_BOX_TYPE_PHONENUMBER, MAW_EDIT_BOX_TYPE_URL, MAW_EDIT_BOX_TYPE_DECIMAL, #MAW_EDIT_BOX_TYPE_SINGLELINE.
Operations
Set only.
Example
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_INPUT_MODE, toString(MAW_EDIT_BOX_NUMERIC);
#define MAW_EDIT_BOX_INPUT_FLAG   "inputFlag"

Specifies the editing flags applied to the edit box. Those flags are mutual exclusive, so the previous value is always ignored.

Valid values
One of the values MAW_EDIT_BOX_FLAG_PASSWORD, MAW_EDIT_BOX_FLAG_SENSITIVE, MAW_EDIT_BOX_FLAG_INITIAL_CAPS_ALL_CHARACTERS, MAW_EDIT_BOX_FLAG_INITIAL_CAPS_WORD, MAW_EDIT_BOX_FLAG_INITIAL_CAPS_SENTENCE.
Operations
Set only.
Example
#define MAW_EDIT_BOX_FONT_COLOR   "fontColor"

Sets the font color of the edit box's text.

Valid values
A hexadecimal value 0xRRGGBB, where R, G and B are the red, green and blue components respectively.
Operations
Set only.
Example
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_FONT_COLOR, "0xff0000");
#define MAW_EDIT_BOX_LINES_NUMBER   "linesNumber"

Set the number of lines. Makes the edit box exactly this many lines tall. Note that setting this value overrides any other (minimum / maximum) number of lines or height setting. A single line edit box will set this value to 1. This property will automatically set MAW_EDIT_BOX_TYPE_ANY input mode, so that the edit box will become multiline. Available on Android only.

Valid values
A positive integer.
Operations
Set and get.
Example
#define MAW_EDIT_BOX_MAX_LINES   "maxLines"

Makes the edit box at most this many lines tall. Setting this value overrides any other (maximum) height setting. Available on Android only.

Valid values
A positive integer.
Operations
Set only.
Example
#define MAW_EDIT_BOX_MIN_LINES   "minLines"

Makes the edit box at least this many lines tall. Setting this value overrides any other (minimum) height setting. Available on Android only.

Valid values
A positive integer.
Operations
Set only.
Example
#define MAW_EDIT_BOX_MAX_LENGTH   "maxLength"

Sets or gets the maximum input lenght of the edit box. Setting this value enables multiline input mode by default. Available on Android, iOS and Windows Phone.

Valid values
A positive integer.
Operations
Set and get.
Example
#define MAW_EDIT_BOX_PLACEHOLDER_FONT_COLOR   "placeholderFontColor"

Sets the font color of the placeholder text when an edit box is empty.

Valid values
A hexadecimal value 0xRRGGBB, where R, G and B are the red, green and blue components respectively.
Operations
Set only.
Example
#define MAW_EDIT_BOX_MODE   "mode"

Sets or gets the edit box mode. Changing this value on iOS platform will reset all widget's properties, because the widget will be replaced with a new one. It is recommended to set this value after creating the widget, and before adding it to a layout. Platform: iOS.

Valid values
MAW_EDIT_BOX_MODE_SINGLE_LINE will set the mode to single line, or MAW_EDIT_BOX_MULTI_LINE will set the mode to multi line.
Operations
Set and get.
Example
   char buffer[BUFFER_SIZE];
   sprintf(buffer, "%d", MAW_EDIT_BOX_MODE_MULTI_LINE);
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_MODE, buffer);
#define MAW_EDIT_BOX_AUTOCORRECTION_TYPE   "autoCorrectionType"

Sets or gets the autocorrection type. Enable/disable the auto correction during typing. With auto correction enabled, the text object tracks unknown words and suggests a more suitable replacement candidate to the user, replacing the typed text automatically unless the user explicitly overrides the action. The default value is #MAW_EDIT_BOX_AUTOCORRECTION_TYPE_DEAFULT. Platform: iOS.

Valid values
MAW_EDIT_BOX_AUTOCORRECTION_TYPE_DEFAULT, MAW_EDIT_BOX_AUTOCORRECTION_TYPE_ENABLE or MAW_EDIT_BOX_AUTOCORRECTION_TYPE_DISABLE.
Operations
Set and get.
Example
   char buffer[BUFFER_SIZE];
   sprintf(buffer, "%d", MAW_EDIT_BOX_AUTOCORRECTION_TYPE_YES;
        maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_AUTOCORRECTION_TYPE, buffer);
#define MAW_EDIT_BOX_TEXT_HORIZONTAL_ALIGNMENT   "textHorizontalAlignment"

Sets or gets the horizontal alignment of the text inside the edit box. The default value is MAW_ALIGNMENT_LEFT. Platform: iOS.

Valid values
MAW_ALIGNMENT_LEFT, MAW_ALIGNMENT_CENTER or MAW_ALIGNMENT_RIGHT.
Operations
Set and get.
Example
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines