MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Typedefs | Enumerations | Functions
Miscellaneous 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

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...
 

Detailed Description

Macro Definition Documentation

◆ Beep

#define Beep   Ping

Alias of Ping.

See also
Ping

Definition at line 3563 of file minigui.h.

◆ NotifyParent

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

Typedef Documentation

◆ STRCMP

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.

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ CreateToolTipWin()

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

◆ DestroyToolTipWin()

void DestroyToolTipWin ( HWND  hwnd)

Destroy a tool tip window.

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

Parameters
hwndThe handle to the tool tip window.
See also
CreateToolTipWin

◆ DisabledTextOutEx()

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 the window.
xThe x-coordinate of start point.
yThe y-coordinate of start point.
szTextThe null-terminated text to be output.
See also
TextOut, DrawText

◆ GetOriginalTermIO()

void *GUIAPI GetOriginalTermIO ( void  )

Get termios structure of the original terminal before initializing MiniGUI.

Returns
The pointer to the original termios structure.

◆ GetTickCount()

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.

Returns
The tick counts value that have elapsed since MiniGUI was started.
Note
The prototype had changed since MiniGUI v3.2; The old one: unsinged int GUIAPI GetTickCount (void);

◆ NotifyParentEx()

void GUIAPI NotifyParentEx ( HWND  hwnd,
LINT  id,
int  code,
DWORD  add_data 
)

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.

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
NotifyWindow, SetNotificationCallback

◆ Ping()

void GUIAPI Ping ( void  )

Makes a beep sound.

See also
Beep

◆ ResetToolTipWin()

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

◆ Tone()

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