MiniGUI API Reference (MiniGUI-Threads)
v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Macros | |
#define | NotifyParent(hwnd, id, code) NotifyParentEx(hwnd, id, code, 0) |
Sends a notification message to the parent, but without additional data. More... | |
#define | Beep Ping |
Alias of Ping. More... | |
Typedefs | |
typedef int(* | STRCMP) (const char *s1, const char *s2, size_t n) |
Type of general strncmp function. More... | |
Enumerations | |
enum | SBPolicyType { SB_POLICY_ALWAYS, SB_POLICY_AUTOMATIC, SB_POLICY_NEVER } |
Scroll bar display policies in scrolled window. More... | |
Functions | |
MG_EXPORT void GUIAPI | DisabledTextOutEx (HDC hdc, HWND hwnd, int x, int y, const char *szText) |
Outputs disabled (grayed) text. More... | |
MG_EXPORT HWND | CreateToolTipWin (HWND hParentWnd, int x, int y, int timeout_ms, const char *text,...) |
Creates a tool tip window. More... | |
MG_EXPORT void | ResetToolTipWin (HWND hwnd, int x, int y, const char *text,...) |
Resets a tool tip window. More... | |
MG_EXPORT void | DestroyToolTipWin (HWND hwnd) |
Destroy a tool tip window. More... | |
MG_EXPORT void GUIAPI | NotifyParentEx (HWND hwnd, LINT id, int code, DWORD add_data) |
Send a notification message to the parent. More... | |
MG_EXPORT DWORD GUIAPI | GetTickCount (void) |
Retrieve the tick counts that have elapsed since MiniGUI was started. More... | |
MG_EXPORT void GUIAPI | Ping (void) |
Makes a beep sound. More... | |
MG_EXPORT void GUIAPI | Tone (int frequency_hz, int duration_ms) |
Makes a tone. More... | |
MG_EXPORT void *GUIAPI | GetOriginalTermIO (void) |
Get termios structure of the original terminal before initializing MiniGUI. More... | |
#define NotifyParent | ( | hwnd, | |
id, | |||
code | |||
) | NotifyParentEx(hwnd, id, code, 0) |
Sends a notification message to the parent, but without additional data.
hwnd | The handle to current control window. |
id | The identifier of current control. |
code | The notification code. |
Definition at line 236 of file ctrlhelper.h.
typedef int(* STRCMP) (const char *s1, const char *s2, size_t n) |
Type of general strncmp function.
The function compares the two strings s1 and s2. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2.
Note that it only compares the first (at most) n characters of s1 and s2.
Definition at line 248 of file ctrlhelper.h.
enum SBPolicyType |
Scroll bar display policies in scrolled window.
Enumerator | |
---|---|
SB_POLICY_ALWAYS | The scroll bar is always visible |
SB_POLICY_AUTOMATIC | The scroll bar is shown or hided automatically |
SB_POLICY_NEVER | The scroll bar is never visbile |
Definition at line 89 of file ctrlhelper.h.
Creates a tool tip window.
This function creates a tool tip window and returns the handle to it. You can call DestroyToolTipWin to destroy it. This function also receives printf-like arguments to format a string.
Note that the tool tip window will disappear automatically after the specified milliseconds by timeout_ms if timeout_ms is larger than 9 ms.
hParentWnd | The hosting main window. |
x | The position of the tool tip window. |
y | The position of the tool tip window. |
timeout_ms | The timeout value of the tool tip window. |
text | The format string. |
void DestroyToolTipWin | ( | HWND | hwnd | ) |
Destroy a tool tip window.
This function destroys the specified tool tip window hwnd, which is returned by CreateToolTipWin.
hwnd | The handle to the tool tip window. |
Outputs disabled (grayed) text.
This function outputs a grayed text at the specified position.
hdc | The device context. |
hwnd | Tell the function to draw with the color definitions of the window. |
x | The x-coordinate of start point. |
y | The y-coordinate of start point. |
szText | The null-terminated text to be output. |
void *GUIAPI GetOriginalTermIO | ( | void | ) |
Get termios structure of the original terminal before initializing MiniGUI.
DWORD GUIAPI GetTickCount | ( | void | ) |
Retrieve the tick counts that have elapsed since MiniGUI was started.
This function retrieves the tick counts that have elapsed since MiniGUI was started. It is limited to the resolution of the system timer, i.e. for a general Linux box, the returned tick count value is in unit of 10ms.
Send a notification message to the parent.
This function send a notification message to the parent.
In the early version, the notification from a control will be sent to its parent window within a MSG_COMMAND message.
Since version 1.2.6, MiniGUI defines the Notification Callback Procedure for a window. You can specify a callback function to a window by calling SetNotificationCallback to receive and handle the notification from its children in the procedure.
Note that if the control has WS_EX_NOPARENTNOTIFY style, this function will not notify the parent.
Note taht there was a mistake in the implementation. This function will check and call the notification callback procedure of the control itself instead of its parent.
Since 5.0.0, you can call NotifyWindow to notify any kind of window.
hwnd | The handle to current control window. |
id | The identifier of current control. |
code | The notification code. |
add_data | The additional data of the notification. |
void GUIAPI Ping | ( | void | ) |
Makes a beep sound.
void ResetToolTipWin | ( | HWND | hwnd, |
int | x, | ||
int | y, | ||
const char * | text, | ||
... | |||
) |
Resets a tool tip window.
This function resets the tool tip window specified by hwnd, including its position, text displayed in it, and the visible status. If the tool tip is invisible, it will become visible.
This function also receives printf-like arguments to format a string.
hwnd | The tool tip window handle returned by CreateToolTipWin. |
x | The new position of the tool tip window. |
y | The new position of the tool tip window. |
text | The new format string. |
void GUIAPI Tone | ( | int | frequency_hz, |
int | duration_ms | ||
) |
Makes a tone.
This function will return after the tone. Thus, your program will be blocked when the tone is being played.
frequency_hz | The frequency of the tone in hertz. |
duration_ms | The duration of the tone in millisecond. |