Shiny Language Reference
Language Reference > User Interface > Memo Boxes
setmemoboxstyle
setmemoboxstyle(int ID, int Style, bool Border, int RGB1, int RGB2);
Sets the visual style of a memobox control
The SETMEMOBOXSTYLE statement sets the visual style of a memobox control previously created with creatememobox. 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.
Note the multiple uses of the RGB parameters, below.
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 memo boxes use the setmemoboxdrawfunc 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 memo boxes use the setmemoboxdrawfunc 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 list 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.
This colour is also used for the thumb face of the scrollbar.
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.
This colour is also used for the scrollbar scroll range (the area underneath the scroll thumb and between the scroll buttons).
Return Value
None
Example Code
// Create the memo box X: 10, Y:10 and sized 150*70
int iMemoBoxID = creatememobox(1, 10, 10, 150, 70);
// We'll set it to have a nice blue diagonal gradient
setmemoboxstyle(iMemoBoxID, CTRL_DGRAD, True, RGB(90, 147, 166), RGB(195, 224, 233));