Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PopupMenu Class Reference

Window showing popup menu. More...

#include <popupmenu.h>

Inheritance diagram for PopupMenu:
Popup LinkHandler Container

Public Member Functions

 PopupMenu ()
 
void showPopup (int x, int y, Being *being)
 Shows the being related popup menu at the specified mouse coords.
 
void showPopup (int x, int y, FloorItem *floorItem)
 Shows the floor item related popup menu at the specified mouse coords.
 
void showPopup (Window *parent, int x, int y, Item *item, bool isInventory, bool canDrop=true)
 Shows the related popup menu when right click on the inventory at the specified mouse coordinates.
 
void handleLink (const std::string &link) override
 Handles link action.
 
- Public Member Functions inherited from Popup
 Popup (const std::string &name=std::string(), SkinType skinType=SkinType::Popup)
 Constructor.
 
 ~Popup () override
 Destructor.
 
void add (gcn::Widget *widget) override
 
void add (gcn::Widget *widget, int x, int y) override
 
void draw (gcn::Graphics *graphics) override
 Draws the popup.
 
void drawFrame (gcn::Graphics *graphics) override
 Draws the popup frame.
 
void setContentSize (int width, int height)
 Sets the size of this popup.
 
void setLocationRelativeTo (gcn::Widget *widget)
 Sets the location relative to the given widget.
 
void mouseMoved (gcn::MouseEvent &event) override
 
void setMinWidth (int width)
 Sets the minimum width of the popup.
 
int getMinWidth () const
 
void setMinHeight (int height)
 Sets the minimum height of the popup.
 
int getMinHeight () const
 
void setMaxWidth (int width)
 Sets the maximum width of the popup.
 
int getMaxWidth () const
 
void setMaxHeight (int height)
 Sets the minimum height of the popup.
 
int getMaxHeight () const
 
int getPadding () const
 Gets the padding of the popup.
 
void setPadding (int padding)
 
void setPopupName (const std::string &name)
 Sets the name of the popup.
 
const std::string & getPopupName () const
 
void scheduleDelete ()
 Schedule this popup for deletion.
 
gcn::Rectangle getChildrenArea () override
 
void position (int x, int y)
 Sets the location to display the popup.
 
const SkingetSkin () const
 Returns the Skin used by this popup.
 
- Public Member Functions inherited from Container
 Container ()
 
 ~Container () override
 
void drawFrame (gcn::Graphics *graphics) override
 
- Public Member Functions inherited from LinkHandler
virtual ~LinkHandler ()=default
 

Private Member Functions

void showPopup (int x, int y)
 Shared code for the various showPopup functions.
 

Private Attributes

BrowserBoxmBrowserBox
 
int mBeingId = 0
 
FloorItemmFloorItem = nullptr
 
ItemmItem = nullptr
 
WindowmWindow
 

Additional Inherited Members

- Static Public Member Functions inherited from Popup
static void setWindowContainer (WindowContainer *windowContainer)
 Sets the window container to be used by new popups.
 
- Protected Member Functions inherited from Container
LayoutgetLayout ()
 Gets the layout handler for this container.
 
LayoutCellplace (int x, int y, gcn::Widget *wg, int w=1, int h=1)
 Adds a widget to the container and sets it at given cell.
 
ContainerPlacer getPlacer (int x, int y)
 Returns a proxy for adding widgets in an inner table of the layout.
 

Detailed Description

Window showing popup menu.

Definition at line 36 of file popupmenu.h.

Constructor & Destructor Documentation

◆ PopupMenu()

PopupMenu::PopupMenu ( )

Definition at line 57 of file popupmenu.cpp.

Member Function Documentation

◆ handleLink()

void PopupMenu::handleLink ( const std::string &  link)
overridevirtual

Handles link action.

Implements LinkHandler.

Definition at line 197 of file popupmenu.cpp.

◆ showPopup() [1/4]

void PopupMenu::showPopup ( int  x,
int  y 
)
private

Shared code for the various showPopup functions.

Definition at line 377 of file popupmenu.cpp.

◆ showPopup() [2/4]

void PopupMenu::showPopup ( int  x,
int  y,
Being being 
)

Shows the being related popup menu at the specified mouse coords.

Definition at line 66 of file popupmenu.cpp.

◆ showPopup() [3/4]

void PopupMenu::showPopup ( int  x,
int  y,
FloorItem floorItem 
)

Shows the floor item related popup menu at the specified mouse coords.

Definition at line 179 of file popupmenu.cpp.

◆ showPopup() [4/4]

void PopupMenu::showPopup ( Window parent,
int  x,
int  y,
Item item,
bool  isInventory,
bool  canDrop = true 
)

Shows the related popup menu when right click on the inventory at the specified mouse coordinates.

Definition at line 331 of file popupmenu.cpp.

Member Data Documentation

◆ mBeingId

int PopupMenu::mBeingId = 0
private

Definition at line 67 of file popupmenu.h.

◆ mBrowserBox

BrowserBox* PopupMenu::mBrowserBox
private

Definition at line 65 of file popupmenu.h.

◆ mFloorItem

FloorItem* PopupMenu::mFloorItem = nullptr
private

Definition at line 68 of file popupmenu.h.

◆ mItem

Item* PopupMenu::mItem = nullptr
private

Definition at line 69 of file popupmenu.h.

◆ mWindow

Window* PopupMenu::mWindow
private

Definition at line 71 of file popupmenu.h.


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