Package horizons :: Package gui :: Package tabs :: Module productiontabs :: Class ProductionOverviewTab
[hide private]
[frames] | no frames]

Class ProductionOverviewTab

source code

tabinterface.TabInterface --+    
                            |    
      overviewtab.OverviewTab --+
                                |
                               ProductionOverviewTab

Instance Methods [hide private]
 
__init__(self, instance) source code
 
get_displayed_productions(self)
List all possible productions of a buildings sorted by production line id.
source code
 
refresh(self)
This function is called by the TabWidget to redraw the widget.
source code
 
_center_production_line(self, parent_container, production)
Centers in/out production line display for amount of resources each.
source code
 
_draw_pretty_arrows(self, parent_container, amount, x=0, y=0, out=False)
Draws incoming or outgoing arrows for production line container.
source code
 
_set_resource_amounts(self, container, production) source code
 
destruct_building(self) source code
 
_refresh_utilization(self) source code
 
_add_resource_icons(self, container, resources, marker=False) source code
 
show(self)
Shows the current widget
source code
 
hide(self)
Hides the current widget
source code
 
on_instance_removed(self) source code
 
_cleanup(self) source code
    Inherited from overviewtab.OverviewTab
 
init_stance_widget(self)
Call this for tabs with stances.
source code
 
init_widget(self)
Initialize widget after it was loaded.
source code
    Inherited from tabinterface.TabInterface
 
_get_position(self) source code
 
_schedule_refresh(self)
Schedule a refresh soon, dropping all other refresh request, that appear until then.
source code
 
_set_position(self, value)
Sets the widgets position to tuple *value*
source code
 
_setup_widget(self)
Gets the widget and sets up some attributes and helper.
source code
 
ensure_loaded(self)
Called when a tab is shown, acts as hook for lazy loading
source code
 
get_widget(self)
Loads the filename in self.widget.
source code
 
is_visible(self) source code
Class Methods [hide private]
    Inherited from tabinterface.TabInterface
 
shown_for(cls, instance)
Method for fine-grained control of which tabs to show.
source code
Class Variables [hide private]
  widget = 'overview_productionbuilding.xml'
hash(x)
  helptext = LazyT("Production overview")
  production_line_gui_xml = 'overview_productionline.xml'
  ACTIVE_PRODUCTION_ANIM_DIR = "content/gui/images/animations/co...
  BUTTON_BACKGROUND = "content/gui/images/buttons/msg_button.png"
  ARROW_TOP = "content/gui/icons/templates/production/production...
  ARROW_MID = "content/gui/icons/templates/production/production...
  ARROW_BOTTOM = "content/gui/icons/templates/production/product...
  ARROW_CONNECT_UP = "content/gui/icons/templates/production/pro...
  ARROW_CONNECT_DOWN = "content/gui/icons/templates/production/p...
  ARROWHEAD_TOP = "content/gui/icons/templates/production/produc...
  ARROWHEAD_MID = "content/gui/icons/templates/production/produc...
  ARROWHEAD_BOTTOM = "content/gui/icons/templates/production/pro...
  ARROWHEAD_CONNECT_UP = "content/gui/icons/templates/production...
  ARROWHEAD_CONNECT_DOWN = "content/gui/icons/templates/producti...
  ICON_HEIGHT = ImageFillStatusButton.CELL_SIZE [1]+ ImageFillSt...
    Inherited from overviewtab.OverviewTab
  has_stance = False
  icon_path = 'icons/tabwidget/common/building_overview'
    Inherited from tabinterface.TabInterface
  lazy_loading = True
  position = property(_get_position, _set_position)
  scheduled_update_delay = 0.4
Method Details [hide private]

__init__(self, instance)
(Constructor)

source code 
Parameters:
  • widget - filename of a widget. Set this to None if you create your widget in `get_widget`.
  • widget - Filename of widget to load.
  • icon_path - Where to look for ImageButton icons. Note: this is a `path` attribute!
Overrides: tabinterface.TabInterface.__init__
(inherited documentation)

get_displayed_productions(self)

source code 

List all possible productions of a buildings sorted by production line id. Overwritten in some child classes (e.g. farm tab).

refresh(self)

source code 

This function is called by the TabWidget to redraw the widget.

Overrides: tabinterface.TabInterface.refresh

_center_production_line(self, parent_container, production)

source code 

Centers in/out production line display for amount of resources each.

Returns:
y value to center other gui parts (toggle icon etc.) around vertically.

show(self)

source code 

Shows the current widget

Overrides: tabinterface.TabInterface.show
(inherited documentation)

hide(self)

source code 

Hides the current widget

Overrides: tabinterface.TabInterface.hide
(inherited documentation)

on_instance_removed(self)

source code 
Overrides: overviewtab.OverviewTab.on_instance_removed

Class Variable Details [hide private]

ACTIVE_PRODUCTION_ANIM_DIR

Value:
"content/gui/images/animations/cogs/large"

ARROW_TOP

Value:
"content/gui/icons/templates/production/production_arrow_top.png"

ARROW_MID

Value:
"content/gui/icons/templates/production/production_arrow_start.png"

ARROW_BOTTOM

Value:
"content/gui/icons/templates/production/production_arrow_bottom.png"

ARROW_CONNECT_UP

Value:
"content/gui/icons/templates/production/production_arrow_connect_up.pn\
g"

ARROW_CONNECT_DOWN

Value:
"content/gui/icons/templates/production/production_arrow_connect_down.\
png"

ARROWHEAD_TOP

Value:
"content/gui/icons/templates/production/production_arrowhead_top.png"

ARROWHEAD_MID

Value:
"content/gui/icons/templates/production/production_arrow_head.png"

ARROWHEAD_BOTTOM

Value:
"content/gui/icons/templates/production/production_arrowhead_bottom.pn\
g"

ARROWHEAD_CONNECT_UP

Value:
"content/gui/icons/templates/production/production_arrowhead_connect_u\
p.png"

ARROWHEAD_CONNECT_DOWN

Value:
"content/gui/icons/templates/production/production_arrowhead_connect_d\
own.png"

ICON_HEIGHT

Value:
ImageFillStatusButton.CELL_SIZE [1]+ ImageFillStatusButton.PADDING