FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <resizablewindow.h>
Classes | |
struct | CursorState |
Public Types | |
enum | CursorDirections { CURSOR_DIRECTION_L = 0, CURSOR_DIRECTION_R = 1, CURSOR_DIRECTION_T = 2, CURSOR_DIRECTION_B = 5, CURSOR_DIRECTION_LT = 3, CURSOR_DIRECTION_RT = 4, CURSOR_DIRECTION_LB = 6, CURSOR_DIRECTION_RB = 7 } |
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::Cursor * | m_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< CursorState > | m_cursors |
Definition at line 38 of file resizablewindow.h.
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.
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().
|
virtual |
Definition at line 102 of file resizablewindow.cpp.
|
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.
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.
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.
|
protected |
Definition at line 105 of file resizablewindow.cpp.
References FIFE::CURSOR_NATIVE, FIFE::CURSOR_NONE, fcn::ResizableWindow::CursorState::cursorId, fcn::ResizableWindow::CursorState::cursorType, m_cursors, m_saved, FIFE::NC_ARROW, FIFE::NC_RESIZENESW, FIFE::NC_RESIZENS, FIFE::NC_RESIZENWSE, and FIFE::NC_RESIZEWE.
Referenced by ResizableWindow().
bool fcn::ResizableWindow::isBottomResizable | ( | ) | const |
Gets if the widget is resizable at bottom.
Definition at line 218 of file resizablewindow.cpp.
References m_resizableBottom.
bool fcn::ResizableWindow::isLeftResizable | ( | ) | const |
Gets if the widget is resizable at left.
Definition at line 226 of file resizablewindow.cpp.
References m_resizableLeft.
bool fcn::ResizableWindow::isResizable | ( | ) | const |
Gets if the widget is resizable.
Definition at line 194 of file resizablewindow.cpp.
References m_resizable.
Referenced by fcn::Panel::setDocked().
bool fcn::ResizableWindow::isRightResizable | ( | ) | const |
Gets if the widget is resizable at right.
Definition at line 210 of file resizablewindow.cpp.
References m_resizableRight.
bool fcn::ResizableWindow::isTopResizable | ( | ) | const |
Gets if the widget is resizable at top.
Definition at line 202 of file resizablewindow.cpp.
References m_resizableTop.
|
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().
|
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().
|
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().
|
virtual |
Reimplemented in fcn::DockArea, and fcn::Panel.
Definition at line 334 of file resizablewindow.cpp.
References FIFE::CURSOR_ANIMATION, FIFE::CURSOR_IMAGE, FIFE::CURSOR_NATIVE, FIFE::CURSOR_NONE, fcn::ResizableWindow::CursorState::cursorAnimation, fcn::ResizableWindow::CursorState::cursorId, fcn::ResizableWindow::CursorState::cursorImage, fcn::ResizableWindow::CursorState::cursorType, m_borderDistance, m_cursor, m_cursors, m_resizable, m_resizableBottom, m_resizableLeft, m_resizableRight, m_resizableTop, m_resizing, m_saved, restoreCursor(), and FIFE::Cursor::set().
Referenced by fcn::Panel::mouseMoved(), and fcn::DockArea::mouseMoved().
|
virtual |
Reimplemented in fcn::DockArea, and fcn::Panel.
Definition at line 306 of file resizablewindow.cpp.
References m_borderDistance, m_resizable, m_resizableBottom, m_resizableLeft, m_resizableRight, m_resizableTop, m_resizeBottom, m_resizeLeft, m_resizeRight, m_resizeTop, and m_resizing.
Referenced by fcn::Panel::mousePressed(), and fcn::DockArea::mousePressed().
|
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().
|
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().
|
protected |
Definition at line 139 of file resizablewindow.cpp.
References FIFE::CURSOR_ANIMATION, FIFE::CURSOR_IMAGE, FIFE::CURSOR_NATIVE, fcn::ResizableWindow::CursorState::cursorAnimation, fcn::ResizableWindow::CursorState::cursorId, fcn::ResizableWindow::CursorState::cursorImage, fcn::ResizableWindow::CursorState::cursorType, m_cursor, m_saved, and FIFE::Cursor::set().
Referenced by focusLost(), mouseExited(), mouseMoved(), and fcn::Panel::mouseReleased().
|
protected |
Definition at line 156 of file resizablewindow.cpp.
References FIFE::CURSOR_ANIMATION, FIFE::CURSOR_IMAGE, FIFE::CURSOR_NATIVE, FIFE::CURSOR_NONE, fcn::ResizableWindow::CursorState::cursorAnimation, fcn::ResizableWindow::CursorState::cursorId, fcn::ResizableWindow::CursorState::cursorImage, fcn::ResizableWindow::CursorState::cursorType, FIFE::Cursor::getAnimation(), FIFE::Cursor::getId(), FIFE::Cursor::getImage(), FIFE::Cursor::getType(), m_cursor, m_saved, FIFE::NC_ARROW, and FIFE::SharedPtr< T >::reset().
Referenced by mouseEntered().
void fcn::ResizableWindow::set | ( | CursorDirections | direction, |
uint32_t | cursor_id = 0 |
||
) |
Sets the mouse cursor for the specified direction.
cursor_id | For 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 | ||
) |
Sets the mouse cursor type to image for the specified direction.
image | ImagePtr to a image used for the cursor |
Definition at line 246 of file resizablewindow.cpp.
References FIFE::CURSOR_IMAGE, 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::set | ( | CursorDirections | direction, |
FIFE::AnimationPtr | anim | ||
) |
Sets the mouse cursor type to animation for the specified direction.
anim | AnimationPtr 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.
resizable | True 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().
void fcn::ResizableWindow::setLeftResizable | ( | bool | resizable | ) |
Sets if the widget is resizable at left.
resizable | True 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().
void fcn::ResizableWindow::setResizable | ( | bool | resizable | ) |
Sets if the widget is resizable.
resizable | True if the widget should be resizeable, otherwise false. |
Definition at line 190 of file resizablewindow.cpp.
References m_resizable.
Referenced by fcn::Panel::setDocked().
void fcn::ResizableWindow::setResizableBorderDistance | ( | int32_t | border | ) |
Sets the size of the area that is active for resize events.
border | The 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.
resizable | True 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().
void fcn::ResizableWindow::setShove | ( | bool | shove | ) |
Sets if the widget should be pushed if the size reaches the minimum.
shove | True 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.
resizable | True 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().
|
protected |
Definition at line 199 of file resizablewindow.h.
Referenced by getResizableBorderDistance(), mouseMoved(), mousePressed(), and setResizableBorderDistance().
|
protected |
Definition at line 197 of file resizablewindow.h.
Referenced by mouseMoved(), restoreCursor(), and saveCursor().
|
protected |
Definition at line 230 of file resizablewindow.h.
Referenced by getAnimation(), getId(), getImage(), getType(), initCursors(), mouseMoved(), and set().
|
protected |
Definition at line 201 of file resizablewindow.h.
Referenced by isResizable(), mouseDragged(), mouseEntered(), mouseExited(), mouseMoved(), mousePressed(), resizeToContent(), and setResizable().
|
protected |
Definition at line 207 of file resizablewindow.h.
Referenced by isBottomResizable(), mouseMoved(), mousePressed(), and setBottomResizable().
|
protected |
Definition at line 209 of file resizablewindow.h.
Referenced by isLeftResizable(), mouseMoved(), mousePressed(), and setLeftResizable().
|
protected |
Definition at line 205 of file resizablewindow.h.
Referenced by isRightResizable(), mouseMoved(), mousePressed(), and setRightResizable().
|
protected |
Definition at line 203 of file resizablewindow.h.
Referenced by isTopResizable(), mouseMoved(), mousePressed(), and setTopResizable().
|
protected |
Definition at line 216 of file resizablewindow.h.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Definition at line 217 of file resizablewindow.h.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Definition at line 215 of file resizablewindow.h.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Definition at line 214 of file resizablewindow.h.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Definition at line 211 of file resizablewindow.h.
Referenced by fcn::DockArea::expandContent(), focusLost(), fcn::DockArea::mouseDragged(), mouseDragged(), mouseEntered(), mouseExited(), mouseMoved(), mousePressed(), fcn::DockArea::mouseReleased(), mouseReleased(), and fcn::DockArea::resizeToContent().
|
protected |
Definition at line 228 of file resizablewindow.h.
Referenced by initCursors(), mouseExited(), mouseMoved(), restoreCursor(), and saveCursor().
|
protected |
Definition at line 219 of file resizablewindow.h.
Referenced by getShove(), mouseDragged(), and setShove().