MiniGUI API Reference (MiniGUI-Threads)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Typedefs | Enumerations | Functions

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

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)
 Destroies a tool tip window. More...
 
MG_EXPORT void GUIAPI NotifyParentEx (HWND hwnd, LINT id, int code, DWORD add_data)
 Sends a notification message to the parent. 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)
 Gets termios structure of the original terminal before initializing MiniGUI. More...
 

Detailed Description

Macro Definition Documentation

#define Beep   Ping

Alias of Ping.

See also
Ping

Definition at line 2465 of file minigui.h.

#define NotifyParent (   hwnd,
  id,
  code 
)    NotifyParentEx(hwnd, id, code, 0)

Sends a notification message to the parent, but without additional data.

Parameters
hwndThe handle to current control window.
idThe identifier of current control.
codeThe notification code.
Note
This function is actually a macro of NotifyParentEx with dwAddData being zero.
See also
NotifiyParentEx

Definition at line 218 of file ctrlhelper.h.

Typedef Documentation

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 231 of file ctrlhelper.h.

Enumeration Type Documentation

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 77 of file ctrlhelper.h.

Function Documentation

HWND CreateToolTipWin ( HWND  hParentWnd,
int  x,
int  y,
int  timeout_ms,
const char *  text,
  ... 
)

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.

Parameters
hParentWndThe hosting main window.
xThe position of the tool tip window.
yThe position of the tool tip window.
timeout_msThe timeout value of the tool tip window.
textThe format string.
Returns
The handle to the tool tip window on success, HWND_INVALID on error.
See also
ResetToolTipWin, DestroyToolTipWin
void DestroyToolTipWin ( HWND  hwnd)

Destroies a tool tip window.

This function destroies the specified tool tip window hwnd, which is returned by CreateToolTipWin.

Parameters
hwndThe handle to the tool tip window.
See also
CreateToolTipWin
void GUIAPI DisabledTextOutEx ( HDC  hdc,
HWND  hwnd,
int  x,
int  y,
const char *  szText 
)

Outputs disabled (grayed) text.

This function outputs a grayed text at the specified position.

Parameters
hdcThe device context.
hwndTell the function to draw with the color definitions of this window.
xThe x-coordinate of start point.
yThe y-coordinate of start point.
szTextThe null-terminated text to be output.
See also
TextOut, DrawText
void *GUIAPI GetOriginalTermIO ( void  )

Gets termios structure of the original terminal before initializing MiniGUI.

Returns
The pointer to the original termios structure.
void GUIAPI NotifyParentEx ( HWND  hwnd,
LINT  id,
int  code,
DWORD  add_data 
)

Sends a notification message to the parent.

By default, the notification from a control will be sent to its parent window within a MSG_COMMAND messsage.

Since version 1.2.6, MiniGUI defines the Nofication Callback Procedure for control. You can specify a callback function for a control by calling SetNotificationCallback to receive and handle the notification from the control.

If you have defined the Notificaton Callback Procedure for the control, calling NotifyParentEx will call the notification callback procedure, not send the notification message to the parent.

Note that if the control has WS_EX_NOPARENTNOTIFY style, this function will not notify the parent.

Parameters
hwndThe handle to current control window.
idThe identifier of current control.
codeThe notification code.
add_dataThe additional data of the notification.
Note
The type of id change from int to LINT since v3.2.
See also
SetNotificationCallback
void GUIAPI Ping ( void  )

Makes a beep sound.

See also
Beep
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.

Parameters
hwndThe tool tip window handle returned by CreateToolTipWin.
xThe new position of the tool tip window.
yThe new position of the tool tip window.
textThe new format string.
See also
CreateToolTipWin, DestroyToolTipWin
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.

Parameters
frequency_hzThe frequency of the tone in hertz.
duration_msThe duration of the tone in millisecond.
Bug:
When MiniGUI runs on X Window or RTOS, the tone can not be played correctly.
See also
Ping