Mana
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
InventoryWindow Class Referencefinal

Inventory dialog. More...

#include <inventorywindow.h>

Inheritance diagram for InventoryWindow:
Window InventoryListener EventListener

Public Member Functions

 InventoryWindow (Inventory *inventory)
 
 ~InventoryWindow () override
 
void action (const gcn::ActionEvent &event) override
 Called when receiving actions from the widgets.
 
ItemgetSelectedItem () const
 Returns the selected item.
 
void widgetHidden (const gcn::Event &event) override
 Handles closing of the window.
 
void mouseClicked (gcn::MouseEvent &event) override
 Handles the mouse clicks.
 
void keyReleased (gcn::KeyEvent &event) override
 Handles the key releases.
 
void valueChanged (const gcn::SelectionEvent &event) override
 Updates labels to currently selected item.
 
void close () override
 Closes the Storage Window, as well as telling the server that the window has been closed.
 
void updateButtons ()
 Updates the buttons.
 
bool isInputFocused () const
 
void slotsChanged (Inventory *inventory) override
 
bool isMainInventory () const
 
void event (Event::Channel channel, const Event &event) override
 
- Public Member Functions inherited from Window
 Window (const std::string &caption="Window", bool modal=false, Window *parent=nullptr)
 Constructor.
 
 Window (SkinType skinType, const std::string &caption="Window", bool modal=false, Window *parent=nullptr)
 Constructor that allows customizing the SkinType used by the window.
 
 ~Window () override
 Destructor.
 
void draw (gcn::Graphics *graphics) override
 Draws the window contents.
 
void drawFrame (gcn::Graphics *graphics) override
 Draws the window frame.
 
void setContentSize (int width, int height)
 Sets the size of this window.
 
void setMinimumContentSize (int width, int height)
 Sets the minimum size of the window content.
 
void setLocationRelativeTo (gcn::Widget *widget)
 Sets the location relative to the given widget.
 
void setResizable (bool resize)
 Sets whether or not the window can be resized.
 
void redraw ()
 
void widgetResized (const gcn::Event &event) override
 Called whenever the widget changes size.
 
void widgetHidden (const gcn::Event &event) override
 Called whenever the widget is hidden.
 
void setCloseButton (bool flag)
 Sets whether or not the window has a close button.
 
bool isResizable () const
 Returns whether the window can be resized.
 
void setMinWidth (int width)
 Sets the minimum width of the window.
 
int getMinWidth () const
 
void setMinHeight (int height)
 Sets the minimum height of the window.
 
int getMinHeight () const
 
void setMaxWidth (int width)
 Sets the maximum width of the window.
 
int getMaxWidth () const
 
void setMaxHeight (int height)
 Sets the minimum height of the window.
 
int getMaxHeight () const
 
void setShowTitle (bool flag)
 Sets flag to show a title or not.
 
void setStickyButton (bool flag)
 Sets whether or not the window has a sticky button.
 
void setSticky (bool sticky)
 Sets whether the window is sticky.
 
bool isSticky () const
 Returns whether the window is sticky.
 
virtual void setVisible (bool visible)
 Overloads window setVisible by Guichan to allow sticky window handling.
 
void setVisible (bool visible, bool forceSticky)
 Overloads window setVisible by Guichan to allow sticky window handling, or not, if you force the sticky state.
 
bool isDefaultVisible () const
 Returns whether the window is visible by default.
 
void setDefaultVisible (bool save)
 Sets whether the window is visible by default.
 
bool willSaveVisible () const
 Returns whether the window will save it's visibility.
 
void setSaveVisible (bool save)
 Sets whether the window will save it's visibility.
 
WindowgetParentWindow () const
 Returns the parent window.
 
void scheduleDelete ()
 Schedule this window for deletion.
 
void mousePressed (gcn::MouseEvent &event) override
 Starts window resizing when appropriate.
 
void mouseDragged (gcn::MouseEvent &event) override
 Implements window resizing and makes sure the window is not dragged/resized outside of the screen.
 
void mouseMoved (gcn::MouseEvent &event) override
 Implements custom cursor image changing context, based on mouse relative position.
 
void mouseReleased (gcn::MouseEvent &event) override
 When the mouse button has been let go, this ensures that the mouse custom cursor is restored back to it's standard image.
 
void mouseExited (gcn::MouseEvent &event) override
 When the mouse leaves the window this ensures that the custom cursor is restored back to it's standard image.
 
void setWindowName (const std::string &name)
 Sets the name of the window.
 
const std::string & getWindowName () const
 Returns the name of the window.
 
void loadWindowState ()
 Reads the position (and the size for resizable windows) in the configuration based on the given string.
 
void saveWindowState () const
 Saves the window state so that when the window is reloaded, it'll maintain its previous state and location.
 
void setDefaultSize (int defaultX, int defaultY, int defaultWidth, int defaultHeight)
 Set the default win pos and size.
 
void setDefaultSize ()
 Set the default win pos and size to the current ones.
 
void setDefaultSize (int defaultWidth, int defaultHeight, WindowAlignment alignment, int offsetx=0, int offsetY=0)
 Set the default win pos and size.
 
virtual void resetToDefaultSize ()
 Reset the win pos and size to default.
 
void adjustPositionAfterResize (int oldScreenWidth, int oldScreenHeight)
 Adjusts the window position after the application window has been resized.
 
LayoutgetLayout ()
 Gets the layout handler for this window.
 
void clearLayout ()
 Clears the window's layout (useful for redesigning the window).
 
void reflowLayout (int w=0, int h=0)
 Computes the position of the widgets according to the current layout.
 
LayoutCellplace (int x, int y, gcn::Widget *, int w=1, int h=1)
 Adds a widget to the window 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.
 
void center ()
 Positions the window in the center of it's parent.
 
const SkingetSkin () const
 Returns the Skin used by this window.
 
- Public Member Functions inherited from InventoryListener
virtual ~InventoryListener ()=default
 
- Public Member Functions inherited from EventListener
virtual ~EventListener ()
 
void listen (Event::Channel channel)
 
void ignore (Event::Channel channel)
 

Static Public Member Functions

static bool isAnyInputFocused ()
 
- Static Public Member Functions inherited from Window
static void setWindowContainer (WindowContainer *windowContainer)
 Sets the window container to be used by new windows.
 
static int getGuiAlpha ()
 Gets the alpha value used by the window, in a Guichan usable format.
 

Private Types

using WindowList = std::list< InventoryWindow * >
 

Private Member Functions

void updateWeight ()
 Updates the weight bar.
 

Private Attributes

InventorymInventory
 
ItemContainermItems
 
TextFieldmFilterText
 
std::string mWeight
 
std::string mSlots
 
gcn::Button * mUseButton
 
gcn::Button * mEquipButton
 
gcn::Button * mDropButton
 
gcn::Button * mOutfitButton
 
gcn::Button * mStoreButton
 
gcn::Button * mRetrieveButton
 
gcn::Label * mWeightLabel
 
gcn::Label * mSlotsLabel
 
gcn::Label * mFilterLabel
 
ProgressBarmWeightBar
 
ProgressBarmSlotsBar
 

Static Private Attributes

static WindowList instances
 

Additional Inherited Members

- Protected Member Functions inherited from InventoryListener
 InventoryListener ()
 
- Static Protected Attributes inherited from Window
static int mouseResize = 0
 Active resize handles.
 

Detailed Description

Inventory dialog.

Definition at line 44 of file inventorywindow.h.

Member Typedef Documentation

◆ WindowList

using InventoryWindow::WindowList = std::list<InventoryWindow *>
private

Definition at line 114 of file inventorywindow.h.

Constructor & Destructor Documentation

◆ InventoryWindow()

InventoryWindow::InventoryWindow ( Inventory inventory)

Definition at line 55 of file inventorywindow.cpp.

◆ ~InventoryWindow()

InventoryWindow::~InventoryWindow ( )
override

Definition at line 154 of file inventorywindow.cpp.

Member Function Documentation

◆ action()

void InventoryWindow::action ( const gcn::ActionEvent &  event)
override

Called when receiving actions from the widgets.

Definition at line 163 of file inventorywindow.cpp.

◆ close()

void InventoryWindow::close ( )
overridevirtual

Closes the Storage Window, as well as telling the server that the window has been closed.

Reimplemented from Window.

Definition at line 331 of file inventorywindow.cpp.

◆ event()

void InventoryWindow::event ( Event::Channel  channel,
const Event event 
)
overridevirtual

Implements EventListener.

Definition at line 346 of file inventorywindow.cpp.

◆ getSelectedItem()

Item * InventoryWindow::getSelectedItem ( ) const

Returns the selected item.

Definition at line 222 of file inventorywindow.cpp.

◆ isAnyInputFocused()

bool InventoryWindow::isAnyInputFocused ( )
static

Definition at line 378 of file inventorywindow.cpp.

◆ isInputFocused()

bool InventoryWindow::isInputFocused ( ) const

Definition at line 373 of file inventorywindow.cpp.

◆ isMainInventory()

bool InventoryWindow::isMainInventory ( ) const
inline

Definition at line 103 of file inventorywindow.h.

◆ keyReleased()

void InventoryWindow::keyReleased ( gcn::KeyEvent &  event)
override

Handles the key releases.

Definition at line 293 of file inventorywindow.cpp.

◆ mouseClicked()

void InventoryWindow::mouseClicked ( gcn::MouseEvent &  event)
override

Handles the mouse clicks.

Definition at line 233 of file inventorywindow.cpp.

◆ slotsChanged()

void InventoryWindow::slotsChanged ( Inventory inventory)
overridevirtual

Implements InventoryListener.

Definition at line 387 of file inventorywindow.cpp.

◆ updateButtons()

void InventoryWindow::updateButtons ( )

Updates the buttons.

Definition at line 307 of file inventorywindow.cpp.

◆ updateWeight()

void InventoryWindow::updateWeight ( )
private

Updates the weight bar.

Definition at line 356 of file inventorywindow.cpp.

◆ valueChanged()

void InventoryWindow::valueChanged ( const gcn::SelectionEvent &  event)
override

Updates labels to currently selected item.

Definition at line 299 of file inventorywindow.cpp.

◆ widgetHidden()

void InventoryWindow::widgetHidden ( const gcn::Event &  event)
override

Handles closing of the window.

Definition at line 227 of file inventorywindow.cpp.

Member Data Documentation

◆ instances

InventoryWindow::WindowList InventoryWindow::instances
staticprivate

Definition at line 115 of file inventorywindow.h.

◆ mDropButton

gcn::Button * InventoryWindow::mDropButton
private

Definition at line 124 of file inventorywindow.h.

◆ mEquipButton

gcn::Button * InventoryWindow::mEquipButton
private

Definition at line 124 of file inventorywindow.h.

◆ mFilterLabel

gcn::Label * InventoryWindow::mFilterLabel
private

Definition at line 127 of file inventorywindow.h.

◆ mFilterText

TextField* InventoryWindow::mFilterText
private

Definition at line 120 of file inventorywindow.h.

◆ mInventory

Inventory* InventoryWindow::mInventory
private

Definition at line 117 of file inventorywindow.h.

◆ mItems

ItemContainer* InventoryWindow::mItems
private

Definition at line 118 of file inventorywindow.h.

◆ mOutfitButton

gcn::Button * InventoryWindow::mOutfitButton
private

Definition at line 125 of file inventorywindow.h.

◆ mRetrieveButton

gcn::Button * InventoryWindow::mRetrieveButton
private

Definition at line 125 of file inventorywindow.h.

◆ mSlots

std::string InventoryWindow::mSlots
private

Definition at line 122 of file inventorywindow.h.

◆ mSlotsBar

ProgressBar * InventoryWindow::mSlotsBar
private

Definition at line 129 of file inventorywindow.h.

◆ mSlotsLabel

gcn::Label * InventoryWindow::mSlotsLabel
private

Definition at line 127 of file inventorywindow.h.

◆ mStoreButton

gcn::Button * InventoryWindow::mStoreButton
private

Definition at line 125 of file inventorywindow.h.

◆ mUseButton

gcn::Button* InventoryWindow::mUseButton
private

Definition at line 124 of file inventorywindow.h.

◆ mWeight

std::string InventoryWindow::mWeight
private

Definition at line 122 of file inventorywindow.h.

◆ mWeightBar

ProgressBar* InventoryWindow::mWeightBar
private

Definition at line 129 of file inventorywindow.h.

◆ mWeightLabel

gcn::Label* InventoryWindow::mWeightLabel
private

Definition at line 127 of file inventorywindow.h.


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