r1 - 21 Mar 2006 - 13:40:37 - ReidEllisYou are here: OSAF >  Journal Web  >  ContributorNotes > ReidEllisNotes > MarkupBarNotes20060321

Consider MailMessageButtonBlock

  • derives from DetailStampButton
    • which inherits from DetailSynchronizer and MenusAndToolbars.ToolbarItem
  • created in detailblocks.py, ll 293-300
    • and then passed in to Toolbar.template() ll 339-348
    • the result of which is then invoked with .install(parcel)

  • Questions:
    • why template()?
      • why not use usual init constructor?
    • what does Toolbar.install() do?
      • is it an OSAF method?
      • probably, since it takes a "parcel" argument
        • unless parcel is sufficiently generic for wx or something
  • MenusAndToolBars.Toolbar inherits from Block.RectangularChild
    • it also inherits from DynamicContainer
      • do we need DynamicContainer? Hope not..
      • DynamicContainer is used to handle changing child blocks

Implementing Usage of New MultiStateButton

  • change line 339 of detailblocks.py
    • from: markupBar = MenusAndToolbars.Toolbar.template(
    • to: markupBar = Block.RectangularChild.template(
  • change line 577 of Detail.py
    • from: class DetailStampButton(DetailSynchronizer, MenusAndToolbars.ToolbarItem)
    • to: class DetailStampButton(DetailSynchronizer, MultiStateButton)

Egad

Line 598 of Detail.py in DetailStampButton.synchronizeItemDetail has this doozy:
  • self.parentBlock.widget.ToggleTool(self.toolID, shouldToggleBasedOnKind)
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.