|
MoSync 3.3
|
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. | |
The available widget properties for a MAW_EDIT_BOX. See of Widget properties for more properties.
| #define MAW_EDIT_BOX_TEXT "text" |
Set or get the text entered in the edit box.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_TEXT, "My label");
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.
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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_SHOW_KEYBOARD, "true");
| #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.
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.
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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_INPUT_FLAG, toString(MAW_EDIT_BOX_FLAG_PASSWORD));
| #define MAW_EDIT_BOX_FONT_COLOR "fontColor" |
Sets the font color of the edit box's text.
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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_LINES_NUMBER, "2");
| #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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_MAX_LINES, "2");
| #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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_MIN_LINES, "1");
| #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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_MAX_LENGTH, "10");
| #define MAW_EDIT_BOX_PLACEHOLDER_FONT_COLOR "placeholderFontColor" |
Sets the font color of the placeholder text when an edit box is empty.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_PLACEHOLDER_FONT_COLOR, "0xff0000");
| #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.
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.
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.
maWidgetSetProperty(editBoxHandle, MAW_EDIT_BOX_TEXT_HORIZONTAL_ALIGNMENT, MAW_ALIGNMENT_RIGHT);