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

Macros


Color Brightness percentages.

These macros are internally used by the MGui library for brightness percentage levels.

Using predefined values for color shading is recommended especially when the program runs in Palette mode (up to 256 colors). These values can be used as the percentage parameter in functions like MAllocShiftColor(), MScrolledFormSetSliderColorShift(), MScrollBarSetSliderColorShift(), MSListSetSliderColorShift(), MScrolledEditSetSliderColorShift(), MTreeSetSliderColorShift(), MObjectSetBGColorFromParent()

#define CS_LIGHTER   140
 for object border shadows

#define CS_DARKER   60
 for object border shadows

#define CS_DARK   85
 for armed button bg and default selection highlights

#define CS_LIGHT   115
 for default selection highlights


MGUI Events

Events generated by the MGui library have one of the following values in the type member of all structures in the MEvent union.

#define E_NO_EVENT   0
#define E_KEY_PRESS   1
#define E_BUTTON_PRESS   2
#define E_BUTTON_RELEASE   3
#define E_MOTION   4
#define E_WINDOW_ENTER   5
#define E_WINDOW_EXIT   6
#define E_EXPOSE   7
#define E_DESTROY   8
#define E_MAP   9
#define E_UNMAP   10
#define E_AUTOSIZE   11
#define E_RESIZE   12
#define E_MOVE   13
#define E_SELECT   14
#define E_DESELECT   15
#define E_CONFIGURE   16
#define E_PARENT_MAP   17
#define E_PARENT_UNMAP   18
#define E_SET_COLOR   19
#define E_SET_SHADOW   20
#define E_SET_TEXT   21
#define E_GET_TEXT   22
#define E_WM_CLOSE   23
#define E_SET_SENS   24
#define E_SET_PARENT_SENS   25
#define E_GRAB_LOSE   26
#define E_SET_BG_IMAGE   27
#define E_MOUSE_WHEEL   28
#define E_SET_TRANSPARENCY   29
#define E_PARENT_CHANGED   30

Event Masks.

Bitmask values to select a set of events in a single variable.

A bitmask of these values can be used to set the desired event types to be reported in callbacks set via MObjectAddEventNotifyCallback(), CmObject::setEventCallback.

#define EM_NO_EVENT   0L
#define EM_KEY_PRESS   1L
#define EM_BUTTON_PRESS   (1L<<1)
#define EM_BUTTON_RELEASE   (1L<<2)
#define EM_MOTION   (1L<<3)
#define EM_WINDOW_ENTER   (1L<<4)
#define EM_WINDOW_EXIT   (1L<<5)
#define EM_EXPOSE   (1L<<6)
#define EM_DESTROY   (1L<<7)
#define EM_MAP   (1L<<8)
#define EM_UNMAP   (1L<<9)
#define EM_AUTOSIZE   (1L<<10)
#define EM_RESIZE   (1L<<11)
#define EM_MOVE   (1L<<12)
#define EM_SELECT   (1L<<13)
#define EM_DESELECT   (1L<<14)
#define EM_CONFIGURE   (1L<<15)
#define EM_PARENT_MAP   (1L<<16)
#define EM_PARENT_UNMAP   (1L<<17)
#define EM_SET_COLOR   (1L<<18)
#define EM_SET_SHADOW   (1L<<19)
#define EM_SET_TEXT   (1L<<20)
#define EM_GET_TEXT   (1L<<21)
#define EM_WM_CLOSE   (1L<<22)
#define EM_SET_SENS   (1L<<23)
#define EM_SET_PARENT_SENS   (1L<<24)
#define EM_GRAB_LOSE   (1L<<25)
#define EM_SET_BG_IMAGE   (1L<<26)
#define EM_MOUSE_WHEEL   (1L<<27)
#define EM_SET_TRANSPARENCY   (1L<<28)
#define EM_PARENT_CHANGED   (1L<<29)

Mouse button bitmask in mouse events.

These values can be found in the state member of structure MMouseEvent.

By masking the state field with these macro values you can realize which mouse buttons were hold down when the event was generated.

#define Button1Mask   (1<<8)
#define Button2Mask   (1<<9)
#define Button3Mask   (1<<10)

Mouse button bitmask in mouse events.

Only one of these values can be found in the button field of the MMouseEvent structure.

Note that the given button can be pressed or released depending on the actual value of the type member in the same event (E_BUTTON_PRESS or E_BUTTON_RELEASE)

#define Button1   1
#define Button2   2
#define Button3   3

Keyboard Modifier key masks.

By masking the value o these macros with the state field in events MKeyEvent and MMouseEvent you can figure out the hold down status of such keys at the time the event was generated.

You can also mask them with the value returned by MGetKeyboardState to check the status of the modifier keys at any time.

#define ShiftMask   (1<<0)
#define LockMask   (1<<1)
#define ControlMask   (1<<2)
#define AltMask   (1<<3)

Predefined Mouse Cursors.

When setting a particular mouse cursor to be operative in a given MGui object via MObjectSetCursor or CmObject::setCursor, you can use either one of the predefined mouse cursors or an application created one (via MCreateCursor() or CmCursor::CmCursor)

#define MC_NONE   (MTCursor)0
#define MC_UL_ARROW   (MTCursor)1
#define MC_CROSSHAIR   (MTCursor)2
#define MC_HOURGLASS   (MTCursor)3
#define MC_HSIZE   (MTCursor)4
#define MC_VSIZE   (MTCursor)5
#define MC_NWSIZE   (MTCursor)6
#define MC_NESIZE   (MTCursor)7

Static fonts.

These are predefined font identifiers to be used to set object font either at creation time or via MObjectSetFont() and CmObject::setFont.

Fonts can also be loaded via MLoadFont() and CmFont::CmFont.

#define DEFAULT_FONT   0
#define FIXED_SMALL   1
#define FIXED_MEDIUM   2
#define FIXED_LARGE   3
#define HELV_SMALL   4
#define HELV_MEDIUM   5
#define TIMES_SMALL   6
#define TIMES_MEDIUM   7
#define HELV_LARGE   8
#define TIMES_LARGE   9

Alignment options.

The first 3 are used for text alignment in LABEL and text-only BUTTON objects and in Text drawing primitives (CmPushButton::setAlignment).

All are also used to align objects in the TableForm cell boundaries when a Form is enlarged (MObjectAlign(), MTableFormSetColAlign(), MTableFormSetRowAlign(), CmObject::align, CmAbsTableForm::setColAlign, CmAbsTableForm::setRowAlign). Moreover they all can be used to set the Text vs Image alignment in Buttons (Push/Toggle/Radio) having both image and text via MButtonSetTextVsImageAlignment() and CmAbsButton::setTextVsImageAlignment.

#define LEFT_ALIGN   0
#define RIGHT_ALIGN   1
#define CENTER_ALIGN   2
#define TOP_ALIGN   3
#define BOTTOM_ALIGN   4
#define UNDEF_ALIGN   0x3f

Object Options.

For use with MObjectEnableOptions() and MObjectSaveOptions().

#define MO_FONT   0x1
#define MO_FGCOLOR   0x2
#define MO_BGCOLOR   0x4
#define MO_SHADOW   0x8
#define MO_TEXT   0x10
#define MO_BG_IMAGE   0x20
#define MO_TRANSPARENCY   0x40
#define MO_COLOR   (MO_FGCOLOR|MO_BGCOLOR)
#define MO_ALL   0x7f

Object background Image drawing modes.

To be used in MObjectSetBackgroundImage(), MObjectSetBackgroundImageFile() CmObject::setBackgroundImage(), CmObject::setBackgroundImageFile()

#define BI_TILED   0
#define BI_CENTERED   1
#define BI_SIZE_FORCING   2

Object shadows.

To be used in MObjectSetShadow(), CmObject::setShadow()

#define WS_NONE   0
#define WS_SHADOW_OUT   1
#define WS_SHADOW_IN   2
#define WS_ETCHED_IN   3
#define WS_ETCHED_OUT   4

Object Types.

Function MObjectType() and method CmObject::type return one these value as the object type.

Note that compound objects do not have specific values.

#define OT_SHELL   1
#define OT_FORM   2
#define OT_LABEL   3
#define OT_PBUTTON   4
#define OT_TBUTTON   5
#define OT_RBUTTON   6
#define OT_SCROLLBAR   7
#define OT_EDIT   8
#define OT_STATUSBAR   9
#define OT_TEXT   10
#define OT_SBLIST   11
#define OT_MENUBAR   12
#define OT_MENU   13
#define OT_DRAWAREA   14
#define OT_SPLITTER   15

SHELL creation options.

To be used as bitwise or-ed in the 'flags' parameter of MCreateShell(), CmShell::CmShell().

#define SF_NO_FOCUS_CHANGE   0x1
 Internal use (MENU).

#define SF_SAVEUNDER   0x2
 The area under the appearing SHELL window is stored for a fast redraw when the window is deleted.

#define SF_MODAL   0x4
 Input focus is grabbed by the SHELL until it is removed.

#define SF_POPUP   0x8
 Undecorated window look (MENU).

#define SF_IGNORE_WM_CLOSE   0x10
 SHELL ignores the CLOSE message sent by the Window Manager.

#define SF_UNMAP_ON_WM_CLOSE   0x20
 The SHELL only unmaps itself (not destroy) when receives the CLOSE message from the Window Manager.

#define SF_NO_CLOSE   0x40
 No close button in the title bar.

#define SF_NO_MAXIMIZE   0x80
 No maximize button in the title bar.

#define SF_NO_MINIMIZE   0x100
 No minimize button in the title bar.

#define SF_NO_RESIZE   0x200
 Resize disabled (both width and height).

#define SF_NO_W_RESIZE   0x400
 Width Resize disabled.

#define SF_NO_H_RESIZE   0x800
 Height Resize disabled.


Shell position/size defaults.

To be used in MShellRealizeXY(), MShellRealizeXYWH(), CmShell::realize()

#define DEF_POSITION   -32768
 Default x/y position useable in MShellRealizeXY().

#define DEF_SIZE   -32768

MTNODE creation flags.

To be used in MTreeCreateNode().

#define NF_CONTAINER   0x1
#define NF_TOGGLE   0x2

SPOOL return values for MSpoolFile() and MSpoolTempFile().

#define MSPOOL_OK   0
#define MSPOOL_FULL_QUEUE   -1
#define MSPOOL_NOT_READY   -2
#define MSPOOL_FILE_ERR   -3

Child Attachment

#define F_ATT_NONE   0
#define F_ATT_FORM   1
#define F_ATT_OBJ   2

SCROLLBAR TYPE.

For use in MCreateScrollBar(), CmScrollBar

#define SBT_HOR   0
#define SBT_VERT   1

EDIT filter values.

Use in MEditSetFilter(), CmAbsEditField::setFilter

#define NOCHAR   0
#define ANYCHAR   0x1
#define ALPHA   0x2
#define DIGIT   0x4
#define SPACE   0x8
#define SIGNED   0x100
#define DOT   0x200
#define UPPER   0x400
#define LOWER   0x800
#define ALPHANUM   (ALPHA|DIGIT)
#define UPALPHA   (ALPHA|UPPER)
#define LOWALPHA   (ALPHA|LOWER)
#define U_INT   DIGIT
#define S_INT   (DIGIT|SIGNED)
#define U_FLOAT   (DIGIT|DOT)
#define S_FLOAT   (DIGIT|DOT|SIGNED)

Socket Events

#define SE_READ   0x1
#define SE_WRITE   0x2
#define SE_EXCP   0x4

Define Documentation

#define ALPHA   0x2
 

#define ALPHANUM   (ALPHA|DIGIT)
 

#define AltMask   (1<<3)
 

#define ANYCHAR   0x1
 

#define BI_CENTERED   1
 

#define BI_SIZE_FORCING   2
 

#define BI_TILED   0
 

#define BOTTOM_ALIGN   4
 

#define Button1   1
 

#define Button1Mask   (1<<8)
 

#define Button2   2
 

#define Button2Mask   (1<<9)
 

#define Button3   3
 

#define Button3Mask   (1<<10)
 

#define CENTER_ALIGN   2
 

#define ControlMask   (1<<2)
 

#define CS_DARK   85
 

for armed button bg and default selection highlights

#define CS_DARKER   60
 

for object border shadows

#define CS_LIGHT   115
 

for default selection highlights

#define CS_LIGHTER   140
 

for object border shadows

#define DEF_POSITION   -32768
 

Default x/y position useable in MShellRealizeXY().

#define DEF_SIZE   -32768
 

#define DEFAULT_FONT   0
 

#define DIGIT   0x4
 

#define DOT   0x200
 

#define E_AUTOSIZE   11
 

#define E_BUTTON_PRESS   2
 

#define E_BUTTON_RELEASE   3
 

#define E_CONFIGURE   16
 

#define E_DESELECT   15
 

#define E_DESTROY   8
 

#define E_EXPOSE   7
 

#define E_GET_TEXT   22
 

#define E_GRAB_LOSE   26
 

#define E_KEY_PRESS   1
 

#define E_MAP   9
 

#define E_MOTION   4
 

#define E_MOUSE_WHEEL   28
 

#define E_MOVE   13
 

#define E_NO_EVENT   0
 

#define E_PARENT_CHANGED   30
 

#define E_PARENT_MAP   17
 

#define E_PARENT_UNMAP   18
 

#define E_RESIZE   12
 

#define E_SELECT   14
 

#define E_SET_BG_IMAGE   27
 

#define E_SET_COLOR   19
 

#define E_SET_PARENT_SENS   25
 

#define E_SET_SENS   24
 

#define E_SET_SHADOW   20
 

#define E_SET_TEXT   21
 

#define E_SET_TRANSPARENCY   29
 

#define E_UNMAP   10
 

#define E_WINDOW_ENTER   5
 

#define E_WINDOW_EXIT   6
 

#define E_WM_CLOSE   23
 

#define EM_AUTOSIZE   (1L<<10)
 

#define EM_BUTTON_PRESS   (1L<<1)
 

#define EM_BUTTON_RELEASE   (1L<<2)
 

#define EM_CONFIGURE   (1L<<15)
 

#define EM_DESELECT   (1L<<14)
 

#define EM_DESTROY   (1L<<7)
 

#define EM_EXPOSE   (1L<<6)
 

#define EM_GET_TEXT   (1L<<21)
 

#define EM_GRAB_LOSE   (1L<<25)
 

#define EM_KEY_PRESS   1L
 

#define EM_MAP   (1L<<8)
 

#define EM_MOTION   (1L<<3)
 

#define EM_MOUSE_WHEEL   (1L<<27)
 

#define EM_MOVE   (1L<<12)
 

#define EM_NO_EVENT   0L
 

#define EM_PARENT_CHANGED   (1L<<29)
 

#define EM_PARENT_MAP   (1L<<16)
 

#define EM_PARENT_UNMAP   (1L<<17)
 

#define EM_RESIZE   (1L<<11)
 

#define EM_SELECT   (1L<<13)
 

#define EM_SET_BG_IMAGE   (1L<<26)
 

#define EM_SET_COLOR   (1L<<18)
 

#define EM_SET_PARENT_SENS   (1L<<24)
 

#define EM_SET_SENS   (1L<<23)
 

#define EM_SET_SHADOW   (1L<<19)
 

#define EM_SET_TEXT   (1L<<20)
 

#define EM_SET_TRANSPARENCY   (1L<<28)
 

#define EM_UNMAP   (1L<<9)
 

#define EM_WINDOW_ENTER   (1L<<4)
 

#define EM_WINDOW_EXIT   (1L<<5)
 

#define EM_WM_CLOSE   (1L<<22)
 

#define F_ATT_FORM   1
 

#define F_ATT_NONE   0
 

#define F_ATT_OBJ   2
 

#define FIXED_LARGE   3
 

#define FIXED_MEDIUM   2
 

#define FIXED_SMALL   1
 

#define HELV_LARGE   8
 

#define HELV_MEDIUM   5
 

#define HELV_SMALL   4
 

#define LEFT_ALIGN   0
 

#define LockMask   (1<<1)
 

#define LOWALPHA   (ALPHA|LOWER)
 

#define LOWER   0x800
 

#define MC_CROSSHAIR   (MTCursor)2
 

#define MC_HOURGLASS   (MTCursor)3
 

#define MC_HSIZE   (MTCursor)4
 

#define MC_NESIZE   (MTCursor)7
 

#define MC_NONE   (MTCursor)0
 

#define MC_NWSIZE   (MTCursor)6
 

#define MC_UL_ARROW   (MTCursor)1
 

#define MC_VSIZE   (MTCursor)5
 

#define MO_ALL   0x7f
 

#define MO_BG_IMAGE   0x20
 

#define MO_BGCOLOR   0x4
 

#define MO_COLOR   (MO_FGCOLOR|MO_BGCOLOR)
 

#define MO_FGCOLOR   0x2
 

#define MO_FONT   0x1
 

#define MO_SHADOW   0x8
 

#define MO_TEXT   0x10
 

#define MO_TRANSPARENCY   0x40
 

#define MSPOOL_FILE_ERR   -3
 

#define MSPOOL_FULL_QUEUE   -1
 

#define MSPOOL_NOT_READY   -2
 

#define MSPOOL_OK   0
 

#define NF_CONTAINER   0x1
 

#define NF_TOGGLE   0x2
 

#define NOCHAR   0
 

#define OT_DRAWAREA   14
 

#define OT_EDIT   8
 

#define OT_FORM   2
 

#define OT_LABEL   3
 

#define OT_MENU   13
 

#define OT_MENUBAR   12
 

#define OT_PBUTTON   4
 

#define OT_RBUTTON   6
 

#define OT_SBLIST   11
 

#define OT_SCROLLBAR   7
 

#define OT_SHELL   1
 

#define OT_SPLITTER   15
 

#define OT_STATUSBAR   9
 

#define OT_TBUTTON   5
 

#define OT_TEXT   10
 

#define RIGHT_ALIGN   1
 

#define S_FLOAT   (DIGIT|DOT|SIGNED)
 

#define S_INT   (DIGIT|SIGNED)
 

#define SBT_HOR   0
 

#define SBT_VERT   1
 

#define SE_EXCP   0x4
 

#define SE_READ   0x1
 

#define SE_WRITE   0x2
 

#define SF_IGNORE_WM_CLOSE   0x10
 

SHELL ignores the CLOSE message sent by the Window Manager.

#define SF_MODAL   0x4
 

Input focus is grabbed by the SHELL until it is removed.

#define SF_NO_CLOSE   0x40
 

No close button in the title bar.

#define SF_NO_FOCUS_CHANGE   0x1
 

Internal use (MENU).

#define SF_NO_H_RESIZE   0x800
 

Height Resize disabled.

#define SF_NO_MAXIMIZE   0x80
 

No maximize button in the title bar.

#define SF_NO_MINIMIZE   0x100
 

No minimize button in the title bar.

#define SF_NO_RESIZE   0x200
 

Resize disabled (both width and height).

#define SF_NO_W_RESIZE   0x400
 

Width Resize disabled.

#define SF_POPUP   0x8
 

Undecorated window look (MENU).

#define SF_SAVEUNDER   0x2
 

The area under the appearing SHELL window is stored for a fast redraw when the window is deleted.

#define SF_UNMAP_ON_WM_CLOSE   0x20
 

The SHELL only unmaps itself (not destroy) when receives the CLOSE message from the Window Manager.

#define ShiftMask   (1<<0)
 

#define SIGNED   0x100
 

#define SPACE   0x8
 

#define TIMES_LARGE   9
 

#define TIMES_MEDIUM   7
 

#define TIMES_SMALL   6
 

#define TOP_ALIGN   3
 

#define U_FLOAT   (DIGIT|DOT)
 

#define U_INT   DIGIT
 

#define UNDEF_ALIGN   0x3f
 

#define UPALPHA   (ALPHA|UPPER)
 

#define UPPER   0x400
 

#define WS_ETCHED_IN   3
 

#define WS_ETCHED_OUT   4
 

#define WS_NONE   0
 

#define WS_SHADOW_IN   2
 

#define WS_SHADOW_OUT   1
 


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