Shiny Language Reference
Language Reference > User Interface > Edit Boxes
seteditboxstyle
seteditboxstyle(int ID, int Style, bool Border, int RGB1, int RGB2);
Sets the visual style of an edit box control
The SETEDITBOXSTYLE statement sets the visual style of an edit control previously created with createeditbox. 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 control you wish to change the style of
Style
An integer representing the style of the control, as follows:
0A flat control with a solid colour of RGB1 1A custom drawn control, do not use this value. To create custom draw edit boxes use the seteditboxdrawfunc statement. 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. 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_CUSTOMA custom drawn control, do not use this value. To create custom draw edit boxes use the seteditboxdrawfunc statement. 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.
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. When the edit control has focus, the border changes to a 3d bevelled look.
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.
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.
Return Value
None
Example Code
// Create a 50x20 editbox at 10, 10 and store it's ID
int Id = createeditbox(1, 10, 10, 50, 20);
// Set the editbox to a horizontal, grey shaded edit box with border
setbuttonstyle(Id, 2, True, RGB(100, 100, 100), RGB(200, 200, 200));
// The same control style, using the definitions
setbuttonstyle(Id, CTRL_HGRAD, True, RGB(100, 100, 100), RGB(200, 200, 200));