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

CmObject Class Reference

Abstract Object Class. More...

Inheritance diagram for CmObject:

CmMGUI CmAbsButton CmAbsEdit CmAbsList CmContainer CmDrawArea CmLabel CmMenu CmMenuBar CmPixmap CmScrollBar CmSFile CmSplitter CmStatusBar CmTree

Public Methods

 operator MOBJECT ()
void drawText (int x, int y, int w, int h, const char *text, MTFont font, CmColor *fgc, int alignment)
void drawNText (int x, int y, int w, int h, const char *text, MTFont font, CmColor *fgc, int alignment, int n)
void drawBGText (int x, int y, int w, int h, const char *text, MTFont font, CmColor *bgc, CmColor *fgc, int alignment)
void drawBGNText (int x, int y, int w, int h, const char *text, MTFont font, CmColor *bgc, CmColor *fgc, int alignment, int n)
void drawShadowedText (int x, int y, int w, int h, const char *text, MTFont font, int sh, CmColor *fg1, CmColor *fg2, int alignment)
void drawShadowedNText (int x, int y, int w, int h, const char *text, MTFont font, int sh, CmColor *fg1, CmColor *fg2, int alignment, int n)
void drawPoint (int x, int y, CmColor *col)
void drawLine (int x1, int y1, int x2, int y2, CmColor *col)
void drawPolyline (MPOINT *points, int n, CmColor *col)
void drawFilledPolyline (MPOINT *points, int n, CmColor *col)
void drawBox (int x, int y, int w, int h, CmColor *bgc)
void drawFilledBox (int x, int y, int w, int h, CmColor *bgc)
void drawCircle (int x, int y, int r, CmColor *col)
void drawFilledCircle (int x, int y, int r, CmColor *col)
void drawArc (int x, int y, int r, int a1, int a2, CmColor *col)
void drawFilledArc (int x, int y, int r, int a1, int a2, CmColor *c)
void drawImage (CmImage *gi, int img_x, int img_y, int w, int h, int x, int y)
void drawWindow (void)
void drawShadow (void)
void drawSubShadow (int x, int y, int w, int h, CmColor *tsc, CmColor *bsc, int thick)
void drawBorder (int x, int y, int w, int h, CmColor *col, int thick)
void drawXorLine (int x1, int y1, int x2, int y2)
void drawXorBox (int x, int y, int w, int h)
void setSensitive (void)
void setUnsensitive (void)
void setSensitivity (int true_false)
void setSelectable (void)
void setUnselectable (void)
void setAutoScrollWhenSelected (int TrueFalse)
void setBackgroundColor (CmColor *bgc)
 Sets the desired object background colors.

void setForegroundColor (CmColor *fgc)
 Sets the desired object foreground color.

void setColor (CmColor *bgc, CmColor *fgc)
 Sets the desired object foreground and background colors.

void setBGColorFromParent (int true_false, int percentage)
 Enables/disables getting the object background color from the parent object.

void setFGColorFromParent (int true_false)
 Enables/disables getting the object foreground color from the parent object.

void setBackgroundRGB (unsigned r, unsigned g, unsigned b)
void setForegroundRGB (unsigned r, unsigned g, unsigned b)
void setText (const char *text)
void setName (const char *name)
void setFont (MTFont font, int resize_obj=0)
void setShadow (int type, int in=0, int out=0)
void setResize (int resize_w, int resize_h)
void setSize (int width, int height)
 Sets the object's width and height.

void setMinSize (int width, int height)
 Sets the object's minimum size.

void setWidth (int width)
 Sets the object's width.

void setHeight (int height)
 Sets the object's height.

void setCompositeSize (int width, int height)
 Sets the width and height of a composite object.

void setCompositeWidth (int width)
 Sets the width of a composite object.

void setCompositeHeight (int height)
 Sets the height of a composite object.

void setPosition (int x, int y)
 Sets the (x,y) position of object relative to parent's cohordinates.

void setX (int x)
 Sets the X cohordinate of object relative to parent's cohordinates.

void setY (int y)
 Sets the Y cohordinate of object relative to parent's cohordinates.

void setBackgroundImage (CmImage *gi, int mode)
void setBackgroundImageFile (const char *fname, int mode)
void setColorFromBackgroundImage (void)
void setBGImageMaskByCMapIndex (int id)
void setBGImageMaskByPixel (int x, int y)
void setBGImageMaskByRGB (int r, int g, int b)
void setSolid (void)
void setTransparent (void)
void setTransparency (CARD8 level)
CARD8 getTransparency (void)
void setAttachment (int top, int bottom, int left, int right)
void setOffset (int t_off, int b_off, int l_off, int r_off)
void setCursor (MTCursor cursor)
void setPopupHelp (const char *str, int delay, int duration)
void setLabelHelp (const char *str, CmObject *label)
void setUserData (void *ud)
void changePopupHelpText (const char *str)
void changeLabelHelpText (const char *str)
void topAttach (int att_type, int off, CmObject *obj)
void bottomAttach (int att_type, int off, CmObject *obj)
void leftAttach (int att_type, int off, CmObject *obj)
void rightAttach (int att_type, int off, CmObject *obj)
void align (int h_align, int v_align)
void getText (char *text)
const char * getName (void)
void * getUserData (void)
MTFont getFont (void)
void getShadow (int *type, int *in, int *out)
int isSensitive (void)
int isSelectable (void)
int isMapped (void)
int getWidth (void)
int getHeight (void)
int getCompositeWidth (void)
int getCompositeHeight (void)
int getX (void)
int getY (void)
int usesFGColorFromParent (void)
int usesBGColorFromParent (int *percentage_ret)
CmColorgetBackgroundColor (void)
 Returns the desired object background color.

CmColorgetForegroundColor (void)
 Returns the object's foreground color.

CmContainergetParent (void)
CmShellgetShell (void)
CmImagegetBackgroundImage (void)
void resize (int w, int h)
void redraw (void)
void select (void)
void map (void)
void unmap (void)
void enableOptions (const char *name, CARD32 mask)
void saveOptions (void)
 Saves in the application's resource file all defined options.

void unlink (int resize_obj)
void focusLink (CmObject *obj_to_link)
void reparent (CmContainer *new_parent, CmObject *where)
void link (CmContainer *parent, CmObject *where, int resize_parent)
void sendEvent (MEvent *pe)
void setEventCallback (CmCallback *pp, EVENT_CB ff, CARD32 mask)

Protected Methods

void reserved (void)
virtual ~CmObject (void)

Protected Attributes

MOBJECT obj
EVENT_CB eventCB

Friends

void _ObjectDestroyCB_ (MOBJECT p, void *a, void *ud)
void _EventPreProcessCB_ (MOBJECT p, MEvent *pe, void *ud)

Detailed Description

Abstract Object Class.


Constructor & Destructor Documentation

virtual CmObject::~CmObject void    [protected, virtual]
 


Member Function Documentation

void CmObject::align int    h_align,
int    v_align
 

void CmObject::bottomAttach int    att_type,
int    off,
CmObject *    obj
 

void CmObject::changeLabelHelpText const char *    str
 

void CmObject::changePopupHelpText const char *    str
 

void CmObject::drawArc int    x,
int    y,
int    r,
int    a1,
int    a2,
CmColor   col
 

void CmObject::drawBGNText int    x,
int    y,
int    w,
int    h,
const char *    text,
MTFont    font,
CmColor   bgc,
CmColor   fgc,
int    alignment,
int    n
 

void CmObject::drawBGText int    x,
int    y,
int    w,
int    h,
const char *    text,
MTFont    font,
CmColor   bgc,
CmColor   fgc,
int    alignment
 

void CmObject::drawBorder int    x,
int    y,
int    w,
int    h,
CmColor   col,
int    thick
 

void CmObject::drawBox int    x,
int    y,
int    w,
int    h,
CmColor   bgc
 

void CmObject::drawCircle int    x,
int    y,
int    r,
CmColor   col
 

void CmObject::drawFilledArc int    x,
int    y,
int    r,
int    a1,
int    a2,
CmColor   c
 

void CmObject::drawFilledBox int    x,
int    y,
int    w,
int    h,
CmColor   bgc
 

void CmObject::drawFilledCircle int    x,
int    y,
int    r,
CmColor   col
 

void CmObject::drawFilledPolyline MPOINT   points,
int    n,
CmColor   col
 

void CmObject::drawImage CmImage   gi,
int    img_x,
int    img_y,
int    w,
int    h,
int    x,
int    y
 

void CmObject::drawLine int    x1,
int    y1,
int    x2,
int    y2,
CmColor   col
 

void CmObject::drawNText int    x,
int    y,
int    w,
int    h,
const char *    text,
MTFont    font,
CmColor   fgc,
int    alignment,
int    n
 

void CmObject::drawPoint int    x,
int    y,
CmColor   col
 

void CmObject::drawPolyline MPOINT   points,
int    n,
CmColor   col
 

void CmObject::drawShadow void   
 

void CmObject::drawShadowedNText int    x,
int    y,
int    w,
int    h,
const char *    text,
MTFont    font,
int    sh,
CmColor   fg1,
CmColor   fg2,
int    alignment,
int    n
 

void CmObject::drawShadowedText int    x,
int    y,
int    w,
int    h,
const char *    text,
MTFont    font,
int    sh,
CmColor   fg1,
CmColor   fg2,
int    alignment
 

void CmObject::drawSubShadow int    x,
int    y,
int    w,
int    h,
CmColor   tsc,
CmColor   bsc,
int    thick
 

void CmObject::drawText int    x,
int    y,
int    w,
int    h,
const char *    text,
MTFont    font,
CmColor   fgc,
int    alignment
 

void CmObject::drawWindow void   
 

void CmObject::drawXorBox int    x,
int    y,
int    w,
int    h
 

void CmObject::drawXorLine int    x1,
int    y1,
int    x2,
int    y2
 

void CmObject::enableOptions const char *    name,
CARD32    mask
 

void CmObject::focusLink CmObject *    obj_to_link
 

CmColor* CmObject::getBackgroundColor void   
 

Returns the desired object background color.

The returned value can be different from the actual color the object uses to display itself in case it's partially transparent.

See also:
setBackgroundColor(), setTransparency().

CmImage* CmObject::getBackgroundImage void   
 

int CmObject::getCompositeHeight void   
 

int CmObject::getCompositeWidth void   
 

MTFont CmObject::getFont void   
 

CmColor* CmObject::getForegroundColor void   
 

Returns the object's foreground color.

int CmObject::getHeight void   
 

const char* CmObject::getName void   
 

CmContainer* CmObject::getParent void   
 

void CmObject::getShadow int *    type,
int *    in,
int *    out
 

CmShell* CmObject::getShell void   
 

void CmObject::getText char *    text
 

CARD8 CmObject::getTransparency void   
 

void* CmObject::getUserData void   
 

int CmObject::getWidth void   
 

int CmObject::getX void   
 

int CmObject::getY void   
 

int CmObject::isMapped void   
 

int CmObject::isSelectable void   
 

int CmObject::isSensitive void   
 

void CmObject::leftAttach int    att_type,
int    off,
CmObject *    obj
 

void CmObject::link CmContainer   parent,
CmObject *    where,
int    resize_parent
 

void CmObject::map void   
 

CmObject::operator MOBJECT  
 

void CmObject::redraw void   
 

void CmObject::reparent CmContainer   new_parent,
CmObject *    where
 

void CmObject::reserved void    [protected]
 

void CmObject::resize int    w,
int    h
 

void CmObject::rightAttach int    att_type,
int    off,
CmObject *    obj
 

void CmObject::saveOptions 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:

The global "C" function MSaveOptions() is available for use from outside CmMGUI derived classes.
See also:
CmObject::saveOptions

Reimplemented from CmMGUI.

void CmObject::select void   
 

void CmObject::sendEvent MEvent   pe
 

void CmObject::setAttachment int    top,
int    bottom,
int    left,
int    right
 

void CmObject::setAutoScrollWhenSelected int    TrueFalse
 

void CmObject::setBackgroundColor CmColor   bgc
 

Sets the desired object background colors.

The actual background used to display the object depends on the object transparency level and the color or image background in the parent object.
More precisely, if the object is partially transparent (transparency level > 0 and < 255) then the actual object appereance will result by the combination of the parent background (either solid color or image) and the object background color.

Parameters:
obj The object which to apply the new colors to.
bgc The desired background color. If you pass in the value NOCOLOR then this function will behave exactly as setForegroundColor().
See also:
setColor(), setBGColorFromParent(), setFGColorFromParent(), setColorFromBackgroundImage(), setTransparency()

void CmObject::setBackgroundImage CmImage   gi,
int    mode
 

void CmObject::setBackgroundImageFile const char *    fname,
int    mode
 

void CmObject::setBackgroundRGB unsigned    r,
unsigned    g,
unsigned    b
 

void CmObject::setBGColorFromParent int    true_false,
int    percentage
 

Enables/disables getting the object background color from the parent object.

This function links the object background color to its parent color.
Object color is automatically changed as the parent changes its color. The color change propagated from the parent is recursively propagated to all children objects having the color-from-parent feature set.
The inherited color can be shifted in brightness using last argument.

Parameters:
obj The object which to apply the setting to.
true_false Boolean value stating whether the feature should be enabled or disabled.
percentage This value specifies the brightness percentace to apply when getting the color from parent. A value of 100 means get it as is.
See also:
setFGColorFromParent(), setColorFromBackgroundImage()

void CmObject::setBGImageMaskByCMapIndex int    id
 

void CmObject::setBGImageMaskByPixel int    x,
int    y
 

void CmObject::setBGImageMaskByRGB int    r,
int    g,
int    b
 

void CmObject::setColor CmColor   bgc,
CmColor   fgc
 

Sets the desired object foreground and background colors.

The actual background used to display the object depends on the object transparency level and the color or image background in the parent object.
More precisely, if the object is partially transparent (transparency level > 0 and < 255) then the actual object appereance will result by the combination of the parent background (either solid color or image) and the object background color.

Parameters:
obj The object which to apply the new colors to.
bgc The desired background color. If you pass in the value NOCOLOR then this function will behave exactly as setForegroundColor().
fgc The desired foreground color. If you pass in the value NOCOLOR then this function will behave exactly as setBackgroundColor().
See also:
setBGColorFromParent(), setFGColorFromParent(), setColorFromBackgroundImage(), setTransparency()

void CmObject::setColorFromBackgroundImage void   
 

void CmObject::setCompositeHeight int    height
 

Sets the height of a composite object.

The object height is locked so it cannot be resized due to window resizing or forced attachments. The new height is applied to the main container that contitutes the composite object. For example, an OptionEdit object is constituted by a ColForm that contains an Edit and a PushButton (a SList is also part of the object but it's contained in a separate private Shell).

By applying this method to a non-composite object, you get the same behaviour as calling setHeight().

Parameters:
height New desired height.
See also:
setSize, setWidth, setHeight, getWidth, getHeight, setCompositeSize, setCompositeWidth, getCompositeWidth, getCompositeHeight

void CmObject::setCompositeSize int    width,
int    height
 

Sets the width and height of a composite object.

The object's size is locked so it cannot be resized due to window resizing or forced attachments. The new size is applied to the main container that contitutes the composite object. For example, an OptionEdit object is constituted by a ColForm that contains an Edit and a PushButton (a SList is also part of the object but it's contained in a separate private Shell).

By applying this method to a non-composite object, you get the same behaviour as calling setSize().

Parameters:
width New desired width.
height New desired height.
See also:
setSize, setWidth, setHeight, setPosition, getWidth, getHeight, setCompositeWidth, setCompositeHeight, getCompositeWidth, getCompositeHeight

void CmObject::setCompositeWidth int    width
 

Sets the width of a composite object.

The object's width is locked so it cannot be resized due to window resizing or forced attachments. The new width is applied to the main container that contitutes the composite object. For example, an OptionEdit object is constituted by a ColForm that contains an Edit and a PushButton (a SList is also part of the object but it's contained in a separate private Shell).

By applying this method to a non-composite object, you get the same behaviour as calling setWidth().

Parameters:
width New desired width.
See also:
setSize, setWidth, setHeight, getWidth, getHeight, setCompositeSize, setCompositeHeight, getCompositeWidth, getCompositeHeight

void CmObject::setCursor MTCursor    cursor
 

void CmObject::setEventCallback CmCallback   pp,
EVENT_CB    ff,
CARD32    mask
 

void CmObject::setFGColorFromParent int    true_false
 

Enables/disables getting the object foreground color from the parent object.

This function links the object foreground color to its parent color.
Object color is automatically changed as the parent changes its color. The color change propagated from the parent is recursively propagated to all children objects having the color-from-parent feature set.

Parameters:
obj The object which to apply the setting to.
true_false Boolean value stating whether the feature should be enabled or disabled.
See also:
setBGColorFromParent(), setColorFromBackgroundImage()

void CmObject::setFont MTFont    font,
int    resize_obj = 0
 

void CmObject::setForegroundColor CmColor   fgc
 

Sets the desired object foreground color.

Parameters:
obj The object which to apply the new colors to.
fgc The desired foreground color.
See also:
MObjectSetColor(), MObjectSetBGColorFromParent(), MObjectSetFGColorFromParent(), MObjectSetColorFromBackgroundImage(), MObjectSetTransparency()

void CmObject::setForegroundRGB unsigned    r,
unsigned    g,
unsigned    b
 

void CmObject::setHeight int    height
 

Sets the object's height.

The object's height is locked so it cannot be resized vertically due to window resizing or forced attachments.

By applying this method to a composite object, you actually lock the height of the 'terminal' object. For example, if you setWidth() an OptionEdit object you lock the height of the Edit object inside. If you need to setHeight() the entire OptionEdit object then you should use setCompositeHeight instead.

Parameters:
height New desired height.
See also:
setSize, setWidth, getWidth, getHeight, setCompositeSize, setCompositeWidth, setCompositeHeight, getCompositeWidth, getCompositeHeight

void CmObject::setLabelHelp const char *    str,
CmObject *    label
 

void CmObject::setMinSize int    width,
int    height
 

Sets the object's minimum size.

All resizeable objects have a default minimum size. This method allows you to change that default.

void CmObject::setName const char *    name
 

void CmObject::setOffset int    t_off,
int    b_off,
int    l_off,
int    r_off
 

void CmObject::setPopupHelp const char *    str,
int    delay,
int    duration
 

void CmObject::setPosition int    x,
int    y
 

Sets the (x,y) position of object relative to parent's cohordinates.

This method should be applied to objects created as children of the PosForm container. Object's Top and Left attachments are set to the container with appropriate offsets so the desired position is obtained. If the object is contained in a PosForm, then Right and Bottom attachments are set to None so the object's size will never change due to window resizing.

Parameters:
x New desired X cohordinate.
y New desired Y cohordinate.
See also:
setX, setY, getX, getY

void CmObject::setResize int    resize_w,
int    resize_h
 

void CmObject::setSelectable void   
 

void CmObject::setSensitive void   
 

void CmObject::setSensitivity int    true_false
 

void CmObject::setShadow int    type,
int    in = 0,
int    out = 0
 

void CmObject::setSize int    width,
int    height
 

Sets the object's width and height.

The object's size is locked so it cannot be resized due to window resizing or forced attachments.

By applying this method to a composite object, you actually lock the size of the 'terminal' object. For example, if you setSize() an OptionEdit object you lock the size of the Edit object inside. If you need to setSize() the entire OptionEdit object then you should use setCompositeSize instead.

Parameters:
width New desired width.
height New desired height.
See also:
setWidth, setHeight, getWidth, getHeight, setCompositeSize, setCompositeWidth, setCompositeHeight

void CmObject::setSolid void   
 

void CmObject::setText const char *    text
 

Reimplemented in CmMenu.

void CmObject::setTransparency CARD8    level
 

void CmObject::setTransparent void   
 

void CmObject::setUnselectable void   
 

void CmObject::setUnsensitive void   
 

void CmObject::setUserData void *    ud
 

void CmObject::setWidth int    width
 

Sets the object's width.

The object's width is locked so it cannot be resized horizontally due to window resizing or forced attachments.

By applying this method to a composite object, you actually lock the width of the 'terminal' object. For example, if you setWidth() an OptionEdit object you lock the size of the Edit object inside. If you need to setWidth() the entire OptionEdit object then you should use setCompositeWidth instead.

Parameters:
width New desired width.
See also:
setSize, setHeight, getWidth, getHeight, setCompositeSize, setCompositeWidth, setCompositeHeight, getCompositeWidth, getCompositeHeight

Reimplemented in CmStatusBar.

void CmObject::setX int    x
 

Sets the X cohordinate of object relative to parent's cohordinates.

This method should be applied to objects created as children of the PosForm container. Object's Left attachment is set to the container with an appropriate offset so the desired X position is obtained.

Parameters:
x New desired X cohordinate.
See also:
setPosition, setY, getX, getY

void CmObject::setY int    y
 

Sets the Y cohordinate of object relative to parent's cohordinates.

This method should be applied to objects created as children of the PosForm container. Object's Top attachment is set to the container with an appropriate offset so the desired Y position is obtained.

Parameters:
y New desired Y cohordinate.
See also:
setX, setY, getX, getY

void CmObject::topAttach int    att_type,
int    off,
CmObject *    obj
 

void CmObject::unlink int    resize_obj
 

void CmObject::unmap void   
 

int CmObject::usesBGColorFromParent int *    percentage_ret
 

int CmObject::usesFGColorFromParent void   
 


Friends And Related Function Documentation

void _EventPreProcessCB_ MOBJECT    p,
MEvent   pe,
void *    ud
[friend]
 

void _ObjectDestroyCB_ MOBJECT    p,
void *    a,
void *    ud
[friend]
 

friend class CmOptionEdit [friend]
 

Reimplemented in CmAbsList.


Field Documentation

EVENT_CB CmObject::eventCB [protected]
 

MOBJECT CmObject::obj [protected]
 


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