CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Components
[Crystal Space Windowing System]


Modules

Application
Button
Check box
Color wheel
Dialog
Floating hints
Grid
Input line
Keyboard accelerator
List box
Menu
Notebook
Radio button
Scroll bar
Spin box
Splitter
Static control
Timer
Title bar
Tree box
Windows

Compounds

class  csComponent
 Graphics system component: a menu, window etc. More...


Component state flags

The component state is an (at least) 32-bit integer, which contains up to 32 state flags.

These flags marks various transitional states which can change in time depending on the activity of the component (and user actions). These 32 bits are split into several conventional fields, every set of bits being reserved for different tasks:

  31    24 23    16 15     8 7      0
 +--------+--------+--------+--------+
 |        |        |        |        |
 +--------+--------+--------+--------+
 \---+---/ \---+--/ \-------+-------/
     |         |            +--------* Reserved for the csComponent class
     |         |                       (masks for these bits are defined below)
     |         +---------------------* Reserved for internal use by CSWS
     |                                 components, derived from csComponent.
     +-------------------------------* Reserved for user-defined components.
 
Thus, all values matching the mask 0x0000ffff are reserved for csComponent, all values matching the mask 0x00ff0000 are reserved for other CSWS components (see csListBoxItem, for example), and finally all the bits matching the mask 0xff000000 are reserved for user. Pretty generous, eh? ;-)

#define CSS_VISIBLE   0x00000001
 Component state flag: Component is visible.

#define CSS_FOCUSED   0x00000002
 Component state flag: Component is focused in parent window child list.

#define CSS_DISABLED   0x00000004
 Component state flag: Component is disabled.

#define CSS_SELECTABLE   0x00000008
 Component state flag: Component can be selected.

#define CSS_GROUP   0x00000010
 Component state flag: Component is the beginning of a group of components.

#define CSS_TOPSELECT   0x00000020
 Component state flag: Move component to top Z-order when selected.

#define CSS_TRANSPARENT   0x00000040
 Component state flag: Exclude component from clipping process.

#define CSS_MODAL   0x00000080
 Component state flag: Component is modally executing.

#define CSS_MAXIMIZED   0x00000100
 Component state flag: Component is maximized (NEVER change this manually!).

#define CSS_DIRTY   0x00000200
 Component state flag: Component or (some of) his children components are dirty.

#define CSS_RESTART_DIRTY_CHECK   0x00000400
 Component state flag: Additional state flag used to decide when to finish CheckDirty(); ignore it.


Drag mode flags

These flags are used by csComp::Drag to compute new window coordinates when dragging window with mouse

#define CS_DRAG_XMIN   0x01
 Drag left window border.

#define CS_DRAG_XMAX   0x02
 Drag right window border.

#define CS_DRAG_YMIN   0x04
 Drag top window border.

#define CS_DRAG_YMAX   0x08
 Drag bottom window border.

#define CS_DRAG_MOVEABLE   0x10
 Window is moveable.

#define CS_DRAG_SIZEABLE   0x20
 Window is sizeable.

#define CS_DRAG_ALL   (CS_DRAG_XMIN | CS_DRAG_XMAX | CS_DRAG_YMIN | CS_DRAG_YMAX)
 All flags above combined (used when dragging with titlebar).


Bound resize flags

When the size of certain component changes, it checks all his children what they want to do with their own size.

You can lock the distance between certain margin of the component and respective margin of the parent component to stay the same when this happens, using the ResizeMode field (or SetResizeMode() method).

#define CS_LOCK_XMIN   0x01
 Lock component's left margin with parent's left margin.

#define CS_LOCK_XMAX   0x02
 Lock component's right margin with parent's right margin.

#define CS_LOCK_YMIN   0x04
 Lock component's top margin with parent's top margin.

#define CS_LOCK_YMAX   0x08
 Lock component's bottom margin with parent's bottom margin.

#define CS_LOCK_ALL   (CS_LOCK_XMIN | CS_LOCK_XMAX | CS_LOCK_YMIN | CS_LOCK_YMAX)
 Lock all four margins.


Child repositioning

An alternative way for child repositioning consist of the following: independently of each other in both X and Y direction the child can keep its size, and be placed either at the start, center, or end strip of the reserved for childs space of the parent component.

These values are stored also in the ResizeMode field and occupies same bits as the CS_LOCK_XXX constants; thus these modes are reciprocaly exclusive. You can still use locks for top and bottom margins and use automatic repositioning for left and right margins or vice versa. That is, CS_LOCK_XMIN and CS_LOCK_XMAX are reciprocally exclusive with CS_REPOS_{LEFT|RIGHT|HCENTER} modes, but they are compatible with CS_REPOS_{TOP|BOTTOM|VCENTER} modes.

#define CS_REPOS_HORIZONTAL   0x10
 Used to distinguish when component is repositioned or bound locked horizontally.

#define CS_REPOS_VERTICAL   0x20
 Used to distinguish when component is repositioned or bound locked vertically.

#define CS_REPOS_H_MASK   (CS_REPOS_HORIZONTAL | 0x3)
 The mask for extracting the horizontal automatic position.

#define CS_REPOS_V_MASK   (CS_REPOS_VERTICAL | 0xc)
 The mask for extracting the vertical automatic position.

#define CS_REPOS_LEFT   (CS_REPOS_HORIZONTAL | 0x0)
 The component is automatically placed at the left of the parent window.

#define CS_REPOS_RIGHT   (CS_REPOS_HORIZONTAL | 0x1)
 The component is automatically placed at the right of the parent window.

#define CS_REPOS_HCENTER   (CS_REPOS_HORIZONTAL | 0x2)
 The component is automatically horizontally centered in the parent window.

#define CS_REPOS_HCENTERSIZE   (CS_REPOS_HORIZONTAL | 0x3)
 Same as HCENTER but the component is resized by the same amount as parent.

#define CS_REPOS_TOP   (CS_REPOS_VERTICAL | 0x0)
 The component is automatically placed at the top of the parent window.

#define CS_REPOS_BOTTOM   (CS_REPOS_VERTICAL | 0x4)
 The component is automatically placed at the bottom of the parent window.

#define CS_REPOS_VCENTER   (CS_REPOS_VERTICAL | 0x8)
 The component is automatically vertically centered in the parent window.

#define CS_REPOS_VCENTERSIZE   (CS_REPOS_VERTICAL | 0xc)
 Same as VCENTER but the component is resized by the same amount as parent.


Enumerations

enum  {
  cscmdAreYouDefault = 0x80, cscmdActivate, cscmdHide, cscmdMaximize,
  cscmdClose, cscmdLimitMaximize, cscmdLoseFocus, cscmdReceiveFocus,
  cscmdOK , cscmdColorSchemeChanged, cscmdSkinChanged, cscmdMoveClipChildren,
  cscmdStopModal
}
 Predefined Windowing System Command Codes. More...


Define Documentation

#define CS_DRAG_ALL   (CS_DRAG_XMIN | CS_DRAG_XMAX | CS_DRAG_YMIN | CS_DRAG_YMAX)
 

All flags above combined (used when dragging with titlebar).

Definition at line 265 of file cscomp.h.

#define CS_DRAG_MOVEABLE   0x10
 

Window is moveable.

Definition at line 261 of file cscomp.h.

#define CS_DRAG_SIZEABLE   0x20
 

Window is sizeable.

Definition at line 263 of file cscomp.h.

#define CS_DRAG_XMAX   0x02
 

Drag right window border.

Definition at line 255 of file cscomp.h.

#define CS_DRAG_XMIN   0x01
 

Drag left window border.

Definition at line 253 of file cscomp.h.

#define CS_DRAG_YMAX   0x08
 

Drag bottom window border.

Definition at line 259 of file cscomp.h.

#define CS_DRAG_YMIN   0x04
 

Drag top window border.

Definition at line 257 of file cscomp.h.

#define CS_LOCK_ALL   (CS_LOCK_XMIN | CS_LOCK_XMAX | CS_LOCK_YMIN | CS_LOCK_YMAX)
 

Lock all four margins.

Definition at line 286 of file cscomp.h.

#define CS_LOCK_XMAX   0x02
 

Lock component's right margin with parent's right margin.

Definition at line 280 of file cscomp.h.

#define CS_LOCK_XMIN   0x01
 

Lock component's left margin with parent's left margin.

Definition at line 278 of file cscomp.h.

#define CS_LOCK_YMAX   0x08
 

Lock component's bottom margin with parent's bottom margin.

Definition at line 284 of file cscomp.h.

#define CS_LOCK_YMIN   0x04
 

Lock component's top margin with parent's top margin.

Definition at line 282 of file cscomp.h.

#define CS_REPOS_BOTTOM   (CS_REPOS_VERTICAL | 0x4)
 

The component is automatically placed at the bottom of the parent window.

Definition at line 323 of file cscomp.h.

#define CS_REPOS_H_MASK   (CS_REPOS_HORIZONTAL | 0x3)
 

The mask for extracting the horizontal automatic position.

Definition at line 309 of file cscomp.h.

#define CS_REPOS_HCENTER   (CS_REPOS_HORIZONTAL | 0x2)
 

The component is automatically horizontally centered in the parent window.

Definition at line 317 of file cscomp.h.

#define CS_REPOS_HCENTERSIZE   (CS_REPOS_HORIZONTAL | 0x3)
 

Same as HCENTER but the component is resized by the same amount as parent.

Definition at line 319 of file cscomp.h.

#define CS_REPOS_HORIZONTAL   0x10
 

Used to distinguish when component is repositioned or bound locked horizontally.

Definition at line 305 of file cscomp.h.

#define CS_REPOS_LEFT   (CS_REPOS_HORIZONTAL | 0x0)
 

The component is automatically placed at the left of the parent window.

Definition at line 313 of file cscomp.h.

#define CS_REPOS_RIGHT   (CS_REPOS_HORIZONTAL | 0x1)
 

The component is automatically placed at the right of the parent window.

Definition at line 315 of file cscomp.h.

#define CS_REPOS_TOP   (CS_REPOS_VERTICAL | 0x0)
 

The component is automatically placed at the top of the parent window.

Definition at line 321 of file cscomp.h.

#define CS_REPOS_V_MASK   (CS_REPOS_VERTICAL | 0xc)
 

The mask for extracting the vertical automatic position.

Definition at line 311 of file cscomp.h.

#define CS_REPOS_VCENTER   (CS_REPOS_VERTICAL | 0x8)
 

The component is automatically vertically centered in the parent window.

Definition at line 325 of file cscomp.h.

#define CS_REPOS_VCENTERSIZE   (CS_REPOS_VERTICAL | 0xc)
 

Same as VCENTER but the component is resized by the same amount as parent.

Definition at line 327 of file cscomp.h.

#define CS_REPOS_VERTICAL   0x20
 

Used to distinguish when component is repositioned or bound locked vertically.

Definition at line 307 of file cscomp.h.

#define CSS_DIRTY   0x00000200
 

Component state flag: Component or (some of) his children components are dirty.

Definition at line 92 of file cscomp.h.

#define CSS_DISABLED   0x00000004
 

Component state flag: Component is disabled.

Definition at line 78 of file cscomp.h.

#define CSS_FOCUSED   0x00000002
 

Component state flag: Component is focused in parent window child list.

Definition at line 76 of file cscomp.h.

#define CSS_GROUP   0x00000010
 

Component state flag: Component is the beginning of a group of components.

Definition at line 82 of file cscomp.h.

#define CSS_MAXIMIZED   0x00000100
 

Component state flag: Component is maximized (NEVER change this manually!).

Definition at line 90 of file cscomp.h.

#define CSS_MODAL   0x00000080
 

Component state flag: Component is modally executing.

Definition at line 88 of file cscomp.h.

#define CSS_RESTART_DIRTY_CHECK   0x00000400
 

Component state flag: Additional state flag used to decide when to finish CheckDirty(); ignore it.

Definition at line 94 of file cscomp.h.

#define CSS_SELECTABLE   0x00000008
 

Component state flag: Component can be selected.

Definition at line 80 of file cscomp.h.

#define CSS_TOPSELECT   0x00000020
 

Component state flag: Move component to top Z-order when selected.

Definition at line 84 of file cscomp.h.

#define CSS_TRANSPARENT   0x00000040
 

Component state flag: Exclude component from clipping process.

Definition at line 86 of file cscomp.h.

Referenced by csWindow::GetAlpha(), csDialog::GetAlpha(), and csDialog::GetOverlayAlpha().

#define CSS_VISIBLE   0x00000001
 

Component state flag: Component is visible.

Definition at line 74 of file cscomp.h.


Enumeration Type Documentation

anonymous enum
 

Predefined Windowing System Command Codes.

The list below does not contain all defined messages; these are only the most general ones. Any class which defines some class-specific messages should ensure that no other command is using the integer value of its proprietary command codes. To avoid this as much as possible, the following ranges are reserved:

  • 0x00000000 ... 0x0FFFFFFF: Reserved for CrystalSpace Windowing System
    • 0x00000000 ... 0x000000FF: Non-class specific commands
    • 0x00000100 ... 0x000001FF: csWindow class messages
    • 0x00000200 ... 0x000002FF: csMenu class messages
    • 0x00000300 ... 0x000003FF: csTimer class messages
    • 0x00000400 ... 0x000004FF: csListBox class messages
    • 0x00000500 ... 0x000005FF: csButton class messages
    • 0x00000600 ... 0x000006FF: csScrollBar class messages
    • 0x00000700 ... 0x000007FF: csStatic class messages
    • 0x00000800 ... 0x000008FF: csCheckBox class messages
    • 0x00000900 ... 0x000009FF: csRadioButton class messages
    • 0x00000A00 ... 0x00000AFF: csSpinBox class messages
    • 0x00000B00 ... 0x00000BFF: csColorWheel class messages
    • 0x00000C00 ... 0x00000CFF: csNotebook class messages
    • 0x00000D00 ... 0x00000DFF: csSlider class messages
    • 0x00000E00 ... 0x00000EFF: csTree class messages
    • 0x00000F00 ... 0x00000FFF: csGrid class messages
  • 0x10000000 ... 0xFFFFFFFF: Reserved for user class-specific messages
All commands receives a input parameter in the Command.Info field of iEvent object. They can reply to the message by assigning to Command.Info a value. In the description of messages below they are marked by 'IN' (the value is initially passed to object) and 'OUT' (the value is expected to be filled in by the object) labels. If no IN or OUT labels are present, the value of Command.Info is ignored. Since Command.Info is of type (void *) it should be casted to appropiate type before filling/after reading.
Enumeration values:
cscmdAreYouDefault  Query a control if it would like to be the default control in a dialog.

The control is 'default' if it has a 'default' attribute (this is control-specific, for example buttons have the CSBSTY_DEFAULT style).

 IN: 0
 OUT: (csComponent *) or 0;
 
cscmdActivate  This message is sent by parent to its active child to activate whatever action it does.

For example, this message is sent by a dialog window to its active child when user presses Enter key.

 IN: 0
 OUT: (csComponent *)this if successful;
 
cscmdHide  The "hide window" command.
cscmdMaximize  The "maximize window" command.
cscmdClose  The "close window" button.
cscmdLimitMaximize  This messages gives a chance to parent window to limit child's "maximized" rectangle.

 IN: (csRect *)MaximizedRectangle
 OUT: modify rectangle if needed
 
cscmdLoseFocus  A component loses focus.

This message is sent to the component owner right before component loses focus (i.e. during this message the component still owns the focus)

 IN: (csComponent *)Component
 OUT: 0 if you prohibit the focus change operation
 
cscmdReceiveFocus  A component receives focus.

This message is sent to the component owner right before component receives focus (i.e. during this message the component still does not own the focus)

 IN: (csComponent *)Component
 OUT: 0 if you prohibit the focus change operation
 
cscmdOK  These commands are used for message boxes.

csMessageBox (...) returns cscmdOK, cscmdCancel and so on depending on which button user presses.

cscmdColorSchemeChanged  This command tells every component that Windowing System's color scheme has been changed.

 IN:  nothing
 OUT: nothing
 
cscmdSkinChanged  Skin has changed (or some components of the skin).

If the component is skinnable, it should query the respective skin slice from the skin object and store it into the 'skinslice' member variable for later use. Also the component is invalidated upon reception of this message.

 IN:  (csSkin *)skinslice
 OUT: nothing
 
cscmdMoveClipChildren  CSWS private command sent when a component is moved; in this case we have to move all children who's clip parent is not equal to their parent in a special way.

 IN:  (int *)deltaxy [2]
 
cscmdStopModal  This command is sent when this components get out of modality.

Definition at line 134 of file cscomp.h.


Generated for Crystal Space by doxygen 1.2.18