Tools__ViewTreeApplication.st
author Claus Gittinger <cg@exept.de>
Mon, 15 Jul 2019 18:54:24 +0200
changeset 3689 d0440cfff708
parent 3674 693d13243c07
child 3692 b8a662f98f30
permissions -rw-r--r--
#UI_ENHANCEMENT by cg class: Tools::ViewTreeInspectorApplication class changed: #middleButtonMenu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2748
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     1
"
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     2
 COPYRIGHT (c) 2007 by eXept Software AG
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
     3
	      All Rights Reserved
2748
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     4
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     5
 This software is furnished under a license and may be used
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     6
 only in accordance with the terms of that license and with the
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     8
 be provided or otherwise made available to, or used by, any
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
     9
 other person.  No title to or ownership of the software is
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    10
 hereby transferred.
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    11
"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    12
"{ Package: 'stx:libtool2' }"
87bb1815460b initial checkin
ca
parents:
diff changeset
    13
87bb1815460b initial checkin
ca
parents:
diff changeset
    14
"{ NameSpace: Tools }"
87bb1815460b initial checkin
ca
parents:
diff changeset
    15
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    16
ToolApplicationModel subclass:#ViewTreeInspectorApplication
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    17
	instanceVariableNames:'model treeView hasSingleSelectionHolder clickedItem clickedPoint
2770
9322aee00ea0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
    18
		motionAction process followFocusChannel showNamesHolder
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
    19
		inspectorView inspectorModeIndexHolder path
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
    20
		isCatchingEventsChannel browser'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    21
	classVariableNames:''
87bb1815460b initial checkin
ca
parents:
diff changeset
    22
	poolDictionaries:''
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    23
	category:'Interface-Smalltalk'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    24
!
87bb1815460b initial checkin
ca
parents:
diff changeset
    25
87bb1815460b initial checkin
ca
parents:
diff changeset
    26
Object subclass:#MenuDesc
87bb1815460b initial checkin
ca
parents:
diff changeset
    27
	instanceVariableNames:'title value action'
87bb1815460b initial checkin
ca
parents:
diff changeset
    28
	classVariableNames:''
87bb1815460b initial checkin
ca
parents:
diff changeset
    29
	poolDictionaries:''
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    30
	privateIn:ViewTreeInspectorApplication
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    31
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    32
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    33
HierarchicalItem subclass:#ViewTreeItem
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
    34
	instanceVariableNames:'widget menuItem isDrawnShown exists xOffsetAdditionalName'
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    35
	classVariableNames:'HandleExtent'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    36
	poolDictionaries:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    37
	privateIn:ViewTreeInspectorApplication
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    38
!
87bb1815460b initial checkin
ca
parents:
diff changeset
    39
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    40
ValueModel subclass:#ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    41
	instanceVariableNames:'lockSema selectedSuperItems selection hiddenLevel listOfItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    42
		inputEventAction mappedViewAction beforeSelectionChangedAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    43
		icons timedUpdateTask selectOnClickHolder testModeChannel
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
    44
		hasTargetWidgetChannel catchEvents'
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    45
	classVariableNames:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    46
	poolDictionaries:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    47
	privateIn:ViewTreeInspectorApplication
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    48
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    49
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    50
HierarchicalList subclass:#ItemList
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    51
	instanceVariableNames:'treeModel eventHook eventHookInitialized showWidgetNames'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    52
	classVariableNames:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    53
	poolDictionaries:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    54
	privateIn:ViewTreeInspectorApplication::ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    55
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    56
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    57
!ViewTreeInspectorApplication class methodsFor:'documentation'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    58
2748
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    59
copyright
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    60
"
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    61
 COPYRIGHT (c) 2007 by eXept Software AG
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    62
	      All Rights Reserved
2748
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    63
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    64
 This software is furnished under a license and may be used
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    65
 only in accordance with the terms of that license and with the
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    66
 inclusion of the above copyright notice.   This software may not
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    67
 be provided or otherwise made available to, or used by, any
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    68
 other person.  No title to or ownership of the software is
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    69
 hereby transferred.
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    70
"
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    71
!
76f6fd319918 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
    72
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    73
documentation
87bb1815460b initial checkin
ca
parents:
diff changeset
    74
"
87bb1815460b initial checkin
ca
parents:
diff changeset
    75
     Small application showing a ViewTreeModel use.
87bb1815460b initial checkin
ca
parents:
diff changeset
    76
87bb1815460b initial checkin
ca
parents:
diff changeset
    77
     It displays a hierarchical list of a selected TopView and
87bb1815460b initial checkin
ca
parents:
diff changeset
    78
     all its contained subViews.
87bb1815460b initial checkin
ca
parents:
diff changeset
    79
     Useful to have a look at subcomponents - to see how views
87bb1815460b initial checkin
ca
parents:
diff changeset
    80
     are structured.
87bb1815460b initial checkin
ca
parents:
diff changeset
    81
87bb1815460b initial checkin
ca
parents:
diff changeset
    82
87bb1815460b initial checkin
ca
parents:
diff changeset
    83
    [Instance variables:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    84
	model           <ViewTreeModel>      the used ViewTreeModel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    85
	clickedItem     <ViewTreeItem>       item under the clickedPoint (motion action)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    86
	clickedPoint    <Point>              point where the motion action started from.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    87
	motionAction    <Action>             (oneArg-) action called durring buttonMotion.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    88
87bb1815460b initial checkin
ca
parents:
diff changeset
    89
87bb1815460b initial checkin
ca
parents:
diff changeset
    90
    [author:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    91
	Claus Atzkern
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    92
87bb1815460b initial checkin
ca
parents:
diff changeset
    93
    [see also:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    94
	ViewTreeModel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
    95
	ViewTreeItem
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    96
"
87bb1815460b initial checkin
ca
parents:
diff changeset
    97
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
    98
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    99
!ViewTreeInspectorApplication class methodsFor:'initialization'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   100
87bb1815460b initial checkin
ca
parents:
diff changeset
   101
initialize
87bb1815460b initial checkin
ca
parents:
diff changeset
   102
    "add myself to the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   103
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   104
    self installInLauncher.
87bb1815460b initial checkin
ca
parents:
diff changeset
   105
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   106
87bb1815460b initial checkin
ca
parents:
diff changeset
   107
installInLauncher
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   108
    "add myself to the launcher menu"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   109
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   110
    |menuItem icon|
87bb1815460b initial checkin
ca
parents:
diff changeset
   111
87bb1815460b initial checkin
ca
parents:
diff changeset
   112
    NewLauncher isNil ifTrue:[^ self].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   113
    "/ cg - disabled. the icon is too ugly.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   114
    ^ self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   115
3341
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   116
"/    icon := ToolbarIconLibrary inspectLocals20x20Icon magnifiedTo:28@28.
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   117
"/
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   118
"/    menuItem := MenuItem new
3341
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   119
"/                    label: 'View Tree Inspector';
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   120
"/                    value: [ ViewTreeInspectorApplication open];
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   121
"/                    isButton: true;
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   122
"/                    icon: icon;
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   123
"/                    nameKey: #viewInspect.
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   124
"/
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   125
"/    menuItem startGroup:#right.
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   126
"/    NewLauncher addMenuItem:menuItem in:'toolbar'
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   127
"/                   position:#( #before #help)
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   128
"/                      space:false.
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   129
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   130
    "
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   131
     self installInLauncher
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   132
     self removeFromLauncher
2089a2debb66 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3319
diff changeset
   133
    "
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   134
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   135
87bb1815460b initial checkin
ca
parents:
diff changeset
   136
postAutoload
87bb1815460b initial checkin
ca
parents:
diff changeset
   137
    "add myself to the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   138
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   139
    self installInLauncher.
87bb1815460b initial checkin
ca
parents:
diff changeset
   140
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   141
self installInLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   142
self removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   143
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   144
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   145
87bb1815460b initial checkin
ca
parents:
diff changeset
   146
removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   147
    "remove myself from the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   148
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   149
    NewLauncher isNil ifTrue:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
   150
    NewLauncher removeUserTool:#viewInspect
87bb1815460b initial checkin
ca
parents:
diff changeset
   151
87bb1815460b initial checkin
ca
parents:
diff changeset
   152
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   153
self installInLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   154
self removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   155
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   156
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   157
87bb1815460b initial checkin
ca
parents:
diff changeset
   158
unload
87bb1815460b initial checkin
ca
parents:
diff changeset
   159
    "class is about to be unloaded - remove myself from the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   160
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   161
    self removeFromLauncher.
87bb1815460b initial checkin
ca
parents:
diff changeset
   162
    super unload.
87bb1815460b initial checkin
ca
parents:
diff changeset
   163
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   164
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   165
!ViewTreeInspectorApplication class methodsFor:'help specs'!
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   166
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   167
helpSpec
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   168
    <resource: #help>
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   169
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   170
    ^super helpSpec addPairsFrom:#(
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   171
3186
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   172
#doRedraw
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   173
'Force the application to redraw its windows'
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   174
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   175
#doUncatchEvents
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   176
'Release picked view and uncatch events\(currently locked for widget selection)'
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   177
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   178
#doCatchEvents
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   179
'Lock view and catch events for widget selection\(currently unlocked)'
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   180
3186
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   181
#doInspectApplication
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   182
'Inspect the selected view''s application'
3186
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   183
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   184
#doBrowseApplication
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   185
'Browse the selected view''s application'
3186
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   186
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   187
#doPickView
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   188
'Pick a widget with the mouse and inspect its view hierarchy'
3186
80a20e5881a5 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3185
diff changeset
   189
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   190
)
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   191
! !
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   192
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   193
!ViewTreeInspectorApplication class methodsFor:'image specs'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   194
2759
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
   195
crossHairIcon
3185
3592ea3afb9e class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3184
diff changeset
   196
    ^ ToolbarIconLibrary bigCrossHairIcon
2759
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
   197
!
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
   198
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   199
lockViewIcon
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   200
    "This resource specification was automatically generated
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   201
     by the ImageEditor of ST/X."
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   202
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   203
    "Do not manually edit this!! If it is corrupted,
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   204
     the ImageEditor may not be able to read the specification."
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   205
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   206
    "
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   207
     self lockViewIcon inspect
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   208
     ImageEditor openOnClass:self andSelector:#lockViewIcon
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   209
     Icon flushCachedIcons
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   210
    "
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   211
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   212
    <resource: #image>
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   213
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   214
    ^Icon
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   215
	constantNamed:'Tools::ViewTreeInspectorApplication lockViewIcon'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   216
	ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   217
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   218
@@@@@@@@@@@@@@A8^G!!7O3ACP5*P@@A8^G @@@@@@@@@@@A8^@@@OE0/!!P0S#0@@^G @@@@@@@@@@@B (@D''D#48"1.CX5H@(J@@@@@@@@@@@@B (B(>SAT"
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   219
''%!!/P7,@(J@@@@@@@@@@@@@%IB0#M"H%IRTQV5P@IRT@@@@@@@@@@@ANSX:U]PANS$8:T80@S$8@@@@@@@@@@@AN&UYWK(EYQ@\FUPQHXT8@@@@@@@@@@@AN
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   220
HC2!!TVY:Y#-%I*IKMD8@@@@@@@@@@@A$\@83XBEG%).GGX _!!&P@@@@@@@@@@@AO[P5+ &(WPYN@["!!E\$<@@@@@@@@@@@B_F''FQPAXX_!!&TGH4HB9<@@@@@
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   221
@@@@@@B_%3HCJ7=BKPU,Q)01B9<@@@@@@@@@@@@PBP8T_F!!''JPI)_Y"D&!!@@@@@@@@@@@@@$B)I9TGXO''WQIWQ93W0@@@@@@@@@@@@@$"U=JR$)JR$)JR$)_
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   222
"P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   223
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[132 141 152 147 150 154 250 223 1 246 214 0 205 172 133 238 195 0 213 180 146 217 186 150 188 136 0 206 151 0 183 125 9 208 208 202 196 204 214 255 255 210 255 255 219 210 178 65 242 242 235 106 112 117 96 107 126 250 255 255 255 241 0 154 154 151 255 227 0 67 35 0 52 17 0 253 211 0 208 159 0 167 178 193 222 168 0 248 231 45 208 174 26 199 152 26 225 184 36 255 249 75 220 220 215 77 88 108 241 241 235 245 245 239 255 250 109 242 249 255 255 255 142 255 237 1 142 148 162 242 212 1 143 154 176 174 133 0 222 189 144 169 179 192 177 184 193 184 129 0 255 255 194 253 241 60 210 210 205 214 214 209 77 83 92 230 230 225 98 106 114 243 243 238 117 117 114 255 252 115 255 255 255 115 123 147 130 140 156 152 156 159 241 210 0 53 18 0 151 116 0 162 170 184 218 187 150 193 143 4 220 165 0 206 188 46 181 130 21 204 173 44 206 206 201 208 167 44 72 84 108 240 240 234 244 244 238 243 243 237 212 182 79 255 255 126 131 135 141 119 133 159 132 141 163 195 162 126 219 188 133 218 185 135 180 180 176 221 190 150 175 181 191 176 183 196 181 189 201 202 170 38 209 209 204 207 207 202 251 241 74 229 229 224 238 238 233 226 234 245 244 244 237 255 251 113 255 255 124 255 241 2 255 234 3 249 219 0 255 249 29 252 243 30 227 181 0 212 165 5 222 170 0 173 179 194 216 171 19 255 255 198 208 208 203 156 90 7 206 175 50 91 91 95 211 180 71 242 242 237 246 246 241 212 182 80 255 255 123 129 137 152 255 239 8 251 223 0 59 25 0 251 215 0 228 183 0 222 191 149 249 238 43 177 186 197 187 129 0 186 194 206 209 209 203 249 238 67 255 255 211 226 226 221 235 235 229 100 103 111 76 93 127 255 255 112 88 104 139 130 135 148 149 155 158 247 218 0 224 194 126 255 217 0 228 184 0 13 30 68 161 138 32 204 152 0 255 255 53 206 155 18 207 207 201 255 250 72 255 255 82 209 176 59 232 232 227 243 243 236 245 245 240 255 255 115 255 255 251]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@G8@@O<@@_>@@^^@@\N@@\N@@?? @?? @?? @?? @?? @?? @?? @?? @_?@@@@@@@@@@@@@@@@@@@@@') ; yourself); yourself]
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   224
!
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
   225
3000
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   226
releaseViewIcon
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   227
    "This resource specification was automatically generated
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   228
     by the ImageEditor of ST/X."
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   229
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   230
    "Do not manually edit this!! If it is corrupted,
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   231
     the ImageEditor may not be able to read the specification."
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   232
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   233
    "
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   234
     self releaseViewIcon inspect
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   235
     ImageEditor openOnClass:self andSelector:#releaseViewIcon
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   236
     Icon flushCachedIcons
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   237
    "
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   238
    <resource: #image>
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   239
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   240
    ^Icon
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   241
	constantNamed:'Tools::ViewTreeInspectorApplication releaseViewIcon'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   242
	ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
3000
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   243
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   244
@@@@@@@@@@@@@@A8^G!!7O3ACP5*P@@A8^G @@@@@@@@@@@A8^@@@OE0/!!P0S#0@@^G @@@@@@@@@@@B (@@''D#48"1.CX5H@(J@@@@@@@@@@@@B (@@@@@@"
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   245
''%!!/P7,@(J@@@@@@@@@@@@@%I@@@@BH%IRTQV5P@IRT@@@@@@@@@@@ANSP@@@@ANS$8:T80@S$8@@@@@@@@@@@AN&UYWK(EYQ@\FUPQHXT8@@@@@@@@@@@AN
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   246
HC2!!TVY:Y#-%I*IKMD8@@@@@@@@@@@A$\@83XBEG%).GGX _!!&P@@@@@@@@@@@AO[P5+ &(WPYN@["!!E\$<@@@@@@@@@@@B_F''FQPAXX_!!&TGH4HB9<@@@@@
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   247
@@@@@@B_%3HCJ7=BKPU,Q)01B9<@@@@@@@@@@@@PBP8T_F!!''JPI)_Y"D&!!@@@@@@@@@@@@@$B)I9TGXO''WQIWQ93W0@@@@@@@@@@@@@$"U=JR$)JR$)JR$)_
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   248
"P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7b530cc76688 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2978
diff changeset
   249
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[132 141 152 147 150 154 250 223 1 246 214 0 205 172 133 238 195 0 213 180 146 217 186 150 188 136 0 206 151 0 183 125 9 208 208 202 196 204 214 255 255 210 255 255 219 210 178 65 242 242 235 106 112 117 96 107 126 250 255 255 255 241 0 154 154 151 255 227 0 67 35 0 52 17 0 253 211 0 208 159 0 167 178 193 222 168 0 248 231 45 208 174 26 199 152 26 225 184 36 255 249 75 220 220 215 77 88 108 241 241 235 245 245 239 255 250 109 242 249 255 255 255 142 255 237 1 142 148 162 242 212 1 143 154 176 174 133 0 222 189 144 169 179 192 177 184 193 184 129 0 255 255 194 253 241 60 210 210 205 214 214 209 77 83 92 230 230 225 98 106 114 243 243 238 117 117 114 255 252 115 255 255 255 115 123 147 130 140 156 152 156 159 241 210 0 53 18 0 151 116 0 162 170 184 218 187 150 193 143 4 220 165 0 206 188 46 181 130 21 204 173 44 206 206 201 208 167 44 72 84 108 240 240 234 244 244 238 243 243 237 212 182 79 255 255 126 131 135 141 119 133 159 132 141 163 195 162 126 219 188 133 218 185 135 180 180 176 221 190 150 175 181 191 176 183 196 181 189 201 202 170 38 209 209 204 207 207 202 251 241 74 229 229 224 238 238 233 226 234 245 244 244 237 255 251 113 255 255 124 255 241 2 255 234 3 249 219 0 255 249 29 252 243 30 227 181 0 212 165 5 222 170 0 173 179 194 216 171 19 255 255 198 208 208 203 156 90 7 206 175 50 91 91 95 211 180 71 242 242 237 246 246 241 212 182 80 255 255 123 129 137 152 255 239 8 251 223 0 59 25 0 251 215 0 228 183 0 222 191 149 249 238 43 177 186 197 187 129 0 186 194 206 209 209 203 249 238 67 255 255 211 226 226 221 235 235 229 100 103 111 76 93 127 255 255 112 88 104 139 130 135 148 149 155 158 247 218 0 224 194 126 255 217 0 228 184 0 13 30 68 161 138 32 204 152 0 255 255 53 206 155 18 207 207 201 255 250 72 255 255 82 209 176 59 232 232 227 243 243 236 245 245 240 255 255 115 255 255 251]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@G8@@O<@@O>@@@^@@@N@@@N@@?? @?? @?? @?? @?? @?? @?? @?? @_?@@@@@@@@@@@@@@@@@@@@@') ; yourself); yourself]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   250
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   251
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   252
!ViewTreeInspectorApplication class methodsFor:'interface specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   253
87bb1815460b initial checkin
ca
parents:
diff changeset
   254
windowSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
   255
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   256
     by the UIPainter of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   257
87bb1815460b initial checkin
ca
parents:
diff changeset
   258
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   259
     the UIPainter may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   260
87bb1815460b initial checkin
ca
parents:
diff changeset
   261
    "
2757
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
   262
     UIPainter new openOnClass:Tools::ViewTreeInspectorApplication andSelector:#windowSpec
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
   263
     Tools::ViewTreeInspectorApplication new openInterface:#windowSpec
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
   264
     Tools::ViewTreeInspectorApplication open
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   265
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   266
87bb1815460b initial checkin
ca
parents:
diff changeset
   267
    <resource: #canvas>
87bb1815460b initial checkin
ca
parents:
diff changeset
   268
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   269
    ^
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   270
    #(FullSpec
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   271
       name: windowSpec
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   272
       window:
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   273
      (WindowSpec
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   274
	 label: 'View Tree Inspector'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   275
	 name: 'View Tree Inspector'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   276
	 min: (Point 10 10)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   277
	 max: (Point 1024 9999)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   278
	 bounds: (Rectangle 0 0 693 643)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   279
	 menu: menu
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   280
       )
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   281
       component:
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   282
      (SpecCollection
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   283
	 collection: (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   284
	  (MenuPanelSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   285
	     name: 'toolbarMenu'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   286
	     layout: (LayoutFrame 0 0.0 0 0 0 1.0 40 0)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   287
	     menu: toolbarMenu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   288
	     textDefault: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   289
	   )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   290
	  (VariableVerticalPanelSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   291
	     name: 'VariableVerticalPanel1'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   292
	     layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 0 1.0)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   293
	     component:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   294
	    (SpecCollection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   295
	       collection: (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   296
		(ViewSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   297
		   name: 'PathAndListPane'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   298
		   component:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   299
		  (SpecCollection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   300
		     collection: (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   301
		      (ViewSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   302
			 name: 'PathPane'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   303
			 layout: (LayoutFrame 0 0 0 0 0 1 25 0)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   304
			 component:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   305
			(SpecCollection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   306
			   collection: (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   307
			    (InputFieldSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   308
			       name: 'Path'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   309
			       layout: (LayoutFrame 0 0 0 0 0 1 0 1)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   310
			       model: path
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   311
			       acceptOnReturn: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   312
			       acceptOnTab: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   313
			       acceptOnPointerLeave: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   314
			       emptyFieldReplacementText: 'No View Selected'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   315
			     )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   316
			    )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   317
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   318
			 )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   319
		       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   320
		      (HierarchicalListViewSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   321
			 name: 'List'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   322
			 layout: (LayoutFrame 0 0 25 0 0 1 0 1)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   323
			 level: 1
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   324
			 model: model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   325
			 menu: middleButtonMenu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   326
			 hasHorizontalScrollBar: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   327
			 hasVerticalScrollBar: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   328
			 miniScrollerHorizontal: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   329
			 miniScrollerVertical: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   330
			 listModel: listOfItems
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   331
			 multipleSelectOk: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   332
			 useIndex: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   333
			 highlightMode: label
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   334
			 showLeftIndicators: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   335
			 indicatorSelector: indicatorClicked:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   336
			 useDefaultIcons: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   337
			 postBuildCallback: postBuildTree:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   338
		       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   339
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   340
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   341
		   )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   342
		 )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   343
		(ViewSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   344
		   name: 'Box2'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   345
		   component:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   346
		  (SpecCollection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   347
		     collection: (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   348
		      (TabViewSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   349
			 name: 'TabHeader1'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   350
			 layout: (LayoutFrame 0 0.0 0 0 0 1.0 25 0)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   351
			 model: inspectorModeIndexHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   352
			 menu: inspectorModes
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   353
			 useIndex: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   354
			 translateLabel: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   355
		       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   356
		      (SubCanvasSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   357
			 name: 'Browser'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   358
			 layout: (LayoutFrame 0 0 26 0 0 1 0 1)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   359
			 visibilityChannel: browserVisibleHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   360
			 hasHorizontalScrollBar: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   361
			 hasVerticalScrollBar: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   362
			 majorKey: #'Tools::NewSystemBrowser'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   363
			 minorKey: singleClassWithoutVariableListBrowserSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   364
			 createNewApplication: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   365
			 createNewBuilder: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   366
			 postBuildCallback: postBuildBrowserCanvas:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   367
		       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   368
		      (ViewSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   369
			 name: 'Inspector'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   370
			 layout: (LayoutFrame 0 0 26 0 0 1 0 1)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   371
			 visibilityChannel: inspectorVisibleHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   372
			 postBuildCallback: postBuildInspectorView:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   373
			 viewClassName: 'InspectorView'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   374
		       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   375
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   376
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   377
		   )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   378
		 )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   379
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   380
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   381
	     )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   382
	     handles: (Any 0.5 1.0)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   383
	   )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   384
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   385
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   386
       )
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
   387
     )
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   388
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   389
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   390
!ViewTreeInspectorApplication class methodsFor:'menu specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   391
87bb1815460b initial checkin
ca
parents:
diff changeset
   392
menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   393
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   394
     by the MenuEditor of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   395
87bb1815460b initial checkin
ca
parents:
diff changeset
   396
    "Do not manually edit this!! If it is corrupted,
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   397
     the MenuEditor may not be able to read the specification."
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   398
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
   399
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   400
    "
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
   401
     MenuEditor new openOnClass:Tools::ViewTreeInspectorApplication andSelector:#menu
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
   402
     (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeInspectorApplication menu)) startUp
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   403
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   404
87bb1815460b initial checkin
ca
parents:
diff changeset
   405
    <resource: #menu>
87bb1815460b initial checkin
ca
parents:
diff changeset
   406
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   407
    ^
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   408
     #(Menu
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   409
	(
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   410
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   411
	    label: 'File'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   412
	    submenu:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   413
	   (Menu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   414
	      (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   415
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   416
		  label: 'Pick a View'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   417
		  itemValue: doPickView
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   418
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   419
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   420
		  enabled: hasTargetWidgetChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   421
		  label: 'Release Picked View'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   422
		  itemValue: doUnpick
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   423
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   424
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   425
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   426
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   427
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   428
		  label: 'Settings'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   429
		  submenu:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   430
		 (Menu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   431
		    (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   432
		     (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   433
			label: 'Test Mode'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   434
			hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   435
			indication: testModeChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   436
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   437
		     (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   438
			enabled: testModeChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   439
			label: 'Follow Focus'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   440
			hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   441
			indication: followFocusChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   442
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   443
		     (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   444
			label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   445
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   446
		     (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   447
			label: 'Select on Click'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   448
			hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   449
			indication: selectOnClickHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   450
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   451
		     (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   452
			label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   453
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   454
		     (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   455
			label: 'Show Name of Widgets'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   456
			hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   457
			indication: showNamesHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   458
		      )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   459
		     )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   460
		    nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   461
		    nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   462
		  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   463
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   464
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   465
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   466
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   467
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   468
		  label: 'Exit'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   469
		  itemValue: closeRequest
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   470
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   471
	       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   472
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   473
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   474
	    )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   475
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   476
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   477
	    enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   478
	    label: 'Selection'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   479
	    submenuChannel: middleButtonMenu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   480
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   481
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   482
	    label: 'Widget'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   483
	    submenu:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   484
	   (Menu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   485
	      (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   486
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   487
		  enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   488
		  label: 'Browse'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   489
		  itemValue: doBrowse:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   490
		  argument: view
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   491
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   492
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   493
		  enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   494
		  label: 'Inspect'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   495
		  itemValue: doInspect:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   496
		  argument: view
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   497
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   498
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   499
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   500
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   501
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   502
		  enabled: hasTargetWidgetChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   503
		  label: 'All Components'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   504
		  startGroup: right
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   505
		  submenuChannel: submenuComponents:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   506
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   507
	       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   508
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   509
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   510
	    )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   511
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   512
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   513
	    label: 'Application'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   514
	    submenu:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   515
	   (Menu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   516
	      (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   517
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   518
		  label: 'Redraw'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   519
		  itemValue: doRedraw
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   520
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   521
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   522
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   523
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   524
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   525
		  enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   526
		  label: 'Browse'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   527
		  itemValue: doBrowse:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   528
		  argument: application
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   529
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   530
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   531
		  enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   532
		  label: 'Inspect'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   533
		  itemValue: doInspect:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   534
		  argument: application
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   535
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   536
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   537
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   538
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   539
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   540
		  enabled: canBrowseWindowSpecMethod
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   541
		  label: 'Browse Window Spec Method'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   542
		  itemValue: doBrowseWindowSpecMethod
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   543
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   544
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   545
		  enabled: canEditWindowSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   546
		  label: 'Edit Window Spec'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   547
		  itemValue: doEditWindowSpec
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   548
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   549
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   550
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   551
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   552
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   553
		  enabled: hasTargetWidgetChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   554
		  label: 'All Applications'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   555
		  submenuChannel: submenuApplications:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   556
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   557
	       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   558
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   559
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   560
	    )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   561
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   562
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   563
	    label: 'Process'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   564
	    submenu:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   565
	   (Menu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   566
	      (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   567
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   568
		  enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   569
		  label: 'Debug'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   570
		  itemValue: doDebugProcess
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   571
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   572
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   573
		  enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   574
		  label: 'Inspect'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   575
		  itemValue: doInspect:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   576
		  argument: process
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   577
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   578
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   579
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   580
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   581
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   582
		  label: 'Open Process Monitor'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   583
		  itemValue: doOpenProcessMonitor
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   584
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   585
	       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   586
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   587
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   588
	    )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   589
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   590
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   591
	    label: 'Help'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   592
	    startGroup: conditionalRight
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   593
	    submenu:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   594
	   (Menu
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   595
	      (
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   596
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   597
		  label: 'Documentation'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   598
		  itemValue: openDocumentation
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   599
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   600
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   601
		  label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   602
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   603
	       (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   604
		  label: 'About this Application...'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   605
		  itemValue: openAboutThisApplication
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   606
		)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   607
	       )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   608
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   609
	      nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   610
	    )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   611
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   612
	 )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   613
	nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   614
	nil
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   615
      )
87bb1815460b initial checkin
ca
parents:
diff changeset
   616
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   617
87bb1815460b initial checkin
ca
parents:
diff changeset
   618
middleButtonMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   619
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   620
     by the MenuEditor of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   621
87bb1815460b initial checkin
ca
parents:
diff changeset
   622
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   623
     the MenuEditor may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   624
3213
33e1f779fa15 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3210
diff changeset
   625
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   626
    "
3213
33e1f779fa15 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3210
diff changeset
   627
     MenuEditor new openOnClass:Tools::ViewTreeInspectorApplication andSelector:#middleButtonMenu
33e1f779fa15 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3210
diff changeset
   628
     (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeInspectorApplication middleButtonMenu)) startUp
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   629
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   630
87bb1815460b initial checkin
ca
parents:
diff changeset
   631
    <resource: #menu>
87bb1815460b initial checkin
ca
parents:
diff changeset
   632
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   633
    ^
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   634
     #(Menu
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   635
        (
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   636
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   637
            label: 'Browse View Class'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   638
            itemValue: doBrowse:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   639
            argument: view
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   640
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   641
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   642
            label: 'Browse Model Class'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   643
            itemValue: doBrowse:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   644
            isVisible: hasModel
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   645
            argument: model
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   646
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   647
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   648
            label: 'Browse Application Class'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   649
            itemValue: doBrowse:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   650
            isVisible: hasApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   651
            argument: application
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   652
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   653
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   654
            label: 'Browse Master Application Class'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   655
            itemValue: doBrowse:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   656
            isVisible: hasApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   657
            enabled: hasMasterApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   658
            argument: masterApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   659
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   660
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   661
            label: 'Browse Controller Class'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   662
            itemValue: doBrowse:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   663
            isVisible: hasController
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   664
            argument: controller
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   665
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   666
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   667
            label: '-'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   668
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   669
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   670
            label: 'Inspect View'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   671
            itemValue: doInspect:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   672
            argument: view
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   673
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   674
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   675
            label: 'Inspect Window Group'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   676
            itemValue: doInspect:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   677
            argument: group
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   678
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   679
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   680
            label: 'Inspect Model'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   681
            itemValue: doInspect:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   682
            isVisible: hasModel
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   683
            argument: model
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   684
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   685
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   686
            label: 'Inspect Application'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   687
            itemValue: doInspect:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   688
            isVisible: hasApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   689
            argument: application
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   690
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   691
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   692
            label: 'Inspect Master Application'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   693
            itemValue: doInspect:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   694
            isVisible: hasApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   695
            enabled: hasMasterApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   696
            argument: masterApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   697
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   698
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   699
            label: 'Inspect Controller'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   700
            itemValue: doInspect:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   701
            isVisible: hasController
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   702
            argument: controller
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   703
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   704
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   705
            label: '-'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   706
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   707
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   708
            label: 'Edit Language Resources'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   709
            itemValue: doEditLanguageResources
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   710
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   711
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   712
            label: '-'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   713
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   714
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   715
            label: 'Flash'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   716
            itemValue: doFlash
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   717
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   718
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   719
            label: '-'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   720
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   721
         (MenuItem
3689
d0440cfff708 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
   722
            label: 'Destroy View'
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   723
            itemValue: doDestroy
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   724
            labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   725
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   726
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   727
            label: '-'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   728
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   729
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   730
            label: 'Geometry'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   731
            submenuChannel: submenuGeometry:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   732
            keepLinkedMenu: true
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   733
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   734
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   735
            label: 'Interface'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   736
            submenuChannel: submenuInterface:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   737
            keepLinkedMenu: true
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   738
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   739
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   740
            label: 'Visibility'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   741
            submenuChannel: submenuVisibility:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   742
            keepLinkedMenu: true
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   743
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   744
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   745
            label: 'Instance Variables'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   746
            submenuChannel: submenuInspector:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   747
            keepLinkedMenu: true
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   748
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   749
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   750
            label: '='
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   751
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   752
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   753
            label: ''
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   754
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   755
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   756
            enabled: selectedComponentHasChildren
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   757
            label: 'Applications'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   758
            nameKey: single
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   759
            submenuChannel: submenuApplications:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   760
            keepLinkedMenu: true
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   761
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   762
         (MenuItem
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   763
            enabled: selectedComponentHasChildren
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   764
            label: 'Components'
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   765
            nameKey: single
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   766
            submenuChannel: submenuComponents:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   767
            keepLinkedMenu: true
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   768
          )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   769
         )
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   770
        nil
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   771
        nil
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   772
      )
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
   773
3689
d0440cfff708 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3674
diff changeset
   774
    "Modified: / 15-07-2019 / 18:51:11 / Claus Gittinger"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   775
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   776
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   777
middleButtonMenuForMenuItems
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   778
    "This resource specification was automatically generated
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   779
     by the MenuEditor of ST/X."
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   780
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   781
    "Do not manually edit this!! If it is corrupted,
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   782
     the MenuEditor may not be able to read the specification."
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   783
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   784
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   785
    "
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   786
     MenuEditor new openOnClass:Tools::ViewTreeInspectorApplication andSelector:#middleButtonMenu
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   787
     (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeInspectorApplication middleButtonMenu)) startUp
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   788
    "
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   789
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   790
    <resource: #menu>
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   791
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   792
    ^
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   793
     #(Menu
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   794
	(
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   795
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   796
	    label: 'Browse Menu Item''s Class'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   797
	    itemValue: doBrowse:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   798
	    argument: menuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   799
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   800
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   801
	    label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   802
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   803
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   804
	    label: 'Inspect Menu Item'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   805
	    itemValue: doInspect:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   806
	    argument: menuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   807
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   808
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   809
	    label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   810
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   811
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   812
	    label: 'Interface'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   813
	    submenuChannel: submenuMenuItemInterface:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   814
	    keepLinkedMenu: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   815
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   816
	 )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   817
	nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   818
	nil
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   819
      )
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   820
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   821
    "Created: / 16-08-2017 / 13:48:49 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   822
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
   823
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   824
toolbarMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   825
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   826
     by the MenuEditor of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   827
87bb1815460b initial checkin
ca
parents:
diff changeset
   828
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   829
     the MenuEditor may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   830
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
   831
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   832
    "
2757
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
   833
     MenuEditor new openOnClass:Tools::ViewTreeInspectorApplication andSelector:#toolbarMenu
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
   834
     (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeInspectorApplication toolbarMenu)) startUp
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   835
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   836
87bb1815460b initial checkin
ca
parents:
diff changeset
   837
    <resource: #menu>
87bb1815460b initial checkin
ca
parents:
diff changeset
   838
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   839
    ^
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   840
     #(Menu
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   841
	(
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   842
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   843
	    enabled: hasTargetWidgetChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   844
	    label: 'Redraw'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   845
	    itemValue: doRedraw
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   846
	    isButton: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   847
	    labelImage: (ResourceRetriever ToolbarIconLibrary reloadIcon)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   848
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   849
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   850
	    label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   851
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   852
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   853
	    label: 'Pick a View and Catch Events'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   854
	    itemValue: doPickView
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   855
	    translateLabel: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   856
	    isButton: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   857
	    hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   858
	    labelImage: (ResourceRetriever ToolbarIconLibrary pickWindowIcon)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   859
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   860
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   861
	    enabled: hasTargetWidgetChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   862
	    isVisible: isNotCatchingEventsChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   863
	    label: 'Catch Events of Picked View'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   864
	    activeHelpKey: doCatchEvents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   865
	    itemValue: doCatchEvents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   866
	    nameKey: doCatchEvents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   867
	    isButton: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   868
	    labelImage: (ResourceRetriever nil releaseViewIcon)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   869
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   870
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   871
	    enabled: hasTargetWidgetChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   872
	    isVisible: isCatchingEventsChannel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   873
	    label: 'Release Picked View and Uncatch Events'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   874
	    activeHelpKey: doUncatchEvents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   875
	    itemValue: doUncatchEvents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   876
	    nameKey: doUncatchEvents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   877
	    isButton: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   878
	    labelImage: (ResourceRetriever nil lockViewIcon)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   879
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   880
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   881
	    label: '-'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   882
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   883
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   884
	    activeHelpKey: doBrowseApplication
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   885
	    enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   886
	    label: 'Browse Application'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   887
	    itemValue: doBrowse:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   888
	    translateLabel: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   889
	    isButton: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   890
	    hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   891
	    labelImage: (ResourceRetriever ToolbarIconLibrary systemBrowser24x24Icon2)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   892
	    argument: application
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   893
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   894
	 (MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   895
	    activeHelpKey: doInspectApplication
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   896
	    enabled: hasSingleSelectionHolder
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   897
	    label: 'Inspect Application'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   898
	    itemValue: doInspect:
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   899
	    translateLabel: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   900
	    isButton: true
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   901
	    hideMenuOnActivated: false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   902
	    labelImage: (ResourceRetriever ToolbarIconLibrary inspect22x24Icon)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   903
	    argument: application
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   904
	  )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   905
	 )
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   906
	nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   907
	nil
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   908
      )
87bb1815460b initial checkin
ca
parents:
diff changeset
   909
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   910
2747
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   911
!ViewTreeInspectorApplication class methodsFor:'startup'!
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   912
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   913
openInPickMode
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   914
    |app|
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   915
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   916
    app := self new.
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   917
    app open.
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   918
    app doPickView.
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   919
    ^ app
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   920
!
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   921
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   922
openInPickModeAndRelease
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   923
    "release the pick-lock after picking"
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   924
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   925
    |app|
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   926
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   927
    app := self openInPickMode.
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   928
    app doUncatchEvents.
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   929
    ^ app
3014
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   930
!
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   931
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   932
openOn:aView
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   933
    "show a particular window's topView hierarchy,
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   934
     select the given view"
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   935
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   936
    |app|
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   937
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   938
    app := self new.
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   939
    app open.
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
   940
    app showWindow:aView.
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
   941
    ^ app
2747
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   942
! !
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   943
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   944
!ViewTreeInspectorApplication methodsFor:'actions'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   945
87bb1815460b initial checkin
ca
parents:
diff changeset
   946
indicatorClicked:anIndex
87bb1815460b initial checkin
ca
parents:
diff changeset
   947
    |item sensor|
87bb1815460b initial checkin
ca
parents:
diff changeset
   948
87bb1815460b initial checkin
ca
parents:
diff changeset
   949
    item := model listOfItems at:anIndex ifAbsent:nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   950
87bb1815460b initial checkin
ca
parents:
diff changeset
   951
    item notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   952
	(     (sensor := self window sensor) notNil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   953
	 and:[(sensor ctrlDown or:[sensor shiftDown])]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   954
	) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   955
	    item recursiveToggleExpand
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   956
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   957
	    item toggleExpand
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   958
	]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   959
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   960
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   961
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   962
!ViewTreeInspectorApplication methodsFor:'aspects'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   963
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   964
browserVisibleHolder
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   965
    "what is shown in the inspector:
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   966
     1->Widget
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   967
     2->Application
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   968
     3->WindowGroup
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   969
     4->Sensor
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   970
     5->Model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   971
     6->Widget Class
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   972
     7->Application Class
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   973
    "
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   974
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   975
    ^ BlockValue
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   976
	with:[:v | self inspectorMode == #widgetClass or:[self inspectorMode == #applicationClass] ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
   977
	argument:self inspectorModeIndexHolder
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   978
!
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
   979
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   980
canBrowseWindowSpecMethod
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   981
    ^ self hasSingleSelectionHolder value and:[ self windowSpecMethodOfSelection notNil ]
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   982
!
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   983
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   984
canEditWindowSpec
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   985
    ^ self hasSingleSelectionHolder value and:[ self windowSpecMethodOfSelection notNil ]
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   986
!
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
   987
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   988
followFocusChannel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   989
    "boolean holder, which indicates whether selection changed dependend on the focus view"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   990
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   991
    ^ followFocusChannel
87bb1815460b initial checkin
ca
parents:
diff changeset
   992
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   993
87bb1815460b initial checkin
ca
parents:
diff changeset
   994
hasSingleSelectionHolder
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   995
    "boolean holder, true if one item is selected"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   996
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   997
    ^ hasSingleSelectionHolder
87bb1815460b initial checkin
ca
parents:
diff changeset
   998
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   999
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1000
hasTargetWidgetChannel
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1001
    "answer the channel which is set to true if a target widget exists"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1002
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1003
    ^ model hasTargetWidgetChannel
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1004
!
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1005
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1006
inspectorMode
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1007
    "what is shown in the inspector:
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1008
     1->widget
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1009
     2->application
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1010
     3->WindowGroup
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1011
     4->Sensor
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1012
     5->Model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1013
     6->Widget Class
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1014
     7->Application Class
3574
ea4dce86360d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  1015
     8 -> Resources
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1016
    "
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1017
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1018
    |mode|
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1019
    mode := inspectorModeIndexHolder value.
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1020
    ^ #( widget application group sensor model widgetClass applicationClass resources) at:mode ifAbsent:#widget
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1021
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1022
    "Created: / 30-07-2013 / 07:44:59 / cg"
3574
ea4dce86360d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  1023
    "Modified (comment): / 17-07-2018 / 09:27:13 / Claus Gittinger"
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1024
!
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1025
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1026
inspectorModeIndexHolder
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1027
    "what is shown in the inspector:
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1028
     1->Widget
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1029
     2->Application
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1030
     3->WindowGroup
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1031
     4->Sensor
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1032
     5->Model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1033
     6->Widget Class
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1034
     7->Application Class
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1035
     8->Resources
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  1036
    "
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1038
    ^ inspectorModeIndexHolder
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1039
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1040
    "Created: / 30-07-2013 / 07:44:07 / cg"
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1041
    "Modified (comment): / 17-07-2018 / 08:46:12 / Claus Gittinger"
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1042
!
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1043
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1044
inspectorModes
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1045
    "/ labels of tabs
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1046
    ^ #('Widget' 'Application' 'WindowGroup' 'Sensor' 'Model' 'Widget Class' 'App Class' 'Resources')
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1047
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1048
    "Created: / 30-07-2013 / 09:42:16 / cg"
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1049
    "Modified: / 17-07-2018 / 08:45:56 / Claus Gittinger"
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1050
!
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1051
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1052
inspectorVisibleHolder
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1053
    "what is shown in the inspector:
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1054
     1->Widget
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1055
     2->Application
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1056
     3->WindowGroup
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1057
     4->Sensor
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1058
     5->Model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1059
     6->Widget Class
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1060
     7->Application Class
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1061
    "
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1062
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1063
    ^ BlockValue
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1064
	with:[:v | v not ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1065
	argument:self browserVisibleHolder
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1066
!
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1067
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1068
isCatchingEventsChannel
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1069
    ^ isCatchingEventsChannel
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1070
!
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1071
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1072
isNotCatchingEventsChannel
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1073
    ^ BlockValue forLogicalNot:self isCatchingEventsChannel
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1074
!
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1075
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1076
listOfItems
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1077
    "returns the hierarchical list of items"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1078
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1079
    ^ model listOfItems
87bb1815460b initial checkin
ca
parents:
diff changeset
  1080
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1081
87bb1815460b initial checkin
ca
parents:
diff changeset
  1082
model
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1083
    "returns my selection model, a ViewTreeModel"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1084
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1085
    ^ model
87bb1815460b initial checkin
ca
parents:
diff changeset
  1086
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1087
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1088
path
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1089
    <resource: #uiAspect>
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1090
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1091
    path isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1092
	path := PluggableAdaptor
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1093
		    on: self model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1094
		    getter:[ :model | model path ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1095
		    setter:[ :model :newValue |  ]
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1096
    ].
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1097
    ^ path.
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1098
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1099
    "Modified: / 19-05-2014 / 18:40:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1100
!
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  1101
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1102
selectOnClickHolder
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1103
    "boolean holder, which indicates whether the selection will change on click"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1104
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1105
    ^ model selectOnClickHolder
87bb1815460b initial checkin
ca
parents:
diff changeset
  1106
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1107
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1108
showNamesHolder
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1109
    "boolean holder, which indicates whether application names or widget names
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1110
     as additional text are shown for the items"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1111
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1112
    ^ showNamesHolder
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1113
!
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1114
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1115
testModeChannel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1116
    "answer a boolean channel which describes the behaviour how to process
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1117
     events on the target view.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1118
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1119
     false: all input events are eaten and the selection is shown on the target view.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1120
     true:  no  input events are eaten and no  selection is shown on the target view."
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1121
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1122
    ^ model testModeChannel
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1123
!
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1124
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1125
windowSpecMethodOfSelection
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1126
    |item view app nonMeta meta masterApp
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1127
     spec builder specSelector implementors|
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1128
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1129
    item := model selectedItem.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1130
    item isNil ifTrue:[^ nil].
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1131
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1132
    view := item widget.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1133
    view isNil ifTrue:[^ nil].
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1134
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1135
    app := view application.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1136
    app isNil ifTrue:[^ nil].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1137
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1138
    builder := app builder.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1139
    builder isNil ifTrue:[^ nil].
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1140
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1141
    spec := builder spec.
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1142
    spec isNil ifTrue:[^ nil].
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1143
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1144
    specSelector := spec name.
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1145
    specSelector isNil ifTrue:[^ nil].
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1146
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1147
    ((nonMeta := app class theNonMetaclass) canUnderstand:specSelector) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1148
	^ nonMeta lookupMethodFor:specSelector.
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1149
    ].
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1150
    ((meta := app class theMetaclass) canUnderstand:specSelector) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1151
	^ meta lookupMethodFor:specSelector.
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1152
    ].
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1153
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1154
    "/ maybe a simple dialog given a spec
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1155
    (masterApp := app masterApplication) notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1156
	((nonMeta := masterApp class theNonMetaclass) canUnderstand:specSelector) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1157
	    ^ nonMeta lookupMethodFor:specSelector.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1158
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1159
	((meta := masterApp class theMetaclass) canUnderstand:specSelector) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1160
	    ^ meta lookupMethodFor:specSelector.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1161
	].
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1162
    ].
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1163
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1164
    implementors := Smalltalk allImplementorsOf: specSelector.
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1165
    implementors size == 1 ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1166
	^ implementors first compiledMethodAt:specSelector.
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1167
    ].
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1168
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  1169
    ^ nil
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1170
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1171
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1172
!ViewTreeInspectorApplication methodsFor:'change & update'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1173
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1174
inspectorModeIndexHolderChanged
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1175
    self updateInspector
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1176
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1177
    "Created: / 30-07-2013 / 09:21:51 / cg"
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1178
!
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1179
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1180
selectionChanged
87bb1815460b initial checkin
ca
parents:
diff changeset
  1181
    |info view item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1182
87bb1815460b initial checkin
ca
parents:
diff changeset
  1183
    item := model selectedItem.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1184
    item notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1185
	|state|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1186
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1187
	view := item widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1188
	view isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1189
	    info := '%1 [%2]' bindWith:(item menuItem label asString)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1190
				  with:(item menuItem value asString).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1191
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1192
	    view id isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1193
		state := 'no ID'.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1194
	    ] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1195
		view shown ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1196
		    state := 'visible'.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1197
		] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1198
		    state := 'invisible'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1199
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1200
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1201
	    info := '%1 [%2] - %3' bindWith:(view class name)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1202
				       with:(view name ? '') with:state allBold.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1203
	]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1204
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1205
	info := ''
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1206
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1207
    hasSingleSelectionHolder value:(view notNil).
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1208
    self updateInspector
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1209
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1210
    "Modified: / 16-08-2017 / 13:44:59 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1211
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1212
87bb1815460b initial checkin
ca
parents:
diff changeset
  1213
update:something with:someArgument from:aModel
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
  1214
    |oldSelection|
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
  1215
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1216
    aModel == showNamesHolder ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1217
	oldSelection := model selectedItem.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1218
	model selectedItem:nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1219
	self listOfItems showWidgetNames:(aModel value).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1220
	model selectedItem:oldSelection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1221
	^ self
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1222
    ].
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1223
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1224
    aModel == model ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1225
	self selectionChanged.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1226
	^ self
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1227
    ].
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1228
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1229
    super update:something with:someArgument from:aModel.
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1230
!
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1231
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1232
updateBrowser
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1233
    |cls widget|
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1234
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1235
    widget := self selectedView.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1236
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1237
    "/ update the browser
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1238
    self inspectorMode == #widgetClass ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1239
	cls := widget class.
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1240
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1241
	cls := widget application class
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1242
    ].
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1243
    browser switchToClass:cls selector:nil.
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1244
!
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1245
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1246
updateInspector
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1247
    |view mode obj|
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1248
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1249
    view := self selectedView.
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1250
    mode := self inspectorMode.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1251
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1252
    ((mode == #widgetClass) or:[(mode == #applicationClass)]) ifTrue:[
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1253
        "/ update the browser
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1254
        view notNil ifTrue:[
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1255
            self updateBrowser.
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1256
        ].
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1257
        ^ self.
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1258
    ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1259
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1260
    (view isNil or:[mode == #widget]) ifTrue:[
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1261
        obj := view.
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1262
    ] ifFalse:[ (mode == #group) ifTrue:[
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1263
        obj := view windowGroup
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1264
    ] ifFalse:[ (mode == #sensor) ifTrue:[
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1265
        obj := view sensor
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1266
    ] ifFalse:[ (mode == #model) ifTrue:[
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1267
        obj := view model
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1268
    ] ifFalse:[ (mode == #resources) ifTrue:[
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1269
        obj := view resources
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1270
    ] ifFalse:[
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1271
        obj := view application.
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1272
    ]]]]].
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1273
    inspectorView inspect:obj.
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1274
    inspectorView headLineLabel:(obj class nameWithoutPrefix)
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1275
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1276
    "Created: / 30-07-2013 / 09:21:16 / cg"
3573
fc569c283368 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3568
diff changeset
  1277
    "Modified: / 17-07-2018 / 08:46:40 / Claus Gittinger"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1278
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1279
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1280
!ViewTreeInspectorApplication methodsFor:'event processing'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1281
87bb1815460b initial checkin
ca
parents:
diff changeset
  1282
processButtonMotionEvent:ev
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1283
    |click rootView|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1284
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1285
    motionAction isNil ifTrue:[^ self].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1286
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1287
    (rootView := model rootView) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1288
	clickedItem := motionAction := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1289
	^ self
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1290
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1291
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1292
    click := rootView device
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1293
	    translatePoint:((ev x)@ (ev y))
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1294
	    fromView:(ev view)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1295
	    toView:rootView.
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1296
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1297
    click = clickedPoint ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1298
	(clickedItem isNil or:[(click dist:clickedPoint) > 5.0]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1299
	    motionAction value:click
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1300
	]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1301
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1302
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1303
87bb1815460b initial checkin
ca
parents:
diff changeset
  1304
processButtonPressEvent:ev
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1305
    |rootView sensor lastRectangle|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1306
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1307
    rootView    := model rootView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1308
    sensor      := model rootView sensor.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1309
    clickedItem := model listOfItems detectItemRespondsToView:(ev view).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1310
87bb1815460b initial checkin
ca
parents:
diff changeset
  1311
    (sensor ctrlDown or:[sensor shiftDown]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1312
	clickedItem notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1313
	    self selectOnClickHolder value ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1314
		model toggleSelectItem:clickedItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1315
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1316
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1317
	clickedItem := motionAction := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1318
	^ self
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1319
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1320
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1321
    clickedPoint := rootView device translatePoint:((ev x)@ (ev y))  fromView:(ev view) toView:rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1322
    lastRectangle := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1323
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1324
    motionAction :=[:p|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1325
	rootView    := model rootView device rootView.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1326
	rootView    := model rootView.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1327
	clickedItem := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1328
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1329
	rootView xoring:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1330
	    lastRectangle notNil ifTrue:[ rootView displayRectangle:lastRectangle ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1331
				ifFalse:[ rootView clippedByChildren:false ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1332
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1333
	    p isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1334
		rootView clippedByChildren:true.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1335
		motionAction := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1336
	    ] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1337
		lastRectangle := Rectangle origin:(clickedPoint min:p) corner:(clickedPoint max:p).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1338
		rootView displayRectangle:lastRectangle.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1339
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1340
	    rootView flush.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1341
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1342
	lastRectangle
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1343
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1344
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1345
87bb1815460b initial checkin
ca
parents:
diff changeset
  1346
processButtonReleaseEvent:anEvent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1347
    |rootView rectangle newItems widget origin|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1348
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1349
    (rootView := model rootView) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1350
	clickedItem := motionAction := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1351
	^ self
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1352
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1353
    motionAction isNil ifTrue:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1354
    clickedItem notNil ifTrue:[ ^ model selectItem:clickedItem ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1355
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1356
    rectangle := motionAction value:nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1357
    rectangle isNil ifTrue:[^ self].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1358
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1359
    newItems := OrderedCollection new.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1360
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1361
    model rootItem recursiveDo:[:anItem|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1362
	widget := anItem widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1363
	widget notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1364
	    origin := widget originRelativeTo:rootView.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1365
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1366
	    (rectangle containsRect:(Rectangle origin:origin extent:(widget extent))) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1367
		newItems add:anItem.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1368
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1369
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1370
    ].
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1371
    model value:newItems.
3500
51cbdcf5b2cb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3457
diff changeset
  1372
51cbdcf5b2cb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3457
diff changeset
  1373
    "Modified: / 11-11-2017 / 17:24:59 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1374
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1375
87bb1815460b initial checkin
ca
parents:
diff changeset
  1376
processEvent:anEvent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1377
    |button menu|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1378
2758
c61fe917957a comment/format in:8 methods
Claus Gittinger <cg@exept.de>
parents: 2757
diff changeset
  1379
    anEvent isKeyPressEvent ifTrue:[ self processKeyPressEvent:anEvent. ^ self  ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1380
    anEvent isButtonEvent  ifFalse:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1381
87bb1815460b initial checkin
ca
parents:
diff changeset
  1382
    button := anEvent button.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1383
87bb1815460b initial checkin
ca
parents:
diff changeset
  1384
    (button == 2 or:[button == #menu]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1385
	motionAction isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1386
	    anEvent isButtonPressEvent ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1387
		self selectOnClickHolder value ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1388
		    menu := self middleButtonMenu value.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1389
		    menu notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1390
			menu := MenuPanel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1391
				    menu:(Menu new fromLiteralArrayEncoding:menu)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1392
				    receiver:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1393
			menu startUp.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1394
		    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1395
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1396
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1397
	    clickedItem := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1398
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1399
	^ self
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1400
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1401
2758
c61fe917957a comment/format in:8 methods
Claus Gittinger <cg@exept.de>
parents: 2757
diff changeset
  1402
    anEvent isButtonPressEvent  ifTrue:[ self processButtonPressEvent:anEvent. ^ self ].
c61fe917957a comment/format in:8 methods
Claus Gittinger <cg@exept.de>
parents: 2757
diff changeset
  1403
    anEvent isButtonMotionEvent ifTrue:[ self processButtonMotionEvent:anEvent. ^ self ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1404
87bb1815460b initial checkin
ca
parents:
diff changeset
  1405
    anEvent isButtonReleaseEvent ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1406
	self selectOnClickHolder value ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1407
	    self processButtonReleaseEvent:anEvent
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1408
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1409
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1410
    clickedItem := motionAction := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1411
87bb1815460b initial checkin
ca
parents:
diff changeset
  1412
    anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1413
	self selectOnClickHolder value ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1414
	    self doInspect:#view.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1415
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1416
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1417
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1418
87bb1815460b initial checkin
ca
parents:
diff changeset
  1419
processKeyPressEvent:anEvent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1420
    |item prnt idx key max next|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1421
87bb1815460b initial checkin
ca
parents:
diff changeset
  1422
    key := anEvent key.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1423
    key isSymbol ifFalse:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1424
87bb1815460b initial checkin
ca
parents:
diff changeset
  1425
    key == #Delete    ifTrue:[ ^ self doDestroy ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1426
    key == #InspectIt ifTrue:[ ^ self doInspect:#view ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1427
87bb1815460b initial checkin
ca
parents:
diff changeset
  1428
    (   key == #CursorUp
87bb1815460b initial checkin
ca
parents:
diff changeset
  1429
    or:[key == #CursorDown
87bb1815460b initial checkin
ca
parents:
diff changeset
  1430
    or:[key == #CursorLeft
87bb1815460b initial checkin
ca
parents:
diff changeset
  1431
    or:[key == #CursorRight]]]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1432
    ) ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1433
	^ self
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1434
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1435
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1436
87bb1815460b initial checkin
ca
parents:
diff changeset
  1437
    item isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1438
	^ model selectedItem:(model first ? model rootItem)
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1439
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1440
87bb1815460b initial checkin
ca
parents:
diff changeset
  1441
    prnt := item parent.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1442
    prnt isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1443
	"/ is the root item
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1444
	(key == #CursorUp or:[key == #CursorLeft]) ifTrue:[item := model listOfItems last]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1445
						  ifFalse:[item := item at:1 ifAbsent:item].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1446
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1447
	^ model selectedItem:item
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1448
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1449
    key == #CursorLeft ifTrue:[ ^ model selectedItem:prnt ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1450
87bb1815460b initial checkin
ca
parents:
diff changeset
  1451
    key == #CursorRight ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1452
	next := item at:1 ifAbsent:nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1453
	next notNil ifTrue:[ model selectedItem:next ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1454
	^ self
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1455
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1456
87bb1815460b initial checkin
ca
parents:
diff changeset
  1457
    max := prnt size.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1458
87bb1815460b initial checkin
ca
parents:
diff changeset
  1459
    key == #CursorUp ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1460
	idx := prnt identityIndexOf:item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1461
	idx == 1 ifTrue:[idx := max + 1].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1462
	model selectedItem:(prnt at:idx - 1).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1463
	^ self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1464
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1465
87bb1815460b initial checkin
ca
parents:
diff changeset
  1466
    key == #CursorDown ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1467
	idx := prnt identityIndexOf:item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1468
	idx == max ifTrue:[idx := 0].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1469
	model selectedItem:(prnt at:idx + 1).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1470
	^ self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1471
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1472
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1473
87bb1815460b initial checkin
ca
parents:
diff changeset
  1474
processMappedView:aView
87bb1815460b initial checkin
ca
parents:
diff changeset
  1475
    |parent anchor|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1476
87bb1815460b initial checkin
ca
parents:
diff changeset
  1477
    parent := self listOfItems detectItemRespondsToView:aView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1478
    parent isNil ifTrue:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1479
87bb1815460b initial checkin
ca
parents:
diff changeset
  1480
    NotFoundSignal handle:[:ex|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1481
	"contained subvies used by spec are not yet created;
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1482
	 thus we have to wait until last used subview is build
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1483
	"
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1484
	anchor := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1485
    ] do:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1486
	anchor := parent class buildViewsFrom:(parent widget).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1487
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1488
    anchor notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1489
	parent updateFromChildren:anchor children.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1490
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1491
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1492
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1493
!ViewTreeInspectorApplication methodsFor:'initialization & release'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1494
87bb1815460b initial checkin
ca
parents:
diff changeset
  1495
closeDownViews
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1496
    "release the grapped application"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1497
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1498
    process := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1499
    super closeDownViews.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1500
    self doUnpick.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1501
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1502
87bb1815460b initial checkin
ca
parents:
diff changeset
  1503
initialize
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1504
    "setup my model and channels"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1505
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1506
    super initialize.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1507
87bb1815460b initial checkin
ca
parents:
diff changeset
  1508
    hasSingleSelectionHolder := false asValue.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1509
    followFocusChannel       := false asValue.
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  1510
    isCatchingEventsChannel  := false asValue.
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1511
    inspectorModeIndexHolder := 1 asValue.
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1512
    inspectorModeIndexHolder onChangeSend:#inspectorModeIndexHolderChanged to:self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1513
87bb1815460b initial checkin
ca
parents:
diff changeset
  1514
    model := ViewTreeModel new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1515
    model inputEventAction:[:ev| self processEvent:ev ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1516
    model mappedViewAction:[:vw| self processMappedView:vw ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1517
    model application:self.
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1518
    model addDependent:self.
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1519
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1520
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1521
    showNamesHolder := false asValue.
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1522
    showNamesHolder addDependent:self.
3037
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1523
876c28de42da class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3034
diff changeset
  1524
    "Modified: / 30-07-2013 / 09:20:08 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1525
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1526
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1527
postBuildBrowserCanvas:aSubCanvas
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1528
    browser := aSubCanvas application.
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1529
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1530
    "/ browser navigationState meta onChangeEvaluate:(self updateBrowser).
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1531
    "/ self updateBrowser.
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1532
!
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  1533
2770
9322aee00ea0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1534
postBuildInspectorView:anInspector
9322aee00ea0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1535
    inspectorView := anInspector.
9322aee00ea0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1536
!
9322aee00ea0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1537
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1538
postBuildTree:aTree
87bb1815460b initial checkin
ca
parents:
diff changeset
  1539
    treeView := aTree scrolledView.
3105
b33e0b8e6038 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1540
    "/ treeView hasConstantHeight:true.
3104
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1541
!
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1542
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1543
release
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1544
    "release the grapped application"
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1545
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1546
    super release.
59230707e466 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3079
diff changeset
  1547
    self doUnpick.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1548
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1549
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1550
!ViewTreeInspectorApplication methodsFor:'menu queries'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1551
87bb1815460b initial checkin
ca
parents:
diff changeset
  1552
hasApplication
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1553
    "returns true if the current selected view has an application"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1554
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1555
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1556
87bb1815460b initial checkin
ca
parents:
diff changeset
  1557
    view := self selectedView.
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1558
    ^ (view notNil and:[view application notNil])
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1559
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1560
    "Modified (format): / 30-10-2018 / 16:20:26 / Claus Gittinger"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1561
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1562
87bb1815460b initial checkin
ca
parents:
diff changeset
  1563
hasController
87bb1815460b initial checkin
ca
parents:
diff changeset
  1564
    "returns true if the current selected item's view has a controller
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1565
     other than nil or the view itself"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1566
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1567
    |view controller|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1568
87bb1815460b initial checkin
ca
parents:
diff changeset
  1569
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1570
87bb1815460b initial checkin
ca
parents:
diff changeset
  1571
    view notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1572
	controller := view controller.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1573
      ^ (controller notNil and:[controller ~~ view])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1574
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1575
    ^ false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1576
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1577
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1578
hasMasterApplication
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1579
    "returns true if the current selected view has an application"
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1580
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1581
    |view|
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1582
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1583
    view := self selectedView.
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1584
    ^ (view notNil 
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1585
        and:[view application notNil
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1586
        and:[view application masterApplication notNil]])
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1587
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1588
    "Created: / 30-10-2018 / 16:20:23 / Claus Gittinger"
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1589
!
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  1590
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1591
hasModel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1592
    "returns true if the current selected view has a model"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1593
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1594
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1595
87bb1815460b initial checkin
ca
parents:
diff changeset
  1596
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1597
  ^ (view notNil and:[view model notNil])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1598
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1599
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1600
!ViewTreeInspectorApplication methodsFor:'menu specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1601
87bb1815460b initial checkin
ca
parents:
diff changeset
  1602
middleButtonMenu
3551
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1603
    "returns the middleButton menu for the single selected view tree item or nil"
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1604
3660
4b4a427f8976 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3658
diff changeset
  1605
    <resource: #programMenu >
4b4a427f8976 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3658
diff changeset
  1606
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1607
    ^ [
3551
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1608
        |viewTreeItem|
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1609
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1610
        (viewTreeItem := model selectedItem) notNil ifTrue:[
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1611
            viewTreeItem isView ifTrue:[
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1612
                self class middleButtonMenu
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1613
            ] ifFalse:[
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1614
                self class middleButtonMenuForMenuItems
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1615
            ].
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1616
        ] ifFalse:[
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1617
            nil
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  1618
        ]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1619
      ]
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1620
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1621
    "Modified: / 16-08-2017 / 13:48:31 / cg"
3660
4b4a427f8976 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3658
diff changeset
  1622
    "Modified: / 02-05-2019 / 22:39:49 / Claus Gittinger"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1623
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1624
87bb1815460b initial checkin
ca
parents:
diff changeset
  1625
submenuApplications:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1626
    |applications menu item list addBlock|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1627
87bb1815460b initial checkin
ca
parents:
diff changeset
  1628
    item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1629
					      ifFalse:[model rootItem].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1630
    item isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1631
87bb1815460b initial checkin
ca
parents:
diff changeset
  1632
    applications := IdentityDictionary new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1633
87bb1815460b initial checkin
ca
parents:
diff changeset
  1634
    addBlock := [:el| |cls ctr|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1635
	cls := self resolveApplicationClassFor:el.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1636
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1637
	cls notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1638
	    ctr := applications at:cls ifAbsent:0.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1639
	    applications at:cls put:(ctr + 1).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1640
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1641
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1642
    item recursiveDo:addBlock.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1643
    addBlock value:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1644
87bb1815460b initial checkin
ca
parents:
diff changeset
  1645
    applications isEmpty ifTrue:[^ nil ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1646
    list := SortedCollection sortBlock:[:a :b| a title < b title ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1647
87bb1815460b initial checkin
ca
parents:
diff changeset
  1648
    applications keysAndValuesDo:[:cls :ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1649
       list add:(MenuDesc title:(cls name)
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1650
			  value:(ctr printString)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1651
			 action:[self doSelectNextOfApplicationClass:cls startingIn:item]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1652
		 ).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1653
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1654
87bb1815460b initial checkin
ca
parents:
diff changeset
  1655
    menu := MenuDesc buildFromList:list onGC:aMenu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1656
    menu do:[:el|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1657
	el hideMenuOnActivated:false
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1658
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1659
    ^ menu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1660
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1661
87bb1815460b initial checkin
ca
parents:
diff changeset
  1662
submenuComponents:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1663
    |widgets list total menu item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1664
87bb1815460b initial checkin
ca
parents:
diff changeset
  1665
    item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1666
					      ifFalse:[model rootItem].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1667
    item isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1668
87bb1815460b initial checkin
ca
parents:
diff changeset
  1669
    widgets := IdentityDictionary new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1670
    total   := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1671
87bb1815460b initial checkin
ca
parents:
diff changeset
  1672
    item recursiveDo:[:el| |cls ctr|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1673
	cls := el widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1674
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1675
	cls notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1676
	    cls := cls class.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1677
	    ctr := widgets at:cls ifAbsent:0.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1678
	    widgets at:cls put:(ctr + 1).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1679
	    total := total + 1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1680
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1681
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1682
    total == 0 ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1683
    list := SortedCollection sortBlock:[:a :b| a title < b title ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1684
87bb1815460b initial checkin
ca
parents:
diff changeset
  1685
    widgets keysAndValuesDo:[:cls :ctr|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1686
	list add:(MenuDesc title:(cls name)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1687
			   value:(ctr printString)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1688
			  action:[self doSelectNextOfClass:cls startingIn:item]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1689
		 ).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1690
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1691
    list := list asOrderedCollection.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1692
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1693
    list add:(MenuDesc title:'Total' value:(total printString)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1694
    menu := MenuDesc buildFromList:list onGC:aMenu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1695
    menu do:[:el|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1696
	el hideMenuOnActivated:false
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1697
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1698
    ^ menu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1699
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1700
87bb1815460b initial checkin
ca
parents:
diff changeset
  1701
submenuGeometry:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1702
    "builds and returns the geometry submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1703
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1704
    |view point inst list x y|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1705
87bb1815460b initial checkin
ca
parents:
diff changeset
  1706
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1707
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1708
87bb1815460b initial checkin
ca
parents:
diff changeset
  1709
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1710
87bb1815460b initial checkin
ca
parents:
diff changeset
  1711
    "/ origin
87bb1815460b initial checkin
ca
parents:
diff changeset
  1712
    point := view relativeOrigin.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1713
    point isNil ifTrue:[ point := view origin ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1714
87bb1815460b initial checkin
ca
parents:
diff changeset
  1715
    x := view left.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1716
    y := view top.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1717
87bb1815460b initial checkin
ca
parents:
diff changeset
  1718
    (x == point x and:[y == point y]) ifTrue:[ inst := point ]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1719
				     ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1720
87bb1815460b initial checkin
ca
parents:
diff changeset
  1721
    list add:(MenuDesc title:'origin' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1722
87bb1815460b initial checkin
ca
parents:
diff changeset
  1723
    "/ corner
87bb1815460b initial checkin
ca
parents:
diff changeset
  1724
    point := view relativeCorner.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1725
    point isNil ifTrue:[ point := view corner ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1726
87bb1815460b initial checkin
ca
parents:
diff changeset
  1727
    x := view right.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1728
    y := view bottom.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1729
87bb1815460b initial checkin
ca
parents:
diff changeset
  1730
    (x == point x and:[y == point y]) ifTrue:[ inst := point ]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1731
				     ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1732
87bb1815460b initial checkin
ca
parents:
diff changeset
  1733
    list add:(MenuDesc title:'corner' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1734
87bb1815460b initial checkin
ca
parents:
diff changeset
  1735
    "/ extent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1736
    (point := view relativeExtent) isNil ifTrue:[point := view extent].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1737
    list add:(MenuDesc title:'extent' value:point).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1738
87bb1815460b initial checkin
ca
parents:
diff changeset
  1739
    "/ preferred extent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1740
    list add:(MenuDesc title:'pref. extent' value:(view preferredExtent)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1741
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1742
87bb1815460b initial checkin
ca
parents:
diff changeset
  1743
    "/ view insets
87bb1815460b initial checkin
ca
parents:
diff changeset
  1744
    inst := 'l:%1  r:%2  t:%3  b:%4' bindWith:(view leftInset)
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1745
					 with:(view rightInset)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1746
					 with:(view topInset)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1747
					 with:(view bottomInset).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1748
87bb1815460b initial checkin
ca
parents:
diff changeset
  1749
    list add:(MenuDesc title:'insets'      value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1750
    list add:(MenuDesc title:'borderWidth' value:(view borderWidth)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1751
    list add:(MenuDesc title:'level'       value:(view level)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1752
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1753
87bb1815460b initial checkin
ca
parents:
diff changeset
  1754
    (inst := view layout) notNil ifTrue:[ inst := inst displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1755
    list add:(MenuDesc title:'layout' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1756
87bb1815460b initial checkin
ca
parents:
diff changeset
  1757
    (inst := view transformation) notNil ifTrue:[ inst := inst displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1758
    list add:(MenuDesc title:'transformation' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1759
3183
cd02c3731897 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3174
diff changeset
  1760
    (view isKindOf:Label) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1761
	list add:(MenuDesc separator).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1762
	(inst := view adjust) notNil ifTrue:[ inst := inst displayString ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1763
	list add:(MenuDesc title:'adjust' value:inst).
3183
cd02c3731897 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3174
diff changeset
  1764
    ].
cd02c3731897 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3174
diff changeset
  1765
    (view isKindOf:PanelView) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1766
	list add:(MenuDesc separator).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1767
	(inst := view horizontalLayout ) notNil ifTrue:[ inst := inst displayString ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1768
	list add:(MenuDesc title:'horizontalLayout' value:inst).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1769
	(inst := view verticalLayout ) notNil ifTrue:[ inst := inst displayString ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1770
	list add:(MenuDesc title:'verticalLayout' value:inst).
3183
cd02c3731897 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3174
diff changeset
  1771
    ].
cd02c3731897 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3174
diff changeset
  1772
cd02c3731897 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3174
diff changeset
  1773
    ^ MenuDesc buildFromList:list onGC:aMenu
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1774
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1775
87bb1815460b initial checkin
ca
parents:
diff changeset
  1776
submenuInspector:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1777
    "builds and returns the inspector submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1778
3040
b62c4b71910c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1779
    |view list n names label value indices|
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1780
87bb1815460b initial checkin
ca
parents:
diff changeset
  1781
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1782
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1783
87bb1815460b initial checkin
ca
parents:
diff changeset
  1784
    n := view class instSize.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1785
    n > 0 ifFalse:[^ nil ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1786
87bb1815460b initial checkin
ca
parents:
diff changeset
  1787
    list  := OrderedCollection new:n.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1788
    names := view class allInstVarNames.
3040
b62c4b71910c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1789
    indices := (1 to:names size) asArray.
b62c4b71910c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1790
    names sortWith:indices.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1791
87bb1815460b initial checkin
ca
parents:
diff changeset
  1792
    1 to:n do:[:i| |action|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1793
	label := (names at:i) printString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1794
	value := view instVarAt:(indices at:i).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1795
	value isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1796
	    value  := '------'.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1797
	    action := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1798
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1799
	    value  := value displayString contractAtEndTo:40.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1800
	    action := [(view instVarAt:i) inspect].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1801
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1802
	list add:(MenuDesc title:label value:value action:action).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1803
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1804
87bb1815460b initial checkin
ca
parents:
diff changeset
  1805
    ^ MenuDesc buildFromList:list onGC:aMenu
3040
b62c4b71910c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1806
b62c4b71910c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1807
    "Modified: / 31-07-2013 / 13:12:52 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1808
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1809
87bb1815460b initial checkin
ca
parents:
diff changeset
  1810
submenuInterface:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1811
    "builds and returns the interface submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1812
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1813
    |view label inst value list|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1814
87bb1815460b initial checkin
ca
parents:
diff changeset
  1815
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1816
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1817
87bb1815460b initial checkin
ca
parents:
diff changeset
  1818
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1819
87bb1815460b initial checkin
ca
parents:
diff changeset
  1820
    inst  := view controller.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1821
    value := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1822
87bb1815460b initial checkin
ca
parents:
diff changeset
  1823
    inst isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1824
	label := nil
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1825
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1826
	inst == view ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1827
	    label := '== view itself'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1828
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1829
	    label := inst displayString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1830
	    value := [view controller inspect].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1831
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1832
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1833
    list add:(MenuDesc title:'controller' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1834
87bb1815460b initial checkin
ca
parents:
diff changeset
  1835
    inst := view delegate.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1836
    inst notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1837
	list add:(MenuDesc title:'delegate' value:(inst displayString) action:[ view delegate inspect ]).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1838
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1839
87bb1815460b initial checkin
ca
parents:
diff changeset
  1840
    inst := view application.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1841
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1842
    inst notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1843
	|topAppl|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1844
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1845
	list add:(MenuDesc title:'application' value:inst action:[ view application inspect ]).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1846
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1847
	topAppl := inst topApplication.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1848
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1849
	(topAppl notNil and:[topAppl ~~ inst]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1850
	    list add:(MenuDesc title:'topApplication' value:topAppl action:[ inst topApplication inspect ]).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1851
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1852
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1853
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1854
2888
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1855
    (view respondsTo:#'model') ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1856
	inst := view model.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1857
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1858
	inst isNil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1859
	    ifTrue:[ label := value := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1860
	    ifFalse:[ label := inst displayString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1861
		      label := label,(self aspectLabelFor:inst inApplicationOf:view).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1862
		      value := [ view model inspect ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1863
		    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1864
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1865
	list add:(MenuDesc title:'model' value:label action:value).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1866
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1867
	(inst notNil and:[view respondsTo:#modelInterface]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1868
	    view modelInterface keysAndValuesDo:[:key : val|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1869
		val isNil ifTrue:[ label := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1870
			 ifFalse:[ label := val displayString ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1871
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1872
		list add:(MenuDesc title:('      - ', key) value:label ).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1873
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1874
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1875
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1876
87bb1815460b initial checkin
ca
parents:
diff changeset
  1877
    (view respondsTo:#enableChannel) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1878
	inst := view enableChannel.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1879
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1880
	inst isNil ifTrue:[ label := value := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1881
		  ifFalse:[ label := inst displayString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1882
			    label := label,(self aspectLabelFor:inst inApplicationOf:view).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1883
			    value := [ view enableChannel inspect ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1884
			  ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1885
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1886
	list add:(MenuDesc title:'enableChannel' value:label action:value).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1887
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1888
2888
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1889
    #( #action #pressAction #releaseAction ) do:[:actionSelector |
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1890
	(view respondsTo:actionSelector) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1891
	    inst := view perform:actionSelector.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1892
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1893
	    inst isNil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1894
		ifTrue:[ label := value := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1895
		ifFalse:[ label := inst displayString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1896
			    value := [ (view perform:actionSelector) inspect ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1897
			].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1898
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1899
	    list add:(MenuDesc title:actionSelector"'action'" value:label action:value).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1900
	].
2779
10fef360ad85 changed: #submenuInterface:
Claus Gittinger <cg@exept.de>
parents: 2770
diff changeset
  1901
    ].
10fef360ad85 changed: #submenuInterface:
Claus Gittinger <cg@exept.de>
parents: 2770
diff changeset
  1902
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1903
    list last isSeparator ifFalse:[ list add:(MenuDesc separator) ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1904
87bb1815460b initial checkin
ca
parents:
diff changeset
  1905
    (view respondsTo:#listHolder) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1906
	inst := view listHolder.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1907
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1908
	inst isNil ifTrue:[ label := value := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1909
		  ifFalse:[ label := inst class printString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1910
			    label := label,(self aspectLabelFor:inst inApplicationOf:view).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1911
			    value := [ view listHolder inspect ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1912
			  ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1913
	list add:(MenuDesc title:'listHolder' value:label action:value).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1914
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1915
87bb1815460b initial checkin
ca
parents:
diff changeset
  1916
    (view respondsTo:#list) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1917
	inst := view list.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1918
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1919
	inst isNil ifTrue:[ label := value := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1920
		  ifFalse:[ label := '%1 [%2]' bindWith:(inst class printString) with:(inst size).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1921
			    label := label,(self aspectLabelFor:inst inApplicationOf:view).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1922
			    value := [ view list inspect ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1923
			  ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1924
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1925
	list add:(MenuDesc title:'list' value:label action:value).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1926
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1927
87bb1815460b initial checkin
ca
parents:
diff changeset
  1928
    list last isSeparator ifTrue:[ list removeLast ].
2888
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1929
    ^ MenuDesc buildFromList:list onGC:aMenu
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1930
3040
b62c4b71910c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3037
diff changeset
  1931
    "Modified: / 31-07-2013 / 13:09:55 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1932
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1933
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1934
submenuMenuItemInterface:aMenu
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1935
    "builds and returns the menuItem interface submenu"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1936
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1937
    |item list|
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1938
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1939
    item := self selectedMenuItem.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1940
    item isNil ifTrue:[^ nil].
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1941
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1942
    list := OrderedCollection new.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1943
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1944
    list add:(MenuDesc
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1945
		title:'itemValue'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1946
		value:(item itemValue)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1947
		action:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1948
		    UserPreferences systemBrowserClass
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1949
			browseImplementorsOf:item itemValue
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1950
		]).
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1951
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1952
    ^ MenuDesc buildFromList:list onGC:aMenu
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1953
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1954
    "Created: / 16-08-2017 / 13:51:05 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1955
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  1956
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1957
submenuVisibility:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1958
    "builds and returns the geometry submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1959
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1960
    |view list value|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1961
87bb1815460b initial checkin
ca
parents:
diff changeset
  1962
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1963
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1964
87bb1815460b initial checkin
ca
parents:
diff changeset
  1965
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1966
87bb1815460b initial checkin
ca
parents:
diff changeset
  1967
    list add:(MenuDesc title:'device'     value:(view device printString)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1968
    list add:(MenuDesc title:'drawableId' value:(view id)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1969
    list add:(MenuDesc title:'gcId'       value:(view gcId)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1970
87bb1815460b initial checkin
ca
parents:
diff changeset
  1971
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1972
87bb1815460b initial checkin
ca
parents:
diff changeset
  1973
    list add:(MenuDesc title:'shown'    value:(view shown)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1974
    list add:(MenuDesc title:'realized' value:(view realized)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1975
87bb1815460b initial checkin
ca
parents:
diff changeset
  1976
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1977
87bb1815460b initial checkin
ca
parents:
diff changeset
  1978
    list add:(MenuDesc title:'hiddenOnRealize' value:(view isHiddenOnRealize)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1979
87bb1815460b initial checkin
ca
parents:
diff changeset
  1980
    (value := view visibilityChannel) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1981
	list add:(MenuDesc title:'visibilityChannel' value:'------').
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1982
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1983
	list add:(MenuDesc title:'visibilityChannel'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1984
			   value:(value displayString)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  1985
			  action:[view visibilityChannel inspect]).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1986
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1987
2758
c61fe917957a comment/format in:8 methods
Claus Gittinger <cg@exept.de>
parents: 2757
diff changeset
  1988
    ^ MenuDesc buildFromList:list onGC:aMenu
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1989
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1990
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1991
!ViewTreeInspectorApplication methodsFor:'private'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1992
2888
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1993
aspectLabelFor:aModel inApplicationOf:aView
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1994
    |app|
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1995
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1996
    aModel isNil ifTrue:[^ ''].
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1997
    aView isNil ifTrue:[^ ''].
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1998
    (app := aView application) isNil ifTrue:[^ ''].
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  1999
    app builder bindings keysAndValuesDo:[:aspect :value |
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2000
	value == aModel ifTrue:[^ ' [aspect: ',aspect,']'].
2888
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2001
    ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2002
    app class allInstVarNames do:[:nm |
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2003
	(app instVarNamed:nm) == aModel ifTrue:[^ ' [instvar: ',nm,']']
2888
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2004
    ].
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2005
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2006
    ^ ''
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2007
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2008
    "Created: / 27-04-2012 / 14:22:09 / cg"
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2009
!
Claus Gittinger <cg@exept.de>
parents: 2779
diff changeset
  2010
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2011
selectFocusView
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2012
    |rootView focusView|
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2013
87bb1815460b initial checkin
ca
parents:
diff changeset
  2014
    rootView := model rootView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2015
87bb1815460b initial checkin
ca
parents:
diff changeset
  2016
    (rootView notNil and:[rootView shown]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2017
	focusView := rootView windowGroup focusView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2018
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2019
    focusView isNil ifTrue:[^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2020
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2021
    self selectView:focusView
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2022
!
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2023
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2024
selectView:aView
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2025
    |currentItem viewItem|
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2026
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2027
    currentItem := model selectedItem.
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2028
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2029
    (currentItem notNil and:[currentItem widget == aView]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2030
	^ self
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2031
    ].
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2032
    viewItem := model listOfItems recursiveDetect:[:el| el widget == aView ].
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2033
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2034
    viewItem notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2035
	model selectItem:viewItem.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2036
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2037
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2038
87bb1815460b initial checkin
ca
parents:
diff changeset
  2039
setRootItem:aRootItemOrNil
87bb1815460b initial checkin
ca
parents:
diff changeset
  2040
    |theProcess|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2041
87bb1815460b initial checkin
ca
parents:
diff changeset
  2042
    aRootItemOrNil isNil ifTrue:[
3658
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2043
        process := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2044
    ] ifFalse:[
3658
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2045
        "/ expand tree to level 3
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2046
        aRootItemOrNil do:[:aRootChild|
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2047
            aRootChild do:[:aSubChild| aSubChild expand ].
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2048
            aRootChild expand.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2049
        ].
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2050
        aRootItemOrNil expand.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2051
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2052
        process isNil ifTrue:[
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2053
            "/ the focusFollower process terminates itself, when process is not longer theProcess
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2054
            theProcess := process :=
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2055
                Process
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2056
                    for:[
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2057
                        |update testModeChannel|
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2058
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2059
                        update := false.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2060
                        testModeChannel := model testModeChannel.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2061
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2062
                        [process == theProcess] whileTrue:[
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2063
                            Delay waitForSeconds:0.5.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2064
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2065
                            (treeView notNil and:[process == theProcess and:[treeView shown]]) ifTrue:[
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2066
                                (testModeChannel value == true and:[followFocusChannel value == true]) ifTrue:[
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2067
                                    self selectFocusView.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2068
                                ].
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2069
                                update ifTrue:[
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2070
                                    self updateShownStatus.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2071
                                ].
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2072
                                update := update not.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2073
                            ].
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2074
                        ].
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2075
                    ]
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2076
                    priority:(Processor userSchedulingPriority).
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2077
            theProcess name:'ViewTreeInspector - Focus Follower'.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2078
            theProcess resume.
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2079
        ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2080
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2081
    model rootItem:aRootItemOrNil.
3034
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2082
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2083
    "Modified: / 25-07-2013 / 12:03:44 / cg"
3658
18137fdc0f76 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3628
diff changeset
  2084
    "Modified (format): / 30-04-2019 / 22:32:23 / Claus Gittinger"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2085
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2086
87bb1815460b initial checkin
ca
parents:
diff changeset
  2087
updateShownStatus
87bb1815460b initial checkin
ca
parents:
diff changeset
  2088
    |rootItem min max visState listIdx visY0 visY1 height damage|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2089
87bb1815460b initial checkin
ca
parents:
diff changeset
  2090
    rootItem := model rootItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2091
    (rootItem notNil and:[rootItem widget shown]) ifFalse:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2092
87bb1815460b initial checkin
ca
parents:
diff changeset
  2093
    max := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2094
    min := 9999999.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2095
87bb1815460b initial checkin
ca
parents:
diff changeset
  2096
    rootItem recursiveEachVisibleItemDo:[:anItem|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2097
	anItem widget notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2098
	    visState := (anItem widget shown).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2099
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2100
	    visState ~~ anItem isDrawnShown ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2101
		anItem isDrawnShown:visState.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2102
		listIdx := treeView identityIndexOf:anItem.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2103
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2104
		listIdx > 0 ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2105
		    max := max max:listIdx.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2106
		    min := min min:listIdx.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2107
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2108
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2109
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2110
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2111
    max < min ifTrue:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2112
    max := max + 1.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2113
87bb1815460b initial checkin
ca
parents:
diff changeset
  2114
    visY0  := (treeView yVisibleOfLine:min) max:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2115
    visY1  := (treeView yVisibleOfLine:max) min:(treeView height).
87bb1815460b initial checkin
ca
parents:
diff changeset
  2116
    height := visY1 - visY0.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2117
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2118
    height > 2 ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2119
	treeView shown ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2120
	    damage := Rectangle left:0 top:visY0 width:(treeView width) height:height.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2121
	    treeView invalidateDeviceRectangle:damage repairNow:false.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2122
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2123
    ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2124
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2125
    "Modified: / 16-08-2017 / 12:29:15 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2126
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2127
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2128
!ViewTreeInspectorApplication methodsFor:'selection'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2129
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2130
selectedMenuItem
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2131
    "answer the selected menuItem or nil"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2132
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2133
    |item|
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2134
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2135
    item := model selectedItem.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2136
    item notNil ifTrue:[ ^ item menuItem ].
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2137
    ^ nil
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2138
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2139
    "Created: / 16-08-2017 / 13:50:35 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2140
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2141
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2142
selectedView
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2143
    "answer the selected view or nil"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2144
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2145
    |item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2146
87bb1815460b initial checkin
ca
parents:
diff changeset
  2147
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2148
    item notNil ifTrue:[ ^ item widget ].
3457
3f3ea99e8af5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3456
diff changeset
  2149
    ^ nil
3f3ea99e8af5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3456
diff changeset
  2150
3f3ea99e8af5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3456
diff changeset
  2151
    "Modified (format): / 16-08-2017 / 13:57:30 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2152
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2153
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2154
!ViewTreeInspectorApplication methodsFor:'testing'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2155
87bb1815460b initial checkin
ca
parents:
diff changeset
  2156
resolveApplicationClassFor:aTreeItem
87bb1815460b initial checkin
ca
parents:
diff changeset
  2157
    aTreeItem isApplicationClass ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  2158
       ^ aTreeItem applicationClass
87bb1815460b initial checkin
ca
parents:
diff changeset
  2159
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2160
    ^ nil
87bb1815460b initial checkin
ca
parents:
diff changeset
  2161
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2162
87bb1815460b initial checkin
ca
parents:
diff changeset
  2163
selectedComponentHasChildren
87bb1815460b initial checkin
ca
parents:
diff changeset
  2164
    |item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2165
87bb1815460b initial checkin
ca
parents:
diff changeset
  2166
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2167
    ^ (item notNil and:[item hasChildren])
87bb1815460b initial checkin
ca
parents:
diff changeset
  2168
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2169
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2170
!ViewTreeInspectorApplication methodsFor:'user operations'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2171
87bb1815460b initial checkin
ca
parents:
diff changeset
  2172
doBrowse:what
87bb1815460b initial checkin
ca
parents:
diff changeset
  2173
    "open browser on:
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2174
        #view           browse class
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2175
        #model          browse model class
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2176
        #application    browse application class
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2177
        #masterApplication    browse master application class
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2178
        #controller     browse controller class
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2179
    "
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2180
    |inst|
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2181
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2182
    (inst := self objectToInspectOrBrowse:what) isNil ifTrue:[^ self].
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2183
    inst class browserClass openInClass:(inst class) selector:nil
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  2184
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  2185
    "Modified: / 28-08-2013 / 23:57:42 / cg"
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2186
    "Modified (comment): / 30-10-2018 / 16:21:25 / Claus Gittinger"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2187
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2188
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2189
doBrowseWindowSpecMethod
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2190
    |mthd|
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2191
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2192
    mthd := self windowSpecMethodOfSelection.
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2193
    NewSystemBrowser openInClass:mthd mclass selector:mthd selector
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2194
!
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2195
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2196
doCatchEvents
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2197
    model catchEvents:true.
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2198
    isCatchingEventsChannel value:true.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2199
"/    ((builder componentAt:'toolbarMenu') itemAt:#doUncatchEvents)
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2200
"/        enabled:true;
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2201
"/        label:(self class releaseViewIcon);
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2202
"/        activeHelpKey:#doUncatchEvents.
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2203
!
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2204
3171
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2205
doDebugProcess
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2206
    "open debugger on the window process"
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2207
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2208
    |view|
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2209
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2210
    view := self selectedView.
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2211
    view isNil ifTrue:[^ nil].
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2212
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2213
    Debugger openOn:view windowGroup process
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2214
!
16cec0f0e3b4 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3169
diff changeset
  2215
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2216
doDestroy
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2217
    "destroy the current selected view"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2218
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2219
    |item parent|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2220
87bb1815460b initial checkin
ca
parents:
diff changeset
  2221
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2222
    item isNil ifTrue:[ ^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2223
87bb1815460b initial checkin
ca
parents:
diff changeset
  2224
    parent := item parent.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2225
87bb1815460b initial checkin
ca
parents:
diff changeset
  2226
    parent isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2227
	"/ the root
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2228
	model withSelectionHiddenDo:[item deleteAll].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2229
      ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
  2230
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2231
87bb1815460b initial checkin
ca
parents:
diff changeset
  2232
    model withSelectionHiddenDo:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2233
	|idx nsel|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2234
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2235
	idx := parent identityIndexOf:item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2236
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2237
	idx == parent size ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2238
	    nsel := parent at:(idx - 1) ifAbsent:parent
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2239
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2240
	    nsel := parent at:(idx + 1)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2241
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2242
	model setValue:nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2243
	item delete.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2244
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2245
	parent isLayoutContainer ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2246
	    parent widget sizeChanged:nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2247
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2248
	model value:nsel.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2249
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2250
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2251
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2252
doEditLanguageResources
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2253
    "open language editor on the application's resources:
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2254
    "
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2255
    |inst|
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2256
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2257
    (inst := self objectToInspectOrBrowse:#application) isNil ifTrue:[^ self].
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2258
    Tools::InternationalLanguageTranslationEditor 
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2259
        openOnPackage:inst class package
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2260
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2261
    "Created: / 30-10-2018 / 16:26:17 / Claus Gittinger"
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2262
!
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2263
3174
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2264
doEditWindowSpec
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2265
    |mthd|
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2266
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2267
    mthd := self windowSpecMethodOfSelection.
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2268
    UIPainter openOnClass:mthd mclass andSelector:mthd selector
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2269
!
cd45c49a0d63 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3171
diff changeset
  2270
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2271
doFlash
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2272
    "flash the selected view"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2273
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2274
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2275
87bb1815460b initial checkin
ca
parents:
diff changeset
  2276
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2277
    view isNil ifTrue:[ ^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2278
87bb1815460b initial checkin
ca
parents:
diff changeset
  2279
    view shown ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2280
	model withSelectionHiddenDo:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2281
	    view perform:#flash ifNotUnderstood:nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2282
	].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2283
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2284
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2285
87bb1815460b initial checkin
ca
parents:
diff changeset
  2286
doInspect:what
87bb1815460b initial checkin
ca
parents:
diff changeset
  2287
    "open inspector on:
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2288
	#view           inspect class
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2289
	#group          inspect windowGroup
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2290
	#model          inspect model
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2291
	#application    inspect application
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2292
	#controller     inspect controller
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2293
	#process        inspect application's process
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2294
    "
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2295
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2296
    |inst|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2297
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2298
    (inst := self objectToInspectOrBrowse:what) isNil ifTrue:[^ self].
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2299
    inst inspect.
3049
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  2300
292d06e8b7ae class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3040
diff changeset
  2301
    "Modified: / 28-08-2013 / 23:58:27 / cg"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2302
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2303
3034
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2304
doOpenProcessMonitor
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2305
    (ProcessMonitorV2 ? ProcessMonitor) open
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2306
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2307
    "Created: / 25-07-2013 / 12:34:23 / cg"
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2308
!
862cd32dc02f class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3017
diff changeset
  2309
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2310
doPickView
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2311
    "pick a window's topView"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2312
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2313
    |screen clickedView topWindow cursor|
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2314
87bb1815460b initial checkin
ca
parents:
diff changeset
  2315
    self doUnpick.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2316
2759
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
  2317
    cursor := Cursor fromImage:(self class crossHairIcon).
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
  2318
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
  2319
    screen := Screen current.
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2320
    clickedView := screen viewFromPoint:(screen pointFromUserShowing:cursor).
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2321
    clickedView isNil ifTrue:[^ self].
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2322
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2323
    topWindow := clickedView topView.
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2324
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2325
    (    topWindow == Screen current rootView
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  2326
     or:[topWindow == self window topView]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2327
    ) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2328
	^ self
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2329
    ].
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2330
3070
648aad0e3777 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3049
diff changeset
  2331
    self showWindow:clickedView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2332
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2333
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2334
doRedraw
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2335
    "redraw the app"
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2336
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2337
    |rootView|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2338
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2339
    (rootView := model rootView) notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2340
	rootView withAllSubViewsDo:[:v | v "redraw; "invalidate].
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2341
    ]
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2342
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2343
    "Modified: / 16-08-2017 / 12:02:11 / cg"
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2344
!
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2345
3168
894c517d8696 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3167
diff changeset
  2346
doSelectNextElementStartingIn:anItem forWhich:aBlock
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2347
    |startItem firstFound searchNext|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2348
87bb1815460b initial checkin
ca
parents:
diff changeset
  2349
    startItem  := model last.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2350
    searchNext := startItem notNil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2351
    firstFound := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2352
87bb1815460b initial checkin
ca
parents:
diff changeset
  2353
    anItem recursiveDo:[:el|
3525
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2354
        el == startItem ifTrue:[
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2355
            searchNext := false
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2356
        ] ifFalse:[
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2357
            (aBlock value:el) ifTrue:[
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2358
                searchNext ifFalse:[^ model selectItem:el].
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2359
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2360
                firstFound isNil ifTrue:[
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2361
                    firstFound := el
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2362
                ]
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2363
            ]
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2364
        ]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2365
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2366
    firstFound notNil ifTrue:[
3525
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2367
        self beepInEditor.
5df4da794cd2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
  2368
        model selectItem:firstFound
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2369
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2370
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2371
3168
894c517d8696 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3167
diff changeset
  2372
doSelectNextOfApplicationClass:aClass startingIn:anItem
894c517d8696 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3167
diff changeset
  2373
    self doSelectNextElementStartingIn:anItem forWhich:[:el | (self resolveApplicationClassFor:el) == aClass].
894c517d8696 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3167
diff changeset
  2374
!
894c517d8696 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3167
diff changeset
  2375
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2376
doSelectNextOfClass:aClass startingIn:anItem
3168
894c517d8696 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3167
diff changeset
  2377
    self doSelectNextElementStartingIn:anItem forWhich:[:el | el widget class == aClass].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2378
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2379
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2380
doUncatchEvents
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2381
    "release the inspected window (no longer catch its events)"
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2382
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2383
    model catchEvents:false.
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2384
    isCatchingEventsChannel value:false.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2385
"/    ((builder componentAt:'toolbarMenu') itemAt:#doUncatchEvents)
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2386
"/        label:(self class releaseViewIcon);
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2387
"/        enabled:false;
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2388
"/        activeHelpKey:#doCatchEvents.
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2389
    self doRedraw
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2390
!
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  2391
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2392
doUnpick
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2393
    "release current picked window and contained subwindows"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  2394
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2395
    self setRootItem:nil.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2396
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2397
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2398
objectToInspectOrBrowse:what
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2399
    "return one of:
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2400
        #view           for inspect/browse view/widget
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2401
        #group          for inspect/browse windowGroup
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2402
        #model          for inspect/browse model
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2403
        #application    for inspect/browse application
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2404
        #masterApplication    for inspect/browse master application
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2405
        #controller     for inspect/browse controller
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2406
        #process        for inspect/browse application's process
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2407
        #widgetClass    for inspect/browse widget's class
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2408
        #menuItem       for inspect/browse menuItem
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2409
    "
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2410
    |view|
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2411
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2412
    what == #menuItem       ifTrue:[
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2413
        ^ model selectedItem menuItem
3457
3f3ea99e8af5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3456
diff changeset
  2414
    ].
3f3ea99e8af5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3456
diff changeset
  2415
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2416
    view := self selectedView.
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2417
    view isNil ifTrue:[^ nil].
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2418
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2419
    what == #group       ifTrue:[ ^ view windowGroup ].
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2420
    what == #model       ifTrue:[ ^ view model ].
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2421
    what == #controller  ifTrue:[ ^ view controller ].
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2422
    what == #process     ifTrue:[ ^ view windowGroup process ].
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2423
    what == #sensor      ifTrue:[ ^ view sensor ].
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2424
    what == #application ifTrue:[ ^ view application ? view topView ].
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2425
    what == #masterApplication ifTrue:[ ^ view application masterApplication ].
3302
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2426
    what == #applicationClass ifTrue:[ ^ view application ? view topView ].
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2427
413a225308d1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3217
diff changeset
  2428
    ^ view
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2429
3457
3f3ea99e8af5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3456
diff changeset
  2430
    "Modified: / 16-08-2017 / 13:57:36 / cg"
3628
dae68c3b50a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3574
diff changeset
  2431
    "Modified: / 30-10-2018 / 16:22:13 / Claus Gittinger"
3167
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2432
!
95025cd0fbce class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3141
diff changeset
  2433
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2434
openDocumentation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2435
    HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#VIEWTREEINSPECTOR'
3014
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2436
!
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2437
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2438
showWindow:aView
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2439
    "show a particular window's topView hierarchy,
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2440
     select the given view"
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2441
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2442
    | topWindow |
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2443
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2444
    topWindow := aView topView.
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2445
3124
1973e28a2c75 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3123
diff changeset
  2446
    self doCatchEvents.
3014
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2447
    self setRootItem:(ViewTreeItem buildViewsFrom:topWindow).
05208490cea6 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3000
diff changeset
  2448
    self selectView:aView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2449
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2450
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2451
!ViewTreeInspectorApplication::MenuDesc class methodsFor:'building'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2452
87bb1815460b initial checkin
ca
parents:
diff changeset
  2453
buildFromList:aList onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  2454
    |tabSpec menu w menuPanel|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2455
87bb1815460b initial checkin
ca
parents:
diff changeset
  2456
    w := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2457
    aList do:[:el| w := w max:(el widthOn:aMenu) ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2458
87bb1815460b initial checkin
ca
parents:
diff changeset
  2459
    tabSpec := TabulatorSpecification new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2460
    tabSpec unit:#pixel.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2461
    tabSpec positions:#(0     1.5 ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  2462
    tabSpec align:#(#left #left).
87bb1815460b initial checkin
ca
parents:
diff changeset
  2463
87bb1815460b initial checkin
ca
parents:
diff changeset
  2464
    w := w + 15.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2465
    tabSpec positions:(Array with:0 with:w).
87bb1815460b initial checkin
ca
parents:
diff changeset
  2466
87bb1815460b initial checkin
ca
parents:
diff changeset
  2467
    menu := Menu new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2468
87bb1815460b initial checkin
ca
parents:
diff changeset
  2469
    aList do:[:el|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2470
	menu addItem:(el asMenuItemWithTabulatorSpecification:tabSpec).
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2471
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2472
    menuPanel := MenuPanel menu:menu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2473
    ^ menuPanel
87bb1815460b initial checkin
ca
parents:
diff changeset
  2474
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2475
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2476
!ViewTreeInspectorApplication::MenuDesc class methodsFor:'instance creation'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2477
87bb1815460b initial checkin
ca
parents:
diff changeset
  2478
separator
87bb1815460b initial checkin
ca
parents:
diff changeset
  2479
    ^ self new
87bb1815460b initial checkin
ca
parents:
diff changeset
  2480
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2481
87bb1815460b initial checkin
ca
parents:
diff changeset
  2482
title:aTitle value:aValue
87bb1815460b initial checkin
ca
parents:
diff changeset
  2483
    ^ self title:aTitle value:aValue action:nil
87bb1815460b initial checkin
ca
parents:
diff changeset
  2484
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2485
87bb1815460b initial checkin
ca
parents:
diff changeset
  2486
title:aTitle value:aValue action:anAction
87bb1815460b initial checkin
ca
parents:
diff changeset
  2487
    ^ self new title:aTitle value:aValue action:anAction
87bb1815460b initial checkin
ca
parents:
diff changeset
  2488
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2489
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2490
!ViewTreeInspectorApplication::MenuDesc methodsFor:'accessing'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2491
87bb1815460b initial checkin
ca
parents:
diff changeset
  2492
title
87bb1815460b initial checkin
ca
parents:
diff changeset
  2493
    ^ title
87bb1815460b initial checkin
ca
parents:
diff changeset
  2494
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2495
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2496
!ViewTreeInspectorApplication::MenuDesc methodsFor:'building'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2497
87bb1815460b initial checkin
ca
parents:
diff changeset
  2498
asMenuItemWithTabulatorSpecification:aTabSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
  2499
    |array|
87bb1815460b initial checkin
ca
parents:
diff changeset
  2500
87bb1815460b initial checkin
ca
parents:
diff changeset
  2501
    title isNil ifTrue:[ ^ MenuItem label:value ].     "/ separator
87bb1815460b initial checkin
ca
parents:
diff changeset
  2502
87bb1815460b initial checkin
ca
parents:
diff changeset
  2503
    array := Array with:(title, ':') with:'------'.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2504
87bb1815460b initial checkin
ca
parents:
diff changeset
  2505
    value notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2506
	array at:2 put:(value printString, ' ')
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2507
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2508
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2509
   ^ MenuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2510
	label:(MultiColListEntry fromStrings:array tabulatorSpecification:aTabSpec)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2511
	value:action
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2512
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2513
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2514
!ViewTreeInspectorApplication::MenuDesc methodsFor:'instance creation'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2515
87bb1815460b initial checkin
ca
parents:
diff changeset
  2516
title:aTitle value:aValue action:anAction
87bb1815460b initial checkin
ca
parents:
diff changeset
  2517
    "test for separator
87bb1815460b initial checkin
ca
parents:
diff changeset
  2518
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
  2519
    title  := aTitle withoutSeparators.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2520
    action := anAction.
87bb1815460b initial checkin
ca
parents:
diff changeset
  2521
87bb1815460b initial checkin
ca
parents:
diff changeset
  2522
    aValue notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2523
	value := aValue printString.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2525
	value size > 70 ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2526
	    value := value copyFrom:1 to:70.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2527
	    value := value, '...'
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2528
	]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2529
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  2530
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2531
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2532
!ViewTreeInspectorApplication::MenuDesc methodsFor:'queries'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2533
87bb1815460b initial checkin
ca
parents:
diff changeset
  2534
isSeparator
87bb1815460b initial checkin
ca
parents:
diff changeset
  2535
    ^ title isNil
87bb1815460b initial checkin
ca
parents:
diff changeset
  2536
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  2537
87bb1815460b initial checkin
ca
parents:
diff changeset
  2538
widthOn:aGC
87bb1815460b initial checkin
ca
parents:
diff changeset
  2539
    title isNil ifTrue:[^ 5].  "/ separator
2758
c61fe917957a comment/format in:8 methods
Claus Gittinger <cg@exept.de>
parents: 2757
diff changeset
  2540
    ^ title widthOn:aGC
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2541
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2542
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2543
!ViewTreeInspectorApplication::ViewTreeItem class methodsFor:'building'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2544
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2545
buildMenuItemsFrom:aMenuItem
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2546
    "build the items starting from a source menu item;
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2547
     returns the anchor.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2548
    "
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2549
    |item subMenu subItems|
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2550
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2551
    aMenuItem isNil ifTrue:[^ nil].
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2552
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2553
    item     := self forMenuItem:aMenuItem.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2554
    subItems := OrderedCollection new.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2555
    (subMenu := aMenuItem submenuOrNil) notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2556
	subMenu items do:[:eachMenuItem |
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2557
	    subItems add:(self buildMenuItemsFrom:eachMenuItem)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2558
	].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2559
    ].
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2560
    item children:subItems.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2561
    ^ item
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2562
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2563
    "Created: / 16-08-2017 / 12:23:02 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2564
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2565
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2566
buildViewsFrom:aView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2567
    "build the items starting from a source view;
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2568
     returns the anchor.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2569
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2570
    |item subViews subItems|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2571
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2572
    aView isNil ifTrue:[^ nil].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2573
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2574
    item     := self forView:aView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2575
    subViews := aView subViews.
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2576
    subItems := OrderedCollection new.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2577
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2578
    subViews notEmptyOrNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2579
	subViews do:[:aSubView|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2580
	    subItems add:(self buildViewsFrom:aSubView).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2581
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2582
    ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2583
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2584
    (aView isKindOf:MenuPanel) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2585
	(aView items ? #()) do:[:eachMenuItem |
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2586
	    subItems add:(self buildMenuItemsFrom:eachMenuItem)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2587
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2588
    ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2589
    item children:subItems.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2590
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2591
    ^ item
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2592
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2593
    "Modified: / 16-08-2017 / 12:43:35 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2594
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2595
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2596
!ViewTreeInspectorApplication::ViewTreeItem class methodsFor:'documentation'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2597
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2598
documentation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2599
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2600
    ViewTreeItems represants a pickable object within a ViewTreeModel.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2601
    The class is used to build up the hierarchical tree.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2602
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2603
    [Instance variables:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2604
	widget        <View>            the widget represented by the item
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2605
	spec          <UISpecification> the UISpecification or nil
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2606
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2607
    [Class variables:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2608
	HandleExtent  <Point>           keeps the extent of a handle
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2609
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2610
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2611
    [author:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2612
	Claus Atzkern
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2613
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2614
    [see also:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2615
	HierarchicalItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2616
	ViewTreeModel
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2617
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2618
!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  2619
87bb1815460b initial checkin
ca
parents:
diff changeset
  2620
version
87bb1815460b initial checkin
ca
parents:
diff changeset
  2621
    ^ '$Header$'
87bb1815460b initial checkin
ca
parents:
diff changeset
  2622
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  2623
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2624
!ViewTreeInspectorApplication::ViewTreeItem class methodsFor:'initialization'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2625
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2626
initialize
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2627
    "set the extent of the Handle
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2628
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2629
    HandleExtent := 6@6.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2630
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2631
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2632
!ViewTreeInspectorApplication::ViewTreeItem class methodsFor:'instance creation'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2633
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2634
forMenuItem:aMenuItem
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2635
    |item|
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2636
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2637
    item := self basicNew initialize.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2638
    item forMenuItem:aMenuItem.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2639
    ^ item
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2640
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2641
    "Created: / 16-08-2017 / 12:07:55 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2642
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2643
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2644
forView:aView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2645
    |item|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2646
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2647
    item := self basicNew initialize.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2648
    item forView:aView.
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2649
    ^ item
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2650
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2651
    "Modified (format): / 16-08-2017 / 12:07:40 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2652
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2653
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2654
new
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2655
    self error:'not allowed'.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2656
  ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2657
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2658
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2659
on:aView withSpec:aSpec
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2660
    |item|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2661
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2662
    item := self basicNew initialize.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2663
    item on:aView withSpec:aSpec.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2664
  ^ item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2665
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2666
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2667
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'accessing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2668
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2669
applicationClass
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2670
    |appl|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2671
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2672
    widget notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2673
	appl := widget application.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2674
	appl notNil ifTrue:[^ appl class ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2675
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2676
    ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2677
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2678
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2679
isDrawnShown
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2680
    "returns true if the last display operations was done during the widget was shown
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2681
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2682
    ^ isDrawnShown
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2683
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2684
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2685
isDrawnShown:aBoolean
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2686
    isDrawnShown := aBoolean.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2687
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2688
3551
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  2689
isMenuItem
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  2690
    ^ menuItem notNil
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  2691
!
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  2692
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2693
menuItem
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2694
    ^ menuItem
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2695
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2696
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2697
parent:aParent
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2698
    super parent:aParent.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2699
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2700
    "Created: / 16-08-2017 / 12:40:26 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2701
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2702
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2703
rootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2704
    "returns the widget assigned to the root or nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2705
    "
3216
41118d54b47c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
  2706
    parent isNil ifTrue:[^ nil].
41118d54b47c class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
  2707
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2708
    ^ parent rootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2709
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2710
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2711
specClass
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2712
    "returns the spec-class assigned to the item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2713
    "
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2714
    widget isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2715
	^ MenuPanelSpec
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2716
    ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2717
    ^ widget specClass
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2718
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2719
    "Modified (format): / 16-08-2017 / 12:31:36 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2720
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2721
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2722
treeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2723
    "returns the assigned treeModel, an instance of ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2724
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2725
    ^ parent treeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2726
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2727
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2728
widget
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2729
    "returns the widget assigned to the item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2730
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2731
    ^ widget
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2732
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2733
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2734
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'accessing layout'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2735
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2736
boundsRelativeToRoot
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2737
    "returns the bounds relative to the root widget
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2738
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2739
    ^ self originRelativeToRoot extent:(widget extent)
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2740
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2741
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2742
cornerRelativeToRoot
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2743
    "returns the corner relative to the root widget
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2744
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2745
    ^ self originRelativeToRoot + (widget extent)
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2746
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2747
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2748
extent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2749
    "returns the extent of the widget
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2750
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2751
    ^ widget extent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2752
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2753
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2754
layoutType
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2755
    "returns the type of layout assigned to the wiget; nil if the
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2756
     superView cannot resize its sub widgets
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2757
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2758
    |layout specClass superView|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2759
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2760
    (superView := widget superView) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2761
	^ #Extent
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2762
    ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2763
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2764
    specClass := superView specClass.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2765
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2766
    (specClass notNil and:[specClass isLayoutContainer]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2767
	^ specClass canResizeSubComponents ifTrue:[#Extent] ifFalse:[nil]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2768
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2769
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2770
    (layout := widget geometryLayout) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2771
	^ #Extent
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2772
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2773
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2774
    layout isLayout ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2775
	layout isLayoutFrame        ifTrue:[ ^ #LayoutFrame ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2776
	layout isAlignmentOrigin    ifTrue:[ ^ #AlignmentOrigin ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2777
	layout isLayoutOrigin       ifTrue:[ ^ #LayoutOrigin ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2778
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2779
	layout isRectangle          ifTrue:[ ^ #Rectangle ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2780
	layout isPoint              ifTrue:[ ^ #Point ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2781
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2782
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2783
    Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2784
  ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2785
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2786
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2787
originRelativeToRoot
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2788
    "returns the origin relative to the root widget
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2789
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2790
    ^ widget originRelativeTo:(self rootView)
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2791
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2792
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2793
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'accessing optimize'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2794
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2795
children
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2796
    "redefined: optimize
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2797
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2798
    ^ children
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2799
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2800
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2801
hasChildren
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2802
    "not only a query; also builds"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2803
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2804
    |subViews list item subMenu|
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2805
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2806
    children isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2807
	isExpanded := false.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2808
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2809
	list := OrderedCollection new.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2810
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2811
	"/ it's either a widget or a menuItem
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2812
	widget notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2813
	    subViews := widget subViews.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2814
	    subViews notEmptyOrNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2815
		subViews do:[:aSubView|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2816
		    item := self class buildViewsFrom:aSubView.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2817
		    item parent:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2818
		    list add:item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2819
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2820
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2821
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2822
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2823
	menuItem notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2824
	    (subMenu := menuItem submenuOrNil) notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2825
		subMenu items do:[:aSubItem|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2826
		    item := self class buildMenuItemsFrom:aSubItem.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2827
		    item parent:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2828
		    list add:item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2829
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2830
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2831
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2832
	children := list.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2833
    ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2834
    ^ children notEmpty
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2835
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2836
    "Modified: / 16-08-2017 / 12:27:23 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2837
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2838
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2839
size
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2840
    "redefined: returns list of children
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2841
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2842
    ^ children size
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2843
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2844
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2845
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'displaying'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2846
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2847
additionalLabelForItem:anItem
3017
d971763e5d03 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3014
diff changeset
  2848
    "answer an additional label for an Item"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2849
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2850
    parent notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2851
	^ parent additionalLabelForItem:anItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2852
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2853
    ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2854
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2855
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2856
displayIcon:anIcon atX:x y:y on:aGC
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2857
    |x0 y0 y1 w|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2858
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2859
    super displayIcon:anIcon atX:x y:y on:aGC.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2860
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2861
    self exists ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2862
	aGC paint:(Color red).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2863
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2864
	y0 := y + 1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2865
	y1 := y + anIcon height - 2.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2866
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2867
	x0 := x - 1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2868
	w  := anIcon width.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2869
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2870
	2 timesRepeat:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2871
	    aGC displayLineFromX:x0 y:y0 toX:(x0 + w) y:y1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2872
	    aGC displayLineFromX:x0 y:y1 toX:(x0 + w) y:y0.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2873
	    x0 := x0 + 1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2874
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2875
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2876
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2877
3184
7ff3f8fb0b79 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3183
diff changeset
  2878
displayOn:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2879
    |labelHeight additionalName label isValidAndShown|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2880
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2881
    label := self label.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2882
    label isEmptyOrNil ifTrue:[^ self].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2883
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2884
    widget isNil ifTrue:[
3674
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2885
        isValidAndShown := true.
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2886
    ] ifFalse:[
3674
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2887
        widget id isNil ifTrue:[
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2888
            isDrawnShown := false.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2889
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2890
            self exists ifFalse:[
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2891
                xOffsetAdditionalName := nil.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2892
            ].
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2893
            isValidAndShown := false.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2894
        ] ifFalse:[
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2895
            isValidAndShown := widget shown.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2896
        ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2897
    ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2898
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2899
    isValidAndShown ifFalse:[
3674
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2900
        label := Text string:label emphasis:#italic.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2901
        label withColor:Color gray.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2902
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2903
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2904
    labelHeight := self heightOn:aGC.
3184
7ff3f8fb0b79 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3183
diff changeset
  2905
    self displayLabel:label h:labelHeight on:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2906
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2907
    xOffsetAdditionalName notNil ifTrue:[
3674
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2908
        additionalName := self additionalLabelForItem:self.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2909
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2910
        additionalName notNil ifTrue:[
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2911
            self displayLabel:additionalName
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2912
                            h:labelHeight on:aGC
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2913
                            x:(x + xOffsetAdditionalName) y:y
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2914
                            h:h.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2915
        ] ifFalse:[
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2916
            xOffsetAdditionalName := nil.
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2917
        ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2918
    ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2919
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2920
    "Modified (format): / 16-08-2017 / 12:57:39 / cg"
3674
693d13243c07 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3667
diff changeset
  2921
    "Modified: / 07-06-2019 / 22:14:30 / Claus Gittinger"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2922
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2923
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2924
recursiveAdditionalNameBehaviourChanged
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2925
    width := xOffsetAdditionalName := nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2926
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2927
    children notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2928
	children do:[:each| each recursiveAdditionalNameBehaviourChanged ]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2929
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2930
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2931
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2932
widthOn:aGC
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2933
    "return the width of the receiver, if it is to be displayed on aGC
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2934
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2935
    |additionalName|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2936
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2937
    width isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2938
	width := self widthOf:(self label) on:aGC.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2939
	width := width + 2.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2940
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2941
	additionalName := self additionalLabelForItem:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2942
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2943
	additionalName notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2944
	    xOffsetAdditionalName := width + 10.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2945
	    width := xOffsetAdditionalName + (self widthOf:additionalName on:aGC).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2946
	    width := width + 2.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2947
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2948
	    xOffsetAdditionalName := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2949
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2950
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2951
    ^ width
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2952
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2953
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2954
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'enumerating'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2955
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2956
handlesDo:aTwoArgAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2957
    "evaluate the two arg block on each handle; the arguments to the block is
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2958
     the rectangle relative to the rootView and the handle type which is
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2959
     set to nil if not resizeable.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2960
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2961
     TYPES:     type    position( X - Y )
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2962
		-------------------------
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2963
		#LT     Left   - Top
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2964
		#LC     Left   - Center
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2965
		#LB     Left   - Bottom
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2966
		#CT     Center - Top
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2967
		#CB     Center - Bottom
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2968
		#RT     Right  - Top
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2969
		#RC     Right  - Center
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2970
		#RB     Right  - Bottom
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2971
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  2972
		nil     ** handle not pickable **
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2973
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2974
    |type relOrg relCrn maxExt rootView w h
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2975
     xL    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2976
     xC    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2977
     xR    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2978
     yT    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2979
     yC    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2980
     yB    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2981
    |
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2982
    rootView := self rootView.
3217
af9fd0c681e0 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
  2983
    rootView isNil ifTrue:[^ self ].
af9fd0c681e0 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3216
diff changeset
  2984
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2985
    widget isNil ifTrue:[^ self].
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  2986
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2987
    relOrg   := widget originRelativeTo:rootView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2988
    relOrg isNil ifTrue:[ ^ self ].    "/ widget destroyed
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2989
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2990
    relOrg   := relOrg - (HandleExtent // 2).
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2991
    relCrn   := relOrg + widget extent.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2992
    maxExt   := rootView extent - HandleExtent.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2993
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2994
    xL := relOrg x max:0.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2995
    xR := relCrn x min:(maxExt x).
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2996
    xC := xR + xL // 2.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2997
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2998
    yT := relOrg y max:0.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  2999
    yB := relCrn y min:(maxExt y).
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3000
    yC := yB + yT // 2.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3001
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3002
    type := self layoutType.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3003
    w   := HandleExtent x.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3004
    h   := HandleExtent y.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3005
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3006
    (type == #LayoutFrame or:[type == #Rectangle]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3007
	aTwoArgAction value:(Rectangle left:xL top:yT width:w height:h) value:#LT.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3008
	aTwoArgAction value:(Rectangle left:xL top:yC width:w height:h) value:#LC.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3009
	aTwoArgAction value:(Rectangle left:xL top:yB width:w height:h) value:#LB.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3010
	aTwoArgAction value:(Rectangle left:xC top:yT width:w height:h) value:#CT.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3011
	aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3012
	aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:#RT.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3013
	aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3014
	aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3015
      ^ self
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3016
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3017
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3018
    aTwoArgAction value:(Rectangle left:xL top:yT width:w height:h) value:nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3019
    aTwoArgAction value:(Rectangle left:xL top:yB width:w height:h) value:nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3020
    aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3021
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3022
    type == #Extent ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3023
	aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3024
	aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3025
	aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3026
      ^ self
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3027
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3028
    aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:nil.
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3029
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3030
    "Modified: / 16-08-2017 / 13:04:27 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3031
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3032
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3033
recursiveEachVisibleItemDo:anOneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3034
    "recursive evaluate the block on each child which is visible
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3035
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3036
    (isExpanded and:[children size > 0]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3037
	children do:[:aChild|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3038
	    anOneArgBlock value:aChild.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3039
	    aChild recursiveEachVisibleItemDo:anOneArgBlock.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3040
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3041
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3042
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3043
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3044
subViewsDo:aOneArgBlock
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3045
    "evaluate aBlock for all subviews other than InputView's
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3046
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3047
    |subViews|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3048
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3049
    subViews := widget subViews.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3050
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3051
    subViews notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3052
	subViews do:aOneArgBlock
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3053
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3054
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3055
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3056
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'initialization'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3057
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3058
forMenuItem:aMenuItem
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3059
    menuItem := aMenuItem.
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3060
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3061
    "Created: / 16-08-2017 / 12:08:50 / cg"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3062
!
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3063
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3064
forView:aView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3065
    widget := aView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3066
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3067
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3068
initialize
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3069
    "setup default attributes
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3070
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3071
    super initialize.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3072
    isDrawnShown := false.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3073
    isExpanded   := false.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3074
    children     := OrderedCollection new.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3075
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3076
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3077
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'operations delete'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3078
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3079
delete
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3080
    "delete self and all contained items; the assigned views are destroyed
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3081
     in case of rootView, only the children are deleted
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3082
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3083
    parent isHierarchicalItem ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3084
	self criticalDo:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3085
	    parent remove:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3086
	    widget destroy.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3087
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3088
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3089
	self deleteAll
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3090
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3091
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3092
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3093
deleteAll
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3094
    "delete all contained items; the assigned views are destroyed
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3095
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3096
    children size == 0 ifTrue:[^ self].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3097
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3098
    self criticalDo:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3099
	self nonCriticalDo:[:el| el widget destroy ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3100
	self removeAll
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3101
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3102
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3103
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3104
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'operations layout'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3105
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3106
asLayoutFrame
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3107
    "convert the layout of the widget to a LayoutFrame;
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3108
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3109
    |extent layout newLyt lftFrc lftOff topFrc topOff|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3110
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3111
    layout := widget geometryLayout.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3112
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3113
    layout isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3114
	^ widget bounds asLayout
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3115
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3116
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3117
    layout isLayout ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3118
	layout isRectangle ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3119
	    ^ LayoutFrame leftOffset:(layout left) rightOffset:(layout right)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3120
			   topOffset:(layout top) bottomOffset:(layout bottom)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3121
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3122
	layout isPoint ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3123
	    extent := widget extent.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3124
	  ^ LayoutFrame leftOffset:(layout x)  rightOffset:(layout x + extent x)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3125
			 topOffset:(layout y) bottomOffset:(layout y + extent y)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3126
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3127
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3128
	Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3129
      ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3130
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3131
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3132
    layout isLayoutFrame ifTrue:[ ^ layout copy ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3133
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3134
    lftFrc := layout leftFraction.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3135
    lftOff := layout leftOffset.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3136
    topFrc := layout topFraction.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3137
    topOff := layout topOffset.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3138
    extent := widget extent.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3139
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3140
    newLyt := LayoutFrame leftFraction:lftFrc offset:lftOff
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3141
			 rightFraction:lftFrc offset:(lftOff + extent x)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3142
			   topFraction:topFrc offset:topOff
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3143
			bottomFraction:topFrc offset:(topOff + extent y).
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3144
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3145
    (      layout isAlignmentOrigin
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3146
     and:[(layout leftAlignmentFraction ~= 0 or:[layout topAlignmentFraction ~= 0])]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3147
    ) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3148
	|svRc prBd dlta|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3149
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3150
	svRc := widget superView viewRectangle.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3151
	prBd := widget preferredBounds.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3152
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3153
	dlta := (  ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3154
		 - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3155
		) rounded.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3156
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3157
	newLyt   leftOffset:(lftOff + dlta x).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3158
	newLyt  rightOffset:(lftOff + extent x + dlta x).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3159
	newLyt    topOffset:(topOff + dlta y).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3160
	newLyt bottomOffset:(topOff + extent y + dlta y).
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3161
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3162
    ^ newLyt
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3163
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3164
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3165
moveLeft:l top:t
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3166
    "move the widget n pixele left and right
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3167
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3168
    |layout|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3169
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3170
    self isMoveable ifFalse:[ ^ self ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3171
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3172
    (layout := widget geometryLayout) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3173
	"Extent"
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3174
	widget origin:(widget origin + (l@t)).
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3175
      ^ self
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3176
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3177
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3178
    layout := layout copy.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3179
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3180
    layout isLayout ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3181
	layout leftOffset:(layout leftOffset + l)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3182
		topOffset:(layout topOffset  + t).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3183
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3184
	layout isLayoutFrame ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3185
	    layout  rightOffset:(layout rightOffset  + l).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3186
	    layout bottomOffset:(layout bottomOffset + t).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3187
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3188
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3189
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3190
	layout isRectangle ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3191
	    layout setLeft:(layout left + l).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3192
	    layout  setTop:(layout top  + t).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3193
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3194
	    layout isPoint ifFalse:[^ self].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3195
	    layout x:(layout x + l) y:(layout y + t).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3196
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3197
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3198
    widget geometryLayout:layout.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3199
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3200
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3201
resizeLeft:l top:t right:r bottom:b
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3202
    "resize the widget measured in pixels
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3203
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3204
    |layout|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3205
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3206
    self isResizeable ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3207
	^ self
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3208
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3209
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3210
    (layout := widget geometryLayout) isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3211
	"Extent"
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3212
	(r == l and:[b == t]) ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3213
	    widget extent:(widget computeExtent + ((r-l) @ (b-t))).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3214
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3215
	^ self
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3216
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3217
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3218
    layout isLayout ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3219
	layout := layout copy.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3220
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3221
	layout leftOffset:(layout leftOffset + l)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3222
		topOffset:(layout topOffset  + t).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3223
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3224
	layout isLayoutFrame ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3225
	    layout bottomOffset:(layout bottomOffset + b).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3226
	    layout  rightOffset:(layout rightOffset  + r).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3227
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3228
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3229
	layout isRectangle ifFalse:[^ self].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3230
	layout := layout copy.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3231
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3232
	layout left:(layout left   + l)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3233
	      right:(layout right  + r)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3234
		top:(layout top    + t)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3235
	     bottom:(layout bottom + b).
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3236
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3237
    widget geometryLayout:layout.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3238
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3239
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3240
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'operations update'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3241
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3242
updateChildren
3209
c13a1f4f4ccb class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3186
diff changeset
  3243
    |queue|
c13a1f4f4ccb class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3186
diff changeset
  3244
3532
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3245
    queue := OrderedCollection with:self.
3209
c13a1f4f4ccb class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3186
diff changeset
  3246
c13a1f4f4ccb class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3186
diff changeset
  3247
    self criticalDo:[
3532
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3248
        [queue notEmpty] whileTrue:[
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3249
            |toRemove  elProcessed|
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3250
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3251
            elProcessed := queue removeFirst.
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3252
            toRemove := nil.
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3253
            elProcessed nonCriticalDo:[:el|
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3254
                el exists ifTrue:[
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3255
                    queue add:el.
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3256
                ] ifFalse:[
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3257
                    toRemove isNil ifTrue:[toRemove := OrderedCollection new].
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3258
                    toRemove add:el.
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3259
                ]
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3260
            ].
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3261
            toRemove notNil ifTrue:[
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3262
                toRemove do:[:el| elProcessed remove:el ].
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3263
            ].
12b7b904b5e1 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
  3264
        ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3265
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3266
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3267
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3268
updateFromChildren:mergedList
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3269
    "update my children against the list of items derived from
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3270
     the merged list.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3271
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3272
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3273
    mergedList size == 0 ifTrue:[ ^ self removeAll ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3274
    children   size == 0 ifTrue:[ ^ self addAll:mergedList ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3275
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3276
    self criticalDo:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3277
	self nonCriticalDo:[:el| |wdg|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3278
	    wdg := el widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3279
	    mergedList detect:[:e2| e2 widget == wdg ] ifNone:[ self remove:el ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3280
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3281
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3282
	mergedList keysAndValuesDo:[:i :el| |wdg e2|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3283
	    wdg := el widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3284
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3285
	    e2  := self at:i ifAbsent:nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3286
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3287
	    (e2 isNil or:[e2 widget ~~ wdg]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3288
		self add:el beforeIndex:i
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3289
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3290
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3291
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3292
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3293
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3294
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'printing & storing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3295
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3296
icon
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3297
    "get the icon used for presentation"
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3298
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3299
    |specClass model|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3300
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3301
    menuItem notNil ifTrue:[
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3302
        menuItem isSeparator ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3303
            (parent widget perform:#isVerticalLayout ifNotUnderstood:[^ DividerSpec icon]) ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3304
                ^ DividerSpec horizontalIcon.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3305
            ].    
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3306
            ^ DividerSpec verticalIcon.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3307
        ].    
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3308
        menuItem label isImage ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3309
            ^ menuItem label magnifiedTo:20@20.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3310
        ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3311
    ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3312
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3313
    specClass := self specClass.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3314
    specClass isNil ifTrue:[^ nil].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3315
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3316
    model := self treeModel.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3317
    model notNil ifTrue:[
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3318
        ^ model iconAt:specClass ifNonePut:[specClass icon]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3319
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3320
    ^ specClass icon
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3321
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3322
    "Modified: / 16-08-2017 / 13:00:35 / cg"
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  3323
    "Modified: / 27-05-2019 / 13:27:28 / Claus Gittinger"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3324
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3325
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3326
label
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3327
    "get the label used for presentation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3328
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3329
    ^ self string
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3330
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3331
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3332
printOn:aStream
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3333
    "append a a printed representation of the item to aStream
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3334
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3335
    aStream nextPutAll:(self string)
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3336
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3337
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3338
string
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3339
    "get the string
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3340
    "
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3341
    widget isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3342
	^ menuItem class name
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3343
    ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3344
    ^ widget class name.
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3345
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3346
    "Modified: / 16-08-2017 / 13:45:39 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3347
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3348
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3349
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'queries'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3350
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3351
canChangeLayout
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3352
    "returns true if the layout of the widget can be changed and the
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3353
     layout is not organized by its superView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3354
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3355
    ^ self isResizeable
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3356
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3357
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3358
canResizeSubComponents
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3359
    "returns true if the widget can resize its sub components
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3360
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3361
    |specClass|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3362
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3363
    specClass := self specClass.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3364
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3365
    specClass notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3366
	^ specClass canResizeSubComponents
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3367
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3368
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3369
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3370
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3371
exists
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3372
    widget isNil ifTrue:[^ menuItem notNil].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3373
    widget id notNil ifTrue:[^ true ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3374
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3375
    exists ~~ false ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3376
	exists := false.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3377
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3378
	widget superView notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3379
	    (parent isHierarchicalItem and:[parent exists]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3380
		exists := (parent widget subViews includesIdentical:widget).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3381
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3382
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3383
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3384
    ^ exists
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3385
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3386
    "Modified: / 16-08-2017 / 12:47:50 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3387
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3388
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3389
isApplicationClass
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3390
    |cls|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3391
3551
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3392
    widget isNil ifTrue:[^ false].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3393
    cls := widget class.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3394
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3395
    ^ (    cls == ApplicationSubView
3551
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3396
        or:[cls == ApplicationWindow
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3397
        or:[cls == SubCanvas]]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3398
      )
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3399
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3400
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3401
isSelected
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3402
    |model|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3403
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3404
    model := self treeModel.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3405
    model notNil ifTrue:[^ model isSelected:self].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3406
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3407
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3408
3551
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3409
isView
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3410
    ^ widget notNil
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3411
!
94a23bbd725b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3532
diff changeset
  3412
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3413
supportsSubComponents
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3414
    "returns true if the widget supports sub components
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3415
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3416
    |specClass|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3417
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3418
    widget isScrollWrapper ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3419
	^ false
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3420
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3421
    specClass := self specClass.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3422
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3423
    specClass notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3424
	^ specClass supportsSubComponents
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3425
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3426
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3427
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3428
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3429
!ViewTreeInspectorApplication::ViewTreeItem methodsFor:'testing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3430
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3431
isInLayoutContainer
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3432
    "returns true if the widget is in a layout container
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3433
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3434
    |sv specClass|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3435
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3436
    sv := widget superView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3437
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3438
    sv notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3439
	specClass := sv specClass.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3440
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3441
	specClass notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3442
	    ^ specClass isLayoutContainer
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3443
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3444
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3445
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3446
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3447
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3448
isLayoutContainer
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3449
    "answer whether corresponding view instances of the spec class can contain
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3450
     (and arrange) other view
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3451
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3452
    |specClass|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3453
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3454
    specClass := self specClass.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3455
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3456
    specClass notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3457
	^ specClass isLayoutContainer
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3458
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3459
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3460
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3461
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3462
isMoveable
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3463
    "returns true if the widget is not in a layout container
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3464
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3465
    self isInLayoutContainer ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3466
	^ widget superView notNil
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3467
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3468
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3469
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3470
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3471
isResizeable
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3472
    "returns true if the widget is resizeable
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3473
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3474
    |sv specClass|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3475
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3476
    sv := widget superView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3477
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3478
    sv notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3479
	specClass := sv specClass.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3480
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3481
	specClass notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3482
	    ^ specClass canResizeSubComponents
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3483
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3484
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3485
    ^ false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3486
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3487
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3488
!ViewTreeInspectorApplication::ViewTreeModel class methodsFor:'documentation'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3489
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3490
documentation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3491
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3492
    Instances of ViewTreeModel can be used as model on a View and all
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3493
    it contained subviews for a HierarchicalListView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3494
    The model keeps two values, the hierarchical representation of the views
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3495
    and subviews (ViewTreeItems) and the selection, a list of selected ViewTreeItems's.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3496
    It shows the selected items highlighted.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3497
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3498
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3499
    [Instance variables:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3500
	lockSema            <Semaphore>         lock selection notifications and redraws
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3501
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3502
	testModeChannel     <ValueHolder>       true, than running in test mode.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3503
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3504
	hasTargetWidgetChannel <ValueHolder>    true, than any target view is grapped
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3505
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3506
	selection           <Sequence or nil>   selected items or nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3507
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3508
	hiddenLevel         <Integer>           internal use; redrawing the selection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3509
						only is done if the counter is 0.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3510
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3511
	listOfItems         <HierarchicalList>  hiearchical list build from existing items.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3512
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3513
	selectedSuperItems  <Sequence>          list of selected super items; items selected
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3514
						but not contained in another selected item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3515
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3516
	inputEventAction    <Action>            called for each InputEvent
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3517
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3518
	mappedViewAction    <Action>            called for a new mapped view which
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3519
						can not be found in the current item list.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3520
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3521
	beforeSelectionChangedAction <Action>   called before the selection changed
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3522
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3523
    [author:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3524
	Claus Atzkern
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3525
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3526
    [see also:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3527
	ViewTreeItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3528
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3529
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3530
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3531
examples
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3532
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3533
    example 1: pick any window and show views and contained views
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3534
										[exBegin]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3535
    |top sel model panel|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3536
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3537
    model := ViewTreeModel new.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3538
    top   := StandardSystemView new; extent:440@400.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3539
    sel   := ScrollableView for:HierarchicalListView miniScroller:true origin:0.0@0.0 corner:1.0@1.0 in:top.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3540
    sel bottomInset:24.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3541
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3542
    panel := HorizontalPanelView origin:0.0@1.0 corner:1.0@1.0 in:top.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3543
    panel topInset:-24.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3544
    panel horizontalLayout:#fitSpace.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3545
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3546
    Button label:'Exit'       action:[model rootItem:nil. top destroy] in:panel.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3547
    Button label:'Pick Views' action:[  |win|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3548
					(     (win := Screen current viewFromUser) notNil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3549
					 and:[(win := win topView) ~~ Screen current rootView
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3550
					 and:[win ~~ top]]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3551
					) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3552
					    model rootItem:(ViewTreeItem buildViewsFrom:win)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3553
					] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3554
					    model rootItem:nil
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3555
					]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3556
				     ] in:panel.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3557
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3558
    sel  multipleSelectOk:true.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3559
    sel              list:model listOfItems.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3560
    sel             model:model.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3561
    sel          useIndex:false.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3562
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3563
    sel doubleClickAction:[:i| |el|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3564
	el := model listOfItems at:i.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3565
	el spec notNil ifTrue:[ el spec   inspect ] ifFalse:[ el widget inspect ]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3566
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3567
    sel indicatorAction:[:i| (model listOfItems at:i) toggleExpand ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3568
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3569
    model inputEventAction:[:anEvent| |item|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3570
	anEvent isButtonEvent ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3571
	    anEvent isButtonPressEvent ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3572
		model selectedItem:(model listOfItems detectItemRespondsToView:(anEvent view)).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3573
	    ] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3574
		anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3575
		    (item := model selectedItem) notNil ifTrue:[item widget inspect]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3576
		]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3577
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3578
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3579
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3580
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3581
    top openAndWait.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3582
    [[top shown] whileTrue:[Delay waitForSeconds:0.5]. model rootItem:nil] forkAt:8
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3583
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3584
										[exEnd]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3585
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3586
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3587
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3588
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'accessing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3589
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3590
application:anApplication
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3591
    listOfItems application:anApplication.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3592
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3593
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3594
catchEvents:aBoolean
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3595
    catchEvents := aBoolean.
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3596
    aBoolean ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3597
	self redrawUnselected:selection andLock:false checkTestMode:false.
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3598
    ].
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3599
!
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3600
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3601
path
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3602
    "Return a XPath like path to this item"
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3603
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3604
    | view views|
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3605
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3606
    selection isNil ifTrue:[ ^ nil ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3607
    selection isCollection ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3608
	selection size ~~ 1 ifTrue:[ ^ nil ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3609
	view := selection anElement widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3610
    ] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3611
	view := selection widget.
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3612
    ].
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3613
    view isNil ifTrue:[^ nil].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3614
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3615
    views := OrderedCollection new.
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3616
    [ view notNil ] whileTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3617
	views add: view.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3618
	view := view superView.
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3619
    ].
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3620
    views removeLast.
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3621
    ^ String streamContents:[ :s|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3622
	views reverseDo:[:each |
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3623
	    s nextPutAll:'/'.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3624
	    s nextPutAll: each name asString "storeString".
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3625
	].
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3626
    ]
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3627
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3628
    "Created: / 19-05-2014 / 18:15:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  3629
    "Modified: / 16-08-2017 / 13:03:47 / cg"
3112
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3630
!
80453ab62df9 Added field that shows XPath like path to selected widged.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3105
diff changeset
  3631
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3632
rootItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3633
    "get the rootItem the event viewer is established on
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3634
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3635
    ^ listOfItems root
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3636
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3637
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3638
rootItem:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3639
    "set the rootItem the event viewer is established on
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3640
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3641
    |expanded|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3642
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3643
    timedUpdateTask := nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3644
    self deselect.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3645
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3646
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3647
	anItem notNil ifTrue:[ expanded := anItem isExpanded ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3648
		     ifFalse:[ expanded := false ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3649
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3650
	self value:nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3651
	listOfItems root:anItem.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3652
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3653
	anItem notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3654
	    timedUpdateTask := Process for:[ self timedUpdateTaskCycle ] priority:8.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3655
	    timedUpdateTask name:'Update'.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3656
	    timedUpdateTask resume.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3657
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3658
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3659
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3660
    (expanded and:[anItem notNil]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3661
	anItem expand
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3662
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3663
    ^ anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3664
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3665
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3666
rootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3667
    "get the top widget the event viewer is established on, a View
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3668
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3669
    ^ listOfItems rootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3670
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3671
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3672
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'accessing actions'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3673
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3674
beforeSelectionChangedAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3675
    "none argument action which is called before
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3676
     the selection changed
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3677
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3678
    ^ beforeSelectionChangedAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3679
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3680
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3681
beforeSelectionChangedAction:aNoneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3682
    "none argument action which is called before
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3683
     the selection changed
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3684
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3685
    beforeSelectionChangedAction := aNoneArgBlock.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3686
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3687
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3688
inputEventAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3689
    "called for each input event; the argument to the action is the WindowEvent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3690
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3691
    ^ inputEventAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3692
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3693
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3694
inputEventAction:aOneArgActionTheEvent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3695
    "called for each input event; the argument to the action is the WindowEvent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3696
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3697
    inputEventAction := aOneArgActionTheEvent.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3698
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3699
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3700
mappedViewAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3701
    "called for a new mapped view which can not be found
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3702
     in the current item list
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3703
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3704
    ^ mappedViewAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3705
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3706
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3707
mappedViewAction:aOneArgBlockTheMappedView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3708
    "called for a new mapped view which can not be found
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3709
     in the current item list
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3710
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3711
    mappedViewAction := aOneArgBlockTheMappedView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3712
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3713
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3714
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'accessing look'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3715
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3716
iconAt:aKey ifNonePut:aNoneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3717
    |icon view|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3718
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3719
    icon := icons at:aKey ifAbsent:nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3720
    icon notNil ifTrue:[^ icon].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3721
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3722
    icon := aNoneArgBlock value.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3723
    icon isNil ifTrue:[^ nil].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3724
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3725
    view := self rootView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3726
    view isNil ifTrue:[^ icon].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3727
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3728
    icon := icon copy onDevice:(view device).
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3729
    icon isImage ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3730
	icon clearMaskedPixels.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3731
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3732
    icons at:aKey put:icon.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3733
    ^ icon
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3734
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3735
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3736
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'accessing visibility'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3737
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3738
signalHiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3739
    "show the selection if signaled; increments hiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3740
     see: #waitHiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3741
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3742
    (hiddenLevel := hiddenLevel - 1) < 1 ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3743
	hiddenLevel := 0.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3744
	self invalidateSelection.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3745
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3746
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3747
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3748
waitHiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3749
    "hide the selection until signaled; increments hiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3750
     see: #signalHiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3751
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3752
    self redrawUnselected:selection andLock:true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3753
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3754
3453
01e6b207c1b4 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
  3755
withSelectionHiddenDo:aZeroArgumentBlock
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3756
    "apply block with selection hidden
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3757
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3758
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3759
    [
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3760
	self waitHiddenLevel.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3761
	aZeroArgumentBlock value
3453
01e6b207c1b4 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
  3762
    ] ensure:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3763
	self signalHiddenLevel.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3764
    ].
3453
01e6b207c1b4 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
  3765
01e6b207c1b4 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
  3766
    "Modified (format): / 17-07-2017 / 10:44:01 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3767
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3768
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3769
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'aspects'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3770
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3771
hasTargetWidgetChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3772
    "answer the channel which is set to true if a target widget exists"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3773
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3774
    ^ hasTargetWidgetChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3775
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3776
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3777
listOfItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3778
    "hiearchical list build from existing items"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3779
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3780
    ^ listOfItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3781
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3782
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3783
selectOnClickHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3784
    "boolean holder, which indicates whether the selection will change on click
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3785
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3786
    ^ selectOnClickHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3787
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3788
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3789
testModeChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3790
    "answer a boolean channel which describes the behaviour how to process
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3791
     events on the target view.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3792
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3793
     false: all input events are eaten and the selection is shown on the target view.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3794
     true:  no  input events are eaten and no  selection is shown on the target view."
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3795
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3796
    ^ testModeChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3797
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3798
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3799
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'change & update'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3800
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3801
targetWidgetChanged
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3802
    hasTargetWidgetChannel value:(self rootItem notNil).
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3803
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3804
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3805
timedUpdateTaskCycle
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3806
    |view myTaskId|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3807
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3808
    myTaskId := timedUpdateTask.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3809
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3810
    listOfItems root notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3811
	view := listOfItems root widget.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3812
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3813
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3814
    [ view notNil ] whileTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3815
	Delay waitForSeconds:0.5.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3816
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3817
	(myTaskId == timedUpdateTask and:[view id notNil]) ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3818
	    view := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3819
	] ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3820
	    (view sensor hasUserEvent:#updateChildren for:self) ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3821
		view sensor pushUserEvent:#updateChildren for:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3822
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3823
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3824
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3825
    timedUpdateTask == myTaskId ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3826
	timedUpdateTask := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3827
	listOfItems root:nil.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3828
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3829
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3830
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3831
update:something with:someArgument from:aModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3832
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3833
    aModel == testModeChannel ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3834
	(hiddenLevel == 0 and:[selection size > 0]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3835
	    testModeChannel value ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3836
		self redrawUnselected:selection andLock:false checkTestMode:false.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3837
	    ] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3838
		self invalidateSelection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3839
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3840
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3841
	^ self
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3842
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3843
    super update:something with:someArgument from:aModel.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3844
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3845
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3846
updateChildren
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3847
    |rootItem|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3848
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3849
    rootItem := listOfItems root.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3850
    rootItem isNil ifTrue:[^ self].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3851
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3852
    rootItem exists ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3853
	listOfItems root:nil.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3854
    ] ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3855
	rootItem updateChildren.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3856
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3857
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3858
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3859
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'event processing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3860
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3861
processEvent:anEvent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3862
    "catch and process all WindowEvents for the rootComponent and its contained
2757
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
  3863
     widgets; redraw selection in case of damage...
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
  3864
     return true, if the event was eaten"
6c83d6b487b2 changed:
Claus Gittinger <cg@exept.de>
parents: 2748
diff changeset
  3865
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3866
    |evView item rootView testMode|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3867
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3868
    catchEvents ifFalse:[^ false].
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3869
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3870
    evView := anEvent view.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3871
    evView isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3872
	(anEvent isMessageSendEvent not or:[anEvent receiver ~~ self]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3873
	    ^ false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3874
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3875
	anEvent value.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3876
	^ true.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3877
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3878
    rootView := listOfItems rootView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3879
    rootView isNil ifTrue:[ ^ false ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3880
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3881
    anEvent isConfigureEvent ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3882
	hiddenLevel == 0 ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3883
	    self redrawUnselected:selection andLock:false.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3884
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3885
	^ false
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3886
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3887
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3888
    "/ check whether view is contained within the rootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3889
    (evView == rootView or:[evView isComponentOf:rootView]) ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3890
	^ false
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3891
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3892
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3893
    anEvent isInputEvent ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3894
	anEvent isDamage ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3895
	    hiddenLevel == 0 ifTrue:[self invalidateSelection].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3896
	    ^ false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3897
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3898
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3899
	anEvent isMapEvent ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3900
	    mappedViewAction notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3901
		item := listOfItems recursiveDetect:[:el| el widget == evView].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3902
		item isNil ifTrue:[ mappedViewAction value:evView ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3903
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3904
	    ^ false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3905
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3906
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3907
	anEvent type == #terminate ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3908
	    item := listOfItems recursiveDetect:[:el| el widget == evView].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3909
	    item notNil ifTrue:[ self processTerminateForItem:item ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3910
	    ^ false
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3911
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3912
	^ false
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3913
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3914
    testMode := testModeChannel value.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3915
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3916
    anEvent isFocusEvent ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3917
	evView == rootView ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3918
	    self invalidateSelection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3919
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3920
	^ testMode not.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3921
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3922
    anEvent isPointerEnterLeaveEvent ifTrue:[ ^ testMode not ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3923
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3924
    testMode ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3925
	inputEventAction notNil ifTrue:[ inputEventAction value:anEvent ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3926
    ] ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3927
	anEvent isButtonPressEvent ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3928
	    selectOnClickHolder value ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3929
		self selectItem:(listOfItems detectItemRespondsToView:evView).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3930
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3931
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3932
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3933
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3934
    (hiddenLevel ~~ 0 and:[anEvent isButtonReleaseEvent]) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3935
	hiddenLevel := 1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3936
	self signalHiddenLevel.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3937
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3938
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3939
    ^ testMode not
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3940
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3941
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3942
processTerminateForItem:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3943
    "received terminate for an item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3944
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3945
    anItem remove.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3946
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3947
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3948
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'initialization'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3949
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3950
initialize
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3951
    "setup the default attributes
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3952
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3953
    super initialize.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3954
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3955
    hiddenLevel           := 0.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3956
    lockSema              := RecursionLock new.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3957
    listOfItems           := ItemList new on:self.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3958
    selectedSuperItems    := #().
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3959
    icons                 := IdentityDictionary new.
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  3960
    catchEvents           := true.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3961
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3962
    hasTargetWidgetChannel := false asValue.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3963
    selectOnClickHolder    := true asValue.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3964
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3965
    testModeChannel := false asValue.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3966
    testModeChannel addDependent:self.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3967
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3968
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3969
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'private selection'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3970
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3971
invalidateSelection
3319
97fd83492529 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3302
diff changeset
  3972
    "invalidate (force async redraw) the current selection
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3973
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3974
    |topView|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3975
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3976
    testModeChannel value ifTrue:[ ^ self ]. "/ test whether running testMode
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3977
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3978
    (     hiddenLevel == 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3979
     and:[selection notNil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3980
     and:[(topView := listOfItems rootView) notNil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3981
     and:[topView shown]]]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3982
    ) ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  3983
	topView sensor pushUserEvent:#redrawSelection for:self withArguments:#()
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3984
    ]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3985
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3986
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3987
recursiveRepair:theDamages startIn:aView relativeTo:aRootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3988
    "repair all views and contained views, which intersects the damage.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3989
     !!!! all damages repaired are removed from the list of damages !!!!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3990
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3991
    |color relOrg damage subViews repaired
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3992
     bwWidth    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3993
     x          "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3994
     y          "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3995
     w          "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3996
     h          "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3997
     relOrgX    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3998
     relOrgY    "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  3999
     width      "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4000
     height     "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4001
     size       "{ Class:SmallInteger }"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4002
    |
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4003
    (aView shown and:[theDamages notEmpty]) ifFalse:[ ^ self ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4004
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4005
    subViews := aView subViews.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4006
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4007
    subViews size ~~ 0 ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4008
	subViews reverseDo:[:v| self recursiveRepair:theDamages startIn:v relativeTo:aRootView ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4009
	theDamages isEmpty ifTrue:[ ^ self ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4010
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4011
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4012
    relOrg  := aView originRelativeTo:aRootView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4013
    bwWidth := aView borderWidth.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4014
    size    := theDamages size.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4015
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4016
    "/ compute relative origin starting from border left@top
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4017
    relOrgX := relOrg x - bwWidth.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4018
    relOrgY := relOrg y - bwWidth.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4019
    width   := aView width  + bwWidth + bwWidth.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4020
    height  := aView height + bwWidth + bwWidth.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4021
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4022
    size to:1 by:-1 do:[:anIndex|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4023
	repaired := damage := theDamages at:anIndex.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4024
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4025
	"/ compute the rectangle into the view
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4026
	y := damage top  - relOrgY.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4027
	x := damage left - relOrgX.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4028
	w := damage width.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4029
	h := damage height.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4030
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4031
	x     < 0      ifTrue:[ w := w + x. x := 0. repaired := nil ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4032
	y     < 0      ifTrue:[ h := h + y. y := 0. repaired := nil ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4033
	x + w > width  ifTrue:[ w := width  - x.    repaired := nil ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4034
	y + h > height ifTrue:[ h := height - y.    repaired := nil ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4035
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4036
	(w > 0 and:[h > 0]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4037
	    bwWidth ~~ 0 ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4038
		color isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4039
		    "/ must force redraw of border
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4040
		    color := aView borderColor.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4041
		    aView borderColor:(Color colorId:1).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4042
		    aView borderColor:color.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4043
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4044
		w := w - bwWidth.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4045
		h := h - bwWidth.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4046
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4047
		(x := x - bwWidth) < 0 ifTrue:[w := w + x. x := 0].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4048
		(y := y - bwWidth) < 0 ifTrue:[h := h + y. y := 0].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4049
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4050
		h > 0 ifFalse:[w := 0].         "/ later testing on width only
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4051
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4052
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4053
	    w > 0 ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4054
		aView clearRectangleX:x y:y width:w height:h.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4055
		aView exposeX:x y:y width:w height:h
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4056
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4057
	    repaired notNil ifTrue:[ theDamages removeFromIndex:anIndex toIndex:anIndex ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4058
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4059
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4060
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4061
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4062
redrawSelection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4063
    "redraw all items selected
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4064
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4065
    |topView size|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4066
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4067
    testModeChannel value ifTrue:[ ^ self ]. "/ test whether running testMode
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4068
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4069
    (     hiddenLevel == 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4070
     and:[(size := selection size) > 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4071
     and:[(topView := listOfItems rootView) notNil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4072
     and:[topView shown
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4073
     and:[(topView sensor hasEvent:#redrawSelection for:self) not]]]]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4074
    ) ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4075
	^ self
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4076
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4077
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4078
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4079
	|list|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4080
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4081
	list := selection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4082
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4083
	list size > 0 ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4084
	    topView paint:(Color black).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4085
	    topView clippedByChildren:false.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4086
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4087
	    list keysAndValuesReverseDo:[:anIndex :anItem|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4088
		(anIndex == 1 and:[size > 1]) ifTrue:[ topView paint:(Color red) ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4089
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4090
		anItem handlesDo:[:aRect :what|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4091
		    what isNil ifTrue:[topView displayRectangle:aRect]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4092
			      ifFalse:[topView fillRectangle:aRect]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4093
		]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4094
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4095
	    topView clippedByChildren:true.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4096
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4097
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4098
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4099
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4100
redrawUnselected:aList andLock:doLock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4101
    "redraw all items unselected; if doLock is true, the hiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4102
     is incremented and thus the select mechanism is locked.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4103
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4104
    self redrawUnselected:aList andLock:doLock checkTestMode:true.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4105
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4106
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4107
redrawUnselected:aList andLock:doLock checkTestMode:checkTestMode
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4108
    "redraw all items unselected; if doLock is true, the hiddenLevel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4109
     is incremented and thus the select mechanism is locked.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4110
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4111
    |rootView damages subViews x y w h|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4112
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4113
    doLock ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4114
	hiddenLevel := hiddenLevel + 1.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4115
	hiddenLevel ~~ 1 ifTrue:[^ self].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4116
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4117
	hiddenLevel ~~ 0 ifTrue:[^ self].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4118
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4119
    checkTestMode ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4120
	testModeChannel value ifTrue:[ ^ self ]. "/ test whether running testMode
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4121
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4122
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4123
    (     aList size ~~ 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4124
     and:[(rootView := listOfItems rootView) notNil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4125
     and:[rootView shown]]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4126
    ) ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4127
	^ self
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4128
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4129
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4130
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4131
	damages := OrderedCollection new:(8 * aList size).
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4132
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4133
	aList do:[:item|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4134
	    item handlesDo:[:handle :what|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4135
		damages reverseDo:[:el|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4136
		    (el intersects:handle) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4137
			damages removeIdentical:el.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4138
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4139
			handle left:(handle left   min:el left)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4140
			      right:(handle right  max:el right)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4141
				top:(handle top    min:el top)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4142
			     bottom:(handle bottom max:el bottom)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4143
		    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4144
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4145
		damages add:handle
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4146
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4147
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4148
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4149
	damages do:[:el|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4150
	    x := el left.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4151
	    y := el top.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4152
	    w := el width.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4153
	    h := el height.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4154
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4155
	    rootView clearRectangleX:x y:y width:w height:h.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4156
	    rootView         exposeX:x y:y width:w height:h.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4157
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4158
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4159
	(subViews := rootView subViews) notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4160
	    subViews reverseDo:[:v| self recursiveRepair:damages startIn:v relativeTo:rootView ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4161
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4162
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4163
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4164
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4165
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'queries'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4166
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4167
isInTestMode
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4168
    "answer false, all input events are eaten and the selection is shown on the target view.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4169
     answer true,  no  input events are eaten and no  selection is shown on the target view."
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4170
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4171
    ^ testModeChannel value
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4172
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4173
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4174
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection accessing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4175
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4176
at:anIndex
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4177
    "returns the selected item at an index or nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4178
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4179
    selection notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4180
	^ selection at:anIndex ifAbsent:nil
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4181
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4182
    ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4183
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4184
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4185
at:anIndex ifAbsent:aBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4186
    "returns the selected item at an index or the result of the block
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4187
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4188
    selection notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4189
	^ selection at:anIndex ifAbsent:aBlock
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4190
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4191
    ^ aBlock value
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4192
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4193
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4194
first
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4195
    "returns the first selected item or nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4196
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4197
    ^ self at:1
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4198
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4199
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4200
last
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4201
    "returns the last selected item or nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4202
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4203
    ^ selection notNil ifTrue:[selection last] ifFalse:[nil]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4204
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4205
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4206
selectedItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4207
    "returns the single selected item or nil (size ~~ 1 nil is returned)
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4208
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4209
    ^ selection size == 1 ifTrue:[selection at:1] ifFalse:[nil]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4210
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4211
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4212
selectedSuperItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4213
    "returs the list of selected superItems; items selected
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4214
     but not contained in another selected item.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4215
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4216
    ^ selectedSuperItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4217
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4218
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4219
size
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4220
    "returns the number of items selected
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4221
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4222
    ^ selection size
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4223
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4224
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4225
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection adding & removing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4226
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4227
add:item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4228
    "add an item to the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4229
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4230
    |newSelect|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4231
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4232
    item isNil ifTrue:[^ item].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4233
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4234
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4235
	selection isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4236
	    newSelect := Array with:item.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4237
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4238
	    (self includes:item) ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4239
		newSelect := selection copyWith:item
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4240
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4241
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4242
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4243
	newSelect size ~~ selection size ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4244
	    item makeVisible.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4245
	    self value:newSelect
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4246
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4247
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4248
    ^ item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4249
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4250
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4251
addAll:aCollectionOfItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4252
    "add a collection of items to the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4253
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4254
    |newSelect|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4255
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4256
    aCollectionOfItems size == 0 ifTrue:[ ^ aCollectionOfItems ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4257
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4258
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4259
	selection isNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4260
	    newSelect := Array withAll:aCollectionOfItems.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4261
	] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4262
	    newSelect := OrderedCollection withAll:selection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4263
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4264
	    aCollectionOfItems do:[:el|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4265
		(selection includesIdentical:el) ifFalse:[newSelect add:el]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4266
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4267
	].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4268
	self value:newSelect.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4269
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4270
    ^ aCollectionOfItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4271
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4272
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4273
deselect
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4274
    "clear the selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4275
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4276
    self value:nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4277
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4278
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4279
remove:item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4280
    "remove the item from the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4281
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4282
    |newSelect|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4283
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4284
    item isNil ifTrue:[^ nil].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4285
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4286
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4287
	(selection notNil and:[selection includesIdentical:item]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4288
	    selection size == 1 ifTrue:[ newSelect := nil ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4289
			       ifFalse:[ newSelect := selection copyWithout:item ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4290
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4291
	    self value:newSelect
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4292
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4293
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4294
    ^ item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4295
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4296
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4297
removeAll
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4298
    "clear the selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4299
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4300
    self deselect.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4301
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4302
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4303
removeAll:loItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4304
    "remove all items of the collection from the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4305
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4306
    |newSelect|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4307
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4308
    selection   isNil ifTrue:[ ^ loItems ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4309
    loItems size == 0 ifTrue:[ ^ loItems ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4310
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4311
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4312
	selection notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4313
	    newSelect := selection select:[:el| (loItems includesIdentical:el) not ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4314
	    self value:newSelect.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4315
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4316
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4317
    ^ loItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4318
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4319
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4320
selectAll
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4321
    "select all items
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4322
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4323
    |root newSelection|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4324
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4325
    root := listOfItems root.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4326
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4327
    root isNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4328
	newSelection := nil
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4329
    ] ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4330
	newSelection := OrderedCollection new.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4331
	root recursiveDo:[:el| newSelection add:el ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4332
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4333
    self value:newSelection.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4334
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4335
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4336
selectItem:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4337
    "set the current selection to the item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4338
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4339
    self value:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4340
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4341
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4342
selectRootItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4343
    "set the current selection to the root item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4344
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4345
    self value:(self rootItem).
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4346
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4347
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4348
selectedItem:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4349
    "set the current selection to the item
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4350
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4351
    self selectItem:anItem.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4352
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4353
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4354
toggleSelectItem:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4355
    "toggle selection-state of the item; add or remove the item from the
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4356
     current selection.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4357
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4358
    anItem notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4359
	(self includes:anItem) ifTrue:[self remove:anItem]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4360
			      ifFalse:[self add:anItem]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4361
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4362
    ^ anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4363
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4364
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4365
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection enumerating'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4366
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4367
collect:aBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4368
    "for each element in the selection, evaluate the argument, aBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4369
     and return a new collection with the results
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4370
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4371
    |res|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4372
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4373
    res := OrderedCollection new.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4374
    self do:[:el| res add:(aBlock value:el)].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4375
  ^ res
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4376
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4377
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4378
do:aOneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4379
    "evaluate the argument, aBlock for each item in the selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4380
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4381
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4382
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4383
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4384
    (keptSelection := selection) isNil ifTrue:[^ nil].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4385
    ^ keptSelection do:aOneArgBlock
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4386
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4387
    "Modified (format): / 12-02-2017 / 11:53:23 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4388
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4389
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4390
from:start do:aOneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4391
    "evaluate the argument, aBlock for the items starting at index start
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4392
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4393
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4394
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4395
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4396
    (keptSelection := selection) isNil ifTrue:[^ nil].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4397
    "/ but if so, then start may no longer be valid here??
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4398
    ^ keptSelection from:start do:aOneArgBlock
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4399
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4400
    "Modified (comment): / 12-02-2017 / 11:52:57 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4401
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4402
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4403
from:start to:stop do:aOneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4404
    "evaluate the argument, aBlock for the items with index start to
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4405
     stop in the selection.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4406
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4407
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4408
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4409
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4410
    (keptSelection := selection) isNil ifTrue:[^ nil].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4411
    "/ but if so, then start and stop may no longer be valid here??
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4412
    ^ keptSelection from:start to:stop do:aOneArgBlock
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4413
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4414
    "Modified (comment): / 12-02-2017 / 11:52:25 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4415
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4416
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4417
reverseDo:aOneArgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4418
    "evaluate the argument, aBlock for each item in the selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4419
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4420
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4421
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4422
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4423
    (keptSelection := selection) isNil ifTrue:[^ nil].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4424
    ^ keptSelection reverseDo:aOneArgBlock
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4425
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4426
    "Modified: / 12-02-2017 / 11:50:02 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4427
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4428
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4429
select:aBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4430
    "return a new collection with all elements from the selection, for which
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4431
     the argument aBlock evaluates to true.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4432
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4433
    |res|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4434
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4435
    res := OrderedCollection new.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4436
    self do:[:el| (aBlock value:el) ifTrue:[res add:el] ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4437
  ^ res
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4438
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4439
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4440
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection protocol'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4441
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4442
changed:aParameter with:oldSelection
3568
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4443
    "update the visibility status of the current selection
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4444
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4445
    |unselected rootView rootItem selSize|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4446
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4447
    selSize := selection size.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4448
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4449
    selSize == 0 ifTrue:[
3568
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4450
        selectedSuperItems := #().
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4451
    ] ifFalse:[
3568
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4452
        selSize == 1 ifTrue:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4453
            selectedSuperItems := Array with:(selection at:1).
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4454
        ] ifFalse:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4455
            rootItem := listOfItems root.
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4456
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4457
            (selection includesIdentical:rootItem) ifTrue:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4458
                selectedSuperItems := Array with:rootItem.
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4459
            ] ifFalse:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4460
                selectedSuperItems := OrderedCollection new:selSize.
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4461
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4462
                selection do:[:anItem|
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4463
                    anItem parentsDetect:[:el| selection includesIdentical:el ]
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4464
                                  ifNone:[ selectedSuperItems add:anItem ].
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4465
                ].
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4466
            ]
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4467
        ]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4468
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4469
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4470
    (     hiddenLevel == 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4471
     and:[(rootView := listOfItems rootView) notNil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4472
     and:[rootView shown]]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4473
    ) ifTrue:[
3568
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4474
        selSize == 0 ifTrue:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4475
            "/ must redraw the old selection unselected
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4476
            self redrawUnselected:oldSelection andLock:false
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4477
        ] ifFalse:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4478
            self invalidateSelection.
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4479
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4480
            oldSelection size ~~ 0 ifTrue:[
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4481
                "/ must redraw all elements no longer in the selection
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4482
                unselected := oldSelection select:[:el| (selection includesIdentical:el) not ].
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4483
                self redrawUnselected:unselected andLock:false.
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4484
            ]
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4485
        ]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4486
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4487
    super changed:aParameter with:oldSelection.
3568
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4488
5004640f2a10 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3551
diff changeset
  4489
    "Modified (comment): / 29-06-2018 / 08:25:36 / Claus Gittinger"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4490
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4491
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4492
setValue:aNewSelection
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4493
    "set the selection without notifying
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4494
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4495
    |newSelect idx|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4496
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4497
    newSelect := nil.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4498
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4499
    aNewSelection notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4500
	lockSema critical:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4501
	    aNewSelection isCollection ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4502
		(selection size == 1 and:[selection first == aNewSelection]) ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4503
		    newSelect := selection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4504
		] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4505
		    newSelect := Array with:aNewSelection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4506
		]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4507
	    ] ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4508
		aNewSelection notEmpty ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4509
		    aNewSelection size ~~ selection size ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4510
			newSelect := aNewSelection copy.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4511
		    ] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4512
			idx := selection findFirst:[:el| (aNewSelection includesIdentical:el) not ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4513
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4514
			idx ~~ 0 ifTrue:[newSelect := aNewSelection copy]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4515
				ifFalse:[newSelect := selection ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4516
		    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4517
		]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4518
	    ]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4519
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4520
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4521
    newSelect ~~ selection ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4522
	beforeSelectionChangedAction value.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4523
	selection := newSelect.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4524
	selection notNil ifTrue:[selection do:[:el| el makeVisible]]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4525
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4526
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4527
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4528
triggerValue:aValue
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4529
    "set my value & send change notifications to my dependents.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4530
     Send the change message even if the value didn't change.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4531
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4532
    |oldSelection|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4533
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4534
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4535
	oldSelection := selection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4536
	self setValue:aValue.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4537
	self changed:#value with:oldSelection
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4538
    ]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4539
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4540
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4541
value
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4542
    "returns the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4543
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4544
    ^ selection ? #()
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4545
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4546
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4547
value:aValue
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4548
    "change the current selection and send change notifications to my
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4549
     dependents if it changed.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4550
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4551
    |oldSelection|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4552
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4553
    lockSema critical:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4554
	oldSelection := selection.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4555
	self setValue:aValue.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4556
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4557
	oldSelection == selection ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4558
	    self changed:#value with:oldSelection
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4559
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4560
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4561
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4562
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4563
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection searching'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4564
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4565
detect:aBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4566
    "evaluate the argument, aBlock for each item in the selection until
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4567
     the block returns true; in this case return the element which caused
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4568
     the true evaluation.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4569
     If none of the evaluations returns true, an error is raised
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4570
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4571
    ^ self detect:aBlock ifNone:[self errorNotFound]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4572
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4573
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4574
detect:aBlock ifNone:exceptionBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4575
    "evaluate the argument, aBlock for each item in the selection until the
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4576
     block returns true; in this case return the element which caused the
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4577
     true evaluation.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4578
     If none of the evaluations returns true, the result of the evaluation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4579
     of the exceptionBlock is returned
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4580
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4581
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4582
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4583
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4584
    (keptSelection := selection) isNil ifTrue:[ ^ exceptionBlock value ].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4585
    ^ keptSelection detect:aBlock ifNone:exceptionBlock
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4586
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4587
    "Modified (format): / 12-02-2017 / 11:54:13 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4588
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4589
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4590
detectLast:aBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4591
    "evaluate the argument, aBlock for each item in the selection until
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4592
     the block returns true; in this case return the element which caused
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4593
     the true evaluation. The items are processed in reverse order.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4594
     If none of the evaluations returns true, an error is raised
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4595
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4596
    ^ self detectLast:aBlock ifNone:[self errorNotFound]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4597
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4598
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4599
detectLast:aBlock ifNone:exceptionBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4600
    "evaluate the argument, aBlock for each item in the selection until
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4601
     the block returns true; in this case return the element which caused
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4602
     the true evaluation. The items are processed in reverse order.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4603
     If none of the evaluations returns true, the result of the evaluation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4604
     of the exceptionBlock is returned
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4605
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4606
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4607
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4608
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4609
    (keptSelection := selection) isNil ifTrue:[ ^ exceptionBlock value ].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4610
    ^ keptSelection detectLast:aBlock ifNone:exceptionBlock
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4611
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4612
    "Modified (format): / 12-02-2017 / 11:53:49 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4613
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4614
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4615
!ViewTreeInspectorApplication::ViewTreeModel methodsFor:'selection testing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4616
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4617
includes:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4618
    "returns true if the item is in the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4619
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4620
    |keptSelection|
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4621
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4622
    "/ the selection may change at any time (may it?)
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4623
    (keptSelection := selection) isNil ifTrue:[^ false].
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4624
    ^ keptSelection includesIdentical:anItem
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4625
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4626
    "Modified: / 12-02-2017 / 11:51:34 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4627
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4628
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4629
includesAll:aCollection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4630
    "return true, if all items of the collection are included in the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4631
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4632
    |keptSelection|
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4633
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4634
    aCollection size ~~ 0 ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4635
	"/ the selection may change at any time (may it?)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4636
	(keptSelection := selection) isNil ifTrue:[ ^ false ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4637
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4638
	^ aCollection contains:[:el| (keptSelection includesIdentical:el)]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4639
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4640
    ^ true
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4641
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4642
    "Modified (format): / 12-02-2017 / 11:51:14 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4643
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4644
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4645
includesAny:aCollection
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4646
    "return true, if any item of the collection is in the current selection
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4647
    "
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4648
    |keptSelection|
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4649
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4650
    aCollection notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4651
	"/ the selection may change at any time (may it?)
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4652
	(keptSelection := selection) notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4653
	    ^ aCollection contains:[:el| (keptSelection includesIdentical:el)]
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4654
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4655
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4656
    ^ false
3398
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4657
9c87da351c9c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3383
diff changeset
  4658
    "Modified (format): / 12-02-2017 / 11:50:26 / cg"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4659
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4660
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4661
includesIdentical:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4662
    "returns true if the item is in the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4663
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4664
    ^ self includes:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4665
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4666
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4667
isEmpty
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4668
    "returns true if the current selection is empty
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4669
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4670
    ^ selection size == 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4671
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4672
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4673
isSelected:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4674
    "returns true if the item is in the current selection
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4675
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4676
    ^ self includes:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4677
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4678
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4679
notEmpty
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4680
    "returns true if the current selection is not empty
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4681
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4682
    ^ selection size ~~ 0
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4683
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4684
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4685
!ViewTreeInspectorApplication::ViewTreeModel::ItemList class methodsFor:'documentation'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4686
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4687
documentation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4688
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4689
    Kind of HierarchicalList class which contains all the visible
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4690
    ViewTreeItem's and the root, the anchor of the hierarchical list.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4691
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4692
    [Instance variables:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4693
	treeModel       <ViewTreeModel>         all events are delegated to
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4694
	eventHook       <BlockValue>            save and resore the pre/post -EventHook
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4695
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4696
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4697
    [author:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4698
	Claus Atzkern
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4699
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4700
    [see also:]
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4701
	HierarchicalList
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4702
	ViewTreeModel
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4703
	ViewTreeItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4704
"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4705
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4706
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4707
!ViewTreeInspectorApplication::ViewTreeModel::ItemList methodsFor:'accessing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4708
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4709
root:theRoot
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4710
    "set the root item; delegate events to my treeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4711
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4712
    |rootView|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4713
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4714
    theRoot == root ifTrue:[^ self].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4715
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4716
    rootView := self rootView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4717
    super root:theRoot.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4718
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4719
    rootView notNil ifTrue:[ |wgrp|
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4720
	wgrp := rootView windowGroup.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4721
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4722
	wgrp notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4723
	   wgrp removePreEventHook:treeModel.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4724
	   wgrp removePostEventHook:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4725
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4726
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4727
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4728
    super root:theRoot.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4729
    rootView := self rootView.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4730
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4731
    rootView notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4732
	"must setup a task because there might not exist a windowGroup at the moment
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4733
	"
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4734
	[   |wgrp|
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4735
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4736
	    [rootView == self rootView] whileTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4737
		wgrp := rootView windowGroup.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4738
		wgrp notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4739
		    rootView := nil.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4740
		    wgrp addPreEventHook:treeModel.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4741
		    wgrp addPostEventHook:self.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4742
		] ifFalse:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4743
		    Delay waitForMilliseconds:100.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4744
		].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4745
	    ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4746
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4747
	] forkAt:(Processor userSchedulingPriority + 2).
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4748
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4749
    treeModel notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4750
	treeModel targetWidgetChanged.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4751
    ].
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4752
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4753
    ^ root.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4754
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4755
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4756
rootView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4757
    "returns the widget assigned to the root or nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4758
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4759
    ^ root notNil ifTrue:[root widget] ifFalse:[nil]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4760
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4761
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4762
treeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4763
    "returne the treeModel, a ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4764
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4765
    ^ treeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4766
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4767
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4768
!ViewTreeInspectorApplication::ViewTreeModel::ItemList methodsFor:'accessing look'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4769
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4770
additionalLabelForItem:anItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4771
    "answer the additional lable for an item or nil"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4772
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4773
    |widget l applClass applClassName key label|
3017
d971763e5d03 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3014
diff changeset
  4774
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  4775
    l := nil.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4776
    showWidgetNames == true ifTrue:[
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4777
        (widget := anItem widget) notNil ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4778
            l := '"', widget name, '"'
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4779
        ] ifFalse:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4780
            "/ a menuItem
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4781
            anItem menuItem isSeparator ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4782
            ] ifFalse:[    
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4783
                label := anItem menuItem label.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4784
                label isImage ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4785
                    l := ''
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4786
                ] ifFalse:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4787
                    l := '"', label asString, '"'
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4788
                ].
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4789
                l := l , ' value: ',anItem menuItem itemValue printString.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4790
            ].
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4791
        ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4792
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4793
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4794
    anItem isApplicationClass ifTrue:[
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4795
        applClass := anItem applicationClass.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4796
        applClass notNil ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4797
            applClassName := '[', applClass name allBold, ']'.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4798
            l := (l isNil ifTrue:[''] ifFalse:[l , ' ']) , applClassName
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4799
        ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4800
    ].
3017
d971763e5d03 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3014
diff changeset
  4801
d971763e5d03 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3014
diff changeset
  4802
    application notNil ifTrue:[
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4803
        key := application builder namedComponents keyAtValue:widget ifAbsent:nil.
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4804
        key notNil ifTrue:[
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4805
            l := l , ' #',key
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4806
        ].
3017
d971763e5d03 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3014
diff changeset
  4807
    ].
d971763e5d03 class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 3014
diff changeset
  4808
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  4809
    ^ l
3456
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  4810
4d4297bad4fa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3453
diff changeset
  4811
    "Modified: / 16-08-2017 / 12:47:12 / cg"
3667
0b24b3e8c949 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3660
diff changeset
  4812
    "Modified: / 27-05-2019 / 13:19:35 / Claus Gittinger"
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4813
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4814
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4815
showWidgetNames
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4816
    "answer true if the additional text is the widget name
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4817
     otherwise the name of the application"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4818
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  4819
    ^ showWidgetNames ? true
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4820
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4821
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4822
showWidgetNames:aBoolean
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4823
    "set true if the additional text is the widget name
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4824
     otherwise the name of the application"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4825
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4826
    self showWidgetNames == aBoolean ifFalse:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4827
	showWidgetNames := aBoolean.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4828
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4829
	root notNil ifTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4830
	    root recursiveAdditionalNameBehaviourChanged.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4831
	    self changed.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4832
	].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4833
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4834
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4835
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4836
!ViewTreeInspectorApplication::ViewTreeModel::ItemList methodsFor:'event processing'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4837
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4838
processEvent:anEvent
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4839
    "post process event
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4840
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4841
    ^ treeModel isInTestMode not
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4842
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4843
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4844
!ViewTreeInspectorApplication::ViewTreeModel::ItemList methodsFor:'instance creation'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4845
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4846
on:aModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4847
    "set the model, a ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4848
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4849
    treeModel := aModel.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4850
    showRoot  := true.
2762
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  4851
    "/ showWidgetNames := false.
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
  4852
    showWidgetNames := true.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4853
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4854
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4855
!ViewTreeInspectorApplication::ViewTreeModel::ItemList methodsFor:'searching'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4856
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4857
detectItemRespondsToView:aView
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4858
    "returns the bottom-most item which contains the view
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4859
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4860
    |view item topView|
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4861
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4862
    root notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4863
	view    := aView.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4864
	topView := root widget.
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4865
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4866
	[ view notNil ] whileTrue:[
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4867
	    topView == view ifTrue:[^ root].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4868
	    item := root recursiveDetect:[:el| el widget == view ].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4869
	    item notNil ifTrue:[^ item].
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4870
	    view := view superView
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4871
	]
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4872
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4873
    ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4874
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4875
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4876
recursiveDetect:aOneOrgBlock
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4877
    "recursive find the first child, for which evaluation
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4878
     of the block returns true; if none nil is returned
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4879
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4880
    root notNil ifTrue:[
3524
366f04fbfb23 flyByHelpSpec -> helpSpec
Claus Gittinger <cg@exept.de>
parents: 3500
diff changeset
  4881
	(aOneOrgBlock value:root) ifTrue:[ ^ root ].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4882
      ^ root recursiveDetect:aOneOrgBlock
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4883
    ].
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4884
    ^ nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4885
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4886
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4887
!ViewTreeInspectorApplication class methodsFor:'documentation'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4888
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4889
version
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4890
    ^ '$Header$'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4891
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4892
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4893
version_CVS
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4894
    ^ '$Header$'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4895
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4896
2978
a952dfdb1b6a class: Tools::ViewTreeInspectorApplication
Claus Gittinger <cg@exept.de>
parents: 2888
diff changeset
  4897
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4898
ViewTreeInspectorApplication initialize!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  4899
ViewTreeInspectorApplication::ViewTreeItem initialize!