CrystalSpace

Public API Reference

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

cscomp.h File Reference

Crystal Space Windowing System: Component interface. More...

#include "csextern.h"
#include "csgeom/csrect.h"
#include "csutil/parray.h"
#include "csutil/array.h"
#include "cstool/cspixmap.h"
#include "cswspal.h"
#include "ivideo/graph2d.h"
#include "ivideo/fontserv.h"

Go to the source code of this file.

Classes

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


Detailed Description

Crystal Space Windowing System: Component interface.

Definition in file cscomp.h.


Generated for Crystal Space by doxygen 1.3.9.1