Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

pawsStorageWindow Class Reference

The window that deals with interacting with a NPC storage. More...

#include <pawsstoragewindow.h>

List of all members.

Public Member Functions

void Close ()
 Simply calls Hide() unless overidden.
void DoTrade (int count, const char *itemName, const char *itemID)
void HandleMessage (MsgEntry *me)
bool OnButtonPressed (int mouseButton, int keyModifier, pawsWidget *widget)
 Called whenever a button is pressed.
void OnListAction (pawsListBox *listbox, int status)
 Called whenever an item in a child list box is selected.
void OnNumberEntered (const char *name, int param, int value)
 pawsStorageWindow ()
bool PostSetup ()
 This is called after the widget and all of it's children have been created.
virtual ~pawsStorageWindow ()

Protected Member Functions

csString GetColumnText (pawsListBoxRow *row, int colNum)
void HandleCategories (const char *data)
void HandleItems (const char *data)
void HandleMoney (const char *data)
void HandleStorage (const char *data)
void SetColumnText (pawsListBoxRow *row, int colNum, const csString &text)
void SetTradeMode (bool buy)
void TradeSelectedItem (bool all=false, bool single=false)
 Handles the command of trading the item by interacting with the player.
void UpdateMoney (const char *moneyName, const char *imageName, int value)

Protected Attributes

pawsListBoxcategoryBox
 index of item, selected in the itemsBox
csString currentID
csString currentItem
pawsListBoxitemsBox
int merchantID
int selectedItem
int tradeCommand
pawsTextBoxtrias

Detailed Description

The window that deals with interacting with a NPC storage.

Definition at line 33 of file pawsstoragewindow.h.


Constructor & Destructor Documentation

pawsStorageWindow::pawsStorageWindow ( )
virtual pawsStorageWindow::~pawsStorageWindow ( ) [virtual]

Member Function Documentation

void pawsStorageWindow::Close ( ) [virtual]

Simply calls Hide() unless overidden.

Reimplemented from pawsWidget.

void pawsStorageWindow::DoTrade ( int  count,
const char *  itemName,
const char *  itemID 
)
csString pawsStorageWindow::GetColumnText ( pawsListBoxRow row,
int  colNum 
) [protected]
void pawsStorageWindow::HandleCategories ( const char *  data) [protected]
void pawsStorageWindow::HandleItems ( const char *  data) [protected]
void pawsStorageWindow::HandleMessage ( MsgEntry me) [virtual]

Implements psClientNetSubscriber.

void pawsStorageWindow::HandleMoney ( const char *  data) [protected]
void pawsStorageWindow::HandleStorage ( const char *  data) [protected]
bool pawsStorageWindow::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
) [virtual]

Called whenever a button is pressed.

Parameters:
buttonThe button pressed.
keyModifierModifier key in effect.
widgetThe widget the button belongs to.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

void pawsStorageWindow::OnListAction ( pawsListBox selected,
int  status 
) [virtual]

Called whenever an item in a child list box is selected.

Parameters:
selectedThe listbox that has the item selected.
statusFrom listbox when a row is selected.

Reimplemented from pawsWidget.

void pawsStorageWindow::OnNumberEntered ( const char *  name,
int  param,
int  value 
) [virtual]
bool pawsStorageWindow::PostSetup ( ) [virtual]

This is called after the widget and all of it's children have been created.

Remarks:
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.

void pawsStorageWindow::SetColumnText ( pawsListBoxRow row,
int  colNum,
const csString &  text 
) [protected]
void pawsStorageWindow::SetTradeMode ( bool  buy) [protected]
void pawsStorageWindow::TradeSelectedItem ( bool  all = false,
bool  single = false 
) [protected]

Handles the command of trading the item by interacting with the player.

Checks if we buy a single or multiple item and asks in case of uncertainity the amount of items to buy

Parameters:
allindicates that all the item in the current selected entry will be bought/sold
singleindicates only one item in the current selected entry will be bought/sold, even if more are available.
void pawsStorageWindow::UpdateMoney ( const char *  moneyName,
const char *  imageName,
int  value 
) [protected]

Member Data Documentation

index of item, selected in the itemsBox

Definition at line 78 of file pawsstoragewindow.h.

csString pawsStorageWindow::currentID [protected]

Definition at line 82 of file pawsstoragewindow.h.

csString pawsStorageWindow::currentItem [protected]

Definition at line 82 of file pawsstoragewindow.h.

Definition at line 79 of file pawsstoragewindow.h.

Definition at line 74 of file pawsstoragewindow.h.

Definition at line 76 of file pawsstoragewindow.h.

Definition at line 75 of file pawsstoragewindow.h.

Definition at line 80 of file pawsstoragewindow.h.


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