Package horizons :: Package gui :: Package tabs :: Module buildrelatedtab :: Class BuildRelatedTab
[hide private]
[frames] | no frames]

Class BuildRelatedTab

source code

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

Adds a special tab to each production building with at least one entry in the table related_buildings. This tab acts as modified build menu tab and only displays those buildings actually related to the selected building. Examples: tree for lumberjack; pavilion, school, etc. for inhabitants.

Instance Methods [hide private]
 
refresh(self)
This function is called by the TabWidget to redraw the widget.
source code
 
__get_new_container(self)
Loads a background container xml file.
source code
 
_create_build_buttons(self, building_id, container) source code
 
build_related(self, building_id) source code
    Inherited from overviewtab.OverviewTab
 
__init__(self, instance, widget=None, icon_path=None) source code
 
hide(self)
Hides the current widget
source code
 
init_stance_widget(self)
Call this for tabs with stances.
source code
 
init_widget(self)
Initialize widget after it was loaded.
source code
 
on_instance_removed(self) source code
 
show(self)
Shows the current widget
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 = 'related_buildings.xml'
hash(x)
  icon_path = 'icons/tabwidget/production/related'
  helptext = LazyT("Build related buildings")
  template_gui_xml = 'related_buildings_container.xml'
    Inherited from overviewtab.OverviewTab
  has_stance = False
    Inherited from tabinterface.TabInterface
  lazy_loading = True
  position = property(_get_position, _set_position)
  scheduled_update_delay = 0.4
Method Details [hide private]

refresh(self)

source code 

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

Overrides: tabinterface.TabInterface.refresh

__get_new_container(self)

source code 

Loads a background container xml file. Returns the loaded widget.