Shiny Language Reference
Language Reference > User Interface > Static Text
setstatictextstyle
setstatictextstyle(int ID, int Style, bool Border, int RGB1, int RGB2);
Synonyms:
int settextstyle(int ID, int Style, bool Border, int RGB1, int RGB2);
Sets the visual style of a static text control
The SETSTATICTEXTSTYLE statement sets the visual style of a text control previously created with createstatictext. Note that using shaded, gradient controls is no slower during operation than using flat controls due to the way Brass manages visual elements of the display panel.
Parameters
ID
The control ID of the button you wish to change the style of
Style
An integer representing the style of the button, as follows:
0A flat control with a solid colour of RGB1 1Reserved. Do not use this value. 2A shaded control with a gradient moving horizontally from left to right. The left of the gradient begins with the colour specifed by RGB1, and ends at the right of the gradient with the colour specified by RGB2. 3A shaded control with a gradient moving vertically from top to bottom. The top of the gradient begins with the colour specifed by RGB1, and ends at the bottom of the gradient with the colour specified by RGB2. 4A shaded control with a gradient moving diagonally from top left to bottom right. The top left of the gradient begins with the colour specifed by RGB1, and ends at the bottom right of the gradient with the colour specified by RGB2. 5No background is used. The text is drawn directly into the display panel. You may also using the following names instead of the integer values. These values are defined internally in SSEdit:
CTRL_FLATA flat control with a solid colour of RGB1 CTRL_CUSTOMReserved. Do not use this value. CTRL_HGRADA shaded control with a gradient moving horizontally from left to right. The left of the gradient begins with the colour specifed by RGB1, and ends at the right of the gradient with the colour specified by RGB2. CTRL_VGRADA shaded control with a gradient moving vertically from top to bottom. The top of the gradient begins with the colour specifed by RGB1, and ends at the bottom of the gradient with the colour specified by RGB2. CTRL_DGRADA shaded control with a gradient moving diagonally from top left to bottom right. The top left of the gradient begins with the colour specifed by RGB1, and ends at the bottom right of the gradient with the colour specified by RGB2. CTRL_EMPTYNo background is used. The text is drawn directly into the display panel.
Border
True if the control should have a border, otherwise False. A border is drawn as a single line, dark grey pixel around the edge of the control.
RGB1
An integer representing a packed RGB colour value (refer to the RGB statement). If the control style is flat, this colour is used for the background. If the control style is shaded this colour is used for the start of the gradient. If the control style is empty, this parameter is ignored.
RGB2
An integer representing a packed RGB colour value (refer to the RGB statement). If the control style is flat, this parameter is ignored. If the control style is shaded this colour is used for the end of the gradient. If the control style is empty, this parameter is ignored.
Return Value
None
Example Code
// Create a 150*40 control at 10, 10 and store its ID
int FirstTextID = createstatictext(1, 10, 10, 150, 40);
// Set the text to have a horizontal, grey shaded background with border
setstatictextstyle(FirstTextID, CTRL_HGRAD, True, RGB(100, 100, 100), RGB(200, 200, 200));
// Change it to have no background and no border
setstatictextstyle(FirstTextID, CTRL_EMPTY, False, 0, 0);