Tools__ViewTreeApplication.st
author Claus Gittinger <cg@exept.de>
Wed, 03 Feb 2010 11:09:47 +0100
changeset 2747 717a0dcc710d
parent 2744 5bee95e91ffd
child 2748 76f6fd319918
permissions -rw-r--r--
added: #openInPickMode
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
     1
"{ Package: 'stx:libtool2' }"
87bb1815460b initial checkin
ca
parents:
diff changeset
     2
87bb1815460b initial checkin
ca
parents:
diff changeset
     3
"{ NameSpace: Tools }"
87bb1815460b initial checkin
ca
parents:
diff changeset
     4
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
     5
ToolApplicationModel subclass:#ViewTreeInspectorApplication
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
     6
	instanceVariableNames:'model treeView hasSingleSelectionHolder clickedItem clickedPoint
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
     7
		motionAction process followFocusChannel showNamesHolder'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
     8
	classVariableNames:''
87bb1815460b initial checkin
ca
parents:
diff changeset
     9
	poolDictionaries:''
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    10
	category:'Interface-Smalltalk'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    11
!
87bb1815460b initial checkin
ca
parents:
diff changeset
    12
87bb1815460b initial checkin
ca
parents:
diff changeset
    13
Object subclass:#MenuDesc
87bb1815460b initial checkin
ca
parents:
diff changeset
    14
	instanceVariableNames:'title value action'
87bb1815460b initial checkin
ca
parents:
diff changeset
    15
	classVariableNames:''
87bb1815460b initial checkin
ca
parents:
diff changeset
    16
	poolDictionaries:''
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    17
	privateIn:ViewTreeInspectorApplication
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    18
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    19
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    20
HierarchicalItem subclass:#ViewTreeItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    21
	instanceVariableNames:'widget isDrawnShown exists xOffsetAdditionalName'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    22
	classVariableNames:'HandleExtent'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    23
	poolDictionaries:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    24
	privateIn:ViewTreeInspectorApplication
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    25
!
87bb1815460b initial checkin
ca
parents:
diff changeset
    26
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    27
ValueModel subclass:#ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    28
	instanceVariableNames:'lockSema selectedSuperItems selection hiddenLevel listOfItems
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    29
		inputEventAction mappedViewAction beforeSelectionChangedAction
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    30
		icons timedUpdateTask selectOnClickHolder testModeChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    31
		hasTargetWidgetChannel'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    32
	classVariableNames:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    33
	poolDictionaries:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    34
	privateIn:ViewTreeInspectorApplication
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    35
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    36
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    37
HierarchicalList subclass:#ItemList
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    38
	instanceVariableNames:'treeModel eventHook eventHookInitialized showWidgetNames'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    39
	classVariableNames:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    40
	poolDictionaries:''
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    41
	privateIn:ViewTreeInspectorApplication::ViewTreeModel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    42
!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    43
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    44
!ViewTreeInspectorApplication class methodsFor:'documentation'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    45
87bb1815460b initial checkin
ca
parents:
diff changeset
    46
documentation
87bb1815460b initial checkin
ca
parents:
diff changeset
    47
"
87bb1815460b initial checkin
ca
parents:
diff changeset
    48
     Small application showing a ViewTreeModel use.
87bb1815460b initial checkin
ca
parents:
diff changeset
    49
87bb1815460b initial checkin
ca
parents:
diff changeset
    50
     It displays a hierarchical list of a selected TopView and
87bb1815460b initial checkin
ca
parents:
diff changeset
    51
     all its contained subViews.
87bb1815460b initial checkin
ca
parents:
diff changeset
    52
     Useful to have a look at subcomponents - to see how views
87bb1815460b initial checkin
ca
parents:
diff changeset
    53
     are structured.
87bb1815460b initial checkin
ca
parents:
diff changeset
    54
87bb1815460b initial checkin
ca
parents:
diff changeset
    55
87bb1815460b initial checkin
ca
parents:
diff changeset
    56
    [Instance variables:]
87bb1815460b initial checkin
ca
parents:
diff changeset
    57
        model           <ViewTreeModel>      the used ViewTreeModel
87bb1815460b initial checkin
ca
parents:
diff changeset
    58
        clickedItem     <ViewTreeItem>       item under the clickedPoint (motion action)
87bb1815460b initial checkin
ca
parents:
diff changeset
    59
        clickedPoint    <Point>              point where the motion action started from.
87bb1815460b initial checkin
ca
parents:
diff changeset
    60
        motionAction    <Action>             (oneArg-) action called durring buttonMotion.
87bb1815460b initial checkin
ca
parents:
diff changeset
    61
87bb1815460b initial checkin
ca
parents:
diff changeset
    62
87bb1815460b initial checkin
ca
parents:
diff changeset
    63
    [author:]
87bb1815460b initial checkin
ca
parents:
diff changeset
    64
        Claus Atzkern
87bb1815460b initial checkin
ca
parents:
diff changeset
    65
87bb1815460b initial checkin
ca
parents:
diff changeset
    66
    [see also:]
87bb1815460b initial checkin
ca
parents:
diff changeset
    67
        ViewTreeModel
87bb1815460b initial checkin
ca
parents:
diff changeset
    68
        ViewTreeItem
87bb1815460b initial checkin
ca
parents:
diff changeset
    69
"
87bb1815460b initial checkin
ca
parents:
diff changeset
    70
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
    71
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    72
!ViewTreeInspectorApplication class methodsFor:'initialization'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    73
87bb1815460b initial checkin
ca
parents:
diff changeset
    74
initialize
87bb1815460b initial checkin
ca
parents:
diff changeset
    75
    "add myself to the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
    76
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
    77
    self installInLauncher.
87bb1815460b initial checkin
ca
parents:
diff changeset
    78
!
87bb1815460b initial checkin
ca
parents:
diff changeset
    79
87bb1815460b initial checkin
ca
parents:
diff changeset
    80
installInLauncher
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    81
    "add myself to the launcher menu"
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    82
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    83
    |menuItem icon|
87bb1815460b initial checkin
ca
parents:
diff changeset
    84
87bb1815460b initial checkin
ca
parents:
diff changeset
    85
    NewLauncher isNil ifTrue:[^ self].
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    86
    "/ cg - disabled. the icon is too ugly.
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    87
    ^ self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    88
87bb1815460b initial checkin
ca
parents:
diff changeset
    89
    icon := ToolbarIconLibrary inspectLocals20x20Icon magnifiedTo:28@28.
87bb1815460b initial checkin
ca
parents:
diff changeset
    90
87bb1815460b initial checkin
ca
parents:
diff changeset
    91
    menuItem := MenuItem new 
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    92
                    label: 'View Tree Inspector';
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
    93
                    value: [ ViewTreeInspectorApplication open];
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
    94
                    isButton: true;
87bb1815460b initial checkin
ca
parents:
diff changeset
    95
                    icon: icon;
87bb1815460b initial checkin
ca
parents:
diff changeset
    96
                    nameKey: #viewInspect.
87bb1815460b initial checkin
ca
parents:
diff changeset
    97
87bb1815460b initial checkin
ca
parents:
diff changeset
    98
    menuItem startGroup:#right.
87bb1815460b initial checkin
ca
parents:
diff changeset
    99
    NewLauncher addMenuItem:menuItem in:'toolbar'
87bb1815460b initial checkin
ca
parents:
diff changeset
   100
                   position:#( #before #help)
87bb1815460b initial checkin
ca
parents:
diff changeset
   101
                      space:false.
87bb1815460b initial checkin
ca
parents:
diff changeset
   102
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
self removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   106
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   107
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   108
87bb1815460b initial checkin
ca
parents:
diff changeset
   109
postAutoload
87bb1815460b initial checkin
ca
parents:
diff changeset
   110
    "add myself to the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   111
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   112
    self installInLauncher.
87bb1815460b initial checkin
ca
parents:
diff changeset
   113
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   114
self installInLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   115
self removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   116
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   117
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   118
87bb1815460b initial checkin
ca
parents:
diff changeset
   119
removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   120
    "remove myself from the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   121
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   122
    NewLauncher isNil ifTrue:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
   123
    NewLauncher removeUserTool:#viewInspect
87bb1815460b initial checkin
ca
parents:
diff changeset
   124
87bb1815460b initial checkin
ca
parents:
diff changeset
   125
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   126
self installInLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   127
self removeFromLauncher
87bb1815460b initial checkin
ca
parents:
diff changeset
   128
"
87bb1815460b initial checkin
ca
parents:
diff changeset
   129
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   130
87bb1815460b initial checkin
ca
parents:
diff changeset
   131
unload
87bb1815460b initial checkin
ca
parents:
diff changeset
   132
    "class is about to be unloaded - remove myself from the launcher menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   133
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   134
    self removeFromLauncher.
87bb1815460b initial checkin
ca
parents:
diff changeset
   135
    super unload.
87bb1815460b initial checkin
ca
parents:
diff changeset
   136
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   137
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   138
!ViewTreeInspectorApplication class methodsFor:'image specs'!
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   139
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   140
pickWindowIcon
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   141
    "This resource specification was automatically generated
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   142
     by the ImageEditor of ST/X."
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   143
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   144
    "Do not manually edit this!! If it is corrupted,
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   145
     the ImageEditor may not be able to read the specification."
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   146
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   147
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   148
     self pickWindowIcon inspect
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   149
     ImageEditor openOnClass:self andSelector:#pickWindowIcon
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   150
     Icon flushCachedIcons
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   151
    "
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   152
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   153
    <resource: #image>
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   154
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   155
    ^Icon
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   156
        constantNamed:'Tools::ViewTreeInspectorApplication class pickWindowIcon'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   157
        ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   158
,;N3,;N3,;N3,;N3,;N3,;N3,;N3,3H<P38;M3P,H2@^GA(VEQHQCP0KA D<[&-%XU=WST%BN#D!!GQ$TD@(IBP\BQF)+Z6E_U4-FPCX+G1,WEA@JBP$HAT23
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   159
,;N3,;N3,;N3,;N$():Z&IRR&1!!^,;N3,;N3,;N3,;N$)JJ^&)"T$),0W[N3,;N3,;N3,;N3,:R"'')*X%IJWK523,;N3,;N3,0@@@KN3)JJ^&)"T$"5Z,;N3
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   160
,;N3@@B3-KL@@JJ^&)"T$)D*V[N3,;N3@KN3-KR4)JH@&)"T$)*MJE"3,;N3,0B3)JJ4&*R"@I*X%IJZ#RYV,;N3,0B3@JR"-JR"-I(@%IJV%H %U[N3,;L@
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   161
-@B4-KR4-KR4@IRR%IJEIER3,;N3@KL@)JJ4():4&@BO#9RR!!RIS,;N3,;L@,:R"-JJ^& BT#8>O#8H"T+N3,;N3@KN$@@@@'')(@%H>O#(>AH%F3,;N3,;L@
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   162
@JR4'' @@%IJO#8>O RIO,;N3,;N3):P@@@BX%IJO#8>O#7<"S*63,;N$():Z&IRR&IRR#8>O#8=>H"&-,;N$():Z&IRR&)"T$(>O#8>O @<)R$!!GQTD?OS$8
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   163
MSL.I2H"H"H"H"HO,;N3,;N3,;N3,;N3,;N3,;N3,;N3,0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 0 50 164 0 50 171 0 137 0 0 206 0 1 50 177 2 56 178 3 64 241 3 67 246 3 73 255 4 74 255 5 63 191 7 66 194 10 71 196 10 79 255 12 59 167 12 82 255 14 77 199 18 83 201 19 88 255 21 91 255 23 89 204 27 95 206 28 97 255 29 72 179 30 100 255 32 101 209 36 106 255 36 107 211 39 109 255 41 113 214 45 115 255 45 119 216 48 118 255 50 87 176 50 125 219 51 88 176 51 88 177 52 89 178 52 90 178 53 90 178 53 127 212 54 91 179 54 123 255 54 131 221 55 92 180 55 95 181 56 93 180 56 94 181 57 127 255 57 149 229 58 99 184 58 137 224 61 104 187 63 132 255 63 143 226 64 108 190 66 113 193 66 135 255 67 149 229 68 157 232 69 117 196 71 155 231 72 122 199 72 141 255 75 126 202 75 144 255 75 160 234 77 163 236 78 131 206 80 149 255 81 136 209 84 140 212 84 153 255 87 145 215 88 157 255 91 168 235 93 161 255 94 154 222 96 157 223 96 165 255 97 159 225 98 160 225 98 162 226 99 163 227 100 165 228 101 166 229 101 170 255 102 167 230 103 169 231 104 170 232 104 173 255 105 172 233 105 174 234 106 175 235 109 178 255 112 180 255 117 186 255 119 187 255 122 154 245 125 160 253 125 193 255 126 161 253 126 194 255 127 162 254 130 165 254 132 200 255 132 201 255 133 60 36 135 170 255 139 207 255 140 175 255 144 179 255 149 184 255 153 188 255 157 192 255 162 196 255 166 200 255 170 204 255 174 208 255 174 218 230 177 212 255 181 215 255 185 219 255 188 222 255 191 225 255 212 211 224 218 217 230 219 219 230 220 220 231 222 221 232 223 223 233 225 224 234 225 225 234 226 226 237 227 226 235 227 227 236 227 227 238 228 228 237 229 229 239 231 230 238 231 231 238 231 231 240 232 232 241 233 232 239 233 233 240 234 234 242 235 234 241 236 236 243 237 236 242 237 237 244 238 237 243 238 238 244 239 238 243 239 239 245 240 239 244 241 240 245 241 241 246 241 241 247 242 242 246 242 242 247 243 243 247 243 243 248 244 244 248 244 244 249 245 244 247 246 246 249 246 246 250 247 246 249 247 247 250 248 248 251 249 249 250 249 249 251 250 250 251 250 250 252 251 251 252 251 251 253 253 253 254 254 254 255 255 255 255 0 0 0]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@C????????????????????????????????????????????????????????????????????????????????@@@C') ; yourself); yourself]
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   164
! !
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   165
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   166
!ViewTreeInspectorApplication class methodsFor:'interface specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   167
87bb1815460b initial checkin
ca
parents:
diff changeset
   168
windowSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
   169
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   170
     by the UIPainter of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   171
87bb1815460b initial checkin
ca
parents:
diff changeset
   172
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   173
     the UIPainter may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   174
87bb1815460b initial checkin
ca
parents:
diff changeset
   175
    "
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   176
     UIPainter new openOnClass:Tools::ViewTreeApplication andSelector:#windowSpec
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   177
     Tools::ViewTreeApplication new openInterface:#windowSpec
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   178
     Tools::ViewTreeApplication open
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   179
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   180
87bb1815460b initial checkin
ca
parents:
diff changeset
   181
    <resource: #canvas>
87bb1815460b initial checkin
ca
parents:
diff changeset
   182
87bb1815460b initial checkin
ca
parents:
diff changeset
   183
    ^ 
87bb1815460b initial checkin
ca
parents:
diff changeset
   184
     #(FullSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
   185
        name: windowSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
   186
        window: 
87bb1815460b initial checkin
ca
parents:
diff changeset
   187
       (WindowSpec
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   188
          label: 'View Tree Inspector'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   189
          name: 'ViewTreeInspector'
87bb1815460b initial checkin
ca
parents:
diff changeset
   190
          min: (Point 10 10)
87bb1815460b initial checkin
ca
parents:
diff changeset
   191
          max: (Point 1024 9999)
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   192
          bounds: (Rectangle 0 0 381 654)
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   193
          menu: menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   194
        )
87bb1815460b initial checkin
ca
parents:
diff changeset
   195
        component: 
87bb1815460b initial checkin
ca
parents:
diff changeset
   196
       (SpecCollection
87bb1815460b initial checkin
ca
parents:
diff changeset
   197
          collection: (
87bb1815460b initial checkin
ca
parents:
diff changeset
   198
           (MenuPanelSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
   199
              name: 'toolbarMenu'
87bb1815460b initial checkin
ca
parents:
diff changeset
   200
              layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
87bb1815460b initial checkin
ca
parents:
diff changeset
   201
              menu: toolbarMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   202
              textDefault: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   203
            )
87bb1815460b initial checkin
ca
parents:
diff changeset
   204
           (HierarchicalListViewSpec
87bb1815460b initial checkin
ca
parents:
diff changeset
   205
              name: 'List'
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   206
              layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   207
              level: 1
87bb1815460b initial checkin
ca
parents:
diff changeset
   208
              model: model
87bb1815460b initial checkin
ca
parents:
diff changeset
   209
              menu: middleButtonMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   210
              hasHorizontalScrollBar: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   211
              hasVerticalScrollBar: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   212
              miniScrollerHorizontal: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   213
              miniScrollerVertical: false
87bb1815460b initial checkin
ca
parents:
diff changeset
   214
              listModel: listOfItems
87bb1815460b initial checkin
ca
parents:
diff changeset
   215
              multipleSelectOk: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   216
              useIndex: false
87bb1815460b initial checkin
ca
parents:
diff changeset
   217
              highlightMode: label
87bb1815460b initial checkin
ca
parents:
diff changeset
   218
              showLeftIndicators: false
87bb1815460b initial checkin
ca
parents:
diff changeset
   219
              indicatorSelector: indicatorClicked:
87bb1815460b initial checkin
ca
parents:
diff changeset
   220
              useDefaultIcons: false
87bb1815460b initial checkin
ca
parents:
diff changeset
   221
              postBuildCallback: postBuildTree:
87bb1815460b initial checkin
ca
parents:
diff changeset
   222
            )
87bb1815460b initial checkin
ca
parents:
diff changeset
   223
           )
87bb1815460b initial checkin
ca
parents:
diff changeset
   224
         
87bb1815460b initial checkin
ca
parents:
diff changeset
   225
        )
87bb1815460b initial checkin
ca
parents:
diff changeset
   226
      )
87bb1815460b initial checkin
ca
parents:
diff changeset
   227
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   228
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   229
!ViewTreeInspectorApplication class methodsFor:'menu specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   230
87bb1815460b initial checkin
ca
parents:
diff changeset
   231
menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   232
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   233
     by the MenuEditor of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   234
87bb1815460b initial checkin
ca
parents:
diff changeset
   235
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   236
     the MenuEditor may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   237
87bb1815460b initial checkin
ca
parents:
diff changeset
   238
    "
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   239
     MenuEditor new openOnClass:Tools::ViewTreeApplication andSelector:#menu
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   240
     (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeApplication menu)) startUp
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   241
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   242
87bb1815460b initial checkin
ca
parents:
diff changeset
   243
    <resource: #menu>
87bb1815460b initial checkin
ca
parents:
diff changeset
   244
87bb1815460b initial checkin
ca
parents:
diff changeset
   245
    ^ 
87bb1815460b initial checkin
ca
parents:
diff changeset
   246
     #(Menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   247
        (
87bb1815460b initial checkin
ca
parents:
diff changeset
   248
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   249
            label: 'File'
87bb1815460b initial checkin
ca
parents:
diff changeset
   250
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   251
            submenu: 
87bb1815460b initial checkin
ca
parents:
diff changeset
   252
           (Menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   253
              (
87bb1815460b initial checkin
ca
parents:
diff changeset
   254
               (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   255
                  label: 'Pick a View'
87bb1815460b initial checkin
ca
parents:
diff changeset
   256
                  itemValue: doPickViews
87bb1815460b initial checkin
ca
parents:
diff changeset
   257
                  translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   258
                )
87bb1815460b initial checkin
ca
parents:
diff changeset
   259
               (MenuItem
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   260
                  enabled: hasTargetWidgetChannel
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   261
                  label: 'Release Picked View'
87bb1815460b initial checkin
ca
parents:
diff changeset
   262
                  itemValue: doUnpick
87bb1815460b initial checkin
ca
parents:
diff changeset
   263
                  translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   264
                )
87bb1815460b initial checkin
ca
parents:
diff changeset
   265
               (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   266
                  label: '-'
87bb1815460b initial checkin
ca
parents:
diff changeset
   267
                )
87bb1815460b initial checkin
ca
parents:
diff changeset
   268
               (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   269
                  label: 'Settings'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   270
                  translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   271
                  submenu: 
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   272
                 (Menu
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   273
                    (
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   274
                     (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   275
                        label: 'Test Mode'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   276
                        translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   277
                        hideMenuOnActivated: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   278
                        indication: testModeChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   279
                      )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   280
                     (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   281
                        enabled: testModeChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   282
                        label: 'Follow Focus'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   283
                        translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   284
                        hideMenuOnActivated: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   285
                        indication: followFocusChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   286
                      )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   287
                     (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   288
                        label: '-'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   289
                      )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   290
                     (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   291
                        label: 'Select on Click'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   292
                        translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   293
                        hideMenuOnActivated: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   294
                        indication: selectOnClickHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   295
                      )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   296
                     (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   297
                        label: '-'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   298
                      )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   299
                     (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   300
                        label: 'Show Name of Widgets'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   301
                        translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   302
                        hideMenuOnActivated: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   303
                        indication: showNamesHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   304
                      )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   305
                     )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   306
                    nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   307
                    nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   308
                  )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   309
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   310
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   311
                  label: '-'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   312
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   313
               (MenuItem
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   314
                  label: 'Exit'
87bb1815460b initial checkin
ca
parents:
diff changeset
   315
                  itemValue: closeRequest
87bb1815460b initial checkin
ca
parents:
diff changeset
   316
                  translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   317
                )
87bb1815460b initial checkin
ca
parents:
diff changeset
   318
               )
87bb1815460b initial checkin
ca
parents:
diff changeset
   319
              nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   320
              nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   321
            )
87bb1815460b initial checkin
ca
parents:
diff changeset
   322
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   323
         (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   324
            enabled: hasSingleSelectionHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   325
            label: 'Selection'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   326
            translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   327
            submenuChannel: middleButtonMenu
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   328
          )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   329
         (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   330
            label: 'Application'
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   331
            translateLabel: true
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   332
            submenu: 
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   333
           (Menu
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   334
              (
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   335
               (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   336
                  enabled: hasSingleSelectionHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   337
                  label: 'Browse'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   338
                  itemValue: doBrowse:
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   339
                  translateLabel: true
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   340
                  argument: application
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   341
                )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   342
               (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   343
                  enabled: hasSingleSelectionHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   344
                  label: 'Inspect'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   345
                  itemValue: doInspect:
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   346
                  translateLabel: true
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   347
                  argument: application
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   348
                )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   349
               (MenuItem
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   350
                  label: '-'
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   351
                )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   352
               (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   353
                  enabled: hasTargetWidgetChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   354
                  label: 'All Applications'
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   355
                  translateLabel: true
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   356
                  submenuChannel: submenuApplications:
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   357
                )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   358
               )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   359
              nil
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   360
              nil
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   361
            )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   362
          )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   363
         (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   364
            label: 'Widget'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   365
            translateLabel: true
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   366
            submenu: 
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   367
           (Menu
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   368
              (
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   369
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   370
                  enabled: hasSingleSelectionHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   371
                  label: 'Browse'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   372
                  itemValue: doBrowse:
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   373
                  translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   374
                  argument: view
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   375
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   376
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   377
                  enabled: hasSingleSelectionHolder
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   378
                  label: 'Inspect'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   379
                  itemValue: doInspect:
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   380
                  translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   381
                  argument: view
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   382
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   383
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   384
                  label: '-'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   385
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   386
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   387
                  enabled: hasTargetWidgetChannel
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   388
                  label: 'All Components'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   389
                  translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   390
                  startGroup: right
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   391
                  submenuChannel: submenuComponents:
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   392
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   393
               )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   394
              nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   395
              nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   396
            )
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   397
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   398
         (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   399
            label: 'Help'
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   400
            translateLabel: true
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   401
            startGroup: conditionalRight
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   402
            submenu: 
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   403
           (Menu
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   404
              (
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   405
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   406
                  label: 'Documentation'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   407
                  itemValue: openDocumentation
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   408
                  translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   409
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   410
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   411
                  label: '-'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   412
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   413
               (MenuItem
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   414
                  label: 'About this Application...'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   415
                  itemValue: openAboutThisApplication
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   416
                  translateLabel: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   417
                )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   418
               )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   419
              nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   420
              nil
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   421
            )
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   422
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   423
         )
87bb1815460b initial checkin
ca
parents:
diff changeset
   424
        nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   425
        nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   426
      )
87bb1815460b initial checkin
ca
parents:
diff changeset
   427
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   428
87bb1815460b initial checkin
ca
parents:
diff changeset
   429
middleButtonMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   430
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   431
     by the MenuEditor of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   432
87bb1815460b initial checkin
ca
parents:
diff changeset
   433
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   434
     the MenuEditor may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   435
87bb1815460b initial checkin
ca
parents:
diff changeset
   436
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   437
     MenuEditor new openOnClass:ViewTreeApplication andSelector:#middleButtonMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   438
     (Menu new fromLiteralArrayEncoding:(ViewTreeApplication middleButtonMenu)) startUp
87bb1815460b initial checkin
ca
parents:
diff changeset
   439
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   440
87bb1815460b initial checkin
ca
parents:
diff changeset
   441
    <resource: #menu>
87bb1815460b initial checkin
ca
parents:
diff changeset
   442
87bb1815460b initial checkin
ca
parents:
diff changeset
   443
    ^ 
87bb1815460b initial checkin
ca
parents:
diff changeset
   444
     #(Menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   445
        (
87bb1815460b initial checkin
ca
parents:
diff changeset
   446
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   447
            label: 'Geometry'
87bb1815460b initial checkin
ca
parents:
diff changeset
   448
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   449
            submenuChannel: submenuGeometry:
87bb1815460b initial checkin
ca
parents:
diff changeset
   450
            keepLinkedMenu: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   451
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   452
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   453
            label: 'Interface'
87bb1815460b initial checkin
ca
parents:
diff changeset
   454
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   455
            submenuChannel: submenuInterface:
87bb1815460b initial checkin
ca
parents:
diff changeset
   456
            keepLinkedMenu: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   457
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   458
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   459
            label: 'Visibility'
87bb1815460b initial checkin
ca
parents:
diff changeset
   460
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   461
            submenuChannel: submenuVisibility:
87bb1815460b initial checkin
ca
parents:
diff changeset
   462
            keepLinkedMenu: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   463
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   464
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   465
            label: '-'
87bb1815460b initial checkin
ca
parents:
diff changeset
   466
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   467
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   468
            label: 'Browse View Class'
87bb1815460b initial checkin
ca
parents:
diff changeset
   469
            itemValue: doBrowse:
87bb1815460b initial checkin
ca
parents:
diff changeset
   470
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   471
            argument: view
87bb1815460b initial checkin
ca
parents:
diff changeset
   472
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   473
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   474
            label: 'Browse Model Class'
87bb1815460b initial checkin
ca
parents:
diff changeset
   475
            itemValue: doBrowse:
87bb1815460b initial checkin
ca
parents:
diff changeset
   476
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   477
            isVisible: hasModel
87bb1815460b initial checkin
ca
parents:
diff changeset
   478
            argument: model
87bb1815460b initial checkin
ca
parents:
diff changeset
   479
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   480
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   481
            label: 'Browse Application Class'
87bb1815460b initial checkin
ca
parents:
diff changeset
   482
            itemValue: doBrowse:
87bb1815460b initial checkin
ca
parents:
diff changeset
   483
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   484
            isVisible: hasApplication
87bb1815460b initial checkin
ca
parents:
diff changeset
   485
            argument: application
87bb1815460b initial checkin
ca
parents:
diff changeset
   486
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   487
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   488
            label: 'Browse Controller Class'
87bb1815460b initial checkin
ca
parents:
diff changeset
   489
            itemValue: doBrowse:
87bb1815460b initial checkin
ca
parents:
diff changeset
   490
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   491
            isVisible: hasController
87bb1815460b initial checkin
ca
parents:
diff changeset
   492
            argument: controller
87bb1815460b initial checkin
ca
parents:
diff changeset
   493
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   494
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   495
            label: '-'
87bb1815460b initial checkin
ca
parents:
diff changeset
   496
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   497
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   498
            label: 'Inspect View'
87bb1815460b initial checkin
ca
parents:
diff changeset
   499
            itemValue: doInspect:
87bb1815460b initial checkin
ca
parents:
diff changeset
   500
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   501
            argument: view
87bb1815460b initial checkin
ca
parents:
diff changeset
   502
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   503
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   504
            label: 'Inspect Window Group'
87bb1815460b initial checkin
ca
parents:
diff changeset
   505
            itemValue: doInspect:
87bb1815460b initial checkin
ca
parents:
diff changeset
   506
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   507
            argument: group
87bb1815460b initial checkin
ca
parents:
diff changeset
   508
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   509
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   510
            label: 'Inspect Model'
87bb1815460b initial checkin
ca
parents:
diff changeset
   511
            itemValue: doInspect:
87bb1815460b initial checkin
ca
parents:
diff changeset
   512
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   513
            isVisible: hasModel
87bb1815460b initial checkin
ca
parents:
diff changeset
   514
            argument: model
87bb1815460b initial checkin
ca
parents:
diff changeset
   515
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   516
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   517
            label: 'Inspect Application'
87bb1815460b initial checkin
ca
parents:
diff changeset
   518
            itemValue: doInspect:
87bb1815460b initial checkin
ca
parents:
diff changeset
   519
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   520
            isVisible: hasApplication
87bb1815460b initial checkin
ca
parents:
diff changeset
   521
            argument: application
87bb1815460b initial checkin
ca
parents:
diff changeset
   522
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   523
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   524
            label: 'Inspect Controller'
87bb1815460b initial checkin
ca
parents:
diff changeset
   525
            itemValue: doInspect:
87bb1815460b initial checkin
ca
parents:
diff changeset
   526
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   527
            isVisible: hasController
87bb1815460b initial checkin
ca
parents:
diff changeset
   528
            argument: controller
87bb1815460b initial checkin
ca
parents:
diff changeset
   529
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   530
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   531
            label: '-'
87bb1815460b initial checkin
ca
parents:
diff changeset
   532
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   533
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   534
            label: 'Flash'
87bb1815460b initial checkin
ca
parents:
diff changeset
   535
            itemValue: doFlash
87bb1815460b initial checkin
ca
parents:
diff changeset
   536
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   537
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   538
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   539
            label: '-'
87bb1815460b initial checkin
ca
parents:
diff changeset
   540
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   541
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   542
            label: 'Destroy'
87bb1815460b initial checkin
ca
parents:
diff changeset
   543
            itemValue: doDestroy
87bb1815460b initial checkin
ca
parents:
diff changeset
   544
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   545
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   546
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   547
            label: '-'
87bb1815460b initial checkin
ca
parents:
diff changeset
   548
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   549
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   550
            label: 'Instance Variables'
87bb1815460b initial checkin
ca
parents:
diff changeset
   551
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   552
            submenuChannel: submenuInspector:
87bb1815460b initial checkin
ca
parents:
diff changeset
   553
            keepLinkedMenu: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   554
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   555
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   556
            label: '='
87bb1815460b initial checkin
ca
parents:
diff changeset
   557
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   558
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   559
            label: ''
87bb1815460b initial checkin
ca
parents:
diff changeset
   560
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   561
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   562
            enabled: selectedComponentHasChildren
87bb1815460b initial checkin
ca
parents:
diff changeset
   563
            label: 'Applications'
87bb1815460b initial checkin
ca
parents:
diff changeset
   564
            nameKey: single
87bb1815460b initial checkin
ca
parents:
diff changeset
   565
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   566
            submenuChannel: submenuApplications:
87bb1815460b initial checkin
ca
parents:
diff changeset
   567
            keepLinkedMenu: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   568
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   569
         (MenuItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   570
            enabled: selectedComponentHasChildren
87bb1815460b initial checkin
ca
parents:
diff changeset
   571
            label: 'Components'
87bb1815460b initial checkin
ca
parents:
diff changeset
   572
            nameKey: single
87bb1815460b initial checkin
ca
parents:
diff changeset
   573
            translateLabel: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   574
            submenuChannel: submenuComponents:
87bb1815460b initial checkin
ca
parents:
diff changeset
   575
            keepLinkedMenu: true
87bb1815460b initial checkin
ca
parents:
diff changeset
   576
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   577
         )
87bb1815460b initial checkin
ca
parents:
diff changeset
   578
        nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   579
        nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   580
      )
87bb1815460b initial checkin
ca
parents:
diff changeset
   581
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   582
87bb1815460b initial checkin
ca
parents:
diff changeset
   583
toolbarMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
   584
    "This resource specification was automatically generated
87bb1815460b initial checkin
ca
parents:
diff changeset
   585
     by the MenuEditor of ST/X."
87bb1815460b initial checkin
ca
parents:
diff changeset
   586
87bb1815460b initial checkin
ca
parents:
diff changeset
   587
    "Do not manually edit this!! If it is corrupted,
87bb1815460b initial checkin
ca
parents:
diff changeset
   588
     the MenuEditor may not be able to read the specification."
87bb1815460b initial checkin
ca
parents:
diff changeset
   589
87bb1815460b initial checkin
ca
parents:
diff changeset
   590
    "
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   591
     MenuEditor new openOnClass:Tools::ViewTreeApplication andSelector:#toolbarMenu
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   592
     (Menu new fromLiteralArrayEncoding:(Tools::ViewTreeApplication toolbarMenu)) startUp
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   593
    "
87bb1815460b initial checkin
ca
parents:
diff changeset
   594
87bb1815460b initial checkin
ca
parents:
diff changeset
   595
    <resource: #menu>
87bb1815460b initial checkin
ca
parents:
diff changeset
   596
87bb1815460b initial checkin
ca
parents:
diff changeset
   597
    ^ 
87bb1815460b initial checkin
ca
parents:
diff changeset
   598
     #(Menu
87bb1815460b initial checkin
ca
parents:
diff changeset
   599
        (
87bb1815460b initial checkin
ca
parents:
diff changeset
   600
         (MenuItem
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   601
            label: 'Pick a View'
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   602
            itemValue: doPickViews
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   603
            translateLabel: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   604
            isButton: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   605
            hideMenuOnActivated: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   606
            labelImage: (ResourceRetriever #'Tools::ViewTreeInspectorApplication' pickWindowIcon)
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   607
          )
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   608
         (MenuItem
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   609
            enabled: hasSingleSelectionHolder
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   610
            label: 'Browse Application'
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   611
            itemValue: doBrowse:
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   612
            translateLabel: false
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   613
            isButton: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   614
            hideMenuOnActivated: false
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   615
            labelImage: (ResourceRetriever ToolbarIconLibrary systemBrowser24x24Icon2)
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   616
            argument: application
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   617
          )
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   618
         (MenuItem
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   619
            enabled: hasSingleSelectionHolder
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   620
            label: 'Inspect Application'
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   621
            itemValue: doInspect:
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   622
            translateLabel: false
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   623
            isButton: true
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   624
            hideMenuOnActivated: false
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   625
            labelImage: (ResourceRetriever ToolbarIconLibrary inspect22x24Icon)
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   626
            argument: application
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   627
          )
87bb1815460b initial checkin
ca
parents:
diff changeset
   628
         )
87bb1815460b initial checkin
ca
parents:
diff changeset
   629
        nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   630
        nil
87bb1815460b initial checkin
ca
parents:
diff changeset
   631
      )
87bb1815460b initial checkin
ca
parents:
diff changeset
   632
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   633
2747
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   634
!ViewTreeInspectorApplication class methodsFor:'startup'!
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   635
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   636
openInPickMode
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   637
    |app|
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   638
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   639
    app := self new.
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   640
    app open.
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   641
    app doPickViews.
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   642
! !
717a0dcc710d added: #openInPickMode
Claus Gittinger <cg@exept.de>
parents: 2744
diff changeset
   643
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   644
!ViewTreeInspectorApplication methodsFor:'actions'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   645
87bb1815460b initial checkin
ca
parents:
diff changeset
   646
indicatorClicked:anIndex
87bb1815460b initial checkin
ca
parents:
diff changeset
   647
    |item sensor|
87bb1815460b initial checkin
ca
parents:
diff changeset
   648
87bb1815460b initial checkin
ca
parents:
diff changeset
   649
    item := model listOfItems at:anIndex ifAbsent:nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   650
87bb1815460b initial checkin
ca
parents:
diff changeset
   651
    item notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   652
        (     (sensor := self window sensor) notNil
87bb1815460b initial checkin
ca
parents:
diff changeset
   653
         and:[(sensor ctrlDown or:[sensor shiftDown])]
87bb1815460b initial checkin
ca
parents:
diff changeset
   654
        ) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   655
            item recursiveToggleExpand
87bb1815460b initial checkin
ca
parents:
diff changeset
   656
        ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   657
            item toggleExpand
87bb1815460b initial checkin
ca
parents:
diff changeset
   658
        ]
87bb1815460b initial checkin
ca
parents:
diff changeset
   659
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   660
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   661
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   662
!ViewTreeInspectorApplication methodsFor:'aspects'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   663
87bb1815460b initial checkin
ca
parents:
diff changeset
   664
followFocusChannel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   665
    "boolean holder, which indicates whether selection changed dependend on the focus view"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   666
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   667
    ^ followFocusChannel
87bb1815460b initial checkin
ca
parents:
diff changeset
   668
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   669
87bb1815460b initial checkin
ca
parents:
diff changeset
   670
hasSingleSelectionHolder
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   671
    "boolean holder, true if one item is selected"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   672
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   673
    ^ hasSingleSelectionHolder
87bb1815460b initial checkin
ca
parents:
diff changeset
   674
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   675
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   676
hasTargetWidgetChannel
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   677
    "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
   678
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   679
    ^ model hasTargetWidgetChannel
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   680
!
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   681
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   682
listOfItems
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   683
    "returns the hierarchical list of items"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   684
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   685
    ^ model listOfItems
87bb1815460b initial checkin
ca
parents:
diff changeset
   686
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   687
87bb1815460b initial checkin
ca
parents:
diff changeset
   688
model
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   689
    "returns my selection model, a ViewTreeModel"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   690
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   691
    ^ model
87bb1815460b initial checkin
ca
parents:
diff changeset
   692
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   693
87bb1815460b initial checkin
ca
parents:
diff changeset
   694
selectOnClickHolder
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   695
    "boolean holder, which indicates whether the selection will change on click"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   696
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   697
    ^ model selectOnClickHolder
87bb1815460b initial checkin
ca
parents:
diff changeset
   698
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   699
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   700
showNamesHolder
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   701
    "boolean holder, which indicates whether application names or widget names
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   702
     as additional text are shown for the items"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   703
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   704
    ^ showNamesHolder
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   705
!
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   706
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   707
testModeChannel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   708
    "answer a boolean channel which describes the behaviour how to process
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   709
     events on the target view.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   710
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   711
     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
   712
     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
   713
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   714
    ^ model testModeChannel
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   715
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   716
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   717
!ViewTreeInspectorApplication methodsFor:'change & update'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   718
87bb1815460b initial checkin
ca
parents:
diff changeset
   719
selectionChanged
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   720
    "called if the selection changed"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   721
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   722
    |info view item|
87bb1815460b initial checkin
ca
parents:
diff changeset
   723
87bb1815460b initial checkin
ca
parents:
diff changeset
   724
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
   725
87bb1815460b initial checkin
ca
parents:
diff changeset
   726
    item notNil ifTrue:[ |state|
87bb1815460b initial checkin
ca
parents:
diff changeset
   727
        view := item widget.
87bb1815460b initial checkin
ca
parents:
diff changeset
   728
87bb1815460b initial checkin
ca
parents:
diff changeset
   729
        view id isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   730
            state := 'no ID'.
87bb1815460b initial checkin
ca
parents:
diff changeset
   731
        ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   732
            view shown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   733
                state := 'visible'.
87bb1815460b initial checkin
ca
parents:
diff changeset
   734
            ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   735
                state := 'invisible'
87bb1815460b initial checkin
ca
parents:
diff changeset
   736
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   737
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   738
        info := '%1 [%2] - %3' bindWith:(view class name)
87bb1815460b initial checkin
ca
parents:
diff changeset
   739
                                   with:(view name ? '') with:state allBold.
87bb1815460b initial checkin
ca
parents:
diff changeset
   740
87bb1815460b initial checkin
ca
parents:
diff changeset
   741
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   742
        info := ''
87bb1815460b initial checkin
ca
parents:
diff changeset
   743
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   744
    hasSingleSelectionHolder value:(view notNil).
87bb1815460b initial checkin
ca
parents:
diff changeset
   745
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   746
87bb1815460b initial checkin
ca
parents:
diff changeset
   747
update:something with:someArgument from:aModel
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   748
    |oldSelection|
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   749
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   750
    aModel == showNamesHolder ifTrue:[
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   751
        oldSelection := model selectedItem.
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   752
        model selectedItem:nil.
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   753
        self listOfItems showWidgetNames:(aModel value).
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   754
        model selectedItem:oldSelection.
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   755
        ^ self
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   756
    ].
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   757
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   758
    aModel == model ifTrue:[
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   759
        self selectionChanged.
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   760
        ^ self
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   761
    ].
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   762
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   763
    super update:something with:someArgument from:aModel.
87bb1815460b initial checkin
ca
parents:
diff changeset
   764
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   765
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   766
!ViewTreeInspectorApplication methodsFor:'event processing'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   767
87bb1815460b initial checkin
ca
parents:
diff changeset
   768
processButtonMotionEvent:ev
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   769
    "handle a button motion event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   770
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   771
    |click rootView|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   772
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   773
    motionAction isNil ifTrue:[^ self].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   774
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   775
    (rootView := model rootView) isNil ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   776
        clickedItem := motionAction := nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   777
        ^ self
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   778
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   779
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   780
    click := rootView device
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   781
            translatePoint:((ev x)@ (ev y))
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   782
            fromView:(ev view)
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   783
            toView:rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   784
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   785
    click = clickedPoint ifFalse:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   786
        (clickedItem isNil or:[(click dist:clickedPoint) > 5.0]) ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   787
            motionAction value:click
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   788
        ]
87bb1815460b initial checkin
ca
parents:
diff changeset
   789
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   790
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   791
87bb1815460b initial checkin
ca
parents:
diff changeset
   792
processButtonPressEvent:ev
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   793
    "handle a buttopn press event"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   794
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   795
    |rootView sensor lastRectangle|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   796
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   797
    rootView    := model rootView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   798
    sensor      := model rootView sensor.
87bb1815460b initial checkin
ca
parents:
diff changeset
   799
    clickedItem := model listOfItems detectItemRespondsToView:(ev view).
87bb1815460b initial checkin
ca
parents:
diff changeset
   800
87bb1815460b initial checkin
ca
parents:
diff changeset
   801
    (sensor ctrlDown or:[sensor shiftDown]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   802
        clickedItem notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   803
            self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   804
                model toggleSelectItem:clickedItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   805
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   806
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   807
        clickedItem := motionAction := nil.
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   808
        ^ self
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   809
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   810
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   811
    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
   812
    lastRectangle := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   813
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   814
    motionAction :=[:p|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   815
        rootView    := model rootView device rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   816
        rootView    := model rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   817
        clickedItem := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   818
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   819
        rootView xoring:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   820
            lastRectangle notNil ifTrue:[ rootView displayRectangle:lastRectangle ]
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   821
                                ifFalse:[ rootView clippedByChildren:false ].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   822
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   823
            p isNil ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   824
                rootView clippedByChildren:true.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   825
                motionAction := nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   826
            ] ifFalse:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   827
                lastRectangle := Rectangle origin:(clickedPoint min:p) corner:(clickedPoint max:p).
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   828
                rootView displayRectangle:lastRectangle.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   829
            ].
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   830
            rootView flush.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   831
        ].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   832
        lastRectangle
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   833
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   834
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   835
87bb1815460b initial checkin
ca
parents:
diff changeset
   836
processButtonReleaseEvent:anEvent
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   837
    "handle a button release event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   838
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   839
    |rootView rectangle newItems widget origin|
87bb1815460b initial checkin
ca
parents:
diff changeset
   840
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   841
    (rootView := model rootView) isNil ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   842
        clickedItem := motionAction := nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   843
        ^ self
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   844
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   845
    motionAction isNil ifTrue:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   846
    clickedItem notNil ifTrue:[ ^ model selectItem:clickedItem ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   847
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   848
    rectangle := motionAction value:nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   849
    rectangle isNil ifTrue:[^ self].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   850
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   851
    newItems := OrderedCollection new.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   852
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   853
    model rootItem recursiveDo:[:anItem|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   854
        widget := anItem widget.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   855
        origin := widget originRelativeTo:rootView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   856
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   857
        (rectangle containsRect:(Rectangle origin:origin extent:(widget extent))) ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   858
            newItems add:anItem.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   859
        ]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   860
    ].
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   861
    model value:newItems.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   862
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   863
87bb1815460b initial checkin
ca
parents:
diff changeset
   864
processEvent:anEvent
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   865
    "process an event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   866
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   867
    |button menu|
87bb1815460b initial checkin
ca
parents:
diff changeset
   868
87bb1815460b initial checkin
ca
parents:
diff changeset
   869
    anEvent isKeyPressEvent ifTrue:[ ^ self processKeyPressEvent:anEvent ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   870
    anEvent isButtonEvent  ifFalse:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   871
87bb1815460b initial checkin
ca
parents:
diff changeset
   872
    button := anEvent button.
87bb1815460b initial checkin
ca
parents:
diff changeset
   873
87bb1815460b initial checkin
ca
parents:
diff changeset
   874
    (button == 2 or:[button == #menu]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   875
        motionAction isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   876
            anEvent isButtonPressEvent ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   877
                self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   878
                    menu := self middleButtonMenu value.
87bb1815460b initial checkin
ca
parents:
diff changeset
   879
                    menu notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   880
                        menu := MenuPanel menu:(Menu new fromLiteralArrayEncoding:menu)
87bb1815460b initial checkin
ca
parents:
diff changeset
   881
                                      receiver:self.
87bb1815460b initial checkin
ca
parents:
diff changeset
   882
                        menu startUp.
87bb1815460b initial checkin
ca
parents:
diff changeset
   883
                    ]
87bb1815460b initial checkin
ca
parents:
diff changeset
   884
                ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   885
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   886
            clickedItem := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   887
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   888
        ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
   889
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   890
87bb1815460b initial checkin
ca
parents:
diff changeset
   891
    anEvent isButtonPressEvent  ifTrue:[ ^ self processButtonPressEvent:anEvent  ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   892
    anEvent isButtonMotionEvent ifTrue:[ ^ self processButtonMotionEvent:anEvent ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   893
87bb1815460b initial checkin
ca
parents:
diff changeset
   894
    anEvent isButtonReleaseEvent ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   895
        self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   896
            self processButtonReleaseEvent:anEvent
87bb1815460b initial checkin
ca
parents:
diff changeset
   897
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   898
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   899
    clickedItem := motionAction := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   900
87bb1815460b initial checkin
ca
parents:
diff changeset
   901
    anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   902
        self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   903
            self doInspect:#view.
87bb1815460b initial checkin
ca
parents:
diff changeset
   904
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   905
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   906
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   907
87bb1815460b initial checkin
ca
parents:
diff changeset
   908
processKeyPressEvent:anEvent
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   909
    "process an key press event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   910
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   911
    |item prnt idx key max next|
87bb1815460b initial checkin
ca
parents:
diff changeset
   912
87bb1815460b initial checkin
ca
parents:
diff changeset
   913
    key := anEvent key.
87bb1815460b initial checkin
ca
parents:
diff changeset
   914
    key isSymbol ifFalse:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
   915
87bb1815460b initial checkin
ca
parents:
diff changeset
   916
    key == #Delete    ifTrue:[ ^ self doDestroy ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   917
    key == #InspectIt ifTrue:[ ^ self doInspect:#view ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   918
87bb1815460b initial checkin
ca
parents:
diff changeset
   919
    (   key == #CursorUp
87bb1815460b initial checkin
ca
parents:
diff changeset
   920
    or:[key == #CursorDown
87bb1815460b initial checkin
ca
parents:
diff changeset
   921
    or:[key == #CursorLeft
87bb1815460b initial checkin
ca
parents:
diff changeset
   922
    or:[key == #CursorRight]]]
87bb1815460b initial checkin
ca
parents:
diff changeset
   923
    ) ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   924
        ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
   925
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   926
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
   927
87bb1815460b initial checkin
ca
parents:
diff changeset
   928
    item isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   929
        ^ model selectedItem:(model first ? model rootItem)
87bb1815460b initial checkin
ca
parents:
diff changeset
   930
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   931
87bb1815460b initial checkin
ca
parents:
diff changeset
   932
    prnt := item parent.
87bb1815460b initial checkin
ca
parents:
diff changeset
   933
    prnt isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   934
        "/ is the root item
87bb1815460b initial checkin
ca
parents:
diff changeset
   935
        (key == #CursorUp or:[key == #CursorLeft]) ifTrue:[item := model listOfItems last]
87bb1815460b initial checkin
ca
parents:
diff changeset
   936
                                                  ifFalse:[item := item at:1 ifAbsent:item].
87bb1815460b initial checkin
ca
parents:
diff changeset
   937
87bb1815460b initial checkin
ca
parents:
diff changeset
   938
      ^ model selectedItem:item
87bb1815460b initial checkin
ca
parents:
diff changeset
   939
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   940
    key == #CursorLeft ifTrue:[ ^ model selectedItem:prnt ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   941
87bb1815460b initial checkin
ca
parents:
diff changeset
   942
    key == #CursorRight ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   943
        next := item at:1 ifAbsent:nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   944
        next notNil ifTrue:[ model selectedItem:next ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   945
      ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
   946
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   947
87bb1815460b initial checkin
ca
parents:
diff changeset
   948
    max := prnt size.
87bb1815460b initial checkin
ca
parents:
diff changeset
   949
87bb1815460b initial checkin
ca
parents:
diff changeset
   950
    key == #CursorUp ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   951
        idx := prnt identityIndexOf:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
   952
        idx == 1 ifTrue:[idx := max + 1].
87bb1815460b initial checkin
ca
parents:
diff changeset
   953
        model selectedItem:(prnt at:idx - 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
   954
      ^ self.
87bb1815460b initial checkin
ca
parents:
diff changeset
   955
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   956
87bb1815460b initial checkin
ca
parents:
diff changeset
   957
    key == #CursorDown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   958
        idx := prnt identityIndexOf:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
   959
        idx == max ifTrue:[idx := 0].
87bb1815460b initial checkin
ca
parents:
diff changeset
   960
        model selectedItem:(prnt at:idx + 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
   961
      ^ self.
87bb1815460b initial checkin
ca
parents:
diff changeset
   962
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   963
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   964
87bb1815460b initial checkin
ca
parents:
diff changeset
   965
processMappedView:aView
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   966
    "process a mapped event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   967
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   968
    |parent anchor|
87bb1815460b initial checkin
ca
parents:
diff changeset
   969
87bb1815460b initial checkin
ca
parents:
diff changeset
   970
    parent := self listOfItems detectItemRespondsToView:aView.
87bb1815460b initial checkin
ca
parents:
diff changeset
   971
    parent isNil ifTrue:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   972
87bb1815460b initial checkin
ca
parents:
diff changeset
   973
    NotFoundSignal handle:[:ex|
87bb1815460b initial checkin
ca
parents:
diff changeset
   974
        "contained subvies used by spec are not yet created;
87bb1815460b initial checkin
ca
parents:
diff changeset
   975
         thus we have to wait until last used subview is build
87bb1815460b initial checkin
ca
parents:
diff changeset
   976
        "
87bb1815460b initial checkin
ca
parents:
diff changeset
   977
        anchor := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   978
    ] do:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   979
        anchor := parent class buildViewsFrom:(parent widget).
87bb1815460b initial checkin
ca
parents:
diff changeset
   980
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   981
    anchor notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   982
        parent updateFromChildren:anchor children.
87bb1815460b initial checkin
ca
parents:
diff changeset
   983
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   984
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   985
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   986
!ViewTreeInspectorApplication methodsFor:'initialization & release'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   987
87bb1815460b initial checkin
ca
parents:
diff changeset
   988
closeDownViews
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   989
    "release the grapped application"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   990
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   991
    process := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   992
    super closeDownViews.
87bb1815460b initial checkin
ca
parents:
diff changeset
   993
    self doUnpick.
87bb1815460b initial checkin
ca
parents:
diff changeset
   994
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   995
87bb1815460b initial checkin
ca
parents:
diff changeset
   996
initialize
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   997
    "setup my model and channels"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   998
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   999
    super initialize.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1000
87bb1815460b initial checkin
ca
parents:
diff changeset
  1001
    hasSingleSelectionHolder := false asValue.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1002
    followFocusChannel       := false asValue.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1003
87bb1815460b initial checkin
ca
parents:
diff changeset
  1004
    model := ViewTreeModel new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1005
    model inputEventAction:[:ev| self processEvent:ev ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1006
    model mappedViewAction:[:vw| self processMappedView:vw ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1007
    model application:self.
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1008
    model addDependent:self.
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
  1009
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1010
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1011
    showNamesHolder := false asValue.
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1012
    showNamesHolder addDependent:self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1013
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1014
87bb1815460b initial checkin
ca
parents:
diff changeset
  1015
postBuildTree:aTree
87bb1815460b initial checkin
ca
parents:
diff changeset
  1016
    treeView := aTree scrolledView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1017
    treeView hasConstantHeight:true.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1018
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1019
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1020
!ViewTreeInspectorApplication methodsFor:'menu queries'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1021
87bb1815460b initial checkin
ca
parents:
diff changeset
  1022
hasApplication
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1023
    "returns true if the current selected view has an application"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1024
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1025
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1026
87bb1815460b initial checkin
ca
parents:
diff changeset
  1027
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1028
  ^ (view notNil and:[view application notNil])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1029
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1030
87bb1815460b initial checkin
ca
parents:
diff changeset
  1031
hasController
87bb1815460b initial checkin
ca
parents:
diff changeset
  1032
    "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
  1033
     other than nil or the view itself"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1034
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1035
    |view controller|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1036
87bb1815460b initial checkin
ca
parents:
diff changeset
  1037
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1038
87bb1815460b initial checkin
ca
parents:
diff changeset
  1039
    view notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1040
        controller := view controller.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1041
      ^ (controller notNil and:[controller ~~ view])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1042
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1043
    ^ false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1044
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1045
87bb1815460b initial checkin
ca
parents:
diff changeset
  1046
hasModel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1047
    "returns true if the current selected view has a model"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1048
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1049
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1050
87bb1815460b initial checkin
ca
parents:
diff changeset
  1051
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1052
  ^ (view notNil and:[view model notNil])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1053
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1054
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1055
!ViewTreeInspectorApplication methodsFor:'menu specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1056
87bb1815460b initial checkin
ca
parents:
diff changeset
  1057
middleButtonMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1058
    "returns the middleButton menu for the single selected item or nil"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1059
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1060
    ^ [ model selectedItem notNil ifTrue:[self class middleButtonMenu]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1061
                                 ifFalse:[nil]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1062
      ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1063
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1064
87bb1815460b initial checkin
ca
parents:
diff changeset
  1065
submenuApplications:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1066
    |applications menu item list addBlock|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1067
87bb1815460b initial checkin
ca
parents:
diff changeset
  1068
    item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1069
                                              ifFalse:[model rootItem].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1070
    item isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1071
87bb1815460b initial checkin
ca
parents:
diff changeset
  1072
    applications := IdentityDictionary new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1073
87bb1815460b initial checkin
ca
parents:
diff changeset
  1074
    addBlock := [:el| |cls ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1075
        cls := self resolveApplicationClassFor:el.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1076
87bb1815460b initial checkin
ca
parents:
diff changeset
  1077
        cls notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1078
            ctr := applications at:cls ifAbsent:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1079
            applications at:cls put:(ctr + 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1080
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1081
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1082
    item recursiveDo:addBlock.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1083
    addBlock value:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1084
87bb1815460b initial checkin
ca
parents:
diff changeset
  1085
    applications isEmpty ifTrue:[^ nil ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1086
    list := SortedCollection sortBlock:[:a :b| a title < b title ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1087
87bb1815460b initial checkin
ca
parents:
diff changeset
  1088
    applications keysAndValuesDo:[:cls :ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1089
       list add:(MenuDesc title:(cls name)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1090
                          value:(ctr printString)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1091
                         action:[self doSelectNextOfApplicationClass:cls startingIn:item]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1092
                 ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1093
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1094
87bb1815460b initial checkin
ca
parents:
diff changeset
  1095
    menu := MenuDesc buildFromList:list onGC:aMenu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1096
    menu do:[:el|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1097
        el hideMenuOnActivated:false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1098
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1099
    ^ menu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1100
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1101
87bb1815460b initial checkin
ca
parents:
diff changeset
  1102
submenuComponents:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1103
    |widgets list total menu item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1104
87bb1815460b initial checkin
ca
parents:
diff changeset
  1105
    item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1106
                                              ifFalse:[model rootItem].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1107
    item isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1108
87bb1815460b initial checkin
ca
parents:
diff changeset
  1109
    widgets := IdentityDictionary new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1110
    total   := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1111
87bb1815460b initial checkin
ca
parents:
diff changeset
  1112
    item recursiveDo:[:el| |cls ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1113
        cls := el widget.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1114
87bb1815460b initial checkin
ca
parents:
diff changeset
  1115
        cls notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1116
            cls := cls class.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1117
            ctr := widgets at:cls ifAbsent:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1118
            widgets at:cls put:(ctr + 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1119
            total := total + 1.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1120
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1121
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1122
    total == 0 ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1123
    list := SortedCollection sortBlock:[:a :b| a title < b title ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1124
87bb1815460b initial checkin
ca
parents:
diff changeset
  1125
    widgets keysAndValuesDo:[:cls :ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1126
        list add:(MenuDesc title:(cls name)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1127
                           value:(ctr printString)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1128
                          action:[self doSelectNextOfClass:cls startingIn:item]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1129
                 ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1130
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1131
    list := list asOrderedCollection.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1132
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1133
    list add:(MenuDesc title:'Total' value:(total printString)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1134
    menu := MenuDesc buildFromList:list onGC:aMenu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1135
    menu do:[:el|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1136
        el hideMenuOnActivated:false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1137
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1138
    ^ menu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1139
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1140
87bb1815460b initial checkin
ca
parents:
diff changeset
  1141
submenuGeometry:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1142
    "builds and returns the geometry submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1143
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1144
    |view point inst list x y|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1145
87bb1815460b initial checkin
ca
parents:
diff changeset
  1146
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1147
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1148
87bb1815460b initial checkin
ca
parents:
diff changeset
  1149
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1150
87bb1815460b initial checkin
ca
parents:
diff changeset
  1151
    "/ origin
87bb1815460b initial checkin
ca
parents:
diff changeset
  1152
    point := view relativeOrigin.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1153
    point isNil ifTrue:[ point := view origin ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1154
87bb1815460b initial checkin
ca
parents:
diff changeset
  1155
    x := view left.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1156
    y := view top.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1157
87bb1815460b initial checkin
ca
parents:
diff changeset
  1158
    (x == point x and:[y == point y]) ifTrue:[ inst := point ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1159
                                     ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1160
87bb1815460b initial checkin
ca
parents:
diff changeset
  1161
    list add:(MenuDesc title:'origin' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1162
87bb1815460b initial checkin
ca
parents:
diff changeset
  1163
    "/ corner
87bb1815460b initial checkin
ca
parents:
diff changeset
  1164
    point := view relativeCorner.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1165
    point isNil ifTrue:[ point := view corner ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1166
87bb1815460b initial checkin
ca
parents:
diff changeset
  1167
    x := view right.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1168
    y := view bottom.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1169
87bb1815460b initial checkin
ca
parents:
diff changeset
  1170
    (x == point x and:[y == point y]) ifTrue:[ inst := point ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1171
                                     ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1172
87bb1815460b initial checkin
ca
parents:
diff changeset
  1173
    list add:(MenuDesc title:'corner' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1174
87bb1815460b initial checkin
ca
parents:
diff changeset
  1175
    "/ extent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1176
    (point := view relativeExtent) isNil ifTrue:[point := view extent].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1177
    list add:(MenuDesc title:'extent' value:point).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1178
87bb1815460b initial checkin
ca
parents:
diff changeset
  1179
    "/ preferred extent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1180
    list add:(MenuDesc title:'pref. extent' value:(view preferredExtent)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1181
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1182
87bb1815460b initial checkin
ca
parents:
diff changeset
  1183
    "/ view insets
87bb1815460b initial checkin
ca
parents:
diff changeset
  1184
    inst := 'l:%1  r:%2  t:%3  b:%4' bindWith:(view leftInset)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1185
                                         with:(view rightInset)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1186
                                         with:(view topInset)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1187
                                         with:(view bottomInset).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1188
87bb1815460b initial checkin
ca
parents:
diff changeset
  1189
    list add:(MenuDesc title:'insets'      value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1190
    list add:(MenuDesc title:'borderWidth' value:(view borderWidth)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1191
    list add:(MenuDesc title:'level'       value:(view level)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1192
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1193
87bb1815460b initial checkin
ca
parents:
diff changeset
  1194
    (inst := view layout) notNil ifTrue:[ inst := inst displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1195
    list add:(MenuDesc title:'layout' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1196
87bb1815460b initial checkin
ca
parents:
diff changeset
  1197
    (inst := view transformation) notNil ifTrue:[ inst := inst displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1198
    list add:(MenuDesc title:'transformation' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1199
87bb1815460b initial checkin
ca
parents:
diff changeset
  1200
  ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1201
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1202
87bb1815460b initial checkin
ca
parents:
diff changeset
  1203
submenuInspector:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1204
    "builds and returns the inspector submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1205
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1206
    |view list n names label value|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1207
87bb1815460b initial checkin
ca
parents:
diff changeset
  1208
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1209
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1210
87bb1815460b initial checkin
ca
parents:
diff changeset
  1211
    n := view class instSize.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1212
    n > 0 ifFalse:[^ nil ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1213
87bb1815460b initial checkin
ca
parents:
diff changeset
  1214
    list  := OrderedCollection new:n.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1215
    names := view class allInstVarNames.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1216
87bb1815460b initial checkin
ca
parents:
diff changeset
  1217
    1 to:n do:[:i| |action|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1218
        label := (names at:i) printString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1219
        value := view instVarAt:i.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1220
        value isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1221
            value  := '------'.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1222
            action := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1223
        ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1224
            value  := value displayString contractAtEndTo:40.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1225
            action := [(view instVarAt:i) inspect].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1226
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1227
        list add:(MenuDesc title:label value:value action:action).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1228
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1229
87bb1815460b initial checkin
ca
parents:
diff changeset
  1230
    ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1231
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1232
87bb1815460b initial checkin
ca
parents:
diff changeset
  1233
submenuInterface:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1234
    "builds and returns the interface submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1235
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1236
    |view label inst value list|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1237
87bb1815460b initial checkin
ca
parents:
diff changeset
  1238
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1239
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1240
87bb1815460b initial checkin
ca
parents:
diff changeset
  1241
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1242
87bb1815460b initial checkin
ca
parents:
diff changeset
  1243
    inst  := view controller.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1244
    value := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1245
87bb1815460b initial checkin
ca
parents:
diff changeset
  1246
    inst isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1247
        label := nil
87bb1815460b initial checkin
ca
parents:
diff changeset
  1248
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1249
        inst == view ifTrue:[ label := '== view itself' ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1250
                    ifFalse:[ label := inst displayString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1251
                              value := [view controller inspect].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1252
                            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1253
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1254
    list add:(MenuDesc title:'controller' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1255
87bb1815460b initial checkin
ca
parents:
diff changeset
  1256
    inst := view delegate.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1257
    inst notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1258
        list add:(MenuDesc title:'delegate' value:(inst displayString) action:[ view delegate inspect ]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1259
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1260
87bb1815460b initial checkin
ca
parents:
diff changeset
  1261
    inst := view application.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1262
87bb1815460b initial checkin
ca
parents:
diff changeset
  1263
    inst notNil ifTrue:[ |topAppl|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1264
        list add:(MenuDesc title:'application' value:inst action:[ view application inspect ]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1265
87bb1815460b initial checkin
ca
parents:
diff changeset
  1266
        topAppl := inst topApplication.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1267
87bb1815460b initial checkin
ca
parents:
diff changeset
  1268
        (topAppl notNil and:[topAppl ~~ inst]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1269
            list add:(MenuDesc title:'topApplication' value:topAppl action:[ inst topApplication inspect ]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1270
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1271
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1272
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1273
87bb1815460b initial checkin
ca
parents:
diff changeset
  1274
    (view respondsTo:#'model:') ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1275
        inst := model.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1276
87bb1815460b initial checkin
ca
parents:
diff changeset
  1277
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1278
                  ifFalse:[ label := inst displayString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1279
                            value := [ view model inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1280
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1281
87bb1815460b initial checkin
ca
parents:
diff changeset
  1282
        list add:(MenuDesc title:'model' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1283
87bb1815460b initial checkin
ca
parents:
diff changeset
  1284
        (inst notNil and:[view respondsTo:#modelInterface]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1285
            view modelInterface keysAndValuesDo:[:key : val|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1286
                val isNil ifTrue:[ label := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1287
                         ifFalse:[ label := val displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1288
87bb1815460b initial checkin
ca
parents:
diff changeset
  1289
                list add:(MenuDesc title:('      - ', key) value:label ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1290
            ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1291
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1292
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1293
87bb1815460b initial checkin
ca
parents:
diff changeset
  1294
    (view respondsTo:#enableChannel) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1295
        inst := view enableChannel.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1296
87bb1815460b initial checkin
ca
parents:
diff changeset
  1297
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1298
                  ifFalse:[ label := inst displayString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1299
                            value := [ view enableChannel inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1300
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1301
87bb1815460b initial checkin
ca
parents:
diff changeset
  1302
        list add:(MenuDesc title:'enableChannel' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1303
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1304
87bb1815460b initial checkin
ca
parents:
diff changeset
  1305
    list last isSeparator ifFalse:[ list add:(MenuDesc separator) ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1306
87bb1815460b initial checkin
ca
parents:
diff changeset
  1307
    (view respondsTo:#listHolder) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1308
        inst := view listHolder.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1309
87bb1815460b initial checkin
ca
parents:
diff changeset
  1310
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1311
                  ifFalse:[ label := inst class printString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1312
                            value := [ view listHolder inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1313
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1314
        list add:(MenuDesc title:'listHolder' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1315
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1316
87bb1815460b initial checkin
ca
parents:
diff changeset
  1317
    (view respondsTo:#list) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1318
        inst := view list.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1319
87bb1815460b initial checkin
ca
parents:
diff changeset
  1320
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1321
                  ifFalse:[ label := '%1 [%2]' bindWith:(inst class printString) with:(inst size).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1322
                            value := [ view list inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1323
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1324
87bb1815460b initial checkin
ca
parents:
diff changeset
  1325
        list add:(MenuDesc title:'list' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1326
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1327
87bb1815460b initial checkin
ca
parents:
diff changeset
  1328
    list last isSeparator ifTrue:[ list removeLast ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1329
  ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1330
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1331
87bb1815460b initial checkin
ca
parents:
diff changeset
  1332
submenuVisibility:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1333
    "builds and returns the geometry submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1334
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1335
    |view list value|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1336
87bb1815460b initial checkin
ca
parents:
diff changeset
  1337
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1338
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1339
87bb1815460b initial checkin
ca
parents:
diff changeset
  1340
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1341
87bb1815460b initial checkin
ca
parents:
diff changeset
  1342
    list add:(MenuDesc title:'device'     value:(view device printString)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1343
    list add:(MenuDesc title:'drawableId' value:(view id)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1344
    list add:(MenuDesc title:'gcId'       value:(view gcId)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1345
87bb1815460b initial checkin
ca
parents:
diff changeset
  1346
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1347
87bb1815460b initial checkin
ca
parents:
diff changeset
  1348
    list add:(MenuDesc title:'shown'    value:(view shown)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1349
    list add:(MenuDesc title:'realized' value:(view realized)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1350
87bb1815460b initial checkin
ca
parents:
diff changeset
  1351
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1352
87bb1815460b initial checkin
ca
parents:
diff changeset
  1353
    list add:(MenuDesc title:'hiddenOnRealize' value:(view isHiddenOnRealize)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1354
87bb1815460b initial checkin
ca
parents:
diff changeset
  1355
    (value := view visibilityChannel) isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1356
        list add:(MenuDesc title:'visibilityChannel' value:'------').
87bb1815460b initial checkin
ca
parents:
diff changeset
  1357
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1358
        list add:(MenuDesc title:'visibilityChannel'
87bb1815460b initial checkin
ca
parents:
diff changeset
  1359
                           value:(value displayString)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1360
                          action:[view visibilityChannel inspect]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1361
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1362
87bb1815460b initial checkin
ca
parents:
diff changeset
  1363
        
87bb1815460b initial checkin
ca
parents:
diff changeset
  1364
  ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1365
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1366
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1367
!ViewTreeInspectorApplication methodsFor:'private'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1368
87bb1815460b initial checkin
ca
parents:
diff changeset
  1369
selectFocusView
87bb1815460b initial checkin
ca
parents:
diff changeset
  1370
    |rootView focusItem focusView|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1371
87bb1815460b initial checkin
ca
parents:
diff changeset
  1372
    rootView := model rootView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1373
87bb1815460b initial checkin
ca
parents:
diff changeset
  1374
    (rootView notNil and:[rootView shown]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1375
        focusView := rootView windowGroup focusView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1376
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1377
    focusView isNil ifTrue:[^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1378
87bb1815460b initial checkin
ca
parents:
diff changeset
  1379
    focusItem := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1380
87bb1815460b initial checkin
ca
parents:
diff changeset
  1381
    (focusItem notNil and:[focusItem widget == focusView]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1382
        ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
  1383
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1384
    focusItem := model listOfItems recursiveDetect:[:el| el widget == focusView ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1385
87bb1815460b initial checkin
ca
parents:
diff changeset
  1386
    focusItem notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1387
        model selectItem:focusItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1388
    ].        
87bb1815460b initial checkin
ca
parents:
diff changeset
  1389
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1390
87bb1815460b initial checkin
ca
parents:
diff changeset
  1391
setRootItem:aRootItemOrNil
87bb1815460b initial checkin
ca
parents:
diff changeset
  1392
    |theProcess|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1393
87bb1815460b initial checkin
ca
parents:
diff changeset
  1394
    aRootItemOrNil isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1395
        process := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1396
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1397
        "/ expand tree to level 3
87bb1815460b initial checkin
ca
parents:
diff changeset
  1398
        aRootItemOrNil do:[:aRootChild|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1399
            aRootChild do:[:aSubChild| aSubChild expand ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1400
            aRootChild expand.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1401
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1402
        aRootItemOrNil expand.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1403
87bb1815460b initial checkin
ca
parents:
diff changeset
  1404
        process isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1405
            theProcess := process :=
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1406
                Process for:[   |update testModeChannel|
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1407
87bb1815460b initial checkin
ca
parents:
diff changeset
  1408
                                update := false.
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1409
                                testModeChannel := model testModeChannel.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1410
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1411
                                [process == theProcess] whileTrue:[
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1412
                                    Delay waitForSeconds:0.5.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1413
87bb1815460b initial checkin
ca
parents:
diff changeset
  1414
                                    (treeView notNil and:[process == theProcess and:[treeView shown]]) ifTrue:[
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1415
                                        (testModeChannel value == true and:[followFocusChannel value == true]) ifTrue:[
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1416
                                            self selectFocusView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1417
                                        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1418
                                        update ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1419
                                            self updateShownStatus.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1420
                                        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1421
                                        update := update not.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1422
                                    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1423
                                ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1424
87bb1815460b initial checkin
ca
parents:
diff changeset
  1425
                             ] priority:8.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1426
            theProcess name:'ViewTreeInspector - Follow Focus'.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1427
            theProcess resume.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1428
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1429
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1430
    model rootItem:aRootItemOrNil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1431
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1432
87bb1815460b initial checkin
ca
parents:
diff changeset
  1433
updateShownStatus
87bb1815460b initial checkin
ca
parents:
diff changeset
  1434
    |rootItem min max visState listIdx visY0 visY1 height damage|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1435
87bb1815460b initial checkin
ca
parents:
diff changeset
  1436
    rootItem := model rootItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1437
    (rootItem notNil and:[rootItem widget shown]) ifFalse:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1438
87bb1815460b initial checkin
ca
parents:
diff changeset
  1439
    max := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1440
    min := 9999999.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1441
87bb1815460b initial checkin
ca
parents:
diff changeset
  1442
    rootItem recursiveEachVisibleItemDo:[:anItem|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1443
        visState := (anItem widget shown).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1444
87bb1815460b initial checkin
ca
parents:
diff changeset
  1445
        visState ~~ anItem isDrawnShown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1446
            anItem isDrawnShown:visState.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1447
            listIdx := treeView identityIndexOf:anItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1448
87bb1815460b initial checkin
ca
parents:
diff changeset
  1449
            listIdx > 0 ifTrue:[    
87bb1815460b initial checkin
ca
parents:
diff changeset
  1450
                max := max max:listIdx.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1451
                min := min min:listIdx.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1452
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1453
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1454
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1455
    max < min ifTrue:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1456
    max := max + 1.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1457
87bb1815460b initial checkin
ca
parents:
diff changeset
  1458
    visY0  := (treeView yVisibleOfLine:min) max:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1459
    visY1  := (treeView yVisibleOfLine:max) min:(treeView height).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1460
    height := visY1 - visY0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1461
    
87bb1815460b initial checkin
ca
parents:
diff changeset
  1462
    height > 2 ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1463
        treeView shown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1464
            damage := Rectangle left:0 top:visY0 width:(treeView width) height:height.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1465
            treeView invalidateDeviceRectangle:damage repairNow:false.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1466
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1467
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1468
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1469
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1470
!ViewTreeInspectorApplication methodsFor:'selection'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1471
87bb1815460b initial checkin
ca
parents:
diff changeset
  1472
selectedView
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1473
    "answer the selected view or nil"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1474
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1475
    |item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1476
87bb1815460b initial checkin
ca
parents:
diff changeset
  1477
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1478
    item notNil ifTrue:[ ^ item widget ].
87bb1815460b initial checkin
ca
parents:
diff