FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
fcn::ResizableWindow Class Reference

#include <resizablewindow.h>

+ Inheritance diagram for fcn::ResizableWindow:
+ Collaboration diagram for fcn::ResizableWindow:

Classes

struct  CursorState
 

Public Types

Public Member Functions

 ResizableWindow ()
 
 ResizableWindow (bool resizable)
 
 ResizableWindow (const std::string &caption, bool resizable=true)
 
virtual ~ResizableWindow ()
 
void setResizableBorderDistance (int32_t border)
 Sets the size of the area that is active for resize events. More...
 
int32_t getResizableBorderDistance () const
 Gets the size of the area that is active for resize events. More...
 
void setResizable (bool resizable)
 Sets if the widget is resizable. More...
 
bool isResizable () const
 Gets if the widget is resizable. More...
 
void setTopResizable (bool resizable)
 Sets if the widget is resizable at top. More...
 
bool isTopResizable () const
 Gets if the widget is resizable at top. More...
 
void setRightResizable (bool resizable)
 Sets if the widget is resizable at right. More...
 
bool isRightResizable () const
 Gets if the widget is resizable at right. More...
 
void setBottomResizable (bool resizable)
 Sets if the widget is resizable at bottom. More...
 
bool isBottomResizable () const
 Gets if the widget is resizable at bottom. More...
 
void setLeftResizable (bool resizable)
 Sets if the widget is resizable at left. More...
 
bool isLeftResizable () const
 Gets if the widget is resizable at left. More...
 
void setShove (bool shove)
 Sets if the widget should be pushed if the size reaches the minimum. More...
 
bool getShove () const
 Gets if the widget should be pushed if the size reaches the minimum. More...
 
void set (CursorDirections direction, uint32_t cursor_id=0)
 Sets the mouse cursor for the specified direction. More...
 
void set (CursorDirections direction, FIFE::ImagePtr image)
 Sets the mouse cursor type to image for the specified direction. More...
 
void set (CursorDirections direction, FIFE::AnimationPtr anim)
 Sets the mouse cursor type to animation for the specified direction. More...
 
FIFE::MouseCursorType getType (CursorDirections direction) const
 Gets the mouse cursor type for the specified direction. More...
 
uint32_t getId (CursorDirections direction) const
 Gets the mouse cursor handle for the specified direction. More...
 
FIFE::ImagePtr getImage (CursorDirections direction)
 Gets the mouse image for the specified direction. More...
 
FIFE::AnimationPtr getAnimation (CursorDirections direction)
 Gets the mouse animation for the specified direction. More...
 
virtual void resizeToContent (bool recursiv=true)
 
virtual void focusLost (const Event &event)
 
virtual void mouseEntered (MouseEvent &mouseEvent)
 
virtual void mouseExited (MouseEvent &mouseEvent)
 
virtual void mousePressed (MouseEvent &mouseEvent)
 
virtual void mouseReleased (MouseEvent &mouseEvent)
 
virtual void mouseMoved (MouseEvent &mouseEvent)
 
virtual void mouseDragged (MouseEvent &mouseEvent)
 

Protected Member Functions

void initCursors ()
 
void restoreCursor ()
 
void saveCursor ()
 

Protected Attributes

FIFE::Cursorm_cursor
 
int32_t m_borderDistance
 
bool m_resizable
 
bool m_resizableTop
 
bool m_resizableRight
 
bool m_resizableBottom
 
bool m_resizableLeft
 
bool m_resizing
 
bool m_resizeTop
 
bool m_resizeRight
 
bool m_resizeBottom
 
bool m_resizeLeft
 
bool m_shove
 
CursorState m_saved
 
std::vector< CursorStatem_cursors
 

Detailed Description

Definition at line 38 of file resizablewindow.h.

Member Enumeration Documentation

Enumerator
CURSOR_DIRECTION_L 
CURSOR_DIRECTION_R 
CURSOR_DIRECTION_T 
CURSOR_DIRECTION_B 
CURSOR_DIRECTION_LT 
CURSOR_DIRECTION_RT 
CURSOR_DIRECTION_LB 
CURSOR_DIRECTION_RB 

Definition at line 40 of file resizablewindow.h.

Constructor & Destructor Documentation

fcn::ResizableWindow::ResizableWindow ( )

Definition at line 38 of file resizablewindow.cpp.

References initCursors().

fcn::ResizableWindow::ResizableWindow ( bool  resizable)

Definition at line 59 of file resizablewindow.cpp.

References initCursors().

fcn::ResizableWindow::ResizableWindow ( const std::string &  caption,
bool  resizable = true 
)

Definition at line 80 of file resizablewindow.cpp.

References initCursors().

fcn::ResizableWindow::~ResizableWindow ( )
virtual

Definition at line 102 of file resizablewindow.cpp.

Member Function Documentation

void fcn::ResizableWindow::focusLost ( const Event &  event)
virtual

Definition at line 421 of file resizablewindow.cpp.

References m_resizing, and restoreCursor().

FIFE::AnimationPtr fcn::ResizableWindow::getAnimation ( CursorDirections  direction)

Gets the mouse animation for the specified direction.

Definition at line 274 of file resizablewindow.cpp.

References m_cursors.

uint32_t fcn::ResizableWindow::getId ( CursorDirections  direction) const

Gets the mouse cursor handle for the specified direction.

Definition at line 266 of file resizablewindow.cpp.

References m_cursors.

FIFE::ImagePtr fcn::ResizableWindow::getImage ( CursorDirections  direction)

Gets the mouse image for the specified direction.

Definition at line 270 of file resizablewindow.cpp.

References m_cursors.

int32_t fcn::ResizableWindow::getResizableBorderDistance ( ) const

Gets the size of the area that is active for resize events.

Returns
The distance from the edge that is active for resize events.

Definition at line 186 of file resizablewindow.cpp.

References m_borderDistance.

bool fcn::ResizableWindow::getShove ( ) const

Gets if the widget should be pushed if the size reaches the minimum.

Returns
True if the widget should be pushed, otherwise false.

Definition at line 234 of file resizablewindow.cpp.

References m_shove.

FIFE::MouseCursorType fcn::ResizableWindow::getType ( CursorDirections  direction) const

Gets the mouse cursor type for the specified direction.

Definition at line 262 of file resizablewindow.cpp.

References m_cursors.

void fcn::ResizableWindow::initCursors ( )
protected
bool fcn::ResizableWindow::isBottomResizable ( ) const

Gets if the widget is resizable at bottom.

Returns
True if the widget should be resizeable at bottom, otherwise false.

Definition at line 218 of file resizablewindow.cpp.

References m_resizableBottom.

bool fcn::ResizableWindow::isLeftResizable ( ) const

Gets if the widget is resizable at left.

Returns
True if the widget should be resizeable at left, otherwise false.

Definition at line 226 of file resizablewindow.cpp.

References m_resizableLeft.

bool fcn::ResizableWindow::isResizable ( ) const

Gets if the widget is resizable.

Returns
True if the widget should be resizeable, otherwise false.

Definition at line 194 of file resizablewindow.cpp.

References m_resizable.

Referenced by fcn::Panel::setDocked().

+ Here is the caller graph for this function:

bool fcn::ResizableWindow::isRightResizable ( ) const

Gets if the widget is resizable at right.

Returns
True if the widget should be resizeable at right, otherwise false.

Definition at line 210 of file resizablewindow.cpp.

References m_resizableRight.

bool fcn::ResizableWindow::isTopResizable ( ) const

Gets if the widget is resizable at top.

Returns
True if the widget should be resizeable at top, otherwise false.

Definition at line 202 of file resizablewindow.cpp.

References m_resizableTop.

void fcn::ResizableWindow::mouseDragged ( MouseEvent &  mouseEvent)
virtual

Reimplemented in fcn::DockArea, and fcn::Panel.

Definition at line 369 of file resizablewindow.cpp.

References m_resizable, m_resizeBottom, m_resizeLeft, m_resizeRight, m_resizeTop, m_resizing, and m_shove.

Referenced by fcn::Panel::mouseDragged(), and fcn::DockArea::mouseDragged().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::mouseEntered ( MouseEvent &  mouseEvent)
virtual

Reimplemented in fcn::DockArea, and fcn::Panel.

Definition at line 290 of file resizablewindow.cpp.

References m_resizable, m_resizing, and saveCursor().

Referenced by fcn::Panel::mouseEntered(), and fcn::DockArea::mouseEntered().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::mouseExited ( MouseEvent &  mouseEvent)
virtual

Reimplemented in fcn::DockArea, and fcn::Panel.

Definition at line 297 of file resizablewindow.cpp.

References FIFE::CURSOR_NONE, fcn::ResizableWindow::CursorState::cursorType, m_resizable, m_resizing, m_saved, and restoreCursor().

Referenced by fcn::Panel::mouseExited(), fcn::DockArea::mouseExited(), and mouseReleased().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::mousePressed ( MouseEvent &  mouseEvent)
virtual
void fcn::ResizableWindow::mouseReleased ( MouseEvent &  mouseEvent)
virtual

Reimplemented in fcn::DockArea, and fcn::Panel.

Definition at line 320 of file resizablewindow.cpp.

References m_resizing, and mouseExited().

Referenced by fcn::Panel::mouseReleased(), and fcn::DockArea::mouseReleased().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::resizeToContent ( bool  recursiv = true)
virtual

Reimplemented in fcn::DockArea, and fcn::Panel.

Definition at line 278 of file resizablewindow.cpp.

References m_resizable.

Referenced by fcn::Panel::expandContent(), fcn::Panel::resizeToContent(), and fcn::DockArea::resizeToContent().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::set ( CursorDirections  direction,
uint32_t  cursor_id = 0 
)

Sets the mouse cursor for the specified direction.

Parameters
cursor_idFor native cursors, this is the resource id to native cursor, or one of the values in NativeCursor

Definition at line 238 of file resizablewindow.cpp.

References FIFE::CURSOR_NATIVE, fcn::ResizableWindow::CursorState::cursorAnimation, fcn::ResizableWindow::CursorState::cursorId, fcn::ResizableWindow::CursorState::cursorImage, fcn::ResizableWindow::CursorState::cursorType, m_cursors, and FIFE::SharedPtr< T >::reset().

void fcn::ResizableWindow::set ( CursorDirections  direction,
FIFE::ImagePtr  image 
)
void fcn::ResizableWindow::set ( CursorDirections  direction,
FIFE::AnimationPtr  anim 
)

Sets the mouse cursor type to animation for the specified direction.

Parameters
animAnimationPtr to a loaded animation used for the cursor

Definition at line 254 of file resizablewindow.cpp.

References FIFE::CURSOR_ANIMATION, fcn::ResizableWindow::CursorState::cursorAnimation, fcn::ResizableWindow::CursorState::cursorId, fcn::ResizableWindow::CursorState::cursorImage, fcn::ResizableWindow::CursorState::cursorType, m_cursors, FIFE::NC_ARROW, and FIFE::SharedPtr< T >::reset().

void fcn::ResizableWindow::setBottomResizable ( bool  resizable)

Sets if the widget is resizable at bottom.

Parameters
resizableTrue if the widget should be resizeable at bottom, otherwise false.

Definition at line 214 of file resizablewindow.cpp.

References m_resizableBottom.

Referenced by fcn::DockArea::DockArea(), and fcn::DockArea::setTopSide().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::setLeftResizable ( bool  resizable)

Sets if the widget is resizable at left.

Parameters
resizableTrue if the widget should be resizeable at left, otherwise false.

Definition at line 222 of file resizablewindow.cpp.

References m_resizableLeft.

Referenced by fcn::DockArea::DockArea(), and fcn::DockArea::setRightSide().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::setResizable ( bool  resizable)

Sets if the widget is resizable.

Parameters
resizableTrue if the widget should be resizeable, otherwise false.

Definition at line 190 of file resizablewindow.cpp.

References m_resizable.

Referenced by fcn::Panel::setDocked().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::setResizableBorderDistance ( int32_t  border)

Sets the size of the area that is active for resize events.

Parameters
borderThe distance from the edge that is active for resize events.

Definition at line 182 of file resizablewindow.cpp.

References m_borderDistance.

void fcn::ResizableWindow::setRightResizable ( bool  resizable)

Sets if the widget is resizable at right.

Parameters
resizableTrue if the widget should be resizeable at right, otherwise false.

Definition at line 206 of file resizablewindow.cpp.

References m_resizableRight.

Referenced by fcn::DockArea::DockArea(), and fcn::DockArea::setLeftSide().

+ Here is the caller graph for this function:

void fcn::ResizableWindow::setShove ( bool  shove)

Sets if the widget should be pushed if the size reaches the minimum.

Parameters
shoveTrue if the widget should be pushed, otherwise false.

Definition at line 230 of file resizablewindow.cpp.

References m_shove.

void fcn::ResizableWindow::setTopResizable ( bool  resizable)

Sets if the widget is resizable at top.

Parameters
resizableTrue if the widget should be resizeable at top, otherwise false.

Definition at line 198 of file resizablewindow.cpp.

References m_resizableTop.

Referenced by fcn::DockArea::DockArea(), and fcn::DockArea::setBottomSide().

+ Here is the caller graph for this function:

Member Data Documentation

int32_t fcn::ResizableWindow::m_borderDistance
protected
FIFE::Cursor* fcn::ResizableWindow::m_cursor
protected

Definition at line 197 of file resizablewindow.h.

Referenced by mouseMoved(), restoreCursor(), and saveCursor().

std::vector<CursorState> fcn::ResizableWindow::m_cursors
protected

Definition at line 230 of file resizablewindow.h.

Referenced by getAnimation(), getId(), getImage(), getType(), initCursors(), mouseMoved(), and set().

bool fcn::ResizableWindow::m_resizable
protected
bool fcn::ResizableWindow::m_resizableBottom
protected

Definition at line 207 of file resizablewindow.h.

Referenced by isBottomResizable(), mouseMoved(), mousePressed(), and setBottomResizable().

bool fcn::ResizableWindow::m_resizableLeft
protected

Definition at line 209 of file resizablewindow.h.

Referenced by isLeftResizable(), mouseMoved(), mousePressed(), and setLeftResizable().

bool fcn::ResizableWindow::m_resizableRight
protected

Definition at line 205 of file resizablewindow.h.

Referenced by isRightResizable(), mouseMoved(), mousePressed(), and setRightResizable().

bool fcn::ResizableWindow::m_resizableTop
protected

Definition at line 203 of file resizablewindow.h.

Referenced by isTopResizable(), mouseMoved(), mousePressed(), and setTopResizable().

bool fcn::ResizableWindow::m_resizeBottom
protected

Definition at line 216 of file resizablewindow.h.

Referenced by mouseDragged(), and mousePressed().

bool fcn::ResizableWindow::m_resizeLeft
protected

Definition at line 217 of file resizablewindow.h.

Referenced by mouseDragged(), and mousePressed().

bool fcn::ResizableWindow::m_resizeRight
protected

Definition at line 215 of file resizablewindow.h.

Referenced by mouseDragged(), and mousePressed().

bool fcn::ResizableWindow::m_resizeTop
protected

Definition at line 214 of file resizablewindow.h.

Referenced by mouseDragged(), and mousePressed().

CursorState fcn::ResizableWindow::m_saved
protected

Definition at line 228 of file resizablewindow.h.

Referenced by initCursors(), mouseExited(), mouseMoved(), restoreCursor(), and saveCursor().

bool fcn::ResizableWindow::m_shove
protected

Definition at line 219 of file resizablewindow.h.

Referenced by getShove(), mouseDragged(), and setShove().


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