sptk2 logo
SPTK Home Page

sptk::CWindow Class Reference
[GUI Classes]

Window widget. More...

#include <CWindow.h>

Inheritance diagram for sptk::CWindow:

sptk::CLayoutManager sptk::CWindowShape sptk::CLayoutClient sptk::CDialog sptk::CPopupWindow sptk::CAskDialog sptk::CFileDialog sptk::CSpellChecker sptk::CDBDropDownList sptk::CPopupCalendar sptk::CInputDialog sptk::CMessageDialog sptk::CDirOpenDialog sptk::CFileOpenDialog sptk::CFileSaveDialog sptk::CEditorSpellChecker

List of all members.

Public Member Functions

 CWindow (int w, int h, const char *label=0L)
 Constructor.
 CWindow (int x, int y, int w, int h, const char *label=0L)
 Constructor.
virtual void draw ()
 Draws a window, including an optional background image.
virtual void show ()
 Custom show method.
virtual void show (int argc, char *argv[])
 Custom show method.
virtual void hide ()
 Custom hide method.
virtual void relayout ()
 Relayouts window's widgets that have CLayoutClient interface.
virtual void clear ()
 Removes all the widgets inside the window.
virtual void resize (int x, int y, int w, int h)
 Resizes the window and inside widgets.
virtual bool preferredSize (int &w, int &h)
 Computes the optimal window size.
int handle (int event)
 Custom window events handle.
virtual void load (const CXmlNode *node, CLayoutXMLmode xmlMode) throw (CException)
 Loads window coordinates and widgets from XML node.
virtual void save (CXmlNode *node, CLayoutXMLmode xmlMode) const
 Saves window coordinates and widgets into XML node.
void loadPosition (const CXmlNode *node)
 Loads the window position from XML node.
void savePosition (CXmlNode *node) const
 Saves the window position into XML node.
std::string label () const
 Returns the current label.
void label (const char *lbl)
 Sets the new label.
void label (const std::string &lbl)
virtual std::string className () const
 Returns widget class name (internal SPTK RTTI).


Detailed Description

Window widget.

Extended version of FLTK's standard Fl_Double_Window, with added CLayoutManager capabilities


Constructor & Destructor Documentation

sptk::CWindow::CWindow ( int  w,
int  h,
const char *  label = 0L 
) [inline]

Constructor.

Parameters:
w int, window width
h int, window height
label int, window label

sptk::CWindow::CWindow ( int  x,
int  y,
int  w,
int  h,
const char *  label = 0L 
) [inline]

Constructor.

Parameters:
x int, window x-position
y int, window y-position
w int, window width
h int, window height
label int, window label


Member Function Documentation

int sptk::CWindow::handle ( int  event  ) 

Custom window events handle.

Mostly used for supporting non-rectangular shape windows.

Reimplemented in sptk::CPopupCalendar, sptk::CDialog, sptk::CDBDropDownList, and sptk::CPopupWindow.

void sptk::CWindow::label ( const std::string &  lbl  )  [inline]

Sets label for the group, makes an internal copy of the string

Parameters:
lbl const string&, new label

Reimplemented from sptk::CLayoutClient.

References label().

void sptk::CWindow::label ( const char *  lbl  )  [inline]

Sets the new label.

Parameters:
lbl const char*, new label

Reimplemented from sptk::CLayoutClient.

References label().

virtual void sptk::CWindow::load ( const CXmlNode node,
CLayoutXMLmode  xmlMode 
) throw (CException) [virtual]

Loads window coordinates and widgets from XML node.

Parameters:
node const CXmlNode*, node to load data from
xmlMode CLayoutXMLmode, the mode defining how the layout and/or data should be loaded

Reimplemented from sptk::CLayoutClient.

void sptk::CWindow::loadPosition ( const CXmlNode node  ) 

Loads the window position from XML node.

Parameters:
node const CXmlNode&, node to load position from

virtual bool sptk::CWindow::preferredSize ( int &  w,
int &  h 
) [virtual]

Computes the optimal window size.

Parameters:
w int&, input - width offered by the program, output - width required by widget
h int&, input - height offered by the program, output - height required by widget
Returns:
true if the size is stable (doesn't depend on input sizes)

Reimplemented from sptk::CLayoutClient.

Reimplemented in sptk::CDBDropDownList.

virtual void sptk::CWindow::resize ( int  x,
int  y,
int  w,
int  h 
) [virtual]

Resizes the window and inside widgets.

Parameters:
x int, x-position
y int, y-position
w int, width
h int, height

Reimplemented in sptk::CPopupCalendar, and sptk::CDBDropDownList.

Referenced by relayout().

virtual void sptk::CWindow::save ( CXmlNode node,
CLayoutXMLmode  xmlMode 
) const [virtual]

Saves window coordinates and widgets into XML node.

Parameters:
node CXmlNode*, node to save data into
xmlMode CLayoutXMLmode, the mode defining how the layout and/or data should be loaded

Reimplemented from sptk::CLayoutClient.

void sptk::CWindow::savePosition ( CXmlNode node  )  const

Saves the window position into XML node.

Parameters:
node CXmlNode&, node to save position into

virtual void sptk::CWindow::show ( int  argc,
char *  argv[] 
) [inline, virtual]

Custom show method.

Parameters:
argc int, number of parameters in argv[]
argv char*[], an array of program command line arguments

References show().


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:20 2012: SPTK 3.5.7