Package osaf :: Package framework :: Package blocks :: Module Block :: Class Block
[frames | no frames]

Type Block

object --+            
         |            
     CItem --+        
             |        
          Item --+    
                 |    
              Item --+
                     |
                    Block

Known Subclasses:
AmazonController, FeedController, FlickrCollectionController, MenuBar, MenuItem, RectangularChild, StatusBar, Timer, ToolbarItem

Method Summary
  addToNameToItemUUIDDictionary(theClass, list, dictionary)
(Class method)
  dispatchEvent(theClass, event)
(Class method)
  findBlockByName(theClass, name)
(Class method)
  findBlockEventByName(theClass, name)
(Class method)
  finishEdits(theClass, onBlock)
If the given block, or the focus block if no block given, has a saveValue method, call it to write pending edits back. (Class method)
  getFocusBlock(theClass)
(Class method)
  getFrame(self)
Cruse up the tree of blocks looking for the top-most block that has a python attribute, which is the wxWidgets wxFrame window.
  getProxiedContents(self)
Get our 'contents', wrapped in a proxy if appropriate.
  getWidgetID(theClass, object)
wxWindows needs a integer for a id. (Class method)
  onCollectionEvent(self, op, item, name, other, *args)
When our item collection has changed, we need to synchronize
  onDestroyWidget(self)
Called just before a widget is destroyed.
  onModifyCollectionEvent(self, event)
Adds itms to a collection, by default the sidebarCollection.
  onShowHideEvent(self, event)
  onShowHideEventUpdateUI(self, event)
  post(self, event, arguments)
Events that are posted by the block pass along the block that sent it.
  postEventByName(self, eventName, args)
  pushView(self)
Pushes a new view on to our list of views.
  removeFromNameToItemUUIDDictionary(theClass, list, dictionary)
(Class method)
  render(self)
  setContentsOnBlock(self, item, collection)
A utility routine for onSetContents handlers that sets the contents of a block and updates the contents subscribers
  startNotificationDirt(self)
  stopNotificationDirt(self)
  synchronizeSoon(self, **hints)
Invoke our general deferred-synchronization mechanism
  synchronizeWidget(self, **hints)
synchronizeWidget's job is to make the wxWidget match the state of the data persisted in the block.
  template(theClass, blockName, **attrs)
Very similar to the default template() routine, except that 1) childrenBlocks is used for children 2) the repository name and blockname are unified 3) eventsForNamedLookup is automatically populated (Class method)
  unRender(self)
  widgetIDToBlock(theClass, wxID)
Given a wxWindows Id, returns the corresponding Chandler block (Class method)
  wxOnDestroyWidget(theClass, widget)
(Class method)
Inherited from Item: __init__, getDefaultParent, getKind, iterItems
Inherited from Item: __getitem__, __iter__, _repr_, addValue, check, clone, collectionChanged, copy, delete, dir, find, findMatch, findPath, findUUID, getACL, getAttributeValue, getItemChild, getItemCloud, getItemDisplayName, getItemDisplayString, getValue, getVersion, hasAttributeAspect, hasChild, hasChildren, hashItem, hasKey, hasLocalAttributeValue, hasValue, isAttributeDirty, isItemOf, isRemote, iterAttributeValues, iterChildren, mixinKinds, move, placeChild, printItem, refCount, removeACL, removeAttributeValue, removeValue, rename, setACL, setAttributeValue, setPinned, setValue, unwatchCollection, unwatchKind, walk, watchCollection, watchKind
Inherited from CItem: __new__, __repr__, getAttributeAspect, getDirty, isDeleted, isDeleting, isDirty, isNew, isPinned, isSchema, isStale, setDirty
Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __str__

Instance Variable Summary
  blockName: One(Bytes)
  childrenBlocks: Sequence(Block)
  contents: One(ContentItem)
  contentsCollection: One(ContentItem)
  contextMenu: One(ContextMenu)
  eventBoundary: One(Boolean)
  eventsForNamedLookup: Sequence(BlockEvent)
  isShown: One(Boolean)
  parentBlock: One(Block)
  parentTrunkSubtrees: Sequence(TrunkSubtree)
  position: One(Float)
  TPBDetailItemOwner: Sequence(Block)
  TPBSelectedItemOwner: Sequence(Block)
  viewAttribute: One(Text)
  viewContainer: Sequence(Block)
Inherited from Item: collections, description, displayName, kindExtent, monitors, references, watcherDispatch, watchers, watches
Inherited from Item: aliasedBy, path, typeFor, version
Inherited from CItem: itsKind, itsName, itsParent, itsPath, itsRoot, itsUUID, itsVersion, itsView

Class Variable Summary
dict __kind_clouds__ = {'copying': <application.schema.Cloud ...
dict blockNameToItemUUID = {}
dict dirtyBlocks = {}
dict eventNameToItemUUID = {}
list IdToUUID = []
bool profileEvents = False
bool showBorders = False
dict UUIDtoIds = {}
Inherited from Item: __default_path__
Inherited from CItem: ADIRTY, CDIRTY, CMERGED, CONTAINER, COPYEXPORT, CORESCHEMA, DELETED, DELETING, DIRTY, FDIRTY, IMPORTING, MERGED, MUTATING, NDIRTY, NEW, NMERGED, NODIRTY, PINNED, RAW, RDIRTY, RMERGED, SAVEMASK, SCHEMA, STALE, VDIRTY, VMERGED, VRDIRTY

Instance Method Details

getFrame(self)

Cruse up the tree of blocks looking for the top-most block that has a python attribute, which is the wxWidgets wxFrame window.

getProxiedContents(self)

Get our 'contents', wrapped in a proxy if appropriate.

onCollectionEvent(self, op, item, name, other, *args)

When our item collection has changed, we need to synchronize

onDestroyWidget(self)

Called just before a widget is destroyed. It is the opposite of instantiateWidget.

onModifyCollectionEvent(self, event)

Adds itms to a collection, by default the sidebarCollection.

This method originally had an operation attribute that let you add, remove or toggle (e.g. add if not present or delete if present) items to a collection.

Since this behavior is no longer used, we removed it. It can be added back if necessary

post(self, event, arguments)

Events that are posted by the block pass along the block that sent it.
Parameters:
event - the event to post
           (type=a BlockEvent)
arguments - arguments to pass to the event
           (type=a dict)
Returns:
the value returned by the event handler

pushView(self)

Pushes a new view on to our list of views.

Currently, we're limited to a depth of four nested views
Parameters:
self - the new view

setContentsOnBlock(self, item, collection)

A utility routine for onSetContents handlers that sets the contents of a block and updates the contents subscribers

synchronizeSoon(self, **hints)

Invoke our general deferred-synchronization mechanism

synchronizeWidget(self, **hints)

synchronizeWidget's job is to make the wxWidget match the state of the data persisted in the block. There's a tricky problem that occurs: Often we add a handler to the wxWidget of a block to, for example, get called when the user changes the selection, which we use to update the block's selection and post a selection item block event. It turns out that while we are in synchronizeWidget, changes to the wxWidget cause these handlers to be called, and in this case we don't want to post an event. So we wrap calls to synchronizeWidget and set a flag indicating that we're inside synchronizeWidget so the handlers can tell when not to post selection changed events. We use this flag in other similar situations, for example, during shutdown to ignore events caused by the framework tearing down wxWidgets.

Class Method Details

finishEdits(theClass, onBlock=None)

If the given block, or the focus block if no block given, has a saveValue method, call it to write pending edits back.

getWidgetID(theClass, object)

wxWindows needs a integer for a id. Commands between wx.ID_LOWEST and wx.ID_HIGHEST are reserved for wxWidgets. Calling wxNewId allocates incremental ids starting at 100. Passing -1 for new IDs starting with -1 and decrementing. Some rouge dialogs use IDs outside wx.ID_LOWEST and wx.ID_HIGHEST.

Use IdToUUID to lookup the Id for a event's UUID. Use UUIDtoIds to lookup the UUID of a block that corresponds to an event id -- DJA

template(theClass, blockName, **attrs)

Very similar to the default template() routine, except that 1) childrenBlocks is used for children 2) the repository name and blockname are unified 3) eventsForNamedLookup is automatically populated

widgetIDToBlock(theClass, wxID)

Given a wxWindows Id, returns the corresponding Chandler block

Instance Variable Details

blockName

One(Bytes)
Value:
<Role blockName of <class 'osaf.framework.blocks.Block.Block'>>        

childrenBlocks

Sequence(Block)
Value:
<Role childrenBlocks of <class 'osaf.framework.blocks.Block.Block'>>   

contents

One(ContentItem)
Value:
<Role contents of <class 'osaf.framework.blocks.Block.Block'>>         

contentsCollection

One(ContentItem)
Value:
<Role contentsCollection of <class 'osaf.framework.blocks.Block.Block'\
>>                                                                     

contextMenu

One(ContextMenu)
Value:
<Role contextMenu of <class 'osaf.framework.blocks.Block.Block'>>      

eventBoundary

One(Boolean)
Value:
<Role eventBoundary of <class 'osaf.framework.blocks.Block.Block'>>    

eventsForNamedLookup

Sequence(BlockEvent)
Value:
<Role eventsForNamedLookup of <class 'osaf.framework.blocks.Block.Bloc\
k'>>                                                                   

isShown

One(Boolean)
Value:
<Role isShown of <class 'osaf.framework.blocks.Block.Block'>>          

parentBlock

One(Block)
Value:
<Role parentBlock of <class 'osaf.framework.blocks.Block.Block'>>      

parentTrunkSubtrees

Sequence(TrunkSubtree)
Value:
<Role parentTrunkSubtrees of <class 'osaf.framework.blocks.Block.Block\
'>>                                                                    

position

One(Float)
Value:
<Role position of <class 'osaf.framework.blocks.Block.Block'>>         

TPBDetailItemOwner

Sequence(Block)
Value:
<Role TPBDetailItemOwner of <class 'osaf.framework.blocks.Block.Block'\
>>                                                                     

TPBSelectedItemOwner

Sequence(Block)
Value:
<Role TPBSelectedItemOwner of <class 'osaf.framework.blocks.Block.Bloc\
k'>>                                                                   

viewAttribute

One(Text)

Specifies which attribute of the selected Item should be associated with this block.
Value:
<Role viewAttribute of <class 'osaf.framework.blocks.Block.Block'>>    

viewContainer

Sequence(Block)
Value:
<Role viewContainer of <class 'osaf.framework.blocks.Block.Block'>>    

Class Variable Details

__kind_clouds__

Type:
dict
Value:
{'copying': <application.schema.Cloud instance at 0xb7a3678c>}         

blockNameToItemUUID

Type:
dict
Value:
{}                                                                     

dirtyBlocks

Type:
dict
Value:
{}                                                                     

eventNameToItemUUID

Type:
dict
Value:
{}                                                                     

IdToUUID

Type:
list
Value:
[]                                                                     

profileEvents

Type:
bool
Value:
False                                                                  

showBorders

Type:
bool
Value:
False                                                                  

UUIDtoIds

Type:
dict
Value:
{}                                                                     

Generated by Epydoc 2.1 on Mon Dec 19 13:33:28 2005 http://epydoc.sf.net