µC/GUI Widgets
You are here : Micrium
: Products : µC/GUI :
Widgets
Widgets are windows with object type properties; they are called controls in the windows world and make up the elements of the user interface. They can react automatically to certain events; for example, a button can appear in a different state if it is pressed. Widgets need to be created, have properties which may be changed at any time during their existence and are then typically deleted when they are no longer needed. Just like a window, a widget is referenced by a handle which is returned by its create function.
Widgets require the window manager. Once a widget is created, it is treated just like any other window; the WM ensures that it is properly displayed (and redrawn) when ever necessary. Widgets are not required when writing an application or a user interface, but they can make programming much easier
Some basics
Available widgets
The following widgets are currently available:
| Name |
Description |
| BUTTON |
Button which can be pressed. Text or bitmaps may be displayed on a button. |
| CHECKBOX |
Check box which may be checked or unchecked. |
| DROPDOWN |
Dropdown listbox, opens a listbox when pressed |
| EDIT |
Single-line edit field which prompts the user to type a number or text. |
| FRAMEWIN |
Frame window. Creates the typical GUI look. |
| GRAPH |
Graph widgets can be used to visualize data. |
| HEADER |
Header control, used to manage columns |
| LISTBOX |
Listbox which highlights items as they are selected by the user. |
| LISTVIEW |
Listview widgets are used to creates tables. |
| MENU |
Menu widget can be used to create several kinds of menus. |
| MESSAGEBOX |
A MESSAGEBOX widget is used to show a message in a frame window with a title ba and an "OK" button. |
| MULTIEDIT |
MULTIEDIT widget enables you to edit text with multiple lines. |
| MULTIPAGE |
By using a MULTIPAGE widget, an application can define multiple pages for the same area of a window or dialog box. |
| PROGBAR |
Progress bar used for visualization. |
| RADIOBUTTON |
Radio button which may be selected. Only one button may be selected at a time. |
| SCROLLBAR |
Scrollbar which may be horizontal or vertical. |
| SLIDER |
Slider bar used for changing values. |
| TEXT |
Static text controls typically used in dialogs. |
Understanding the redrawing mechanism
A widget draws itself according to its properties. This is done when WM_ExecIdle() is called. If you do not call WM_ExecIdle() from within your program, WM_Paint() must be called for the widget. In a multitasking environment, a background task is normally used to call WM_ExecIdle() and update the widgets (and all other windows with callback functions). It is then not necessary to manually call WM_Paint(); however, it is still legal to do so and may also make sense if you want to ensure that the widget is redrawn immediately.
When a property of a widget is changed, the window of the widget (or part of it) is marked as invalid, but it is not immediately redrawn. Therefore, the section of code executes very fast. The redrawal is done by the WM at a later time or it can be forced by calling WM_Paint() for the widget (or WM_ExecIdle() until all windows are redrawn).
How to use widgets
Suppose we would like to display a progress bar. All that is needed is the following code:
PROGBAR_Handle hProgBar;
GUI_DispStringAt("Progress bar", 100, 20);
hProgBar = PROGBAR_Create(100, 40, 100, 20, WM_CF_SHOW); |
 |
The first line reserves memory for the handle of the widget. The last line actually creates the widget. The widget will then automatically be drawn by the window manager if WM_ExecIdle() is called at a later point or in a separate task.
Member functions are available for each type of widget which allow modifications to their appearance. Once the widget has been created, its properties can be changed by calling one of its member functions. These functions take the handle of the widget as their first argument.In order to make the progress bar show 45% and to change the colors from their defaults to green/red for the bar, the following code section may be used:
PROGBAR_SetBarColor(hProgBar, 0, GUI_GREEN);
PROGBAR_SetBarColor(hProgBar, 1, GUI_RED);
PROGBAR_SetValue(hProgBar, 45);
|
 |
Dynamic memory usage for widgets
In embedded applications it is usually not very desirable to use dynamic memory at all because of fragmentation effects. There are a number of different strategies that can be used to avoid this, but they all work in a limited way whenever memory areas are referenced by a pointer in the application program. For this reason, µC/GUI uses a different approach: all objects (and all data stored at runtime) are stored in memory areas referenced by a handle. This makes it possible to relocate the allocated memory areas at runtime, thus avoiding the long term allocation problems which occur when using pointers. All widgets are thus referenced by handles.
3D support
Many widgets may be displayed with or without 3D effects. 3D support is enabled by default, but may be disabled by setting the configuration macro (WIDGET)_USE_3D to 0. A widget will function exactly the same way whether it uses three dimensional effects or not; the only difference will be in its appearance. This is demonstrated below with a slider widget:
| 3D effects enabled (default) |
3D effects disabled |
|
|
API reference: widgets (general)
Since widgets are essentially windows, they are compatible with any of the window manager API functions. The handle of the widget is used as the hWin parameter and the widget is treated like any other window. The WM functions most commonly used with widgets are listed as follows:
| Function |
Description |
| WM_DeleteWindow |
Delete a window. |
| WM_DisableMemdev |
Disable usage of memory devices for redrawing. |
| WM_EnableMemdev |
Enable usage of memory devices for redrawing. |
| WM_InvalidateWindow |
Invalidate a window. |
| WM_Paint |
Draw or redraw a window immediately. |
API reference: functions common to all widgets
The table below lists available widget-related functions in alphabetical order. These functions are common to all widgets, and are listed here in order to avoid repetition. Descriptions of the functions follow. The additional member functions available for each widget may be found in later sections.
| Function |
Description |
| <WIDGET>_CreateIndirect |
Used for automatic creation in dialog boxes. |
| WM_EnableWindow |
Set the widget state to enabled (default). |
| WM_DisableWindow |
Set the widget state to disabled. |
BUTTON: Button widget
Button widgets are commonly used as the primary user interface element for touch- screens. Buttons may be displayed with text, as shown below, or with a bitmap.
All BUTTON-related functions are located in the file(s) BUTTON*.c, BUTTON.h. All identifiers are prefixed BUTTON.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
BUTTON_3D_MOVE_X |
1 |
Number of pixels that text/bitmap moves in horizontal direction in pressed state. |
| N |
BUTTON_3D_MOVE_Y |
1 |
Number of pixels that text/bitmap moves in vertical direction in pressed state. |
| N |
BUTTON_BKCOLOR0_DEFAULT |
0xAAAAAA |
Background color, unpressed state. |
| N |
BUTTON_BKCOLOR1_DEFAULT |
GUI_WHITE |
Background color, pressed state. |
| S |
BUTTON_FONT_DEFAULT |
&GUI_Font13_1 |
Font used for button text. |
| N |
BUTTON_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color, unpressed state. |
| N |
BUTTON_TEXTCOLOR1_DEFAULT |
GUI_BLACK |
Text color, pressed state. |
| B |
BUTTON_USE_3D |
1 |
Enable support for 3D effects. |
The default for the button is to use a white background in pressed state. This has been done purposely because it makes it very obvious that the button is pressed, on any kind of display. If you want the background color of the button to be the same in both its pressed and unpressed states, change BUTTON_BKCOLOR1_DEFAULT to BUTTON_BKCOLOR0_DEFAULT.
API reference
The table below lists the available µC/GUI BUTTON-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| BUTTON_Create |
Create the button. |
| BUTTON_CreateAsChild |
Create the button as a child window. |
| BUTTON_CreateIndirect |
Create the button from resource table entry. |
| BUTTON_SetBitmap |
Set the bitmap used when displaying the button. |
| BUTTON_SetBitmapEx |
Set the bitmap used when displaying the button. |
| BUTTON_SetBkColor |
Set the background color of the button. |
| BUTTON_SetFont |
Select the font for the text. |
| BUTTON_SetState |
Set the button state (handled automatically by touch module). |
| BUTTON_SetStreamedBitmap |
Set the bitmap used when displaying the button. |
| BUTTON_SetText |
Set the text. |
| BUTTON_SetTextColor |
Set the color(s) for the text. |
CHECKBOX: Check box widget
One of the most familiar widgets for selecting various choices is the check box. A check box may be checked or unchecked by the user, and any number of boxes may be checked at one time. A box will appear gray if it is disabled, as seen in the table below where each of the four possible check box appearances are illustrated:
| |
Checked |
Unchecked |
| Enabled |
|
|
| Disabled |
|
|
All CHECKBOX-related functions are located in the file(s) CHECKBOX*.c, CHECKBOX.h. All identifiers are prefixed CHECKBOX.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
CHECKBOX_BKCOLOR0_DEFAULT |
0x808080 |
Background color, disabled state. |
| N |
CHECKBOX_BKCOLOR1_DEFAULT |
GUI_WHITE |
Background color, enabled state. |
| N |
CHECKBOX_FGCOLOR0_DEFAULT |
0x101010 |
Foreground color, disabled state. |
| N |
CHECKBOX_FGCOLOR1_DEFAULT |
GUI_BLACK |
Foreground color, enabled state. |
| S |
CHECKBOX_FONT_DEFAULT |
&GUI_Font13_1 |
Font used for check mark. |
| B |
CHECKBOX_USE_3D |
1 |
Enable support for 3D effects. |
CHECKBOX API reference
The table below lists the available µC/GUI CHECKBOX-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| CHECKBOX_Check |
Set the check box state to checked. |
| CHECKBOX_Create |
Create the check box. |
| CHECKBOX_CreateIndirect |
Create the check box from resource table entry. |
| CHECKBOX_IsChecked |
Return the current state (checked or not checked) of the check box. |
| CHECKBOX_Uncheck |
Set the check box state to unchecked (default). |
DROPDOWN: Dropdown widget
DROPDOWN widgets are used to select one element of a list with several columns. It
shows the currently selected item in non open state. If the user opens a DROPDOWN widget
a LISTBOX appears to select a new item.
| Dropdown closed |
Dropdown opened |
|
|
Configuration options
| Type |
Macro |
Default |
Description |
| N |
DROPDOWN_ALIGN_DEFAULT |
GUI_TA_LEFT |
Text alignment used to display dropdown
text in closed state. |
| S |
DROPDOWN_FONT_DEFAULT |
&GUI_Font13_1 |
Default font |
| N |
DROPDOWN_BKCOLOR0_DEFAULT |
GUI_WHITE |
Background color, unselected state. |
| N |
DROPDOWN_BKCOLOR1_DEFAULT |
GUI_GRAY |
Background color, selected state without
focus. |
| N |
DROPDOWN_BKCOLOR2_DEFAULT |
GUI_BLUE |
Background color, selected state with focus. |
| N |
DROPDOWN_KEY_EXPAND |
GUI_KEY_SPACE |
Key which can be used to expand the
dropdown list. |
| N |
DROPDOWN_KEY_SELECT |
GUI_KEY_ENTER |
Key which can be used to select an item
from the open dropdown list. |
| N |
DROPDOWN_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color, unselected state. |
| N |
DROPDOWN_TEXTCOLOR1_DEFAULT |
GUI_BLACK |
Text color, selected state without focus. |
| N |
DROPDOWN_TEXTCOLOR2_DEFAULT |
GUI_WHITE |
Enable 3D support. |
DROPDOWN API reference
The table below lists the available µC/GUI DROPDOWN-related functions in alphabetical order. Descriptions of the functions follo
| Function |
Description |
| DROPDOWN_AddString |
Adds an element to the DROPDOWN list. |
| DROPDOWN_Collapse |
Closes the dropdown list. |
| DROPDOWN_Create |
Creates a DROPDOWN widget. (Obsolete) |
| DROPDOWN_CreateEx |
Creates a DROPDOWN widget. |
| DROPDOWN_CreateIndirect |
Creates a DROPDOWN widget from a resource table entry. |
| DROPDOWN_DecSel |
Decrements selection. |
| DROPROWN_DeleteItem |
Deletes an item of the DROPDOWN list. |
| DROPDOWN_Expand |
Opens the dropdown list. |
| DROPDOWN_GetDefaultFont |
Returns the default font used to create DROPDOWN widgets. |
| DROPDOWN_GetNumItems |
Returns the number of items in the dropdown list. |
| DROPDOWN_GetSel |
Returns the number of the currently selected element. |
| DROPDOWN_IncSel |
Increments selection. |
| DROPDOWN_InsertString |
Inserts a string to the dropdown list. |
| DROPDOWN_SetAutoScroll |
Enables the automatic use of a scrollbar in the dropdown list. |
| DROPDOWN_SetBkColor |
Sets the background color. |
| DROPDOWN_SetColor |
Sets the color of the arrow and the button of the widget. |
| DROPDOWN_SetDefaultColor |
Sets the default color of the arrow and the button for new DROPDOWN widgets. |
| DROPDOWN_SetDefaultFont |
Sets the default font used to create DROPDOWN widgets. |
| DROPDOWN_SetDefaultScrollbarColor |
Sets the default colors of the optional scrollbar in the dropdown list. |
| DROPDOWN_SetFont |
Sets the font of the given DROPDOWN widget. |
| DROPDOWN_SetItemSpacing |
Sets an additional spacing between the items of the dropdown list. |
| DROPDOWN_SetScrollbarColor |
Sets the colors of the scrollbar in the dropdown list. |
| DROPDOWN_SetSel |
Sets the current selection. |
| DROPDOWN_SetTextAlign |
Sets the text alignment used to display the dropdown text in closed state. |
| DROPDOWN_SetTextColor |
Sets the text color of the given DROPDOWN widget. |
| DROPDOWN_SetTextHeight |
Sets the height of the rectangle used to display the dropdown text in closed state. |
EDIT: Edit widget
Edit fields are commonly used as the primary user interface for text input:
| Blank edit field |
Edit field with user input |
|
|
You can also use edit fields for entering values in binary, decimal, or hexadecimal modes. A decimal-mode edit field might appear similar to those in the following table. Like a check box, an edit field will appear gray if disabled:
| Edit field with user input (decimal) |
Disabled edit field |
|
|
Configuration options
| Type |
Macro |
Default |
Description |
| S |
EDIT_ALIGN_DEFAULT |
GUI_TA_RIGHT|
GUI_TA_VCENTER |
Alignment for edit field text. |
| N |
EDIT_BKCOLOR0_DEFAULT |
0xc0c0c0 |
Background color, disabled state. |
| N |
EDIT_BKCOLOR1_DEFAULT |
GUI_WHITE |
Background color, enabled state. |
| N |
EDIT_BORDER_DEFAULT |
1 |
Width of border, in pixels. |
| S |
EDIT_FONT_DEFAULT |
&GUI_Font13_1 |
Font used for edit field text. |
| N |
EDIT_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color, disabled state. |
| N |
EDIT_TEXTCOLOR1_DEFAULT |
GUI_BLACK |
Text color, enabled state. |
| N |
EDIT_XOFF |
2 |
Distance in X to offset text from left border
of edit field. |
Available alignment flags are:
GUI_TA_LEFT, GUI_TA_RIGHT, GUI_TA_HCENTER for horizontal alignment.
GUI_TA_TOP, GUI_TA_BOTTOM, GUI_TA_VCENTER for vertical alignment.
EDIT API reference
The table below lists the available µC/GUI EDIT-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| EDIT_AddKey |
Key input function. |
| EDIT_Create |
Create the edit field. |
| EDIT_CreateIndirect |
Create the edit field from resource table entry. |
| EDIT_GetDefaultFont |
Returns the default font |
| EDIT_GetText |
Get user input. |
| EDIT_GetValue |
Returns the current value |
| EDIT_SetBinMode |
Enables the binary edit mode |
| EDIT_SetBkColor |
Set the background color of the edit field. |
| EDIT_SetDecMode |
Enables the decimal edit mode |
| EDIT_SetDefaultFont |
Sets the default font used for edit fields. |
| EDIT_SetDefaultTextAlign |
Sets the default text alignment for edit fields. |
| EDIT_SetFont |
Select the font for the text. |
| EDIT_SetHexMode |
Enables the hexadecimal edit mode |
| EDIT_SetMaxLen |
Sets the maximum number of characters of the edit field. |
| EDIT_SetText |
Set the text. |
| EDIT_SetTextAlign |
Sets the text alignment for the edit field. |
| EDIT_SetTextColor |
Set the color(s) for the text. |
| EDIT_SetValue |
Sets the current value |
| GUI_EditBin |
Edits a binary value at the current cursor position |
| GUI_EditDec |
Edits a decimal value at the current cursor position |
| GUI_EditHex |
Edits a hexadecimal value at the current cursor position |
| GUI_EditString |
Edits a string at the current cursor position |
FRAMEWIN: Frame window widget
Frame windows give your application a PC application-window appearance. They consist of a surrounding frame, a title bar and a user area. The color of the title bar changes to show whether the window is active or inactive, as seen below:
| Active frame window |
Inactive frame window |
|
|
All FRAMEWIN-related functions are located in the file(s) FRAMEWIN*.c, FRAMEWIN.h. All identifiers are prefixed FRAMEWIN.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT |
0xff0000 |
Title bar color, active state. |
| N |
FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT |
0x404040 |
Title bar color, inactive state. |
| N |
FRAMEWIN_BORDER_DEFAULT |
3 |
Outer border width, in pixels. |
| N |
FRAMEWIN_CLIENTCOLOR_DEFAULT |
0xc0c0c0 |
Color of client window area. |
| S |
FRAMEWIN_DEFAULT_FONT |
&GUI_Font8_1 |
Font used for title bar text. |
| N |
FRAMEWIN_FRAMECOLOR_DEFAULT |
0xaaaaaa |
Frame color. |
| N |
FRAMEWIN_IBORDER_DEFAULT |
1 |
Inner border width, in pixels. |
| B |
FRAMEWIN_USE_3D |
1 |
Enable support for 3D effects. |
FRAMEWIN API reference
The table below lists the available µC/GUI EDIT-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| FRAMEWIN_Create |
Creates the frame window. |
| FRAMEWIN_CreateAsChild |
Create the frame window as a child window. |
| FRAMEWIN_CreateIndirect |
Create the frame window from resource table entry. |
| FRAMEWIN_GetDefaultBorderSize |
Returns the default border size |
| FRAMEWIN_GetDefaultCaptionSize |
Returns the default size of the title bar |
| FRAMEWIN_GetDefaultFont |
Returns the default font used for the title bar |
| FRAMEWIN_SetActive |
Sets the state of the frame window |
| FRAMEWIN_SetBarColor |
Sets the background color of the title bar. |
| FRAMEWIN_SetClientColor |
Sets the background color of the title bar. |
| FRAMEWIN_SetDefaultBarColor |
Sets the default color of the title bar |
| FRAMEWIN_SetDefaultBorderSize |
Sets the default border size |
| FRAMEWIN_SetDefaultCaptionSize |
Sets the default height of the title bar |
| FRAMEWIN_SetDefaultFont |
Sets the default font of the title bar. |
| FRAMEWIN_SetFont |
Selects the font for the title text. |
| FRAMEWIN_SetText |
Sets the title text. |
| FRAMEWIN_SetTextAlign |
Sets the alignment of the title text. |
| FRAMEWIN_SetTextColor |
Sets the color(s) for the title text. |
| FRAMEWIN_SetTextPos |
Sets the position of the title text. |
GRAPH: Graph widget
Graph widgets can be used to visualize data. Typical applications for graph widgets are showing measurement values or the curve of a function graph. Multiple curves can be shown simultaneously. Horizontal and vertical scales can be used to label the curves. A grid with different horizontal and vertical spacing can be shown on the background. If the data array does not fit into the visible area of the graph, the widget can automatically show scrollbars which allow scrolling through large data arrays.
Structure of the graph widget
A graph widget consists of different kinds objects:
- The graph widget itself to which data objects and scale objects can be attached.
- Optionally one or more data objects.
- Optionally one or more scale objects.
The following diagram shows the detailed structure of a graph widget:

| Detail |
Description |
| Border |
The optional border is part of the graph widget. |
| Frame |
A thin line around the data area, part of the graph widget. |
| Grid |
Shown in the background of the data area, part of the graph widget. |
| Data area |
Area, in which grid and data objects are shown. |
| Data object(s) |
For each curve one data object should be added to the graph widget. |
| Application defined graphic |
An application defined callback function can be used to draw any application defined text and/or graphics. |
Supported curve types
The requirements for showing a curve with continuously updated measurement values can be different to the requirements when showing a function graph with X/Y coordinates. For that reason the widget currently supports 2 kinds of data objects, which are shown in the table below:
| GRAPH_DATA_XY |
GRAPH_DATA_YT |
|
|
GRAPH_DATA_XY
This data object is used to show curves which consist of an array of points. The object data is drawn as a polyline. A typical application for using this data object is drawing a function graph.
GRAPH_DATA_YT
This data object is used to show curves with one Y-value for each X-position on the graph. A typical application for using this data object is showing a curve with with continuously updated measurement values.;
Configuration options
| Type |
Macro |
Default |
Description |
| N |
GRAPH_BKCOLOR_DEFAULT |
GUI_BLACK |
Default background color of the data area. |
| N |
GRAPH_BORDERCOLOR_DEFAULT |
0xC0C0C0 |
Default background color of the border. |
| N |
GRAPH_FRAMECOLOR_DEFAULT |
&GUI_WHITE |
Default color of the thin frame line. |
| N |
GRAPH_GRIDCOLOR_DEFAULT |
GUI_DARKGRAY |
Default color used to draw the grid. |
| N |
GRAPH_GRIDSPACING_X_DEFAULT |
50 |
Default horizontal spacing of the grid. |
| N |
GRAPH_GRIDSPACING_Y_DEFAULT |
50 |
Default vertical spacing of the grid. |
| N |
GRAPH_BORDER_L_DEFAULT |
0 |
Default size of the left border. |
| N |
GRAPH_BORDER_T_DEFAULT |
0 |
Default size of the top border. |
| N |
GRAPH_BORDER_R_DEFAULT |
0 |
Default size of the right border. |
| N |
GRAPH_BORDER_B_DEFAULT |
0 |
Default size of the bottom border. |
The table below lists the available µC/GUI GRAPH-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
Common functions |
| GRAPH_AttachData |
Attaches a data object to an existing graph widget. |
| GRAPH_AttachScale |
Attaches a scale object to an existing graph widget. |
| GRAPH_CreateEx |
Creates a graph widget. |
| GRAPH_SetBorder |
Sets the size (right, left, top and bottom) of the border. |
| GRAPH_SetColor |
Sets the color of the graph widget. |
| GRAPH_SetGridDistX |
Sets the horizontal grid spacing. |
| GRAPH_SetGridDistY |
Sets the vertical grid spacing. |
| GRAPH_SetGridFixedX |
Fixes the grid in X-axis. |
| GRAPH_SetGridVis |
Enables the drawing of a grid. |
| GRAPH_SetLineStyleH |
Sets the line style for the horizontal grid lines. |
| GRAPH_SetLineStyleV |
Sets the line style for the vertical grid lines. |
| GRAPH_SetVSizeX |
Sets the horizontal range of the graph widget. |
| GRAPH_SetVSizeY |
Sets the vertical range of the graph widget. |
| GRAPH_SetUserDraw |
Sets the user callback function. |
GRAPH_DATA_YT related functions |
| GRAPH_DATA_YT_AddValue |
Adds one data item to the data object. |
| GRAPH_DATA_YT_Create |
Creates a GRAPH_DATA_YT object. |
| GRAPH_DATA_YT_SetOffY |
Sets a vertical offset for drawing the data. |
GRAPH_DATA_XY related functions |
| GRAPH_DATA_XY_AddPoint |
Adds one point to the data object. |
| GRAPH_DATA_XY_Create |
Creates a GRAPH_DATA_XY object. |
| GRAPH_DATA_XY_SetOffX |
Sets a horizontal offset for drawing the data. |
| GRAPH_DATA_XY_SetOffY |
Sets a vertical offset for drawing the data. |
| GRAPH_DATA_XY_SetPenSize |
Sets the pen size used to draw the data. |
Scale related functions |
| GRAPH_SCALE_Create |
Creates a scale object. |
| GRAPH_SCALE_SetFactor |
Sets a calculation factor used to calculate from pixels to the desired unit. |
| GRAPH_SCALE_SetFixed |
Avoids scrolling of the scale. |
| GRAPH_SCALE_SetFont |
Sets the font used to draw the numbers. |
| GRAPH_SCALE_SetNumDecs |
Sets the number of digits of the fractional portion. |
| GRAPH_SCALE_SetOff |
Sets an optional offset which is added to the numbers. |
| GRAPH_SCALE_SetPos |
Sets the horizontal or vertical position of the scale. |
| GRAPH_SCALE_SetTextColor |
Sets the text color of the scale. |
| GRAPH_SCALE_SetTickDist |
Sets the distance in pixels between the tick marks. |
HEADER: Header widget
HEADER widgets are used to label columns of a table.
When working with a touch screen or with mouse-support you can also manage the column width of a table. If you move the cursor nearby a divider the cursor will change:
There are 2 predefined cursors as shown below:
| GUI_CursorHeaderM (default) |
GUI_CursorHeaderMI |
|
|
You can also create and use your own cursors when using a HEADER widget.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
HEADER_BKCOLOR_DEFAULT |
0xAAAAAA |
Default value of background color |
| S |
HEADER_CURSOR_DEFAULT |
GUI_CursorHeaderM |
Default cursor |
| S |
HEADER_FONT_DEFAULT |
&GUI_Font13_1 |
Default font |
| N |
HEADER_BORDER_H_DEFAULT |
2 |
Horizontal space between text and border |
| N |
HEADER_BORDER_V_DEFAULT |
0 |
Vertical space between text and border |
| B |
HEADER_SUPPORT_DRAG |
1 |
Enable/disable dragging support |
| N |
HEADER_TEXTCOLOR_DEFAULT |
GUI_BLACK |
Default value of text color |
HEADER API reference
| Function |
Description |
| HEADER_AddItem |
Adds one item at the right side |
| HEADER_Create |
Creates a HEADER widget. (Obsolete) |
| HEADER_CreateAttached |
Creates a HEADER widget attached to a window |
| HEADER_CreateEx |
Creates a HEADER widget. |
| HEADER_CreateIndirect |
Creates a HEADER widget from a resource table entry |
| HEADER_GetDefaultBkColor |
Returns the default background color |
| HEADER_GetDefaultBorderH |
Returns the value of the horizontal spacing. |
| HEADER_GetDefaultBorderV |
Returns the value of the vertical spacing. |
| HEADER_GetDefaultCursor |
Returns the a pointer to the default cursor. |
| HEADER_GetDefaultFont |
Returns a pointer to the default font. |
| HEADER_GetDefaultTextColor |
Returns the default text color. |
| HEADER_GetHeight |
Returns the height of the widget. |
| HEADER_GetItemWidth |
Returns the item width. |
| HEADER_GetNumItems |
Returns the number of items. |
| HEADER_SetBitmap |
Sets the bitmap used when displaying the given item. |
| HEADER_SetBitmapEx |
Sets the bitmap used when displaying the given item. |
| HEADER_SetBkColor |
Sets the background color of the widget. |
| HEADER_SetBMP |
Sets the bitmap used when displaying the given item. |
| HEADER_SetBMPEx |
Sets the bitmap used when displaying the given item. |
| HEADER_SetDefaultBkColor |
Sets the default background color. |
| HEADER_SetDefaultBorderH |
Sets the default value for the horizontal spacing. |
| HEADER_SetDefaultBorderV |
Sets the default value for the vertical spacing. |
| HEADER_SetDefaultCursor |
Sets the default cursor. |
| HEADER_SetDefaultFont |
Sets the default font. |
| HEADER_SetDefaultTextColor |
Sets the default text color. |
| HEADER_SetFont |
Sets the font of the widget. |
| HEADER_SetHeight |
Sets the height of the widget. |
| HEADER_SetTextAlign |
Sets the alignment of the given item. |
| HEADER_SetItemText |
Sets the text of a given item. |
| HEADER_SetItemWidth |
Sets the width of a given item. |
| HEADER_SetStreamedBitmap |
Sets the bitmap used when displaying the given item. |
| HEADER_SetStreamedBitmapEx |
Sets the bitmap used when displaying the given item. |
| HEADER_SetTextColor() |
Sets the Text color of the widget. |
LISTBOX: List box widget
List boxes are used to select one element of a list. A list box can be created without a surrounding frame window, as shown below, or as a child window of a FRAMEWIN widget (see the additional screen shots at the end of the section). As items in a list box are selected, they appear highlighted. Note that the background color of a selected item depends on whether the list box window has input focus.
| List box with focus |
List box without focus |
|
|
All LISTBOX-related functions are in the file(s) LISTBOX*.c, LISTBOX.h. All identifiers are prefixed LISTBOX.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
LISTBOX_BKCOLOR0_DEFAULT |
GUI_WHITE |
Background color, unselected state. |
| N |
LISTBOX_BKCOLOR1_DEFAULT |
GUI_GRAY |
Background color, selected state without focus. |
| N |
LISTBOX_BKCOLOR2_DEFAULT |
GUI_WHITE |
Background color, selected state with focus. |
| S |
LISTBOX_FONT_DEFAULT |
&GUI_Font13_1 |
Font used. |
| N |
LISTBOX_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color, unselected state. |
| N |
LISTBOX_TEXTCOLOR1_DEFAULT |
GUI_BLACK |
Text color, selected state without focus. |
| N |
LISTBOX_TEXTCOLOR2_DEFAULT |
GUI_BLACK |
Text color, selected state with focus. |
| B |
LISTBOX_USE_3D |
1 |
Enable support for 3D effects. |
LISTBOX API reference
The table below lists the available µC/GUI LISTBOX-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| LISTBOX_Create |
Create the list box. |
| LISTBOX_CreateAsChild |
Create the list box as a child window. |
| LISTBOX_CreateIndirect |
Create the list box from resource table entry. |
| LISTBOX_DecSel |
Decrement selection. |
| LISTBOX_GetDefaultFont |
Return the default font for LISTBOX widgets. |
| LISTBOX_GetSel |
Return the number of the selected row. |
| LISTBOX_IncSel |
Increment selection. |
| LISTBOX_SetBackColor |
Set the background color. |
| LISTBOX_SetDefaultFont |
Change the default font for LISTBOX widgets. |
| LISTBOX_SetFont |
Select the font. |
| LISTBOX_SetSel |
Set the selected row. |
| LISTBOX_SetTextColor |
Set the foreground color. |
LISTVIEW: Listview widget
LISTVIEW widgets are used to select one element of a list with several columns. To manage the columns a LISTWIEW widget contains a HEADER widget. A LISTVIEW can be created without a surrounding frame window or as a child window of a FRAMEWIN widget. As items in a listview are selected, they appear highlighted. Note that the background color of a selected item depends on whether the LISTVIEW window has input focus. The table below shows the appearance of the LISTVIEW widget:
| Description |
Listview widget |
No focus
No surrounding FRAMEWIN
No SCROLLBAR attached
Grid lines not visible |
|
Has input focus
No surrounding FRAMEWIN
No SCROLLBAR attached
Grid lines not visible |
|
Has input focus
With surrounding FRAMEWIN
No SCROLLBAR attached
Grid lines not visible |
|
Has input focus
With surrounding FRAMEWIN
SCROLLBAR attached
Grid lines not visible |
|
Has input focus
With surrounding FRAMEWIN
SCROLLBAR attached
Grid lines visible |
|
Configuration options
| Type |
Macro |
Default |
Description |
| S |
LISTVIEW_FONT_DEFAULT |
&GUI_Font13_1 |
Default font |
| N |
LISTVIEW_BKCOLOR0_DEFAULT |
GUI_WHITE |
Background color, unselected state. |
| N |
LISTVIEW_BKCOLOR1_DEFAULT |
GUI_GRAY |
Background color, selected state without
focus. |
| N |
LISTVIEW_BKCOLOR2_DEFAULT |
GUI_BLUE |
Background color, selected state with
focus |
| N |
LISTVIEW_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color, unselected state. |
| N |
LISTVIEW_TEXTCOLOR1_DEFAULT |
GUI_WHITE |
Text color, selected state without focus. |
| N |
LISTVIEW_TEXTCOLOR2_DEFAULT |
GUI_WHITE |
Text color, selected state with focus. |
| N |
LISTVIEW_GRIDCOLOR_DEFAULT |
GUI_LIGHTGRAY |
Color of grid lines (if shown) |
| N |
LISTVIEW_ALIGN_DEFAULT |
GUI_TA_VCENTER |GUI_TA_HCENTER |
Default text alignment |
LISTVIEW API reference
The table below lists the available µC/GUI LISTVIEW-related functions in alphabetical order.
| Function |
Description |
| LISTVIEW_AddColumn |
Adds a column to a LISTVIEW. |
| LISTVIEW_AddRow |
Adds a row to a LISTVIEW. |
| LISTVIEW_Create |
Creates a LISTVIEW widget. (Obsolete) |
| LISTVIEW_CreateAttached |
Creates a LISTVIEW widget attached to a window. |
| LISTVIEW_CreateEx |
Creates a LISTVIEW widget. |
| LISTVIEW_CreateIndirect |
Creates a LISTVIEW widget from a resource table entry. |
| LISTVIEW_DecSel |
Decrements selection. |
| LISTVIEW_DeleteColumn |
Deletes the given column. |
| LISTVIEW_DeleteRow |
Deletes the given row. |
| LISTVIEW_DisableRow |
Sets the state of the given row to disabled. |
| LISTVIEW_EnableRow |
Sets the state of the given row to enabled. |
| LISTVIEW_GetBkColor |
Returns the background color of the LISTVIEW. |
| LISTVIEW_GetFont |
Returns the font of the LISTVIEW. |
| LISTVIEW_GetHeader |
Returns the handle of the attached HEADER widget. |
| LISTVIEW_GetItemText |
Returns the text of the given cell. |
| LISTVIEW_GetNumColumns |
Returns the number of columns. |
| LISTVIEW_GetNumRows |
Returns the number of rows. |
| LISTVIEW_GetSel |
Returns the number of the selected item. |
| LISTVIEW_GetTextColor |
Returns the text color of the LISTVIEW. |
| LISTVIEW_IncSel |
Increments selection. |
| LISTVIEW_SetBkColor |
Sets the background color. |
| LISTVIEW_SetColumnWidth |
Sets the column width. |
| LISTVIEW_SetDefaultBkColor |
Sets the default background color for HEADER widgets. |
| LISTVIEW_SetDefaultFont |
Sets the default font for HEADER widgets. |
| LISTVIEW_SetDefaultGridColor |
Sets the default text color for HEADER widgets. |
| LISTVIEW_SetDefaultTextColor |
Sets the default color of the grid lines for HEADER widgets. |
| LISTVIEW_SetFixed() |
Fixes the given number of columns. |
| LISTVIEW_SetFont |
Sets the font of the LISTVIEW. |
| LISTVIEW_SetGridVis |
Sets the visibility flag of the grid lines. |
| LISTVIEW_SetItemBkColor |
Sets the background color of a LISTVIEW cell |
| LISTVIEW_SetItemText |
Sets the text of a LISTVIEW cell. |
| LISTVIEW_SetItemTextColor |
Sets the text color of a LISTVIEW cell |
| LISTVIEW_SetLBorder |
Sets the number of pixels used for the left border. |
| LISTVIEW_SetRBorder |
Sets the number of pixels used for the right border. |
| LISTVIEW_SetRowHeight |
Sets the row height of the LISTVIEW |
| LISTVIEW_SetSel |
Sets the current selection. |
| LISTVIEW_SetTextAlign |
Sets the text alignment of a column. |
| LISTVIEW_SetTextColor |
Sets the text color. |
MENU: Menu widget
The MENU widget can be used to create several kinds of menus. Each menu item represents an application command or a submenu. MENUs can be shown horizontally and/or vertically. Menu items can be grouped using separators. Separators are supported for horizontal and vertical menus. Selecting a menu item sends a WM_MENU message to the owner of the menu or opens a submenu.
The µC/GUI shipment contains an application sample which shows how to use the MENU widget.
The table below shows the appearance of a horizontal MENU widget with a vertical submenu. It shows the appearance of the menu widget using its default effect WIDGET_Effect_3D1L and using WIDGET_Effect_Simple. It also works with all other effects.
| Description |
Menu using WIDGET_Effect_3D1L |
Menu using WIDGET_Effect_Simple |
Color display
(8666 mode) |
|
|
Monochrome display
(16 gray scales) |
|
|
| Black/white display |
|
|
All MENU-related functions are in the file(s) MENU*.c, MENU.h. All identifiers are prefixed MENU.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
MENU_BKCOLOR0_DEFAULT |
GUI_LIGHTGRAY |
Background color for enabled and unselected items. |
| N |
MENU_BKCOLOR1_DEFAULT |
0x980000 |
Background color for enabled and selected items. |
| N |
MENU_BKCOLOR2_DEFAULT |
GUI_LIGHTGRAY |
Background color for disabled items. |
| N |
MENU_BKCOLOR3_DEFAULT |
0x980000 |
Background color for disabled and selected items. |
| N |
MENU_BKCOLOR4_DEFAULT |
0x7C7C7C |
Background color for active submenu items. |
| N |
MENU_BORDER_BOTTOM_DEFAULT |
2 |
Border between item text and item bottom. |
| N |
MENU_BORDER_LEFT_DEFAULT |
4 |
Border between item text and left edge of item. |
| N |
MENU_BORDER_RIGHT_DEFAULT |
4 |
Border between item text and right edge of item. |
| N |
MENU_BORDER_TOP_DEFAULT |
2 |
Border between item text and item top. |
| S |
MENU_EFFECT_DEFAULT |
WIDGET_Effect_3D1L |
Default effect. |
| S |
MENU_FONT_DEFAULT |
GUI_Font13_1 |
Font used. |
| N |
MENU_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color for enabled and unselected items. |
| N |
MENU_TEXTCOLOR1_DEFAULT |
GUI_WHITE |
Text color for enabled and selected items. |
| N |
MENU_TEXTCOLOR2_DEFAULT |
0x7C7C7C |
Text color for disabled items. |
| N |
MENU_TEXTCOLOR3_DEFAULT |
GUI_LIGHTGRAY |
Text color for disabled and selected items. |
| N |
MENU_TEXTCOLOR4_DEFAULT |
GUI_WHITE |
Text color for active submenu items. |
MENU API reference
The table below lists the available µC/GUI MENU-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| MENU_AddItem |
Adds an item to an existing menu. |
| MENU_Attach |
Attaches a menu with the given size at the given position to a specified window. |
| MENU_CreateEx |
Creates a menu widget. |
| MENU_DeleteItem |
Deletes the specified menu item. |
| MENU_DisableItem |
Disables the specified menu item. |
| MENU_EnableItem |
Enables the specified menu item. |
| MENU_GetDefaultBkColor |
Returns the default background color for new menus. |
| MENU_GetDefaultBorderSize |
Returns the default border size for new menus. |
| MENU_GetDefaultEffect |
Returns the default effect for new menus. |
| MENU_GetDefaultFont |
Returns a pointer to the default font used to display the menu item text of new menus. |
| MENU_GetDefaultTextColor |
Returns the default text color for new menus. |
| MENU_GetItem |
Retrieves information about the given menu item. |
| MENU_GetItemText |
Returns the text of the given menu item. |
| MENU_GetNumItems |
Returns the number of items of the given menu. |
| MENU_InsertItem |
Inserts a menu item. |
| MENU_SetBkColor |
Sets the background color of the given menu. |
| MENU_SetBorderSize |
Sets the border size of the given menu. |
| MENU_SetDefaultBkColor |
Sets the default background color for new menus. |
| MENU_SetDefaultBorderSize |
Sets the default border size for new menus. |
| MENU_SetDefaultEffect |
Sets the default effect for new menus. |
| MENU_SetDefaultFont |
Sets a pointer to the default font used to display the menu item text of new menus. |
| MENU_SetDefaultTextColor |
Sets the default text color for new menus. |
| MENU_SetFont |
Sets the font used to display the menu item text of the given menu. |
| MENU_SetItem |
Changes the information about the given menu item. |
| MENU_SetOwner |
Sets the window to be informed by the menu. |
| MENU_SetTextColor |
Sets the text color of the given menu. |
MESSAGEBOX: Message box widget
A MESSAGEBOX widget is used to show a message in a frame window with a title bar, as well as an "OK" button which must be pressed in order to close the window. It requires only one line of code to create or to create and execute a message box. The table below shows the appearance of the MESSAGEBOX widget:
All MESSAGEBOX-related functions are in the file(s) MESSAGEBOX*.c, MESSAGEBOX.h and GUI.h.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
MESSAGEBOX_BORDER |
4 |
Distance between the elements of a message box and the elements of the client window frame. |
| N |
MESSAGEBOX_XSIZEOK |
50 |
X-size of the "OK" button. |
| N |
MESSAGEBOX_YSIZEOK |
20 |
Y-size of the "OK" button. |
| S |
MESSAGEBOX_BKCOLOR |
GUI_WHITE |
Color of the client window background. |
MESSAGEBOX API reference
The table below lists the available µC/GUI MESSAGERBOX-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| GUI_MessageBox |
Creates and displays a message box. |
| MESSAGEBOX_Create |
Creates a message box. |
MULTIEDIT: Multi line text widget
The MULTIEDIT widget enables you to edit text with multiple lines. You can use it as a simple text editor or to display static text. The widget supports scrolling with and without scrollbars. The table below shows the appearance of the MULTIEDIT widget.
| Description |
Frame window |
edit mode,
automatic horizontal scrollbar,
non wrapping mode,
insert mode, |
|
edit mode,
automatic vertical scrollbar,
word wrapping mode,
overwrite mode, |
|
read only mode,
word wrapping mode |
|
Configuration options
| Type |
Macro |
Default |
Description |
| S |
MULTIEDIT_FONT_DEFAULT |
GUI_Font13_1 |
Font used. |
| N |
MULTIEDIT_BKCOLOR0_DEFAULT |
GUI_WHITE |
Background color. |
| N |
MULTIEDIT_BKCOLOR2_DEFAULT |
0xC0C0C0 |
Background color read only mode. |
| N |
MULTIEDIT_TEXTCOLOR0_DEFAULT |
GUI_BLACK |
Text color. |
| N |
MULTIEDIT_TEXTCOLOR2_DEFAULT |
GUI_BLACK |
Text color read only mode. |
All MULTIEDIT-related functions are in the file(s) MULTIEDIT*.c, MULTIEDIT.h. All identifiers are prefixed MULTIEDIT.
MULTIEDIT API reference
The table below lists the available µC/GUI MULTIEDIT-related functions in alphabetical order. Descriptions of the functions follow:
| Function |
Description |
| MULTIEDIT_AddKey |
Key input function. |
| MULTIEDIT_Create |
Creates a multiedit widget. (Obsolete) |
| MULTIEDIT_CreateEx |
Creates a multiedit widget. |
| MULTIEDIT_GetPrompt |
Returns the text of the prompt. |
| MULTIEDIT_GetText |
Returns the text. |
| MULTIEDIT_GetTextSize |
Returns the buffer size used by the current text. |
| MULTIEDIT_SetAutoScrollH |
Activates automatic use of a horizontal scrollbar. |
| MULTIEDIT_SetAutoScrollV |
Activates automatic use of a vertical scrollbar. |
| MULTIEDIT_SetBkColor |
Sets the background color. |
| MULTIEDIT_SetBufferSize |
Sets the buffer size used for text and prompt. |
| MULTIEDIT_SetCursorOffset |
Sets the cursor to the given character. |
| MULTIEDIT_SetFont |
Sets the font. |
| MULTIEDIT_SetInsertMode |
Enables/disables the insert mode. |
| MULTIEDIT_SetMaxNumChars |
Sets the maximum number of characters including the prompt. |
| MULTIEDIT_SetPasswordMode |
Enables/disables password mode. |
| MULTIEDIT_SetPrompt |
Sets the prompt text. |
| MULTIEDIT_SetReadOnly |
Enables/disables the read only mode. |
| MULTIEDIT_SetText |
Sets the text. |
| MULTIEDIT_SetTextAlign() |
Sets the text alignment. |
| MULTIEDIT_SetTextColor |
Sets the text color. |
| MULTIEDIT_SetWrapWord |
Enables/disables word wrapping. |
| MULTIEDIT_SetWrapNone |
Enables/disables the non wrapping mode. |
MULTIPAGE: Multiple page widget
A MULTIPAGE widget is analogous to the dividers in a notebook or the labels in a file cabinet. By using a MULTIPAGE widget, an application can define multiple pages for the same area of a window or dialog box. Each page consists of a certain type of information or a group of widgets that the application displays when the user selects the corresponding page. To select a page the tab of the page has to be clicked. If not all tabs can be displayed, the MULTIPAGE widget automatically shows a small scrollbar at the edge to scroll the pages.
The table below shows the appearance of the MULTIPAGE widget:
| Description |
MULTIPAGE widget |
MULTIPAGE widget with 3 pages,
alignment top/left. |
|
MULTIPAGE widget with 6 pages,
alignment bottom/right. |
|
Structure of MULTIPAGE widget
A MULTIPAGE widget with n pages consists of n+2 windows:
1 MULTIPAGE window
1 Client window
n Page windows
The page windows will be added to the client window of the widget. The diagram at the right side shows the structure of the widget. |
|
Configuration options
| Type |
Macro |
Default |
Description |
| N |
MULTIPAGE_ALIGN_DEFAULT |
MULTIPAGE_ALIGN_LEFT | MULTIPAGE_ALIGN_TOP |
Default alignment. |
| N |
MULTIPAGE_BKCOLOR0_DEFAULT |
0xD0D0D0 |
Default background color of pages in disabled state. |
| N |
MULTIPAGE_BKCOLOR1_DEFAULT |
0xC0C0C0 |
Default background color of pages in enabled state. |
| S |
MULTIPAGE_FONT_DEFAULT |
&GUI_Font13_1 |
Default font used by the widget. |
| N |
MULTIPAGE_TEXTCOLOR0_DEFAULT |
0x808080 |
Default text color of pages in disabled state. |
| N |
MULTIPAGE_TEXTCOLOR0_DEFAULT |
0x000000 |
Default text color of pages in enabled state. |
MULTIPAGE API reference
The table below lists the available µC/GUI MULTIPAGE-related functions in alphabetical order. Descriptions of the functions follow.
| Function |
Description |
| MULTIPAGE_AddPage |
Adds a page to a MULTIPAGE widget. |
| MULTIPAGE_CreateEx |
Creates a new MULTIPAGE widget. |
| MULTIPAGE_CreateIndirect |
Creates the MULTIPAGE widget from a resource table entry. |
| MULTIPAGE_DeletePage |
Deletes a page from a MULTIPAGE widget. |
| MULTIPAGE_DisablePage |
Disables a page from a MULTIPAGE widget. |
| MULTIPAGE_EnablePage |
Enables a page from a MULTIPAGE widget. |
| MULTIPAGE_GetDefaultAlign |
Returns the default alignment for new MULTIPAGE widgets. |
| MULTIPAGE_GetDefaultBkColor |
Returns the default background color for new MULTIPAGE widgets. |
| MULTIPAGE_GetDefaultFont |
Returns the default font used for new MULTIPAGE widgets. |
| MULTIPAGE_GetDefaultTextColor |
Returns the default text color used for new MULTIPAGE widgets. |
| MULTIPAGE_GetSelection |
Returns the current selection. |
| MULTIPAGE_GetWindow |
Returns the window handle of a given page. |
| MULTIPAGE_IsPageEnabled |
Returns if a given page is enabled or not. |
| MULTIPAGE_SelectPage |
Selects the given page. |
| MULTIPAGE_SetAlign |
Sets the alignment for the tabs. |
| MULTIPAGE_SetBkColor |
Sets the background color. |
| MULTIPAGE_SetDefaultAlign |
Sets the default alignment for new MULTIPAGE widgets. |
| MULTIPAGE_SetDefaultBkColor |
Sets the default background color for new MULTIPAGE widgets. |
| MULTIPAGE_SetDefaultFont |
Sets the default font used by new MULTIPAGE widgets. |
| MULTIPAGE_SetDefaultTextColor |
Sets the default text color used by new MULTIPAGE widgets. |
| MULTIPAGE_SetFont |
Selects the font for the widget. |
| MULTIPAGE_SetRotation() |
Sets the rotation mode for the widget. |
| MULTIPAGE_SetText |
Sets the text displayed in a tab of a MULTIPAGE widget. |
| MULTIPAGE_SetTextColor |
Sets the text color. |
PROGBAR: Progress bar widget
Progress bars are commonly used in applications for visualization; for example, a tank fill-level indicator or an oil-pressure indicator. Sample screenshots can be found at the beginning of the chapter and at end of this section. All PROGBAR-related functions are in the file(s) PROGBAR*.c, PROGBAR.h. All identifiers are prefixed PROGBAR.
Configuration options
| Type |
Macro |
Default |
Description |
| S |
PROGBAR_DEFAULT_FONT |
GUI_DEFAULT_FONT |
Font used. |
| N |
PROGBAR_DEFAULT_BARCOLOR0 |
0x555555 (dark gray) |
Left bar color. |
| N |
PROGBAR_DEFAULT_BARCOLOR1 |
0xAAAAAA (light gray) |
Right bar color. |
| N |
PROGBAR_DEFAULT_TEXTCOLOR0 |
0xFFFFFF |
Text color, left bar. |
| N |
PROGBAR_DEFAULT_TEXTCOLOR1 |
0x000000 |
Text color, right bar. |
PROGBAR API reference
The table below lists the available µC/GUI PROGBAR-related functions in alphabetical order.
| Function |
Description |
| PROGBAR_Create |
Create the progress bar. |
| PROGBAR_CreateIndirect |
Create the progress bar from resource table entry. |
| PROGBAR_SetBarColor |
Sets the color(s) for the bar. |
| PROGBAR_SetFont |
Select the font for the text. |
| PROGBAR_SetMinMax |
Set the minimum and maximum values used for the bar. |
| PROGBAR_SetText |
Set the (optional) text for the paragraph. |
| PROGBAR_SetTextAlign |
Set text alignment (default is centered). |
| PROGBAR_SetTextColor |
Set the color(s) for the text. |
| PROGBAR_SetTextPos |
Set the text position (default 0,0). |
| PROGBAR_SetValue |
Set the value for the bar graph (and percentage if no text has been assigned). |
RADIO: Radio button widget
difference from check boxes is that the user can only select one radio button at a time. When a button is selected, the other buttons in the widget are turned off, as shown to the right. One radio button widget may contain any number of buttons, which are always arranged vertically.
All RADIO-related functions are located in the file(s) RADIO*.c, RADIO.h. All identifiers are prefixed RADIO.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
RADIO_BKCOLOR0_DEFAULT |
0xc0c0c0 |
Background color of button, inactive state. |
| N |
RADIO_BKCOLOR1_DEFAULT |
GUI_WHITE |
Background color of button, active state. |
RADIO API reference
The table below lists the available µC/GUI RADIO-related functions in alphabetical order.
| Function |
Description |
| RADIO_Create |
Create a group of radio buttons. |
| RADIO_CreateIndirect |
Create a group of radio buttons from resource table entry. |
| RADIO_Dec |
Decrement the button selection by a value of 1. |
| RADIO_GetValue |
Return the current button selection. |
| RADIO_Inc |
Increment the button selection by a value of 1. |
| RADIO_SetValue |
Set the button selection. |
SCROLLBAR: Scroll bar widget
Scroll bars are used for scrolling through list boxes or any windows which do not fit entirely into their frames. They may be created horizontally, as shown below, or vertically.
A scroll bar is typically used with an existing window, for example the list box shown below:
All SCROLLBAR-related functions are located in the file(s) SCROLLBAR*.c, SCROLL-BAR. h. All identifiers are prefixed SCROLLBAR.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
SCROLLBAR_BKCOLOR0_DEFAULT |
0x808080 |
Background (thumb area) color. |
| N |
SCROLLBAR_BKCOLOR1_DEFAULT |
GUI_BLACK |
Scroll bar (thumb) color. |
| N |
SCROLLBAR_COLOR0_DEFAULT |
0xc0c0c0 |
Arrow button colors. |
| B |
SCROLLBAR_USE_3D |
1 |
Enable support for 3D effects. |
SCROLLBAR API reference
The table below lists the available µC/GUI SCROLLBAR-related functions in alphabetical order.
| Function |
Description |
| SCROLLBAR_AddValue |
Increment or decrement the value of the scroll bar by a specified value. |
| SCROLLBAR_Create |
Create the scroll bar. |
| SCROLLBAR_CreateAttached |
Create a scroll bar attached to a window. |
| SCROLLBAR_CreateIndirect |
Create the scroll bar from resource table entry. |
| SCROLLBAR_Dec |
Decrement the value of the scroll bar by a value of 1. |
| SCROLLBAR_GetValue |
Return the current item value. |
| SCROLLBAR_Inc |
Increment the value of the scroll bar by a value of 1. |
| SCROLLBAR_SetNumItems |
Set the number of items for scrolling. |
| SCROLLBAR_SetPageSize |
Set the page size (in number of items). |
| SCROLLBAR_SetValue |
Set the current value of the scroll bar. |
| SCROLLBAR_SetWidth |
Set the width of the scroll bar. |
SLIDER: Slider widget
Slider widgets are commonly used for modifying values through the use of a slider bar.
All SLIDER-related functions are located in the file(s) SLIDER*.c, SLIDER.h. All identifiers are prefixed SLIDER.
Configuration options
| Type |
Macro |
Default |
Description |
| N |
SLIDER_BKCOLOR0_DEFAULT |
0xc0c0c0 |
Background color. |
| N |
SLIDER_COLOR0_DEFAULT |
0xc0c0c0 |
Slider (thumb) color. |
| B |
SLIDER_USE_3D |
1 |
Enable support for 3D effects. |
SLIDER API reference
The table below lists the available µC/GUI SLIDER-related functions in alphabetical order.
| Function |
Description |
| SLIDER_Create |
Create the slider. |
| SLIDER_CreateIndirect |
Create the slider from resource table entry. |
| SLIDER_Dec |
Decrement the value of the slider bar. |
| SLIDER_GetValue |
Return the current value of the slider bar. |
| SLIDER_Inc |
Increment the value of the slider bar. |
| SLIDER_SetRange |
Set the range of the slider value. |
| SLIDER_SetValue |
Set the current value of the slider bar. |
| SLIDER_SetWidth |
Set the width of the slider bar. |
TEXT: Text widget
Text widgets are typically used in order to display fields of text in dialog boxes, as shown in the message box below:
Of course, text fields may also be used for labeling other widgets, as follows:
Configuration options
| Type |
Macro |
Default |
Description |
| N |
TEXT_FONT_DEFAULT |
&GUI_Font13_1 |
Font used. |
TEXT API reference
The table below lists the available µC/GUI TEXT-related functions in alphabetical order.
| Function |
Description |
| TEXT_Create |
Create the text. |
| TEXT_CreateIndirect |
Create the text from resource table entry. |
| TEXT_GetDefaultFont |
Return the default font used for text. |
| TEXT_SetDefaultFont |
Set the default font used for text. |
| TEXT_SetFont |
Set the font used for a specified text widget. |
| TEXT_SetText |
Set the text for a specified text widget. |
| TEXT_SetTextAlign |
Set the text alignment of a specified text widget. |
| TEXT_SetTextPos |
Set the position of the text in a specified text widget. |
|