Package horizons :: Package gui :: Package widgets :: Module imagefillstatusbutton :: Class ImageFillStatusButton
[hide private]
[frames] | no frames]

Class ImageFillStatusButton

source code

fife.extensions.pychan.widgets.Container --+
                                           |
                                          ImageFillStatusButton

Instance Methods [hide private]
 
__init__(self, path, text, res_id, helptext="", filled=0, marker=0, uncached=False, **kwargs)
Represents the image in the ingame gui, with a bar to show how full the inventory is for that resource.
source code
 
_set_filled(self, percent)
"@param percent: int percent that fillstatus will be green
source code
 
_get_filled(self) source code
 
_draw(self)
Draws the icon + bar.
source code
Class Methods [hide private]
 
init_for_res(cls, db, res, amount=0, filled=0, marker=0, use_inactive_icon=True, uncached=False, showprice=False)
Inites the button to display the icons for res
source code
Class Variables [hide private]
  ICON_SIZE = 32, 32
  CELL_SIZE = 54, 50
  PADDING = 3
  filled = property(_get_filled, _set_filled)
  __widget_cache = {}
Method Details [hide private]

__init__(self, path, text, res_id, helptext="", filled=0, marker=0, uncached=False, **kwargs)
(Constructor)

source code 

Represents the image in the ingame gui, with a bar to show how full the inventory is for that resource. Derives from Container and also takes all arguments of Imagebutton in order to display the resource icon. This is meant to be used with the Inventory widget.

init_for_res(cls, db, res, amount=0, filled=0, marker=0, use_inactive_icon=True, uncached=False, showprice=False)
Class Method

source code 

Inites the button to display the icons for res

Parameters:
  • db - dbreader to get info about res icon.
  • res - resource id
  • amount - int amount of res (used to decide inactiveness and as text)
  • filled - percent of fill status (values are ints in [0, 100])
  • use_inactive_icon - whether to use inactive icon if amount == 0
  • uncached - force no cache. see __init__()
Returns:
ImageFillStatusButton instance