CrystalSpace

Public API Reference

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

csWindow Class Reference
[Windows]

A csWindow object is a rectangular area of screen with border which optionally contains a titlebar, a menubar and a client component. More...

#include <cswindow.h>

Inheritance diagram for csWindow:

csComponent csWindowList List of all members.

Public Methods

 csWindow (csComponent *iParent, const char *iTitle, int iWindowStyle=CSWS_DEFAULTVALUE, csWindowFrameStyle iFrameStyle=cswfs3D)
 Create a window object.

virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Rescale titlebar, menu etc before passing to original SetRect.

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

virtual void FixSize (int &newW, int &newH)
 Don't allow too small windows.

virtual bool Maximize ()
 Maximize window if it is not already and if DragStyle has CS_DRAG_SIZEABLE.

virtual bool Restore ()
 Restore window if it is maximized and if DragStyle has CS_DRAG_SIZEABLE.

virtual void SetText (const char *iText)
 Change titlebar text.

virtual void GetText (char *oText, int iTextSize) const
 Query window title text.

virtual const char * GetText () const
 Same, but returns a readonly value.

virtual void SetState (int mask, bool enable)
 Override SetState method to change titlebar when window focused flag changes.

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

void GetBorderSize (int &bw, int &bh)
 Get window border width and height.

void SetTitlebarHeight (int iHeight)
 Set title bar height and redraws the window.

int GetTitlebarHeight ()
 Get window titlebar height.

void SetMenuBarHeight (int iHeight)
 Set menu bar height and redraws the window.

int GetMenuHeight ()
 Get window menu height.

void ClientToWindow (int &ClientW, int &ClientH)
 Transform client window size into window size.

void WindowToClient (int &ClientW, int &ClientH)
 Transform window size into client window size.

int GetWindowStyle ()
 Query window style bits.

void SetFrameStyle (csWindowFrameStyle iFrameStyle)
 Change window frame style.

csWindowFrameStyle GetFrameStyle ()
 Query window frame style.

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

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

uint8 GetAlpha ()
 Query window transparency level.


Protected Attributes

int WindowStyle
 Window style.

csWindowFrameStyle FrameStyle
 Window frame style.

int BorderWidth
 Window border width/height.

int BorderHeight
 Window border width/height.

int TitlebarHeight
 Titlebar height (this also defines min/max buttons width and height).

int MenuHeight
 Menu height.

uint8 Alpha
 Window transparency (if CSS_TRANSPARENT is set).


Detailed Description

A csWindow object is a rectangular area of screen with border which optionally contains a titlebar, a menubar and a client component.

The client window is the rectangle where the actual window contents (a dialog, a picture etc) are drawn.

Definition at line 125 of file cswindow.h.


Constructor & Destructor Documentation

csWindow::csWindow csComponent   iParent,
const char *    iTitle,
int    iWindowStyle = CSWS_DEFAULTVALUE,
csWindowFrameStyle    iFrameStyle = cswfs3D
 

Create a window object.


Member Function Documentation

void csWindow::ClientToWindow int &    ClientW,
int &    ClientH
 

Transform client window size into window size.

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

Don't allow too small windows.

Reimplemented from csComponent.

uint8 csWindow::GetAlpha   [inline]
 

Query window transparency level.

Definition at line 211 of file cswindow.h.

References Alpha, CSS_TRANSPARENT, and csComponent::GetState().

void csWindow::GetBorderSize int &    bw,
int &    bh
[inline]
 

Get window border width and height.

Definition at line 174 of file cswindow.h.

References BorderHeight, and BorderWidth.

csWindowFrameStyle csWindow::GetFrameStyle   [inline]
 

Query window frame style.

Definition at line 201 of file cswindow.h.

References csWindowFrameStyle, and FrameStyle.

int csWindow::GetMenuHeight   [inline]
 

Get window menu height.

Definition at line 186 of file cswindow.h.

References MenuHeight.

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

Get the name of the skip slice for this component.

Reimplemented from csComponent.

Definition at line 205 of file cswindow.h.

virtual const char* csWindow::GetText   [virtual]
 

Same, but returns a readonly value.

Reimplemented from csComponent.

virtual void csWindow::GetText char *    oText,
int    iTextSize
const [virtual]
 

Query window title text.

Reimplemented from csComponent.

int csWindow::GetTitlebarHeight   [inline]
 

Get window titlebar height.

Definition at line 180 of file cswindow.h.

References TitlebarHeight.

int csWindow::GetWindowStyle   [inline]
 

Query window style bits.

Definition at line 195 of file cswindow.h.

References WindowStyle.

virtual bool csWindow::HandleEvent iEvent   Event [virtual]
 

Handle input events.

Reimplemented from csComponent.

Reimplemented in csWindowList.

virtual bool csWindow::Maximize   [virtual]
 

Maximize window if it is not already and if DragStyle has CS_DRAG_SIZEABLE.

Reimplemented from csComponent.

virtual bool csWindow::Restore   [virtual]
 

Restore window if it is maximized and if DragStyle has CS_DRAG_SIZEABLE.

Reimplemented from csComponent.

void csWindow::SetAlpha uint8    iAlpha
 

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

void csWindow::SetBorderSize int    w,
int    h
 

Set window border width and height.

void csWindow::SetFrameStyle csWindowFrameStyle    iFrameStyle
 

Change window frame style.

void csWindow::SetMenuBarHeight int    iHeight
 

Set menu bar height and redraws the window.

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

Rescale titlebar, menu etc before passing to original SetRect.

Reimplemented from csComponent.

Reimplemented in csWindowList.

virtual void csWindow::SetState int    mask,
bool    enable
[virtual]
 

Override SetState method to change titlebar when window focused flag changes.

Reimplemented from csComponent.

Reimplemented in csWindowList.

virtual void csWindow::SetText const char *    iText [virtual]
 

Change titlebar text.

Reimplemented from csComponent.

void csWindow::SetTitlebarHeight int    iHeight
 

Set title bar height and redraws the window.

void csWindow::WindowToClient int &    ClientW,
int &    ClientH
 

Transform window size into client window size.


Member Data Documentation

uint8 csWindow::Alpha [protected]
 

Window transparency (if CSS_TRANSPARENT is set).

Definition at line 139 of file cswindow.h.

Referenced by GetAlpha().

int csWindow::BorderHeight [protected]
 

Window border width/height.

Definition at line 133 of file cswindow.h.

Referenced by GetBorderSize().

int csWindow::BorderWidth [protected]
 

Window border width/height.

Definition at line 133 of file cswindow.h.

Referenced by GetBorderSize().

csWindowFrameStyle csWindow::FrameStyle [protected]
 

Window frame style.

Definition at line 131 of file cswindow.h.

Referenced by GetFrameStyle().

int csWindow::MenuHeight [protected]
 

Menu height.

Definition at line 137 of file cswindow.h.

Referenced by GetMenuHeight().

int csWindow::TitlebarHeight [protected]
 

Titlebar height (this also defines min/max buttons width and height).

Definition at line 135 of file cswindow.h.

Referenced by GetTitlebarHeight().

int csWindow::WindowStyle [protected]
 

Window style.

Definition at line 129 of file cswindow.h.

Referenced by GetWindowStyle().


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