sptk2 logo
SPTK Home Page

sptk::CWindowShape Class Reference
[GUI Classes]

Window non-rectangular shape support. More...

#include <CWindowShape.h>

Inheritance diagram for sptk::CWindowShape:

sptk::CWindow 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

 CWindowShape (sptk::CWindow *window)
 Constructor.
virtual ~CWindowShape ()
 Destructor.
bool shapeResizing ()
 Returns true if the window is resizing as a result of border drag.

Protected Member Functions

int mouseZone (int mouseX, int mouseY) const
 Computes mouse zone from window coordinates.
void changeSize (int mouseX, int mouseY)
 Resizes the window based on mouse zone and mouse screen coordinates.
virtual int shapeCursorHandle (int event)
 Changes the window cursor based on the mouse position in the window.
void initShapeExtension ()
 Initializes shape extension.
bool borderCleared () const
 Returns true if border was cleared for the shape.
void shapeApply ()
 Sets the shape to the window during window->draw().
void resizingShape (int w, int h)
 Calls resizeShape() from inside CWindow::resize().
virtual void shapeResize (int w, int h)
 Shape resize.

Protected Attributes

sptk::CWindowm_window
 Window to change shape.
int m_resizingZone
 Resizing mouse zone where mouse was pushed.
int m_lastW
 Last window width during the shape generation.
int m_lastH
 Last window height during the shape generation.
int m_pushedX
 X coordinate of the last FL_PUSH event.
int m_pushedY
 Y coordinate of the last FL_PUSH event.
std::vector< CShapePointm_shapePoints
 Vector of points defining window shape.
bool m_shapeChanged
 Is the shape size changed?
int m_borderWidth
 Shape border width, the default is 6.
bool m_borderCleared
 Is no border flag set for the window?
bool m_shapeExtension
 Is the shape extension activated?


Detailed Description

Window non-rectangular shape support.

Window shape is defined with the array of points that should be modified at every resize of the window. The derived window should modify the shape points array by ovewriting shapeResize() method. The window resize support is activated only if window resizable() is true.


Constructor & Destructor Documentation

sptk::CWindowShape::CWindowShape ( sptk::CWindow window  ) 

Constructor.

Parameters:
window sptk::CWindow*, window to change shape


Member Function Documentation

void sptk::CWindowShape::changeSize ( int  mouseX,
int  mouseY 
) [protected]

Resizes the window based on mouse zone and mouse screen coordinates.

Parameters:
mouseX int, mouse x-coordinate in the screen
mouseY int, mouse y-coordinate in the screen

void sptk::CWindowShape::initShapeExtension (  )  [protected]

Initializes shape extension.

Allows window to use shape extension. Should be called before the window is first shown.

int sptk::CWindowShape::mouseZone ( int  mouseX,
int  mouseY 
) const [protected]

Computes mouse zone from window coordinates.

Parameters:
mouseX int, mouse x-coordinate in the window
mouseY int, mouse y-coordinate in the window

virtual int sptk::CWindowShape::shapeCursorHandle ( int  event  )  [protected, virtual]

Changes the window cursor based on the mouse position in the window.

Designed to emulate cursor changes on the window border for shaped windows. Should be uncoditionally called inside handle() for the window.

virtual void sptk::CWindowShape::shapeResize ( int  w,
int  h 
) [inline, protected, virtual]

Shape resize.

This method should be overwritten in the derived class to adapt m_shapePoints[] to the window size.

Referenced by resizingShape().

bool sptk::CWindowShape::shapeResizing (  )  [inline]

Returns true if the window is resizing as a result of border drag.

Can be used to simplified drawing during the resize

References m_resizingZone.


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

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