Shiny Language Reference
Language Reference > User Interface > Memo Boxes
creatememobox
int creatememobox(int ID, int X, int Y, int Width, int Height);
Creates a memobox box in the display panel
The CREATEMEMOBOX statement creates a user interface memo box in the plugin display panel. A memobox is more commonly known as a multi-line edit control. Memoboxes within Brass work exactly the same way as the Windows edit control in multi-line mode. They are designed to store an arbitrary amount of text, formatted into multiple lines in a scrolling window. The number of visible lines in a listbox is determined by the height of the font selected for use, however the only limit on the amount of text a memobox can store is the amount of free system memory available. Memoboxes respond to the arrow keys, home and end, page up and page down. Memoboxes also support range selection by holding down the shift key and moving the caret. Selected text can be copied using the standard Windows CTRL + C or CTRL + X copy and cut shortcuts. Text can be pasted into the control using CTRL + V. CTRL + A will select all the text in the memobox. Memoboxes also respond to scrolling with the mouse wheel.
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. This is analogous to the win32 HWND or HANDLE objects. Note that Brass controls are not Windows controls and can only be accessed via the appropriate Shiny language statements.
CREATEMEMOBOX is the only statement you must call to create a working memobox in the display panel. The remaining memo box 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 button A on top of larger editbox B, create editbox B before button A. This technique allows for controls-in-controls, for example to place a "Browse" button inside an edit box, where the edit box is used to select a folder.
Parameters
ID
Your preferred control ID for this control. 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 CREATEMEMOBOX 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 CREATEMEMOBOX 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
Height
The height in pixels of the control
Return Value
The actual control ID assigned to this control.
Example Code
// Create the memo box X: 10, Y:10 and sized 150*70
int iMemoBoxID = creatememobox(1, 10, 10, 150, 70);