Package horizons :: Package gui :: Package widgets :: Module buysellinventory :: Class BuySellInventory
[hide private]
[frames] | no frames]

Class BuySellInventory

source code

fife.extensions.pychan.widgets.Container --+    
                                           |    
                         inventory.Inventory --+
                                               |
                                              BuySellInventory

The buy/sell inventory widget displays an inventory of goods where the available resources are restricted. It makes use of the ImageFillStatusButton to display resource icons and the fill bar. It can be used like any other widget in xml files, but for full functionality the inventory has to be manually set, or use the TabWidget, which will autoset it (was made to be done this way).

XML use: <BuySellInventory />, can take all parameters of an Inventory. Note that BuySellInventory has False as default value for display_legend where Inventory has True.

Instance Methods [hide private]
 
__init__(self, display_legend=False, **kwargs) source code
 
init(self, db, inventory, limits, selling)
This inits the logic of the inventory.
source code
 
init_needed(self, inventory, limits, selling) source code
 
_draw(self, vbox, current_hbox, index=0)
Draws the inventory.
source code
    Inherited from inventory.Inventory
 
apply_to_buttons(self, action, filt=None)
Applies action to all buttons shown in inventory
source code
 
update(self) source code
Class Variables [hide private]
    Inherited from inventory.Inventory
  ATTRIBUTES = Container.ATTRIBUTES+ [BoolAttr('uncached'), Bool...
  UNUSABLE_SLOT_IMAGE = "content/gui/icons/resources/none_gray.png"
Method Details [hide private]

__init__(self, display_legend=False, **kwargs)
(Constructor)

source code 
Overrides: inventory.Inventory.__init__

init(self, db, inventory, limits, selling)

source code 

This inits the logic of the inventory. @see __init__().

Parameters:
  • ordinal - {res: (min, max)} Display ordinal scale with these boundaries instead of numbers for a particular resource. Currently implemented via ImageFillStatusButton.
Overrides: inventory.Inventory.init
(inherited documentation)

init_needed(self, inventory, limits, selling)

source code 
Overrides: inventory.Inventory.init_needed

_draw(self, vbox, current_hbox, index=0)

source code 

Draws the inventory.

Overrides: inventory.Inventory._draw