|
MoSync 3.3
|
Defines | |
| #define | MAW_BUTTON_TEXT "text" |
| Sets or gets the text that is displayed in the label. | |
| #define | MAW_BUTTON_TEXT_VERTICAL_ALIGNMENT "textVerticalAlignment" |
| Sets the vertical alignment of the text inside the button. If the widget's height is WRAP_CONTENT this property has no effect. | |
| #define | MAW_BUTTON_TEXT_HORIZONTAL_ALIGNMENT "textHorizontalAlignment" |
| Sets the horizontal alignment of the text inside the button. If the widget's width is WRAP_CONTENT this property has no effect. | |
| #define | MAW_BUTTON_FONT_COLOR "fontColor" |
| Sets the font color of the button's text. | |
| #define | MAW_BUTTON_FONT_SIZE "fontSize" |
| Sets the font size in points of the button's text. | |
| #define | MAW_BUTTON_FONT_HANDLE "fontHandle" |
| Sets the typeface and style in which the text should be displayed. | |
The available widget properties for a MAW_BUTTON. See of Widget properties for more properties.
| #define MAW_BUTTON_TEXT "text" |
Sets or gets the text that is displayed in the label.
maWidgetSetProperty(buttonHandle, MAW_BUTTON_TEXT, "My button");
char textBuffer[BUFFER_SIZE]; int result = maWidgetGetProperty(buttonHandle, MAW_BUTTON_TEXT, textBuffer, BUFFER_SIZE); if (result > 0) { // Do something with the label text. }
| #define MAW_BUTTON_TEXT_VERTICAL_ALIGNMENT "textVerticalAlignment" |
Sets the vertical alignment of the text inside the button. If the widget's height is WRAP_CONTENT this property has no effect.
maWidgetSetProperty(buttonHandle, MAW_BUTTON_TEXT_VERTICAL_ALIGNMENT, MAW_ALIGNMENT_CENTER);
| #define MAW_BUTTON_TEXT_HORIZONTAL_ALIGNMENT "textHorizontalAlignment" |
Sets the horizontal alignment of the text inside the button. If the widget's width is WRAP_CONTENT this property has no effect.
maWidgetSetProperty(buttonHandle, MAW_BUTTON_TEXT_HORIZONTAL_ALIGNMENT, MAW_ALIGNMENT_CENTER);
| #define MAW_BUTTON_FONT_COLOR "fontColor" |
Sets the font color of the button's text.
maWidgetSetProperty(buttonHandle, MAW_BUTTON_FONT_COLOR, "0xff0000");
| #define MAW_BUTTON_FONT_SIZE "fontSize" |
Sets the font size in points of the button's text.
maWidgetSetProperty(buttonHandle, MAW_BUTTON_FONT_SIZE, "13.0");
| #define MAW_BUTTON_FONT_HANDLE "fontHandle" |
Sets the typeface and style in which the text should be displayed.
int nrFonts = maFontGetCount(); char buf[256]; // Get first font name. maFontGetName(1, buf, 256); // Load that font for size 10. int fontHandle = maFontLoadWithName(buf, 10); // Set that font to the label. maWidgetSetProperty(buttonHandle, MAW_BUTTON_FONT_HANDLE, toString(fontHandle));