40 m_cursor(
FIFE::FifechanManager::instance()->getCursor()),
44 m_resizableRight(true),
45 m_resizableBottom(true),
46 m_resizableLeft(true),
50 m_resizeBottom(false),
55 addFocusListener(
this);
61 m_cursor(
FIFE::FifechanManager::instance()->getCursor()),
76 addFocusListener(
this);
82 m_cursor(
FIFE::FifechanManager::instance()->getCursor()),
98 addFocusListener(
this);
275 return m_cursors[direction].cursorAnimation;
283 Window::resizeToContent(recursiv);
286 Window::resizeToContent(recursiv);
294 Window::mouseEntered(mouseEvent);
301 mouseEvent.consume();
303 Window::mouseExited(mouseEvent);
307 if (
m_resizable && mouseEvent.getButton() == MouseEvent::Left) {
314 mouseEvent.consume();
317 Window::mousePressed(mouseEvent);
324 if (mouseEvent.getX() <= 0 || mouseEvent.getX() >= getWidth() ||
325 mouseEvent.getY() <= 0 || mouseEvent.getY() >= getHeight()) {
328 mouseEvent.consume();
330 Window::mouseReleased(mouseEvent);
361 mouseEvent.consume();
366 Window::mouseMoved(mouseEvent);
371 int x = mouseEvent.getX();
372 int y = mouseEvent.getY();
374 int oldW = getWidth();
384 int newX = oldW - newW;
389 if (x != getWidth() &&
m_shove) {
390 setX(getX() + (x-getWidth()));
395 int oldH = getHeight();
405 int newY = oldH - newH;
410 if (y != getHeight() &&
m_shove) {
411 setY(getY() + (y-getHeight()));
414 mouseEvent.consume();
416 Window::mouseDragged(mouseEvent);
void setShove(bool shove)
Sets if the widget should be pushed if the size reaches the minimum.
virtual void mousePressed(MouseEvent &mouseEvent)
FIFE::ImagePtr cursorImage
virtual void mouseExited(MouseEvent &mouseEvent)
virtual void mouseReleased(MouseEvent &mouseEvent)
void set(CursorDirections direction, uint32_t cursor_id=0)
Sets the mouse cursor for the specified direction.
bool isTopResizable() const
Gets if the widget is resizable at top.
std::vector< CursorState > m_cursors
bool isResizable() const
Gets if the widget is resizable.
uint32_t getId(CursorDirections direction) const
Gets the mouse cursor handle for the specified direction.
void setResizableBorderDistance(int32_t border)
Sets the size of the area that is active for resize events.
virtual void mouseMoved(MouseEvent &mouseEvent)
void reset(T *ptr=0)
reset this pointer to a null shared pointer this can be used to lower the reference count of the shar...
void setBottomResizable(bool resizable)
Sets if the widget is resizable at bottom.
virtual void resizeToContent(bool recursiv=true)
void setResizable(bool resizable)
Sets if the widget is resizable.
ImagePtr getImage()
Gets the current mouse image.
virtual void focusLost(const Event &event)
bool isBottomResizable() const
Gets if the widget is resizable at bottom.
bool isLeftResizable() const
Gets if the widget is resizable at left.
MouseCursorType
Defines the type of shown cursor native -> default cursor image -> cursor from image pool animation -...
bool isRightResizable() const
Gets if the widget is resizable at right.
void setTopResizable(bool resizable)
Sets if the widget is resizable at top.
FIFE::AnimationPtr cursorAnimation
MouseCursorType getType() const
Gets the current mouse cursor type.
AnimationPtr getAnimation()
Gets the current mouse animation.
FIFE::ImagePtr getImage(CursorDirections direction)
Gets the mouse image for the specified direction.
void setLeftResizable(bool resizable)
Sets if the widget is resizable at left.
FIFE::MouseCursorType cursorType
int32_t getResizableBorderDistance() const
Gets the size of the area that is active for resize events.
void set(uint32_t cursor_id=0)
Sets the current mouse cursor.
FIFE::AnimationPtr getAnimation(CursorDirections direction)
Gets the mouse animation for the specified direction.
bool getShove() const
Gets if the widget should be pushed if the size reaches the minimum.
virtual void mouseDragged(MouseEvent &mouseEvent)
virtual void mouseEntered(MouseEvent &mouseEvent)
uint32_t getId() const
Gets the current mouse cursor handle.
void setRightResizable(bool resizable)
Sets if the widget is resizable at right.
virtual ~ResizableWindow()
FIFE::MouseCursorType getType(CursorDirections direction) const
Gets the mouse cursor type for the specified direction.