Shiny Language Reference
Language Reference > User Interface > Static Text
createstatictext
int createstatictext(int ID, int X, int Y, int Width, int Height);
Synonyms:
int createtext(int ID, int X, int Y, int Width, int Height]);
Creates a static text control in the display panel
The CREATESTATICTEXT statement creates a user interface text control in the plugin display panel. Static text controls within Brass work exactly the same as static controls in Windows. Refer to the Static Text index for a detailed explanation on the difference between a static text control and using drawtext.
Every user interface element is assigned a "control ID". This ID uniquely references an individual control and is the method by which you access and manage the control.
CREATESTATICTEXT is the only statement you must call to create a working text control in the display panel. The remaining statements are provided for extra functionality and ease of use, however they are not mandatory.
Unlike Windows, Brass allows controls to be stacked on top of each other. Controls are ordered visually in the same order that they are created. Therefore to display smaller text control A on top of larger button B, create B before A.
Parameters
ID
Your preferred control ID for this button. You may specify any positive (greater than 0) integer for a control ID. If you specify a control ID that is already in use, the CREATESTATICTEXT statement will return a new, unique ID for this control. Therefore you should assume that any value supplied for this parameter is only a suggestion, and the return value is the absolute control ID. You may specify integer 1 for every call to this statement, which will cause CREATESTATICTEXT to return sequential control IDs for you, removing the need to store the last used control ID.
X
The X pixel position within the display panel of the top left of the control
Y
The Y pixel position within the display panel of the top left of the control
Width
The width in pixels of the control. All text is centered within the control.
Height
The height in pixels of the control. All text is vertically aligned to the top of the control. To use multiple lines, insert a line feed ("\n") into the caption text.
Return Value
The actual control ID assigned to this control.
Example Code
// Create a 150*40 control at 10, 10 and store its ID
int FirstTextID = createtext(1, 10, 10, 150, 40);