Tools__ViewTreeApplication.st
changeset 2451 cbda60900ced
parent 2177 87bb1815460b
child 2454 4867f3e9dd43
equal deleted inserted replaced
2450:ede256dd19a1 2451:cbda60900ced
     3 "{ NameSpace: Tools }"
     3 "{ NameSpace: Tools }"
     4 
     4 
     5 ApplicationModel subclass:#ViewTreeApplication
     5 ApplicationModel subclass:#ViewTreeApplication
     6 	instanceVariableNames:'model treeView hasSingleSelectionHolder clickedItem clickedPoint
     6 	instanceVariableNames:'model treeView hasSingleSelectionHolder clickedItem clickedPoint
     7 		motionAction infoChannel testModeChannel process
     7 		motionAction infoChannel testModeChannel process
     8 		followFocusChannel'
     8 		followFocusChannel showNamesHolder'
     9 	classVariableNames:''
     9 	classVariableNames:''
    10 	poolDictionaries:''
    10 	poolDictionaries:''
    11 	category:'A-Views-Support'
    11 	category:'A-Views-Support'
    12 !
    12 !
    13 
    13 
   118 
   118 
   119     "Do not manually edit this!! If it is corrupted,
   119     "Do not manually edit this!! If it is corrupted,
   120      the UIPainter may not be able to read the specification."
   120      the UIPainter may not be able to read the specification."
   121 
   121 
   122     "
   122     "
   123      UIPainter new openOnClass:ViewTreeApplication andSelector:#windowSpec
   123      UIPainter new openOnClass:Tools::ViewTreeApplication andSelector:#windowSpec
   124      ViewTreeApplication new openInterface:#windowSpec
   124      Tools::ViewTreeApplication new openInterface:#windowSpec
   125      ViewTreeApplication open
   125      Tools::ViewTreeApplication open
   126     "
   126     "
   127 
   127 
   128     <resource: #canvas>
   128     <resource: #canvas>
   129 
   129 
   130     ^ 
   130     ^ 
   134        (WindowSpec
   134        (WindowSpec
   135           label: 'ViewTreeInspector'
   135           label: 'ViewTreeInspector'
   136           name: 'ViewTreeInspector'
   136           name: 'ViewTreeInspector'
   137           min: (Point 10 10)
   137           min: (Point 10 10)
   138           max: (Point 1024 9999)
   138           max: (Point 1024 9999)
   139           bounds: (Rectangle 0 0 325 654)
   139           bounds: (Rectangle 0 0 381 654)
   140           menu: menu
   140           menu: menu
   141         )
   141         )
   142         component: 
   142         component: 
   143        (SpecCollection
   143        (SpecCollection
   144           collection: (
   144           collection: (
   419 
   419 
   420     "Do not manually edit this!! If it is corrupted,
   420     "Do not manually edit this!! If it is corrupted,
   421      the MenuEditor may not be able to read the specification."
   421      the MenuEditor may not be able to read the specification."
   422 
   422 
   423     "
   423     "
   424      MenuEditor new openOnClass:ViewTreeApplication andSelector:#toolbarMenu
   424      MenuEditor new openOnClass:Tools::ViewTreeApplication andSelector:#toolbarMenu
   425      (Menu new fromLiteralArrayEncoding:(ViewTreeApplication toolbarMenu)) startUp
   425      (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeApplication toolbarMenu)) startUp
   426     "
   426     "
   427 
   427 
   428     <resource: #menu>
   428     <resource: #menu>
   429 
   429 
   430     ^ 
   430     ^ 
   443           )
   443           )
   444          (MenuItem
   444          (MenuItem
   445             label: 'Select On Click'
   445             label: 'Select On Click'
   446             translateLabel: true
   446             translateLabel: true
   447             indication: selectOnClickHolder
   447             indication: selectOnClickHolder
       
   448           )
       
   449          (MenuItem
       
   450             label: 'Show Names'
       
   451             translateLabel: true
       
   452             indication: showNamesHolder
   448           )
   453           )
   449          )
   454          )
   450         nil
   455         nil
   451         nil
   456         nil
   452       )
   457       )
   510     "boolean holder, which indicates whether the selection will change on click
   515     "boolean holder, which indicates whether the selection will change on click
   511     "
   516     "
   512     ^ model selectOnClickHolder
   517     ^ model selectOnClickHolder
   513 !
   518 !
   514 
   519 
       
   520 showNamesHolder
       
   521     "boolean holder, which indicates whether application names or widget names
       
   522      as additional text are shown for the items
       
   523     "
       
   524     ^ showNamesHolder
       
   525 !
       
   526 
   515 testModeChannel
   527 testModeChannel
   516     "boolean holder, which indicates whether running in test or edit mode (eat input events)
   528     "boolean holder, which indicates whether running in test or edit mode (eat input events)
   517     "
   529     "
   518     ^ testModeChannel
   530     ^ testModeChannel
   519 ! !
   531 ! !
   551 
   563 
   552 update:something with:someArgument from:aModel
   564 update:something with:someArgument from:aModel
   553 
   565 
   554     aModel == testModeChannel ifTrue:[
   566     aModel == testModeChannel ifTrue:[
   555         model testMode:(testModeChannel value).
   567         model testMode:(testModeChannel value).
       
   568         ^ self
       
   569     ].
       
   570 
       
   571     aModel == showNamesHolder ifTrue:[
       
   572         self listOfItems showWidgetNames:(aModel value).
   556         ^ self
   573         ^ self
   557     ].
   574     ].
   558     super update:something with:someArgument from:aModel.
   575     super update:something with:someArgument from:aModel.
   559 ! !
   576 ! !
   560 
   577 
   787     model mappedViewAction:[:vw| self processMappedView:vw ].
   804     model mappedViewAction:[:vw| self processMappedView:vw ].
   788     model application:self.
   805     model application:self.
   789 
   806 
   790     testModeChannel := model testMode asValue.
   807     testModeChannel := model testMode asValue.
   791     testModeChannel addDependent:self.
   808     testModeChannel addDependent:self.
       
   809 
       
   810     showNamesHolder := false asValue.
       
   811     showNamesHolder addDependent:self.
   792 !
   812 !
   793 
   813 
   794 postBuildTree:aTree
   814 postBuildTree:aTree
   795     treeView := aTree scrolledView.
   815     treeView := aTree scrolledView.
   796     treeView hasConstantHeight:true.
   816     treeView hasConstantHeight:true.
       
   817 ! !
       
   818 
       
   819 !ViewTreeApplication methodsFor:'menu actions'!
       
   820 
       
   821 doShowNames
       
   822     "automatically generated by UIEditor ..."
       
   823 
       
   824     "*** the code below performs no action"
       
   825     "*** (except for some feedback on the Transcript)"
       
   826     "*** Please change as required and accept in the browser."
       
   827     "*** (and replace this comment by something more useful ;-)"
       
   828 
       
   829     "action to be added ..."
       
   830 
       
   831     Transcript showCR:self class name, ': action for #doShowNames ...'.
   797 ! !
   832 ! !
   798 
   833 
   799 !ViewTreeApplication methodsFor:'menu queries'!
   834 !ViewTreeApplication methodsFor:'menu queries'!
   800 
   835 
   801 hasApplication
   836 hasApplication