Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

Resource Handling

This group includes functions for handling resource options. More...

Functions

void MEnableCustomizing (void)
char * MGetStringOption (const char *obj_name, const char *opt_name)
char * MGetTextOption (const char *obj_name)
int MGetIntOption (const char *obj_name, const char *opt_name, int *ret)
int MGetFontOption (const char *obj_name, MTFont *ret)
int MGetBGColorOption (const char *obj_name, int *pr, int *pg, int *pb)
int MGetFGColorOption (const char *obj_name, int *pr, int *pg, int *pb)
int MGetShadowOption (const char *obj_name, int *shadow, int *i_t, int *o_t)
void MSetStringOption (const char *obj_name, const char *opt_name, const char *text)
void MSetTextOption (const char *obj_name, const char *text)
void MSetIntOption (const char *obj_name, const char *opt_name, int val)
void MSetFontOption (const char *obj_name, MTFont font)
void MSetBGColorOption (const char *obj_name, int r, int g, int b)
void MSetFGColorOption (const char *obj_name, int r, int g, int b)
void MSetShadowOption (const char *obj_name, int shadow, int in_t, int out_t)
void MSaveOptions (void)

Detailed Description

This group includes functions for handling resource options.


Function Documentation

void MEnableCustomizing void   
 

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 MEnableCustomizing() 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 MEnableOptions() function, 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.

See also:
MSaveOptions

int MGetBGColorOption const char *    obj_name,
int *    pr,
int *    pg,
int *    pb
 

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.

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
pr Points to an integer variable which to store the return red value to.
pg Points to an integer variable which to store the return green value to.
pb Points to an integer variable which to store the return blue value to.
Returns:
If the option is found, a boolean value of 'True' is returned by the function and the RGB values are stored in the variables pointed to by 'pr', 'pg' and 'pb'. Otherwise the value 'False' is returned.
See also:
MSetBGColorOption

int MGetFGColorOption const char *    obj_name,
int *    pr,
int *    pg,
int *    pb
 

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.

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
pr Points to an integer variable which to store the return red value to.
pg Points to an integer variable which to store the return green value to.
pb Points to an integer variable which to store the return blue value to.
Returns:
If the option is found, a boolean value of 'True' is returned by the function and the RGB values are stored in the variables pointed to by 'pr', 'pg' and 'pb'. Otherwise the value 'False' is returned.
See also:
MSetFGColorOption

int MGetFontOption const char *    obj_name,
MTFont   ret
 

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:

  • FIXED_SMALL
  • FIXED_MEDIUM
  • FIXED_LARGE
  • HELV_SMALL
  • HELV_MEDIUM
  • TIMES_SMALL
  • TIMES_MEDIUM
  • HELV_LARGE
  • TIMES_LARGE

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
ret Points to an integer variable that will contain the return value.
Returns:
If the option is found, a boolean value of 'True' is returned by the function and the MTFont value is stored in the variable pointed to by 'ret'. Otherwise the value 'False' is returned.
See also:
MSetFontOption

int MGetIntOption const char *    obj_name,
const char *    opt_name,
int *    ret
 

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

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
opt_name Specifies the name of the option. Option names in the DOS and Windows resource file appear after an object definition. The option is followed by the '=' character and the option value.
ret Points to an integer variable that will contain the return value.
Returns:
If the option is found, a boolean value of 'True' will be returned by the function and the integer value is stored in the variable pointed to by 'ret'. Otherwise the value 'False' is returned.
See also:
MSetIntOption

int MGetShadowOption const char *    obj_name,
int *    shadow,
int *    i_t,
int *    o_t
 

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

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
shadow Points to a variable that will contain the shadow type on return.
i_t Points to a variable that will contain the internal thickness on return.
o_t Points to a variable that will contain the out thickness on return.
Returns:
If the option is found, a boolean value of 'True' is returned by the function and the Shadow values are stored in the variables pointed to by the appropriate parameters. Otherwise the value 'False' is returned.
See also:
MSetShadowOption

char* MGetStringOption const char *    obj_name,
const char *    opt_name
 

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

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
opt_name Specifies the name of the option. Option names in the DOS and Windows resource file appear after an object definition. The option is followed by the '=' character and the option value.
Returns:
The string value is returned in a new allocated buffer. The application is responsible for freeing the memory, using free(), when the value is no longer needed. The NULL pointer is returned if the option is not found.
See also:
MSetStringOption

char* MGetTextOption const char *    obj_name
 

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

Returns:
The value is returned in a new allocated buffer. The application is responsible for freeing the memory, using free(), when the value is no longer needed. The NULL pointer is returned if the option is not found.
See also:
MSetTextOption, MGetStringOption, MSetStringOption

void MSaveOptions void   
 

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:

See also:
MEnableOptions

void MSetBGColorOption const char *    obj_name,
int    r,
int    g,
int    b
 

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.

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
r The red component of the color to store.
g The green component of the color to store.
b The blue component of the color to store.
See also:
MGetBGColorOption

void MSetFGColorOption const char *    obj_name,
int    r,
int    g,
int    b
 

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.

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
r The red component of the color to store.
g The green component of the color to store.
b The blue component of the color to store.
See also:
MGetFGColorOption

void MSetFontOption const char *    obj_name,
MTFont    font
 

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:

  • FIXED_SMALL
  • FIXED_MEDIUM
  • FIXED_LARGE
  • HELV_SMALL
  • HELV_MEDIUM
  • TIMES_SMALL
  • TIMES_MEDIUM
  • HELV_LARGE
  • TIMES_LARGE
Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
font The MTFont value to be stored.
See also:
MGetFontOption

void MSetIntOption const char *    obj_name,
const char *    opt_name,
int    val
 

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 MSaveOptions (in the application resource file only).

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
opt_name Specifies the name of the option. Option names in the DOS and Windows resource file appear after an object definition. The option is followed by the '=' character and the option value.
val The integer value to be stored.
See also:
MGetIntOption

void MSetShadowOption const char *    obj_name,
int    shadow,
int    in_t,
int    out_t
 

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

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
shadow The shadow type (WS_NONE, WS_SHADOW_IN, WS_SHADOW_OUT, WS_ETCHED_IN, WS_ETCHED_OUT).
in_t The internal thickness.
out_t The out thickness.
See also:
MGetShadowOption

void MSetStringOption const char *    obj_name,
const char *    opt_name,
const char *    text
 

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 MSaveOptions (in the application resource file only). The value is stored in a new allocated buffer.

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
opt_name Specifies the name of the option. Option names in the DOS and Windows resource file appear after an object definition. The option is followed by the '=' character and the option value.
text The text value to be stored.
See also:
MGetStringOption

void MSetTextOption const char *    obj_name,
const char *    text
 

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.

Parameters:
obj_name Specifies the name of the object. An object in the DOS and Windows resource file is defined by enclosing its name in brackets and it is followed by option definitions.
text The text value to be stored.
See also:
MGetTextOption


Generated on Sun Jun 29 13:03:09 2003 for MGui API by doxygen1.3-rc2