GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
statusbar.SbManager Class Reference

Statusbar manager for wx.Statusbar and SbItems. More...

Public Member Functions

def __init__
 Connects manager to statusbar. More...
 
def SetProperty
 Sets property represented by one of contained SbItems. More...
 
def GetProperty
 Returns property represented by one of contained SbItems. More...
 
def HasProperty
 Checks whether property is represented by one of contained SbItems. More...
 
def AddStatusbarItem
 Adds item to statusbar. More...
 
def AddStatusbarItemsByClass
 Adds items to statusbar. More...
 
def HideStatusbarChoiceItemsByClass
 Hides items showed in choice. More...
 
def ShowStatusbarChoiceItemsByClass
 Shows items showed in choice. More...
 
def ShowItem
 Invokes showing of particular item. More...
 
def Update
 Updates statusbar. More...
 
def Reposition
 Reposition items in statusbar. More...
 
def GetProgressBar
 Returns progress bar. More...
 
def OnToggleStatus
 Toggle status text. More...
 
def SetMode
 Sets current mode. More...
 
def GetMode
 Returns current mode. More...
 

Data Fields

 mapFrame
 
 statusbar
 
 choice
 
 statusbarItems
 
 progressbar
 

Detailed Description

Statusbar manager for wx.Statusbar and SbItems.

Statusbar manager manages items added by AddStatusbarItem method. Provides progress bar (SbProgress) and choice (wx.Choice). Items with position 0 are shown according to choice selection. Only one item of the same class is supposed to be in statusbar. Manager user have to create statusbar on his own, add items to manager and call Update method to show particular widgets. User settings (group = 'display', key = 'statusbarMode', subkey = 'selection') are taken into account.

Todo:

generalize access to UserSettings (specify group, etc.)

add GetMode method using name instead of index

Definition at line 50 of file statusbar.py.

Constructor & Destructor Documentation

def statusbar.SbManager.__init__ (   self,
  mapframe,
  statusbar 
)

Connects manager to statusbar.

Creates choice and progress bar.

Definition at line 65 of file statusbar.py.

Member Function Documentation

def statusbar.SbManager.AddStatusbarItem (   self,
  item 
)

Adds item to statusbar.

If item position is 0, item is managed by choice.

See Also
AddStatusbarItemsByClass

Definition at line 111 of file statusbar.py.

References statusbar.SbManager.statusbarItems, mapdisplay.MapFrame.statusbarItems, and frame.MapFrame.statusbarItems.

Referenced by statusbar.SbManager.AddStatusbarItemsByClass().

def statusbar.SbManager.AddStatusbarItemsByClass (   self,
  itemClasses,
  kwargs 
)

Adds items to statusbar.

Parameters
itemClasseslist of classes of items to be add
kwargsSbItem constructor parameters
See Also
AddStatusbarItem

Definition at line 122 of file statusbar.py.

References statusbar.SbManager.AddStatusbarItem().

def statusbar.SbManager.GetMode (   self)

Returns current mode.

Definition at line 276 of file statusbar.py.

def statusbar.SbManager.GetProgressBar (   self)
def statusbar.SbManager.GetProperty (   self,
  name 
)

Returns property represented by one of contained SbItems.

Parameters
namename of SbItem (from name attribute)

Definition at line 93 of file statusbar.py.

References widgets.GetValue(), statusbar.SbManager.statusbarItems, mapdisplay.MapFrame.statusbarItems, and frame.MapFrame.statusbarItems.

def statusbar.SbManager.HasProperty (   self,
  name 
)

Checks whether property is represented by one of contained SbItems.

Parameters
namename of SbItem (from name attribute)
Returns
True if particular SbItem is contained, False otherwise

Definition at line 100 of file statusbar.py.

References statusbar.SbManager.statusbarItems, mapdisplay.MapFrame.statusbarItems, and frame.MapFrame.statusbarItems.

def statusbar.SbManager.HideStatusbarChoiceItemsByClass (   self,
  itemClasses 
)

Hides items showed in choice.

Hides items with position 0 (items showed in choice) by removing them from choice.

Parameters
itemClasseslist of classes of items to be hided
See Also
ShowStatusbarChoiceItemsByClass
Todo:
consider adding similar function which would take item names

Definition at line 134 of file statusbar.py.

References statusbar.SbManager._hiddenItems, and tools.range.

def statusbar.SbManager.Reposition (   self)

Reposition items in statusbar.

Set positions to all items managed by statusbar manager. It should not be necessary to call it manually.

Definition at line 219 of file statusbar.py.

References statusbar.SbManager.choice.

Referenced by statusbar.SbManager.ShowItem().

def statusbar.SbManager.SetMode (   self,
  modeIndex 
)

Sets current mode.

Mode is usually driven by user through choice.

Definition at line 269 of file statusbar.py.

def statusbar.SbManager.SetProperty (   self,
  name,
  value 
)

Sets property represented by one of contained SbItems.

Parameters
namename of SbItem (from name attribute)
valuevalue to be set

Definition at line 85 of file statusbar.py.

References widgets.SetValue(), statusbar.SbManager.statusbarItems, mapdisplay.MapFrame.statusbarItems, and frame.MapFrame.statusbarItems.

Referenced by frame.MapFrame.SetProperties().

def statusbar.SbManager.ShowItem (   self,
  itemName 
)
def statusbar.SbManager.ShowStatusbarChoiceItemsByClass (   self,
  itemClasses 
)

Shows items showed in choice.

Shows items with position 0 (items showed in choice) by adding them to choice. Items are restored in their old positions.

Parameters
itemClasseslist of classes of items to be showed
See Also
HideStatusbarChoiceItemsByClass

Definition at line 156 of file statusbar.py.

References statusbar.SbManager._hiddenItems.

Field Documentation

statusbar.SbManager.choice

Definition at line 73 of file statusbar.py.

Referenced by statusbar.SbManager.Reposition().

statusbar.SbManager.mapFrame

Definition at line 70 of file statusbar.py.

statusbar.SbManager.progressbar

Definition at line 81 of file statusbar.py.

Referenced by statusbar.SbManager.GetProgressBar(), and mapwindow.NvizThread.run().

statusbar.SbManager.statusbar

Definition at line 71 of file statusbar.py.


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