Inheritance diagram for CmMGUI:
Protected Methods | |
virtual void | beep (void) |
This method emits a beep sound using the system specific's default sound. | |
int | getKeyboardState (void) |
Returns the status of the keyboard modifier keys (Alt, Control, Shift). | |
const char * | getSysDir (void) |
Returns a pointer to a constant string specifying the MGUISYS directory. | |
const char * | getApplicationName (void) |
Returns a pointer to a const string containing the running application name. | |
int | paletteMode (void) |
This function returns True if the calling program runs in 16 or 256 colors video mode. | |
int | getScreenWidth (void) |
Returns the screen width in pixel units. | |
int | getScreenHeight (void) |
Returns the screen height in pixel units. | |
int | getNPlanes (void) |
Returns the number of color planes in the display. | |
long | getNColors (void) |
Returns the number of colors in the display. | |
MTColor | getBlackColor (void) |
Returns the color id of the black color. | |
MTColor | getWhiteColor (void) |
Returns the color id of the white color. | |
void | enableCustomizing (void) |
This function enables the run-time resource changing dialog. | |
char * | getStringOption (const char *obj_name, const char *opt_name) |
Retrieves a generic string option from the resource database. | |
char * | getTextOption (const char *obj_name) |
Retrieves a text option from the resource database. | |
int | getIntOption (const char *obj_name, const char *opt_name, int *ret) |
Retrieves an integer option from the resource database. | |
int | getFontOption (const char *obj_name, MTFont *ret) |
Retrieves a Font option from the resource database. | |
int | getBGColorOption (const char *obj_name, int *pr, int *pg, int *pb) |
Retrieves a Background Color option from the resource database. | |
int | getFGColorOption (const char *obj_name, int *pr, int *pg, int *pb) |
Retrieves a Foreground Color option from the resource database. | |
int | getShadowOption (const char *obj_name, int *shadow, int *i_t, int *o_t) |
Retrieves a Shadow option from the resource database. | |
void | setStringOption (const char *obj_name, const char *opt_name, const char *text) |
Stores a generic string option in the resource database. | |
void | setTextOption (const char *obj_name, const char *text) |
Stores a text option in the resource database. | |
void | setIntOption (const char *obj_name, const char *opt_name, int val) |
Stores an integer option in the resource database. | |
void | setFontOption (const char *obj_name, MTFont font) |
Stores a Font option in the resource database. | |
void | setBGColorOption (const char *obj_name, int r, int g, int b) |
Stores a Background Color option in the resource database. | |
void | setFGColorOption (const char *obj_name, int r, int g, int b) |
Stores a Foreground Color option in the resource database. | |
void | setShadowOption (const char *obj_name, int shadow, int in_t, int out_t) |
Stores a Shadow option in the resource database. | |
void | saveOptions (void) |
Saves in the application's resource file all defined options. | |
void | logInit (int level, int nr, int nvr, int nc, int nvc, const char *fname) |
Sets the log level, log window geometry and log filename. | |
void | log (int level, const char *fmt,...) |
Prints a formatted log string in the log window (and the log file if enabled). | |
void | maskedLog (int level, CARD32 mask, const char *fmt,...) |
Prints a formatted log string in the log window using the context mask. | |
void | logSetLevel (int level) |
Sets the current log-level. | |
void | logSetMask (CARD32 mask) |
Sets the current log mask. | |
CARD32 | logGetMask (void) |
Retrieves the current log mask containing enabled log contexts. | |
void | logSetMaskBits (CARD32 mask) |
Adds bits to the current log mask enabling more log contexts. | |
void | logResetMaskBits (CARD32 mask) |
Clears bits in the current log mask disabling some log contexts. | |
void | setTraceFileName (const char *fname) |
Sets the name of the file which to write low level tracing messages. | |
void | logSetTimeFormat (const char *strftime_format) |
void | traceSetTimeFormat (const char *strftime_format) |
void | trace (const char *fmt,...) |
Prints a low level tracing message to the trace file. | |
void | getDefaultBackgroundRGB (int *pr, int *pg, int *pb) |
Retrieves the R-G-B components of the default background color. | |
void | setDefaultBackgroundRGB (int r, int g, int b) |
Sets the R-G-B components of the default background color. | |
void | getDefaultForegroundRGB (int *pr, int *pg, int *pb) |
Retrieves the R-G-B components of the default foreground color. | |
void | setDefaultForegroundRGB (int r, int g, int b) |
Sets the R-G-B components of the default foreground color. | |
int | textCharX (const char *text, MTFont font, int i) |
Returns the x position (in pixels) of the character at a given position in a string array. | |
int | textHeight (const char *text, MTFont font) |
Returns the height of the string 'text' using the font 'font'. | |
int | charHeight (char ch, MTFont font) |
Returns the height of the character 'ch' using the font 'font'. | |
int | textWidth (const char *text, MTFont font) |
Returns the width of the null terminated string 'text' using the font 'font'. | |
int | textNWidth (const char *text, MTFont font, int n) |
Returns the width of the first 'n' characters in the string 'text' using the font 'font'. | |
int | charWidth (char ch, MTFont font) |
Returns the width of the character 'ch' using the font 'font'. | |
int | spoolFile (const char *fname) |
Prints an ascii text file in the system printer. | |
int | spoolTempFile (const char *fname) |
Prints a temporary ascii text file in the system printer. | |
void | mainLoop (void) |
Transfers control to the main MGUI event loop handler. | |
void | loopWhileFlag (int *pflag, int value) |
Transfers control temporarily to a MGUI event loop handler. | |
void | loopWhileEvents (int discard) |
Processes all pending events and then returns. | |
void | nextEvent (MEvent *pe, int wait) |
Retrieves next available MGUI event waiting for it if desired. | |
void | processEvent (MEvent *pe) |
Processes a MGUI event retrieved by nextEvent(). | |
int | messageDialog (const char *title, const char *msg, const char *btn1, const char *btn2,...) |
Displays a modal message window. | |
int | inputPrompt (const char *title, const char *msg, char *text, int len, const char *ok_btn, const char *canc_btn) |
Displays a modal prompt window for a single line text input. | |
char * | textPrompt (const char *title, const char *msg, const char *text, int w, int h, const char *ok_btn, const char *canc_btn) |
Displays a modal prompt window for a multi line text input. | |
int | fileSelection (const char *title, char *filter, char *fname, char *dname, int change_cur_dir) |
Displays a modal prompt window for a file name selection. | |
int | fileBrowse (const char *title, char *filter, char *fname, char *dname, int change_cur_dir) |
Displays a modal prompt window for a file name selection. | |
const char * | getCurrentDirectory (void) |
Returns the program's current directory. | |
void | setInputPromptRGB (int r, int g, int b) |
Sets the R-G-B components of the background color of the InputPrompt dialog. | |
void | setInputPromptFgRGB (int r, int g, int b) |
void | setInputPromptFonts (MTFont text_font, MTFont edit_font, MTFont buttons_font) |
void | setMessageDialogRGB (int r, int g, int b) |
Sets the R-G-B components of the background color of the Message dialog. | |
void | setFileSelectionRGB (int r, int g, int b) |
Sets the R-G-B components of the background color of the FileSelection dialog. | |
void | setMessageDialogFgRGB (int r, int g, int b) |
void | setMessageDialogFonts (MTFont text_font, MTFont buttons_font) |
void | getInputPromptRGB (int *pr, int *pg, int *pb) |
Retrieves the R-G-B components of the background color used in the InputPrompt dialog. | |
void | getInputPromptFgRGB (int *pr, int *pg, int *pb) |
void | getInputPromptFonts (MTFont *text_font, MTFont *edit_font, MTFont *buttons_font) |
void | getMessageDialogRGB (int *pr, int *pg, int *pb) |
Retrieves the R-G-B components of the background color used in the Message dialog. | |
void | getMessageDialogFgRGB (int *pr, int *pg, int *pb) |
void | getMessageDialogFonts (MTFont *text_font, MTFont *buttons_font) |
void | getFileSelectionRGB (int *pr, int *pg, int *pb) |
Retrieves the R-G-B components of the background color used in the FileSelection dialog. | |
void | setFileSelectionTextStrings (char *file_list, char *dir_list, char *drive_list, char *filter, char *filename, char *curr_dir, char *ok_button, char *close_button) |
Changes the text displayed in the labels and buttons in the FileSelection dialog. |
This is an abstract class, with no data and no public methods. It contains all global MGUI functions as protected methods, so they can be called by any derived class.
|
This method emits a beep sound using the system specific's default sound. Under Windows it calls 'MessageBeep(MB_ICONASTERISK)'. Under Unix X-Window it calls 'XBell(display, 100)'. Under any other console systems (DOS and Linux) it puts the bell character to the console. The global "C" function MBeep() is available for use from outside CmMGUI derived classes. |
|
Returns the height of the character 'ch' using the font 'font'. The global "C" function MCharHeight() is available for use from outside CmMGUI derived classes.
|
|
Returns the width of the character 'ch' using the font 'font'. The global "C" function MTextNWidth() is available for use from outside CmMGUI derived classes.
|
|
This function enables the run-time resource changing dialog. You can set object properties as font, color, text and shadow using a run-time dialog window. If enableCustomizing() in your program, then pressing the right mouse button while holding down both Shift and Ctlr keys on an enabled object, the customizing dialog is open. The object must be enabled by calling the enableOptions() method, specifying the object name and the properties you want to be able to change at run-time. Via the customizing dialog you can optionally save the changes made in the application's resource file. The global "C" function MEnableCustomizing() is available for use from outside CmMGUI derived classes.
|
|
Displays a modal prompt window for a file name selection. It allows the program to block its flow, waiting for the user input a file name. The global "C" function MFileBrowse() is available for use from outside CmMGUI derived classes.
|
|
Displays a modal prompt window for a file name selection. It allows the program to block its flow, waiting for the user input a file name. The global "C" function MFileSelection() is available for use from outside CmMGUI derived classes.
|
|
Returns a pointer to a const string containing the running application name. The exe file extension is removed from the name if running under DOS or Windows. The global "C" function MGetApplicationName() is available for use from outside CmMGUI derived classes. |
|
Retrieves a Background Color option from the resource database. A Background Color option is stored in the application or the MGUI resource files using 'background' as the option name. The global "C" function MGetBGColorOption() is available for use from outside CmMGUI derived classes.
|
|
Returns the color id of the black color. Black and white colors are pre-allocated by MGUI at startup. You can use this value instead of allocating the color. The global "C" function MGetBlackColor() is available for use from outside CmMGUI derived classes. |
|
Returns the program's current directory. An ending directory separator character is included in the returned path ('/' under Unix, '\' under DOS/Windows). The drive letter and the ':' characters are also included at the beginning of the path under DOS/Windows. The global "C" function MGetCurrentDirectory() is available for use from outside CmMGUI derived classes.
|
|
Retrieves the R-G-B components of the default background color. This color is used to draw the background in many MGUI objects. The R, G and B values are returned respectively in the variables pointed to by: 'pr', 'pg' and 'pb'. The global "C" function MGetDefaultBackgroundRGB() is available for use from outside CmMGUI derived classes.
|
|
Retrieves the R-G-B components of the default foreground color. This color is used to draw the foreground in many MGUI objects. The R, G and B values are returned respectively in the variables pointed to by: 'pr', 'pg' and 'pb'. The global "C" function MGetDefaultForegroundRGB() is available for use from outside CmMGUI derived classes.
|
|
Retrieves a Foreground Color option from the resource database. A Foreground Color option is stored in the application or the MGUI resource files using 'foreground' as the option name. The global "C" function MGetFGColorOption() is available for use from outside CmMGUI derived classes.
|
|
Retrieves the R-G-B components of the background color used in the FileSelection dialog. The global "C" function MGetFileSelectionRGB() is available for use from outside CmMGUI derived classes.
|
|
Retrieves a Font option from the resource database. A Font option is stored in the application or the MGUI resource files using an option named "font". Only the following fonts are currently supported:
The global "C" function MGetFontOption() is available for use from outside CmMGUI derived classes.
|
|
|
|
|
|
Retrieves the R-G-B components of the background color used in the InputPrompt dialog. The global "C" function MGetInputPromptRGB() is available for use from outside CmMGUI derived classes.
|
|
Retrieves an integer option from the resource database. The integer option is identified by two names: the object name and the option name. Both names are free, the application can retrieve integer options manually defined in the application and the MGUI resource files or stored previously (in the application resource file) via saveOptions . The global "C" function MGetIntOption() is available for use from outside CmMGUI derived classes.
|
|
Returns the status of the keyboard modifier keys (Alt, Control, Shift). The returned integer contains a bit mask of the currently pressed modifier keys. You can test each key by bitwise and-ing the returned value with the following macros (defined in mguidef.h): AltMask, ControlMask, ShiftMask. The global "C" function MGetKeyboardState() is available for use from outside CmMGUI derived classes. |
|
|
|
|
|
Retrieves the R-G-B components of the background color used in the Message dialog. The global "C" function MGetMessageDialogRGB() is available for use from outside CmMGUI derived classes.
|
|
Returns the number of colors in the display. Possible values are: 16, 256, 32K, 64K and 16M. They correspond to: 4, 8, 15, 16 and 24 planes. The global "C" function MGetNColors() is available for use from outside CmMGUI derived classes. |
|
Returns the number of color planes in the display. Possible values are: 4, 8, 15, 16 and 24. They correspond to: 16, 256, 32K, 64K and 16M colors. The global "C" function MGetNPlanes() is available for use from outside CmMGUI derived classes. |
|
Returns the screen height in pixel units. The global "C" function MGetScreenHeight() is available for use from outside CmMGUI derived classes. |
|
Returns the screen width in pixel units. The global "C" function MGetScreenWidth() is available for use from outside CmMGUI derived classes. |
|
Retrieves a Shadow option from the resource database. A Shadow option is stored in the application or the MGUI resource files using an option named "shadow". The global "C" function MGetShadowOption() is available for use from outside CmMGUI derived classes.
|
|
Retrieves a generic string option from the resource database. The string option is identified by two names: the object name and the option name. Both names are free, the application can retrieve string options manually defined in the application or the MGUI resource files or stored (in the application resource file) via saveOptions . The global "C" function MGetStringOption() is available for use from outside CmMGUI derived classes.
|
|
Returns a pointer to a constant string specifying the MGUISYS directory. The MGUISYS directory is searched at startup by the MGui init code that runs before calling the application code: CmAppl::start(). This directory contains MGui bitmaps (as scrollbar arrows), MGui fonts for console systems (DOS and Linux console), MGui resource files. The global "C" function MGetSysDir() is available for use from outside CmMGUI derived classes. |
|
Retrieves a text option from the resource database. The text option is identified by only one name: the object name. A text option is stored in the application or the MGUI resource files using an option named "text". The global "C" function MGetTextOption() is available for use from outside CmMGUI derived classes.
|
|
Returns the color id of the white color. Black and white colors are pre-allocated by MGUI at startup. You can use this value instead of allocating the color. The global "C" function MGetWhiteColor() is available for use from outside CmMGUI derived classes. |
|
Displays a modal prompt window for a single line text input. This dialog window allows the program to block its flow, waiting for the user input a single line text. The global "C" function MInputPrompt() is available for use from outside CmMGUI derived classes.
|
|
Prints a formatted log string in the log window (and the log file if enabled). You can call this function anywhere in your MGUI program, provided your calling method belongs to a class that inherits from CmMGUI. The global "C" function MLog() is available for use from outside CmMGUI derived classes.
|
|
Retrieves the current log mask containing enabled log contexts. The global "C" function MLogGetMask() is available for use from outside CmMGUI derived classes.
|
|
Sets the log level, log window geometry and log filename. MGUI provides a run time log printing both to a window and optionally to a file. Logging is filtered using a threshold level and an optional context mask. By default the context mask is disabled. The first argument enstablishes the starting log-level. All log requests, made later by the program and having a level lower than this, are ignored. The global "C" function MLogInit() is available for use from outside CmMGUI derived classes.
|
|
Clears bits in the current log mask disabling some log contexts. The current log mask is obtained by 'and-ing' the old mask with the negated new one specified as argument. The global "C" function MLogResetMaskBits() is available for use from outside CmMGUI derived classes.
|
|
Sets the current log-level. The global "C" function MLogSetLevel() is available for use from outside CmMGUI derived classes.
|
|
Sets the current log mask. The old mask is replaced by the new one specified as argument. The global "C" function MLogSetMask() is available for use from outside CmMGUI derived classes.
|
|
Adds bits to the current log mask enabling more log contexts. The old mask is or-ed with the new one specified as argument. The global "C" function MLogSetMaskBits() is available for use from outside CmMGUI derived classes.
|
|
|
|
Processes all pending events and then returns. The argument 'discard' is a bolean value specifying whether the function has to discard all pending events or process them normally. It's highly recommended not to discard events. The main purpose of this function is to provide a way to poll for MGUI events, allowing event processing. This function is useful if your application has its own event loop and wants to process MGUI events without blocking into the MGUI loop. The global "C" function MLoopWhileEvents() is available for use from outside CmMGUI derived classes.
|
|
Transfers control temporarily to a MGUI event loop handler. This function acts exactly as mainLoop while the value of the integer pointed to by 'pflag' equals 'value'. When such values differ, the function returns control to the calling program. The main purpose of this function is to provide a way to stop the program flow, allowing event processing, and then to resume it after a particular condition occurs (*pflag becomes different from 'value'). Many utility dialogs provided by MGUI use this function to stop execution and return to the calling program when the desired user input is available (See messageDialog , fileSelection , inputPrompt , textPrompt The global "C" function MLoopWhileFlag() is available for use from outside CmMGUI derived classes.
|
|
Transfers control to the main MGUI event loop handler. This function never returns. It puts the program in an infinite loop allowing the program to get and then process any external MGUI event. External events are:
|
|
Prints a formatted log string in the log window using the context mask. You can call this function anywhere in your MGUI program, provided your calling method belongs to a class that inherits from CmMGUI. The log string is actually printed only if conditions for both the log-level and the context mask are satisfied. The global "C" function MMaskedLog() is available for use from outside CmMGUI derived classes.
|
|
Displays a modal message window. This dialog window allows the program to block its flow until the user selects one of the push buttons provided. The buttons are specified using a NULL terminated list of string pointers. At least one button must be specified, so, the argument 'btn1' describes the text of the first button and 'btn2' could be the NULL pointer or a pointer to string for the text of the second button. The global "C" function MMessageDialog() is available for use from outside CmMGUI derived classes.
|
|
Retrieves next available MGUI event waiting for it if desired. The event is returned in the buffer pointed to by 'pe'. This structure must be allocated by the calling function. The second argument specifies, with a boolean value, whether the caller wants to wait for an event or not. If no pending event is found and 'wait' equals 0, the function returns immediately and sets the 'type' field of the MEvent structure to E_NO_EVENT. The global "C" function MNextEvent() is available for use from outside CmMGUI derived classes.
|
|
This function returns True if the calling program runs in 16 or 256 colors video mode. When running in PaletteMode it's possible to create color animation by changing the RGB values in the colormap cells. The global "C" function MPaletteMode() is available for use from outside CmMGUI derived classes. |
|
Processes a MGUI event retrieved by nextEvent(). The mainLoop() function uses nextEvent() and this function to realize the blocking MGUI loop. The global "C" function MProcessEvent() is available for use from outside CmMGUI derived classes.
|
|
Saves in the application's resource file all defined options. The file is entirely rewritten using option values read at startup from the same file and all options eventually defined at run time using:
Reimplemented in CmObject. |
|
Stores a Background Color option in the resource database. A Background Color option is stored in the application or the MGUI resource files using an option named "background". The RGB values 'r', 'g', and 'b' are stored as the color definition. The global "C" function MSetBGColorOption() is available for use from outside CmMGUI derived classes.
|
|
Sets the R-G-B components of the default background color. This setting does not affect MGUI objects already created. The R, G and B values 'r', 'g' and 'pb' are used to set respectively the red, green and blue components of the new default background color. The global "C" function MSetDefaultBackgroundRGB() is available for use from outside CmMGUI derived classes.
|
|
Sets the R-G-B components of the default foreground color. This setting does not affect MGUI objects already created. The R, G and B values 'r', 'g' and 'pb' are used to set respectively the red, green and blue components of the new default foreground color. The global "C" function MSetDefaultForegroundRGB() is available for use from outside CmMGUI derived classes.
|
|
Stores a Foreground Color option in the resource database. A Foreground Color option is stored in the application or the MGUI resource files using an option named "foreground". The RGB values 'r', 'g', and 'b' are stored as the color definition. The global "C" function MSetFGColorOption() is available for use from outside CmMGUI derived classes.
|
|
Sets the R-G-B components of the background color of the FileSelection dialog. The global "C" function MSetFileSelectionRGB() is available for use from outside CmMGUI derived classes.
|
|
Changes the text displayed in the labels and buttons in the FileSelection dialog. To reset a value to its default, pass the NULL pointer to the corresponding parameter. The global "C" function MSetFileSelectionTextStrings() is available for use from outside CmMGUI derived classes.
|
|
Stores a Font option in the resource database. A Font option is stored in the application or the MGUI resource files using an option named "font". Only the following fonts are currently supported:
|
|
|
|
|
|
Sets the R-G-B components of the background color of the InputPrompt dialog. The global "C" function MSetInputPromptRGB() is available for use from outside CmMGUI derived classes.
|
|
Stores an integer option in the resource database. The integer option is identified by two names: the object name and the option name. Both names are free, the application can store integer options manually defining them in the application or the MGUI resource files or via saveOptions (in the application resource file only). The global "C" function MSetIntOption() is available for use from outside CmMGUI derived classes.
|
|
|
|
|
|
Sets the R-G-B components of the background color of the Message dialog. The global "C" function MSetMessageDialogRGB() is available for use from outside CmMGUI derived classes.
|
|
Stores a Shadow option in the resource database. A Shadow option is stored in the application or the MGUI resource files using an option named "shadow". The Shadow values are stored in the database using the variables 'shadow', 'in_t' and 'out_t' (respectively: 'shadow type', 'internal thickness' and 'out thickness'). The global "C" function MSetShadowOption() is available for use from outside CmMGUI derived classes.
|
|
Stores a generic string option in the resource database. The string option is identified by two names: the object name and the option name. Both names are free, the application can store string options manually defining them in the application or the MGUI resource files or via saveOptions (in the application resource file only). The value is stored in a new allocated buffer. The global "C" function MSetStringOption() is available for use from outside CmMGUI derived classes.
|
|
Stores a text option in the resource database. The text option is identified by only one name: the object name. A text option is stored in the application or the MGUI resource files using an option named "text". The value is stored in a new allocated buffer. The global "C" function MSetTextOption() is available for use from outside CmMGUI derived classes.
|
|
Sets the name of the file which to write low level tracing messages. The global "C" function MSetTraceFileName() is available for use from outside CmMGUI derived classes.
|
|
Prints an ascii text file in the system printer. The print dialog is displayed under Windows. The file is printed in background under DOS, provided that the program periodically gives control to one of the event loop functions. The global "C" function MSpoolFile() is available for use from outside CmMGUI derived classes.
|
|
Prints a temporary ascii text file in the system printer. The file is removed as the printing is done. The print dialog is displayed under Windows. The file is printed in background under DOS, provided that the program periodically gives control to one of the event loop functions. The global "C" function MSpoolFile() is available for use from outside CmMGUI derived classes.
|
|
Returns the x position (in pixels) of the character at a given position in a string array. This function actually converts the position of a character in a string from array index 'i' to x position in pixels using the font 'font'. The global "C" function MTextCharX() is available for use from outside CmMGUI derived classes.
|
|
Returns the height of the string 'text' using the font 'font'. The global "C" function MTextHeight() is available for use from outside CmMGUI derived classes.
|
|
Returns the width of the first 'n' characters in the string 'text' using the font 'font'. The global "C" function MTextNWidth() is available for use from outside CmMGUI derived classes.
|
|
Displays a modal prompt window for a multi line text input. This dialog window allows the program to block its flow, waiting for the user input a multi line text. The arguments 'w' and 'h' specify the width and height of the Edit field object in character units. The global "C" function MTextPrompt() is available for use from outside CmMGUI derived classes.
|
|
Returns the width of the null terminated string 'text' using the font 'font'. The global "C" function MTextWidth() is available for use from outside CmMGUI derived classes.
|
|
Prints a low level tracing message to the trace file. Messages printed via this function are not directed to the log window. Rather they go directly to the trace file (default name is trace.log) created in the current directory of the program. The trace file is open, written and closed at any call to this function, so it's recommended to use it only for low level debugging in case the log() function is not suitable. The global "C" function Trace() is available for use from outside CmMGUI derived classes.
|
|
|