Otclient  14/8/2020
UIMinimap Class Reference

#include <uiminimap.h>

Inheritance diagram for UIMinimap:
Collaboration diagram for UIMinimap:

Public Member Functions

 UIMinimap ()
 
void drawSelf (Fw::DrawPane drawPane)
 
bool zoomIn ()
 
bool zoomOut ()
 
bool setZoom (int zoom)
 
void setMinZoom (int minZoom)
 
void setMaxZoom (int maxZoom)
 
void setCameraPosition (const Position &pos)
 
bool floorUp ()
 
bool floorDown ()
 
Point getTilePoint (const Position &pos)
 
Rect getTileRect (const Position &pos)
 
Position getTilePosition (const Point &mousePos)
 
Position getCameraPosition ()
 
int getMinZoom ()
 
int getMaxZoom ()
 
int getZoom ()
 
float getScale ()
 
void anchorPosition (const UIWidgetPtr &anchoredWidget, Fw::AnchorEdge anchoredEdge, const Position &hookedPosition, Fw::AnchorEdge hookedEdge)
 
void fillPosition (const UIWidgetPtr &anchoredWidget, const Position &hookedPosition)
 
void centerInPosition (const UIWidgetPtr &anchoredWidget, const Position &hookedPosition)
 
- Public Member Functions inherited from UIWidget
 UIWidget ()
 
virtual ~UIWidget ()
 
void addChild (const UIWidgetPtr &child)
 
void insertChild (int index, const UIWidgetPtr &child)
 
void removeChild (UIWidgetPtr child)
 
void focusChild (const UIWidgetPtr &child, Fw::FocusReason reason)
 
void focusNextChild (Fw::FocusReason reason, bool rotate=false)
 
void focusPreviousChild (Fw::FocusReason reason, bool rotate=false)
 
void lowerChild (UIWidgetPtr child)
 
void raiseChild (UIWidgetPtr child)
 
void moveChildToIndex (const UIWidgetPtr &child, int index)
 
void lockChild (const UIWidgetPtr &child)
 
void unlockChild (const UIWidgetPtr &child)
 
void mergeStyle (const OTMLNodePtr &styleNode)
 
void applyStyle (const OTMLNodePtr &styleNode)
 
void addAnchor (Fw::AnchorEdge anchoredEdge, const std::string &hookedWidgetId, Fw::AnchorEdge hookedEdge)
 
void removeAnchor (Fw::AnchorEdge anchoredEdge)
 
void fill (const std::string &hookedWidgetId)
 
void centerIn (const std::string &hookedWidgetId)
 
void breakAnchors ()
 
void updateParentLayout ()
 
void updateLayout ()
 
void lock ()
 
void unlock ()
 
void focus ()
 
void recursiveFocus (Fw::FocusReason reason)
 
void lower ()
 
void raise ()
 
void grabMouse ()
 
void ungrabMouse ()
 
void grabKeyboard ()
 
void ungrabKeyboard ()
 
void bindRectToParent ()
 
void destroy ()
 
void destroyChildren ()
 
void setId (const std::string &id)
 
void setParent (const UIWidgetPtr &parent)
 
void setLayout (const UILayoutPtr &layout)
 
bool setRect (const Rect &rect)
 
void setStyle (const std::string &styleName)
 
void setStyleFromNode (const OTMLNodePtr &styleNode)
 
void setEnabled (bool enabled)
 
void setVisible (bool visible)
 
void setOn (bool on)
 
void setChecked (bool checked)
 
void setFocusable (bool focusable)
 
void setPhantom (bool phantom)
 
void setDraggable (bool draggable)
 
void setFixedSize (bool fixed)
 
void setClipping (bool clipping)
 
void setLastFocusReason (Fw::FocusReason reason)
 
void setAutoFocusPolicy (Fw::AutoFocusPolicy policy)
 
void setAutoRepeatDelay (int delay)
 
void setVirtualOffset (const Point &offset)
 
bool isAnchored ()
 
bool isChildLocked (const UIWidgetPtr &child)
 
bool hasChild (const UIWidgetPtr &child)
 
int getChildIndex (const UIWidgetPtr &child)
 
Rect getPaddingRect ()
 
Rect getMarginRect ()
 
Rect getChildrenRect ()
 
UIAnchorLayoutPtr getAnchoredLayout ()
 
UIWidgetPtr getRootParent ()
 
UIWidgetPtr getChildAfter (const UIWidgetPtr &relativeChild)
 
UIWidgetPtr getChildBefore (const UIWidgetPtr &relativeChild)
 
UIWidgetPtr getChildById (const std::string &childId)
 
UIWidgetPtr getChildByPos (const Point &childPos)
 
UIWidgetPtr getChildByIndex (int index)
 
UIWidgetPtr recursiveGetChildById (const std::string &id)
 
UIWidgetPtr recursiveGetChildByPos (const Point &childPos, bool wantsPhantom)
 
UIWidgetList recursiveGetChildren ()
 
UIWidgetList recursiveGetChildrenByPos (const Point &childPos)
 
UIWidgetList recursiveGetChildrenByMarginPos (const Point &childPos)
 
UIWidgetPtr backwardsGetWidgetById (const std::string &id)
 
void resize (int width, int height)
 
void move (int x, int y)
 
void rotate (float degrees)
 
void hide ()
 
void show ()
 
void disable ()
 
void enable ()
 
bool isActive ()
 
bool isEnabled ()
 
bool isDisabled ()
 
bool isFocused ()
 
bool isHovered ()
 
bool isPressed ()
 
bool isFirst ()
 
bool isMiddle ()
 
bool isLast ()
 
bool isAlternate ()
 
bool isChecked ()
 
bool isOn ()
 
bool isDragging ()
 
bool isVisible ()
 
bool isHidden ()
 
bool isExplicitlyEnabled ()
 
bool isExplicitlyVisible ()
 
bool isFocusable ()
 
bool isPhantom ()
 
bool isDraggable ()
 
bool isFixedSize ()
 
bool isClipping ()
 
bool isDestroyed ()
 
bool hasChildren ()
 
bool containsMarginPoint (const Point &point)
 
bool containsPaddingPoint (const Point &point)
 
bool containsPoint (const Point &point)
 
std::string getId ()
 
UIWidgetPtr getParent ()
 
UIWidgetPtr getFocusedChild ()
 
UIWidgetList getChildren ()
 
UIWidgetPtr getFirstChild ()
 
UIWidgetPtr getLastChild ()
 
UILayoutPtr getLayout ()
 
OTMLNodePtr getStyle ()
 
int getChildCount ()
 
Fw::FocusReason getLastFocusReason ()
 
Fw::AutoFocusPolicy getAutoFocusPolicy ()
 
int getAutoRepeatDelay ()
 
Point getVirtualOffset ()
 
std::string getStyleName ()
 
Point getLastClickPosition ()
 
void setX (int x)
 
void setY (int y)
 
void setWidth (int width)
 
void setHeight (int height)
 
void setSize (const Size &size)
 
void setPosition (const Point &pos)
 
void setColor (const Color &color)
 
void setBackgroundColor (const Color &color)
 
void setBackgroundOffsetX (int x)
 
void setBackgroundOffsetY (int y)
 
void setBackgroundOffset (const Point &pos)
 
void setBackgroundWidth (int width)
 
void setBackgroundHeight (int height)
 
void setBackgroundSize (const Size &size)
 
void setBackgroundRect (const Rect &rect)
 
void setIcon (const std::string &iconFile)
 
void setIconColor (const Color &color)
 
void setIconOffsetX (int x)
 
void setIconOffsetY (int y)
 
void setIconOffset (const Point &pos)
 
void setIconWidth (int width)
 
void setIconHeight (int height)
 
void setIconSize (const Size &size)
 
void setIconRect (const Rect &rect)
 
void setIconClip (const Rect &rect)
 
void setIconAlign (Fw::AlignmentFlag align)
 
void setBorderWidth (int width)
 
void setBorderWidthTop (int width)
 
void setBorderWidthRight (int width)
 
void setBorderWidthBottom (int width)
 
void setBorderWidthLeft (int width)
 
void setBorderColor (const Color &color)
 
void setBorderColorTop (const Color &color)
 
void setBorderColorRight (const Color &color)
 
void setBorderColorBottom (const Color &color)
 
void setBorderColorLeft (const Color &color)
 
void setMargin (int margin)
 
void setMarginHorizontal (int margin)
 
void setMarginVertical (int margin)
 
void setMarginTop (int margin)
 
void setMarginRight (int margin)
 
void setMarginBottom (int margin)
 
void setMarginLeft (int margin)
 
void setPadding (int padding)
 
void setPaddingHorizontal (int padding)
 
void setPaddingVertical (int padding)
 
void setPaddingTop (int padding)
 
void setPaddingRight (int padding)
 
void setPaddingBottom (int padding)
 
void setPaddingLeft (int padding)
 
void setOpacity (float opacity)
 
void setRotation (float degrees)
 
int getX ()
 
int getY ()
 
Point getPosition ()
 
int getWidth ()
 
int getHeight ()
 
Size getSize ()
 
Rect getRect ()
 
Color getColor ()
 
Color getBackgroundColor ()
 
int getBackgroundOffsetX ()
 
int getBackgroundOffsetY ()
 
Point getBackgroundOffset ()
 
int getBackgroundWidth ()
 
int getBackgroundHeight ()
 
Size getBackgroundSize ()
 
Rect getBackgroundRect ()
 
Color getIconColor ()
 
int getIconOffsetX ()
 
int getIconOffsetY ()
 
Point getIconOffset ()
 
int getIconWidth ()
 
int getIconHeight ()
 
Size getIconSize ()
 
Rect getIconRect ()
 
Rect getIconClip ()
 
Fw::AlignmentFlag getIconAlign ()
 
Color getBorderTopColor ()
 
Color getBorderRightColor ()
 
Color getBorderBottomColor ()
 
Color getBorderLeftColor ()
 
int getBorderTopWidth ()
 
int getBorderRightWidth ()
 
int getBorderBottomWidth ()
 
int getBorderLeftWidth ()
 
int getMarginTop ()
 
int getMarginRight ()
 
int getMarginBottom ()
 
int getMarginLeft ()
 
int getPaddingTop ()
 
int getPaddingRight ()
 
int getPaddingBottom ()
 
int getPaddingLeft ()
 
float getOpacity ()
 
float getRotation ()
 
void setImageSource (const std::string &source)
 
void setImageClip (const Rect &clipRect)
 
void setImageOffsetX (int x)
 
void setImageOffsetY (int y)
 
void setImageOffset (const Point &pos)
 
void setImageWidth (int width)
 
void setImageHeight (int height)
 
void setImageSize (const Size &size)
 
void setImageRect (const Rect &rect)
 
void setImageColor (const Color &color)
 
void setImageFixedRatio (bool fixedRatio)
 
void setImageRepeated (bool repeated)
 
void setImageSmooth (bool smooth)
 
void setImageAutoResize (bool autoResize)
 
void setImageBorderTop (int border)
 
void setImageBorderRight (int border)
 
void setImageBorderBottom (int border)
 
void setImageBorderLeft (int border)
 
void setImageBorder (int border)
 
Rect getImageClip ()
 
int getImageOffsetX ()
 
int getImageOffsetY ()
 
Point getImageOffset ()
 
int getImageWidth ()
 
int getImageHeight ()
 
Size getImageSize ()
 
Rect getImageRect ()
 
Color getImageColor ()
 
bool isImageFixedRatio ()
 
bool isImageSmooth ()
 
bool isImageAutoResize ()
 
int getImageBorderTop ()
 
int getImageBorderRight ()
 
int getImageBorderBottom ()
 
int getImageBorderLeft ()
 
int getImageTextureWidth ()
 
int getImageTextureHeight ()
 
void resizeToText ()
 
void clearText ()
 
void setText (std::string text, bool dontFireLuaCall=false)
 
void setTextAlign (Fw::AlignmentFlag align)
 
void setTextOffset (const Point &offset)
 
void setTextWrap (bool textWrap)
 
void setTextAutoResize (bool textAutoResize)
 
void setTextHorizontalAutoResize (bool textAutoResize)
 
void setTextVerticalAutoResize (bool textAutoResize)
 
void setTextOnlyUpperCase (bool textOnlyUpperCase)
 
void setFont (const std::string &fontName)
 
std::string getText ()
 
std::string getDrawText ()
 
Fw::AlignmentFlag getTextAlign ()
 
Point getTextOffset ()
 
bool getTextWrap ()
 
std::string getFont ()
 
Size getTextSize ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

virtual void onZoomChange (int zoom, int oldZoom)
 
virtual void onCameraPositionChange (const Position &position, const Position &oldPosition)
 
virtual void onStyleApply (const std::string &styleName, const OTMLNodePtr &styleNode)
 
- Protected Member Functions inherited from UIWidget
virtual void draw (const Rect &visibleRect, Fw::DrawPane drawPane)
 
virtual void drawChildren (const Rect &visibleRect, Fw::DrawPane drawPane)
 
bool setState (Fw::WidgetState state, bool on)
 
bool hasState (Fw::WidgetState state)
 
virtual void onGeometryChange (const Rect &oldRect, const Rect &newRect)
 
virtual void onLayoutUpdate ()
 
virtual void onFocusChange (bool focused, Fw::FocusReason reason)
 
virtual void onChildFocusChange (const UIWidgetPtr &focusedChild, const UIWidgetPtr &unfocusedChild, Fw::FocusReason reason)
 
virtual void onHoverChange (bool hovered)
 
virtual void onVisibilityChange (bool visible)
 
virtual bool onDragEnter (const Point &mousePos)
 
virtual bool onDragLeave (UIWidgetPtr droppedWidget, const Point &mousePos)
 
virtual bool onDragMove (const Point &mousePos, const Point &mouseMoved)
 
virtual bool onDrop (UIWidgetPtr draggedWidget, const Point &mousePos)
 
virtual bool onKeyText (const std::string &keyText)
 
virtual bool onKeyDown (uchar keyCode, int keyboardModifiers)
 
virtual bool onKeyPress (uchar keyCode, int keyboardModifiers, int autoRepeatTicks)
 
virtual bool onKeyUp (uchar keyCode, int keyboardModifiers)
 
virtual bool onMousePress (const Point &mousePos, Fw::MouseButton button)
 
virtual bool onMouseRelease (const Point &mousePos, Fw::MouseButton button)
 
virtual bool onMouseMove (const Point &mousePos, const Point &mouseMoved)
 
virtual bool onMouseWheel (const Point &mousePos, Fw::MouseWheelDirection direction)
 
virtual bool onClick (const Point &mousePos)
 
virtual bool onDoubleClick (const Point &mousePos)
 
bool propagateOnKeyText (const std::string &keyText)
 
bool propagateOnKeyDown (uchar keyCode, int keyboardModifiers)
 
bool propagateOnKeyPress (uchar keyCode, int keyboardModifiers, int autoRepeatTicks)
 
bool propagateOnKeyUp (uchar keyCode, int keyboardModifiers)
 
bool propagateOnMouseEvent (const Point &mousePos, UIWidgetList &widgetList)
 
bool propagateOnMouseMove (const Point &mousePos, const Point &mouseMoved, UIWidgetList &widgetList)
 
void drawBackground (const Rect &screenCoords)
 
void drawBorder (const Rect &screenCoords)
 
void drawIcon (const Rect &screenCoords)
 
void drawImage (const Rect &screenCoords)
 
virtual void updateText ()
 
void drawText (const Rect &screenCoords)
 
virtual void onTextChange (const std::string &text, const std::string &oldText)
 
virtual void onFontChange (const std::string &font)
 

Additional Inherited Members

- Protected Attributes inherited from UIWidget
std::string m_id
 
Rect m_rect
 
Point m_virtualOffset
 
stdext::boolean< true > m_enabled
 
stdext::boolean< true > m_visible
 
stdext::boolean< true > m_focusable
 
stdext::boolean< false > m_fixedSize
 
stdext::boolean< false > m_phantom
 
stdext::boolean< false > m_draggable
 
stdext::boolean< false > m_destroyed
 
stdext::boolean< false > m_clipping
 
UILayoutPtr m_layout
 
UIWidgetPtr m_parent
 
UIWidgetList m_children
 
UIWidgetList m_lockedChildren
 
UIWidgetPtr m_focusedChild
 
OTMLNodePtr m_style
 
Timer m_clickTimer
 
Fw::FocusReason m_lastFocusReason
 
Fw::AutoFocusPolicy m_autoFocusPolicy
 
Color m_color
 
Color m_backgroundColor
 
Rect m_backgroundRect
 
TexturePtr m_icon
 
Color m_iconColor
 
Rect m_iconRect
 
Rect m_iconClipRect
 
Fw::AlignmentFlag m_iconAlign
 
EdgeGroup< Colorm_borderColor
 
EdgeGroup< int > m_borderWidth
 
EdgeGroup< int > m_margin
 
EdgeGroup< int > m_padding
 
float m_opacity
 
float m_rotation
 
int m_autoRepeatDelay
 
Point m_lastClickPosition
 
TexturePtr m_imageTexture
 
Rect m_imageClipRect
 
Rect m_imageRect
 
Color m_imageColor
 
Point m_iconOffset
 
stdext::boolean< false > m_imageFixedRatio
 
stdext::boolean< false > m_imageRepeated
 
stdext::boolean< false > m_imageSmooth
 
stdext::boolean< false > m_imageAutoResize
 
EdgeGroup< int > m_imageBorder
 
std::string m_text
 
std::string m_drawText
 
Fw::AlignmentFlag m_textAlign
 
Point m_textOffset
 
stdext::boolean< false > m_textWrap
 
stdext::boolean< false > m_textVerticalAutoResize
 
stdext::boolean< false > m_textHorizontalAutoResize
 
stdext::boolean< false > m_textOnlyUpperCase
 
BitmapFontPtr m_font
 

Detailed Description

Definition at line 29 of file uiminimap.h.

Constructor & Destructor Documentation

◆ UIMinimap()

UIMinimap::UIMinimap ( )

Definition at line 32 of file uiminimap.cpp.

Member Function Documentation

◆ anchorPosition()

void UIMinimap::anchorPosition ( const UIWidgetPtr anchoredWidget,
Fw::AnchorEdge  anchoredEdge,
const Position hookedPosition,
Fw::AnchorEdge  hookedEdge 
)

Definition at line 115 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ centerInPosition()

void UIMinimap::centerInPosition ( const UIWidgetPtr anchoredWidget,
const Position hookedPosition 
)

Definition at line 129 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawSelf()

void UIMinimap::drawSelf ( Fw::DrawPane  drawPane)
virtual

Reimplemented from UIWidget.

Definition at line 41 of file uiminimap.cpp.

Here is the call graph for this function:

◆ fillPosition()

void UIMinimap::fillPosition ( const UIWidgetPtr anchoredWidget,
const Position hookedPosition 
)

Definition at line 122 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ floorDown()

bool UIMinimap::floorDown ( )

Definition at line 91 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ floorUp()

bool UIMinimap::floorUp ( )

Definition at line 82 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCameraPosition()

Position UIMinimap::getCameraPosition ( )
inline

Definition at line 50 of file uiminimap.h.

Here is the caller graph for this function:

◆ getMaxZoom()

int UIMinimap::getMaxZoom ( )
inline

Definition at line 52 of file uiminimap.h.

Here is the caller graph for this function:

◆ getMinZoom()

int UIMinimap::getMinZoom ( )
inline

Definition at line 51 of file uiminimap.h.

Here is the caller graph for this function:

◆ getScale()

float UIMinimap::getScale ( )
inline

Definition at line 54 of file uiminimap.h.

Here is the caller graph for this function:

◆ getTilePoint()

Point UIMinimap::getTilePoint ( const Position pos)

Definition at line 100 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTilePosition()

Position UIMinimap::getTilePosition ( const Point mousePos)

Definition at line 110 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTileRect()

Rect UIMinimap::getTileRect ( const Position pos)

Definition at line 105 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getZoom()

int UIMinimap::getZoom ( )
inline

Definition at line 53 of file uiminimap.h.

Here is the caller graph for this function:

◆ onCameraPositionChange()

void UIMinimap::onCameraPositionChange ( const Position position,
const Position oldPosition 
)
protectedvirtual

Definition at line 141 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onStyleApply()

void UIMinimap::onStyleApply ( const std::string &  styleName,
const OTMLNodePtr styleNode 
)
protectedvirtual

Reimplemented from UIWidget.

Definition at line 146 of file uiminimap.cpp.

Here is the call graph for this function:

◆ onZoomChange()

void UIMinimap::onZoomChange ( int  zoom,
int  oldZoom 
)
protectedvirtual

Definition at line 136 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCameraPosition()

void UIMinimap::setCameraPosition ( const Position pos)

Definition at line 73 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxZoom()

void UIMinimap::setMaxZoom ( int  maxZoom)
inline

Definition at line 41 of file uiminimap.h.

Here is the caller graph for this function:

◆ setMinZoom()

void UIMinimap::setMinZoom ( int  minZoom)
inline

Definition at line 40 of file uiminimap.h.

Here is the caller graph for this function:

◆ setZoom()

bool UIMinimap::setZoom ( int  zoom)

Definition at line 51 of file uiminimap.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zoomIn()

bool UIMinimap::zoomIn ( )
inline

Definition at line 36 of file uiminimap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zoomOut()

bool UIMinimap::zoomOut ( )
inline

Definition at line 37 of file uiminimap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

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