SelectionInTreeView.st
changeset 5722 33fa68fa29f9
parent 5690 8831181c2b63
child 6016 26f454374801
equal deleted inserted replaced
5721:601f7686ccdb 5722:33fa68fa29f9
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
     4  COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  1998 !
  2000 !
  1999 
  2001 
  2000 openEditor
  2002 openEditor
  2001     "open an editor on selection"
  2003     "open an editor on selection"
  2002 
  2004 
  2003     |node x0 x1 y0|
  2005     |node x0 w x1 y0|
  2004 
  2006 
  2005     editorWidget notNil ifTrue:[
  2007     editorWidget notNil ifTrue:[
  2006         ^ self
  2008         ^ self
  2007     ].
  2009     ].
  2008     editorIndex := self selectedIndex.
  2010     editorIndex := self selectedIndex.
  2013     ) ifTrue:[   
  2015     ) ifTrue:[   
  2014         ^ self
  2016         ^ self
  2015     ].
  2017     ].
  2016     editorWidget withAllSubViewsDo:[:v| v font:gc font ].
  2018     editorWidget withAllSubViewsDo:[:v| v font:gc font ].
  2017 
  2019 
       
  2020     x0 := self xOfValueNode:node.
  2018     y0 := self yOfVisibleLine:y0.
  2021     y0 := self yOfVisibleLine:y0.
  2019     x0 := self xOfValueNode:node.
  2022     w := (editorWidget preferredWidth) max:50.
  2020     x1 := (editorWidget preferredWidth) max:50.
  2023     x1 := (x0 + w) min:(self width - 5).
  2021     x1 := (x0 + x1) min:(self width - 5).
       
  2022 
  2024 
  2023     editorWidget geometryLayout:(Rectangle left:x0 right:x1 top:y0 bottom:y0 + fontHeight).
  2025     editorWidget geometryLayout:(Rectangle left:x0 right:x1 top:y0 bottom:y0 + fontHeight).
  2024 
  2026 
  2025     self addComponent:editorWidget.
  2027     self addComponent:editorWidget.
  2026     editorWidget realize.
  2028     editorWidget realize.