mGUtils API Reference
v1.2.0
A component of MiniGUI providing users with a number of common dialog templates
|
Data Structures | |
struct | _NEWFILEDLGDATA |
struct | _COLORDATA |
Macros | |
#define | FILE_ERROR_OK 0 |
Open file success. More... | |
#define | FILE_ERROR_PARAMERR -1 |
Wrong parameters. More... | |
#define | MAX_FILTER_LEN 255 |
The maximum length of filter string. More... | |
#define | MY_NAMEMAX 127 |
The maximum length of name. More... | |
#define | MY_PATHMAX 255 |
The maximum length of path. More... | |
Typedefs | |
typedef struct _NEWFILEDLGDATA | NEWFILEDLGDATA |
typedef NEWFILEDLGDATA * | PNEWFILEDLGDATA |
typedef struct _COLORDATA | COLORDATA |
Functions | |
MGUTILS_EXPORT BOOL | ShowCommonDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, void *private_data) |
MGUTILS_EXPORT BOOL | FileOpenSaveDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PFILEDLGDATA pfdd) |
MGUTILS_EXPORT LRESULT | DefFileDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
MGUTILS_EXPORT int | ShowOpenDialog (HWND hWnd, int lx, int ty, int w, int h, PNEWFILEDLGDATA pnfdd) |
Creates an Open File Dialog Box. More... | |
void | RGB2HSV (Uint8 r, Uint8 g, Uint8 b, Uint16 *hout, Uint8 *sout, Uint8 *vout) |
Converts r/g/b values of a color in RGB color space to h/s/v of the color in HSV color space. More... | |
void | HSV2RGB (Uint16 hin, Uint8 sin, Uint8 vin, Uint8 *rout, Uint8 *gout, Uint8 *bout) |
Converts h/s/v values of a color to r/g/b values of the color. More... | |
void | YUV2RGB (int y, int u, int v, Uint8 *r, Uint8 *g, Uint8 *b) |
Converts y/u/v values of a color in YUV color space to to r/g/b values of the color in RGB color space. More... | |
MG_EXPORT void | RGB2YUV (Uint8 r, Uint8 g, Uint8 b, int *y, int *u, int *v) |
Converts r/g/b values of a color in RGB color space to y/u/v values of the color in YUV color space. More... | |
MGUTILS_EXPORT BOOL | ColorSelectDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PCOLORDLGDATA pcdd) |
MGUTILS_EXPORT LRESULT | DefColorDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
MGUTILS_EXPORT int | ColorSelDialog (HWND hWnd, int x, int y, int w, int h, PCOLORDATA pClrData) |
Creates a Color Selection Dialog Box. More... | |
MGUTILS_EXPORT BOOL | FontSelectDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PFONTDLGDATA pfsd) |
MGUTILS_EXPORT LRESULT | DefFontDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
MGUTILS_EXPORT BOOL | InfoShowDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PINFODLGDATA pidd) |
MGUTILS_EXPORT LRESULT | DefInfoDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) |
mGUtils provides a dialog in a main window of MiniGUI.
#define FILE_ERROR_PARAMERR -1 |
Wrong parameters.
Path doesn't exist.
#define MAX_FILTER_LEN 255 |
typedef struct _COLORDATA COLORDATA |
The color data structure used by ColorSelDialog.
typedef struct _NEWFILEDLGDATA NEWFILEDLGDATA |
The file dialog box structure used by ShowOpenDialog.
typedef NEWFILEDLGDATA* PNEWFILEDLGDATA |
int ColorSelDialog | ( | HWND | hWnd, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
PCOLORDATA | pClrData | ||
) |
Creates a Color Selection Dialog Box.
This function creates a Color Selection Dialog Box, and returns the values of the color selected by the user.
hWnd | The hosting main window. |
x | x,y,w,h: The default position and size of the dialog box. |
y | x,y,w,h: The default position and size of the dialog box. |
w | x,y,w,h: The default position and size of the dialog box. |
h | x,y,w,h: The default position and size of the dialog box. |
pClrData | The pointer to the COLORDATA structure. |
IDOK | The user choosed a color and OK button clicked. |
IDCANCEL | The user clicked the Cancel button. |
int ColorSelectDialog | ( | PDLGTEMPLATE | dlg_template, |
HWND | hwnd, | ||
WNDPROC | proc, | ||
PCOLORDLGDATA | pcdd | ||
) |
\ brief Creates a modal Color Selection Dialog Box.
This function creates an Color Selection Dialog Box, and returns the values of the color selected by the user.
dlg_template | The pointer to a DLGTEMPLATE structure. |
hwnd | The handle to the hosting main window. |
proc | The window procedure of the color selection dialog box. |
pcdd | The pointer to the COLORDLGDATA structure. |
MGUTILS_EXPORT LRESULT DefColorDialogProc | ( | HWND | hDlg, |
UINT | message, | ||
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
The default Color Selection Dialog callback procedure.
MGUTILS_EXPORT LRESULT DefFileDialogProc | ( | HWND | hDlg, |
UINT | message, | ||
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
The default File Open/Save Dialog callback procedure.
MGUTILS_EXPORT LRESULT DefFontDialogProc | ( | HWND | hDlg, |
UINT | message, | ||
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
The default Font Selection Dialog callback procedure.
MGUTILS_EXPORT LRESULT DefInfoDialogProc | ( | HWND | hDlg, |
UINT | message, | ||
WPARAM | wParam, | ||
LPARAM | lParam | ||
) |
The default Information Dialog callback procedure.
int FileOpenSaveDialog | ( | PDLGTEMPLATE | dlg_template, |
HWND | hwnd, | ||
WNDPROC | proc, | ||
PFILEDLGDATA | pfdd | ||
) |
\ brief Creates a modal Open/Save File Dialog Box.
This function creates an Open/Save File Dialog Box, and returns the full path name of the file selected by user.
dlg_template | The pointer to a DLGTEMPLATE structure. |
hwnd | The handle to the hosting main window. |
proc | The window procedure of the common dialog box. |
pfdd | The pointer to the FILEDLGDATA structure. |
int FontSelectDialog | ( | PDLGTEMPLATE | dlg_template, |
HWND | hwnd, | ||
WNDPROC | proc, | ||
PFONTDLGDATA | pfsd | ||
) |
\ brief Creates a modal Font Selection Dialog Box.
This function creates an Font Selection Dialog Box, and returns the pointer to the logical font selected by user.
dlg_template | The pointer to a DLGTEMPLATE structure. |
hwnd | The handle to the hosting main window. |
proc | The window procedure of the font selection dialog box. |
pfsd | The pointer to the FONTDLGDATA structure. |
void HSV2RGB | ( | Uint16 | hin, |
Uint8 | sin, | ||
Uint8 | vin, | ||
Uint8 * | rout, | ||
Uint8 * | gout, | ||
Uint8 * | bout | ||
) |
Converts h/s/v values of a color to r/g/b values of the color.
This function converts h/s/v values of a color in HSV color space to r/g/b values of the color in RGB space.
hin | The h value of the HSV color space to be converted, the range is between 0 to 359. |
sin | The s value of the HSV color space to be converted, the range is between 0 to 255. |
vin | The v value of the HSV color space to be converted, the range is between 0 to 255. |
rout | The pointer to Uint8, returns the red value of the RGB color space. |
gout | The pointer to Uint8, returns the green value of the RGB color space. |
bout | The pointer to Uint8, returns the bout value of the RGB color space. |
int InfoShowDialog | ( | PDLGTEMPLATE | dlg_template, |
HWND | hwnd, | ||
WNDPROC | proc, | ||
PINFODLGDATA | pidd | ||
) |
\ brief Creates a modal Information Dialog Box.
This function creates a Information Dialog Box.
dlg_template | The pointer to a DLGTEMPLATE structure. |
hwnd | The handle to the hosting main window. |
proc | The window procedure of the information dialog box. |
pidd | The pointer to the INFODLGDATA structure. |
void RGB2HSV | ( | Uint8 | r, |
Uint8 | g, | ||
Uint8 | b, | ||
Uint16 * | hout, | ||
Uint8 * | sout, | ||
Uint8 * | vout | ||
) |
Converts r/g/b values of a color in RGB color space to h/s/v of the color in HSV color space.
This function converts r/g/b values of a color in RGB color space to h/s/v values of the color in HSV color space.
r | The red value of the color in RGB space to be converted. |
g | The green value of the color in RGB space to be converted. |
b | The blue value of the color in RGB space to be converted. |
hout | The pointer to Uint16, returns the h value of the color in HSV color space. |
sout | The pointer to Uint8, returns the s value of the color in HSV color space returned. |
vout | The pointer to Uint8, returns the v value of the color in HSV color space returned. |
void RGB2YUV | ( | Uint8 | r, |
Uint8 | g, | ||
Uint8 | b, | ||
int * | y, | ||
int * | u, | ||
int * | v | ||
) |
Converts r/g/b values of a color in RGB color space to y/u/v values of the color in YUV color space.
The function converts r/g/b values of a color in RGB color space to y/u/v values of the color in YUV color space.
r | The red value of the RGB color space to be converted. |
g | The green value of the RGB color space to be converted. |
b | The blue value of the RGB color space to be converted. |
y | The pointer to int, returns the y value of the YUV color space. |
u | The pointer to int, returns the u value of the YUV color space. |
v | The pointer to int, returns the v value of the YUV color space. |
int ShowCommonDialog | ( | PDLGTEMPLATE | dlg_template, |
HWND | hwnd, | ||
WNDPROC | proc, | ||
void * | private_data | ||
) |
\ brief Creates a modal common dialog box from a dialog box template in memory and other information.
This function can be used for file choosing dialog, color selecting dialog, font selecting dialog, and information dialog.
dlg_template | The pointer to a DLGTEMPLATE structure. |
hwnd | The handle to the hosting main window. |
proc | The window procedure of the common dialog box. |
private_data | The parameter will be passed to the window procedure. |
int ShowOpenDialog | ( | HWND | hWnd, |
int | lx, | ||
int | ty, | ||
int | w, | ||
int | h, | ||
PNEWFILEDLGDATA | pnfdd | ||
) |
Creates an Open File Dialog Box.
This function creates an Open File Dialog Box, and returns the full path name of the file selected by user.
hWnd | The hosting main window. |
lx | lx,ty,w,h: The default position and size of the dialog box. |
ty | lx,ty,w,h: The default position and size of the dialog box. |
w | lx,ty,w,h: The default position and size of the dialog box. |
h | lx,ty,w,h: The default position and size of the dialog box. |
pnfdd | The pointer to the NEWFILEDLGDATA structure. |
IDOK | The user choosed a file and OK button clicked. |
IDCANCLE | CANCEL button clicked. |
void YUV2RGB | ( | int | y, |
int | u, | ||
int | v, | ||
Uint8 * | r, | ||
Uint8 * | g, | ||
Uint8 * | b | ||
) |
Converts y/u/v values of a color in YUV color space to to r/g/b values of the color in RGB color space.
This function converts y/u/v values of YUV color space to r/g/b values of RGB color space.
y | The y value of the YUV color space to be converted. |
u | The u value of the YUV color space to be converted. |
v | The v value of the YUV color space to be converted. |
r | The pointer to Uint8, returns the red value of the RGB color space. |
g | The pointer to Uint8, returns the green value of the RGB color space. |
b | The pointer to Uint8, returns the bout value of the RGB color space. |