CrystalSpace

Public API Reference

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

csDialog Class Reference
[Dialog]

The Dialog class is a single-colored canvas which contains a number of child controls. More...

#include <csdialog.h>

Inheritance diagram for csDialog:

csComponent csLayout csAbsoluteLayout csBoxLayout csFlowLayout csGridLayout csLayout2 csBorderLayout csGridBagLayout List of all members.

Public Methods

 csDialog (csComponent *iParent, csDialogFrameStyle iFrameStyle=csdfsNone)
 Create dialog object.

virtual ~csDialog ()
 Destroy a dialog object.

virtual bool HandleEvent (iEvent &Event)
 Handle input events.

void SetAutoGrid (int iDeltaX, int iDeltaY, bool iSnapSize)
 Enable/disable(dx<0||dy<0) automatic control placement in a grid fashion.

virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Do auto-placement work if enabled.

virtual void SuggestSize (int &w, int &h)
 Return the recommended minimal size of dialog.

void GetBorderSize (int &w, int &h)
 Return border width and height.

void SetBorderSize (int w, int h)
 Set border width and height.

virtual void FixSize (int &newW, int &newH)
 Fix dialog size when resizing.

csDialogFrameStyle GetFrameStyle ()
 Query dialog border style.

void SetFrameStyle (csDialogFrameStyle iFrameStyle)
 Change dialog border style.

virtual char * GetSkinName ()
 Get the name of the skip slice for this component.

void SetAlpha (uint8 iAlpha)
 Set dialog transparency level (0 - opaque, 255 - fully transparent).

void SetOverlayAlpha (uint8 iAlpha)
 Set dialog overlay transparency level (0 - opaque, 255 - fully transparent).

uint8 GetAlpha ()
 Query dialog transparency level.

uint8 GetOverlayAlpha ()
 Query dialog overlay transparency level.

void SetFrameBitmap (csPixmap *iFrameBitmap, bool iDelFrameBitmap)
 Set the bitmap for the frame (only useful if the framestyle is csdfsBitmap).

void SetOverlayBitmap (csPixmap *iOverlayBitmap, bool iDelOverlayBitmap)
 Set the bitmap for the overlay (only useful if the framestyle is csdfsBitmap).

csPixmapGetFrameBitmap ()
 Get the frame bitmap.

csPixmapGetOverlayBitmap ()
 Get the overlay bitmap.


Protected Methods

void AdjustFocused (bool forward)
 Adjust focused control by switching back or forth if it is disabled.

bool PlaceItems ()
 Place all dialog items in correspondence to GridX, GridY and SnapSizeToGrid.


Static Protected Methods

bool do_topleft (csComponent *comp, void *param)
 Used by SuggestSize.


Protected Attributes

csDialogFrameStyle FrameStyle
 Dialog frame style.

int GridX
 Automatical grid placement parameters.

int GridY
 Automatical grid placement parameters.

bool SnapSizeToGrid
 Automatically snap dialog size to grid?

csComponentfirst
 First component.

int BorderWidth
 Border width and height.

int BorderHeight
 Border width and height.

uint8 Alpha
 Dialog transparency (if CSS_TRANSPARENT is set).

uint8 OverlayAlpha
 Dialog transparency (if CSS_TRANSPARENT is set).

csPixmapFrameBitmap
 Frame bitmap, if there is one.

csPixmapOverlayBitmap
 Frame bitmap, if there is one.

bool delFrameBitmap
 Set if this component should delete the frame bitmap when it is done.

bool delOverlayBitmap
 Set if this component should delete the frame bitmap when it is done.


Detailed Description

The Dialog class is a single-colored canvas which contains a number of child controls.

The dialog can perform a number of operations on its childs such as switching between them using Tab/ShiftTab key, activating the default button when Enter is pressed etc.

Other uses for csDialog class are for floating toolbars. They can be even resizeable; to create a floating toolbar you should create a stand-alone dialog object, setting his DragStyle to CS_DRAG_MOVEABLE and, possibly, CS_DRAG_SIZEABLE. In this case dialog will act as a standalone window; it would be good if you specify its frame style to csdfsAround: in this case it will look like a usual window but without titlebar.

Definition at line 69 of file csdialog.h.


Constructor & Destructor Documentation

csDialog::csDialog csComponent   iParent,
csDialogFrameStyle    iFrameStyle = csdfsNone
 

Create dialog object.

virtual csDialog::~csDialog   [virtual]
 

Destroy a dialog object.


Member Function Documentation

void csDialog::AdjustFocused bool    forward [protected]
 

Adjust focused control by switching back or forth if it is disabled.

bool csDialog::do_topleft csComponent   comp,
void *    param
[static, protected]
 

Used by SuggestSize.

virtual void csDialog::FixSize int &    newW,
int &    newH
[virtual]
 

Fix dialog size when resizing.

Reimplemented from csComponent.

Reimplemented in csLayout.

uint8 csDialog::GetAlpha   [inline]
 

Query dialog transparency level.

Definition at line 140 of file csdialog.h.

References CSS_TRANSPARENT, and csComponent::GetState().

void csDialog::GetBorderSize int &    w,
int &    h
[inline]
 

Return border width and height.

Definition at line 115 of file csdialog.h.

csPixmap* csDialog::GetFrameBitmap   [inline]
 

Get the frame bitmap.

Definition at line 155 of file csdialog.h.

csDialogFrameStyle csDialog::GetFrameStyle   [inline]
 

Query dialog border style.

Definition at line 124 of file csdialog.h.

References csDialogFrameStyle.

uint8 csDialog::GetOverlayAlpha   [inline]
 

Query dialog overlay transparency level.

Definition at line 144 of file csdialog.h.

References CSS_TRANSPARENT, and csComponent::GetState().

csPixmap* csDialog::GetOverlayBitmap   [inline]
 

Get the overlay bitmap.

Definition at line 159 of file csdialog.h.

virtual char* csDialog::GetSkinName   [inline, virtual]
 

Get the name of the skip slice for this component.

Reimplemented from csComponent.

Definition at line 130 of file csdialog.h.

virtual bool csDialog::HandleEvent iEvent   Event [virtual]
 

Handle input events.

Reimplemented from csComponent.

Reimplemented in csLayout.

bool csDialog::PlaceItems   [protected]
 

Place all dialog items in correspondence to GridX, GridY and SnapSizeToGrid.

void csDialog::SetAlpha uint8    iAlpha
 

Set dialog transparency level (0 - opaque, 255 - fully transparent).

void csDialog::SetAutoGrid int    iDeltaX,
int    iDeltaY,
bool    iSnapSize
[inline]
 

Enable/disable(dx<0||dy<0) automatic control placement in a grid fashion.

DeltaX and DeltaY is the horizontal and vertical distance between controls; SnapSize tells dialog object whenever dialog size should snap when it is resized to the maximal x/y coordinates of all controls.

Definition at line 105 of file csdialog.h.

void csDialog::SetBorderSize int    w,
int    h
 

Set border width and height.

void csDialog::SetFrameBitmap csPixmap   iFrameBitmap,
bool    iDelFrameBitmap
 

Set the bitmap for the frame (only useful if the framestyle is csdfsBitmap).

void csDialog::SetFrameStyle csDialogFrameStyle    iFrameStyle
 

Change dialog border style.

void csDialog::SetOverlayAlpha uint8    iAlpha
 

Set dialog overlay transparency level (0 - opaque, 255 - fully transparent).

void csDialog::SetOverlayBitmap csPixmap   iOverlayBitmap,
bool    iDelOverlayBitmap
 

Set the bitmap for the overlay (only useful if the framestyle is csdfsBitmap).

virtual bool csDialog::SetRect int    xmin,
int    ymin,
int    xmax,
int    ymax
[virtual]
 

Do auto-placement work if enabled.

Reimplemented from csComponent.

Reimplemented in csLayout.

virtual void csDialog::SuggestSize int &    w,
int &    h
[virtual]
 

Return the recommended minimal size of dialog.

Reimplemented from csComponent.

Reimplemented in csAbsoluteLayout, csGridBagLayout, csBorderLayout, csBoxLayout, csFlowLayout, csGridLayout, and csLayout.


Member Data Documentation

uint8 csDialog::Alpha [protected]
 

Dialog transparency (if CSS_TRANSPARENT is set).

Definition at line 83 of file csdialog.h.

int csDialog::BorderHeight [protected]
 

Border width and height.

Definition at line 81 of file csdialog.h.

int csDialog::BorderWidth [protected]
 

Border width and height.

Definition at line 81 of file csdialog.h.

bool csDialog::delFrameBitmap [protected]
 

Set if this component should delete the frame bitmap when it is done.

Definition at line 87 of file csdialog.h.

bool csDialog::delOverlayBitmap [protected]
 

Set if this component should delete the frame bitmap when it is done.

Definition at line 87 of file csdialog.h.

csComponent* csDialog::first [protected]
 

First component.

Definition at line 79 of file csdialog.h.

csPixmap* csDialog::FrameBitmap [protected]
 

Frame bitmap, if there is one.

Definition at line 85 of file csdialog.h.

csDialogFrameStyle csDialog::FrameStyle [protected]
 

Dialog frame style.

Definition at line 73 of file csdialog.h.

int csDialog::GridX [protected]
 

Automatical grid placement parameters.

Definition at line 75 of file csdialog.h.

int csDialog::GridY [protected]
 

Automatical grid placement parameters.

Definition at line 75 of file csdialog.h.

uint8 csDialog::OverlayAlpha [protected]
 

Dialog transparency (if CSS_TRANSPARENT is set).

Definition at line 83 of file csdialog.h.

csPixmap * csDialog::OverlayBitmap [protected]
 

Frame bitmap, if there is one.

Definition at line 85 of file csdialog.h.

bool csDialog::SnapSizeToGrid [protected]
 

Automatically snap dialog size to grid?

Definition at line 77 of file csdialog.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18