Tools__ViewTreeApplication.st
author Claus Gittinger <cg@exept.de>
Wed, 03 Feb 2010 11:02:07 +0100
changeset 2744 5bee95e91ffd
parent 2458 64d8f3c973b3
child 2747 717a0dcc710d
permissions -rw-r--r--
*** empty log message ***
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
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   634
!ViewTreeInspectorApplication methodsFor:'actions'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   635
87bb1815460b initial checkin
ca
parents:
diff changeset
   636
indicatorClicked:anIndex
87bb1815460b initial checkin
ca
parents:
diff changeset
   637
    |item sensor|
87bb1815460b initial checkin
ca
parents:
diff changeset
   638
87bb1815460b initial checkin
ca
parents:
diff changeset
   639
    item := model listOfItems at:anIndex ifAbsent:nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   640
87bb1815460b initial checkin
ca
parents:
diff changeset
   641
    item notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   642
        (     (sensor := self window sensor) notNil
87bb1815460b initial checkin
ca
parents:
diff changeset
   643
         and:[(sensor ctrlDown or:[sensor shiftDown])]
87bb1815460b initial checkin
ca
parents:
diff changeset
   644
        ) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   645
            item recursiveToggleExpand
87bb1815460b initial checkin
ca
parents:
diff changeset
   646
        ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   647
            item toggleExpand
87bb1815460b initial checkin
ca
parents:
diff changeset
   648
        ]
87bb1815460b initial checkin
ca
parents:
diff changeset
   649
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   650
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   651
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   652
!ViewTreeInspectorApplication methodsFor:'aspects'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   653
87bb1815460b initial checkin
ca
parents:
diff changeset
   654
followFocusChannel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   655
    "boolean holder, which indicates whether selection changed dependend on the focus view"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   656
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   657
    ^ followFocusChannel
87bb1815460b initial checkin
ca
parents:
diff changeset
   658
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   659
87bb1815460b initial checkin
ca
parents:
diff changeset
   660
hasSingleSelectionHolder
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   661
    "boolean holder, true if one item is selected"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   662
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   663
    ^ hasSingleSelectionHolder
87bb1815460b initial checkin
ca
parents:
diff changeset
   664
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   665
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   666
hasTargetWidgetChannel
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   667
    "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
   668
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   669
    ^ model hasTargetWidgetChannel
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   670
!
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   671
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   672
listOfItems
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   673
    "returns the hierarchical list of items"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   674
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   675
    ^ model listOfItems
87bb1815460b initial checkin
ca
parents:
diff changeset
   676
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   677
87bb1815460b initial checkin
ca
parents:
diff changeset
   678
model
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   679
    "returns my selection model, a ViewTreeModel"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   680
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   681
    ^ model
87bb1815460b initial checkin
ca
parents:
diff changeset
   682
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   683
87bb1815460b initial checkin
ca
parents:
diff changeset
   684
selectOnClickHolder
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   685
    "boolean holder, which indicates whether the selection will change on click"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   686
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   687
    ^ model selectOnClickHolder
87bb1815460b initial checkin
ca
parents:
diff changeset
   688
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   689
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   690
showNamesHolder
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   691
    "boolean holder, which indicates whether application names or widget names
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   692
     as additional text are shown for the items"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   693
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   694
    ^ showNamesHolder
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   695
!
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   696
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   697
testModeChannel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   698
    "answer a boolean channel which describes the behaviour how to process
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   699
     events on the target view.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   700
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   701
     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
   702
     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
   703
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   704
    ^ model testModeChannel
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   705
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   706
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   707
!ViewTreeInspectorApplication methodsFor:'change & update'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   708
87bb1815460b initial checkin
ca
parents:
diff changeset
   709
selectionChanged
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   710
    "called if the selection changed"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   711
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   712
    |info view item|
87bb1815460b initial checkin
ca
parents:
diff changeset
   713
87bb1815460b initial checkin
ca
parents:
diff changeset
   714
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
   715
87bb1815460b initial checkin
ca
parents:
diff changeset
   716
    item notNil ifTrue:[ |state|
87bb1815460b initial checkin
ca
parents:
diff changeset
   717
        view := item widget.
87bb1815460b initial checkin
ca
parents:
diff changeset
   718
87bb1815460b initial checkin
ca
parents:
diff changeset
   719
        view id isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   720
            state := 'no ID'.
87bb1815460b initial checkin
ca
parents:
diff changeset
   721
        ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   722
            view shown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   723
                state := 'visible'.
87bb1815460b initial checkin
ca
parents:
diff changeset
   724
            ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   725
                state := 'invisible'
87bb1815460b initial checkin
ca
parents:
diff changeset
   726
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   727
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   728
        info := '%1 [%2] - %3' bindWith:(view class name)
87bb1815460b initial checkin
ca
parents:
diff changeset
   729
                                   with:(view name ? '') with:state allBold.
87bb1815460b initial checkin
ca
parents:
diff changeset
   730
87bb1815460b initial checkin
ca
parents:
diff changeset
   731
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   732
        info := ''
87bb1815460b initial checkin
ca
parents:
diff changeset
   733
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   734
    hasSingleSelectionHolder value:(view notNil).
87bb1815460b initial checkin
ca
parents:
diff changeset
   735
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   736
87bb1815460b initial checkin
ca
parents:
diff changeset
   737
update:something with:someArgument from:aModel
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   738
    |oldSelection|
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   739
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   740
    aModel == showNamesHolder ifTrue:[
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   741
        oldSelection := model selectedItem.
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   742
        model selectedItem:nil.
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   743
        self listOfItems showWidgetNames:(aModel value).
2454
4867f3e9dd43 *** empty log message ***
ca
parents: 2451
diff changeset
   744
        model selectedItem:oldSelection.
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   745
        ^ self
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
   746
    ].
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   747
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   748
    aModel == model ifTrue:[
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   749
        self selectionChanged.
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   750
        ^ self
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   751
    ].
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   752
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   753
    super update:something with:someArgument from:aModel.
87bb1815460b initial checkin
ca
parents:
diff changeset
   754
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   755
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   756
!ViewTreeInspectorApplication methodsFor:'event processing'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   757
87bb1815460b initial checkin
ca
parents:
diff changeset
   758
processButtonMotionEvent:ev
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   759
    "handle a button motion event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   760
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   761
    |click rootView|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   762
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   763
    motionAction isNil ifTrue:[^ self].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   764
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   765
    (rootView := model rootView) isNil ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   766
        clickedItem := motionAction := nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   767
        ^ self
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   768
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   769
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   770
    click := rootView device
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   771
            translatePoint:((ev x)@ (ev y))
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   772
            fromView:(ev view)
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   773
            toView:rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   774
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   775
    click = clickedPoint ifFalse:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   776
        (clickedItem isNil or:[(click dist:clickedPoint) > 5.0]) ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   777
            motionAction value:click
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   778
        ]
87bb1815460b initial checkin
ca
parents:
diff changeset
   779
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   780
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   781
87bb1815460b initial checkin
ca
parents:
diff changeset
   782
processButtonPressEvent:ev
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   783
    "handle a buttopn press event"
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   784
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   785
    |rootView sensor lastRectangle|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   786
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   787
    rootView    := model rootView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   788
    sensor      := model rootView sensor.
87bb1815460b initial checkin
ca
parents:
diff changeset
   789
    clickedItem := model listOfItems detectItemRespondsToView:(ev view).
87bb1815460b initial checkin
ca
parents:
diff changeset
   790
87bb1815460b initial checkin
ca
parents:
diff changeset
   791
    (sensor ctrlDown or:[sensor shiftDown]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   792
        clickedItem notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   793
            self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   794
                model toggleSelectItem:clickedItem
87bb1815460b initial checkin
ca
parents:
diff changeset
   795
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   796
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   797
        clickedItem := motionAction := nil.
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   798
        ^ self
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   799
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   800
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   801
    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
   802
    lastRectangle := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   803
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   804
    motionAction :=[:p|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   805
        rootView    := model rootView device rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   806
        rootView    := model rootView.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   807
        clickedItem := nil.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   808
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   809
        rootView xoring:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   810
            lastRectangle notNil ifTrue:[ rootView displayRectangle:lastRectangle ]
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   811
                                ifFalse:[ rootView clippedByChildren:false ].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   812
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   813
            p isNil ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   814
                rootView clippedByChildren:true.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   815
                motionAction := nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   816
            ] ifFalse:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   817
                lastRectangle := Rectangle origin:(clickedPoint min:p) corner:(clickedPoint max:p).
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   818
                rootView displayRectangle:lastRectangle.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   819
            ].
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   820
            rootView flush.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   821
        ].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   822
        lastRectangle
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   823
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   824
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   825
87bb1815460b initial checkin
ca
parents:
diff changeset
   826
processButtonReleaseEvent:anEvent
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   827
    "handle a button release event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   828
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   829
    |rootView rectangle newItems widget origin|
87bb1815460b initial checkin
ca
parents:
diff changeset
   830
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   831
    (rootView := model rootView) isNil ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   832
        clickedItem := motionAction := nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   833
        ^ self
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   834
    ].
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   835
    motionAction isNil ifTrue:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   836
    clickedItem notNil ifTrue:[ ^ model selectItem:clickedItem ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   837
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   838
    rectangle := motionAction value:nil.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   839
    rectangle isNil ifTrue:[^ self].
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   840
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   841
    newItems := OrderedCollection new.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   842
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   843
    model rootItem recursiveDo:[:anItem|
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   844
        widget := anItem widget.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   845
        origin := widget originRelativeTo:rootView.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   846
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   847
        (rectangle containsRect:(Rectangle origin:origin extent:(widget extent))) ifTrue:[
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   848
            newItems add:anItem.
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   849
        ]
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   850
    ].
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   851
    model value:newItems.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   852
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   853
87bb1815460b initial checkin
ca
parents:
diff changeset
   854
processEvent:anEvent
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   855
    "process an event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   856
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   857
    |button menu|
87bb1815460b initial checkin
ca
parents:
diff changeset
   858
87bb1815460b initial checkin
ca
parents:
diff changeset
   859
    anEvent isKeyPressEvent ifTrue:[ ^ self processKeyPressEvent:anEvent ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   860
    anEvent isButtonEvent  ifFalse:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   861
87bb1815460b initial checkin
ca
parents:
diff changeset
   862
    button := anEvent button.
87bb1815460b initial checkin
ca
parents:
diff changeset
   863
87bb1815460b initial checkin
ca
parents:
diff changeset
   864
    (button == 2 or:[button == #menu]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   865
        motionAction isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   866
            anEvent isButtonPressEvent ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   867
                self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   868
                    menu := self middleButtonMenu value.
87bb1815460b initial checkin
ca
parents:
diff changeset
   869
                    menu notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   870
                        menu := MenuPanel menu:(Menu new fromLiteralArrayEncoding:menu)
87bb1815460b initial checkin
ca
parents:
diff changeset
   871
                                      receiver:self.
87bb1815460b initial checkin
ca
parents:
diff changeset
   872
                        menu startUp.
87bb1815460b initial checkin
ca
parents:
diff changeset
   873
                    ]
87bb1815460b initial checkin
ca
parents:
diff changeset
   874
                ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   875
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   876
            clickedItem := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   877
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   878
        ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
   879
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   880
87bb1815460b initial checkin
ca
parents:
diff changeset
   881
    anEvent isButtonPressEvent  ifTrue:[ ^ self processButtonPressEvent:anEvent  ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   882
    anEvent isButtonMotionEvent ifTrue:[ ^ self processButtonMotionEvent:anEvent ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   883
87bb1815460b initial checkin
ca
parents:
diff changeset
   884
    anEvent isButtonReleaseEvent ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   885
        self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   886
            self processButtonReleaseEvent:anEvent
87bb1815460b initial checkin
ca
parents:
diff changeset
   887
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   888
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   889
    clickedItem := motionAction := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   890
87bb1815460b initial checkin
ca
parents:
diff changeset
   891
    anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   892
        self selectOnClickHolder value ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   893
            self doInspect:#view.
87bb1815460b initial checkin
ca
parents:
diff changeset
   894
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   895
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   896
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   897
87bb1815460b initial checkin
ca
parents:
diff changeset
   898
processKeyPressEvent:anEvent
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   899
    "process an key press event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   900
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   901
    |item prnt idx key max next|
87bb1815460b initial checkin
ca
parents:
diff changeset
   902
87bb1815460b initial checkin
ca
parents:
diff changeset
   903
    key := anEvent key.
87bb1815460b initial checkin
ca
parents:
diff changeset
   904
    key isSymbol ifFalse:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
   905
87bb1815460b initial checkin
ca
parents:
diff changeset
   906
    key == #Delete    ifTrue:[ ^ self doDestroy ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   907
    key == #InspectIt ifTrue:[ ^ self doInspect:#view ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   908
87bb1815460b initial checkin
ca
parents:
diff changeset
   909
    (   key == #CursorUp
87bb1815460b initial checkin
ca
parents:
diff changeset
   910
    or:[key == #CursorDown
87bb1815460b initial checkin
ca
parents:
diff changeset
   911
    or:[key == #CursorLeft
87bb1815460b initial checkin
ca
parents:
diff changeset
   912
    or:[key == #CursorRight]]]
87bb1815460b initial checkin
ca
parents:
diff changeset
   913
    ) ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   914
        ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
   915
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   916
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
   917
87bb1815460b initial checkin
ca
parents:
diff changeset
   918
    item isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   919
        ^ model selectedItem:(model first ? model rootItem)
87bb1815460b initial checkin
ca
parents:
diff changeset
   920
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   921
87bb1815460b initial checkin
ca
parents:
diff changeset
   922
    prnt := item parent.
87bb1815460b initial checkin
ca
parents:
diff changeset
   923
    prnt isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   924
        "/ is the root item
87bb1815460b initial checkin
ca
parents:
diff changeset
   925
        (key == #CursorUp or:[key == #CursorLeft]) ifTrue:[item := model listOfItems last]
87bb1815460b initial checkin
ca
parents:
diff changeset
   926
                                                  ifFalse:[item := item at:1 ifAbsent:item].
87bb1815460b initial checkin
ca
parents:
diff changeset
   927
87bb1815460b initial checkin
ca
parents:
diff changeset
   928
      ^ model selectedItem:item
87bb1815460b initial checkin
ca
parents:
diff changeset
   929
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   930
    key == #CursorLeft ifTrue:[ ^ model selectedItem:prnt ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   931
87bb1815460b initial checkin
ca
parents:
diff changeset
   932
    key == #CursorRight ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   933
        next := item at:1 ifAbsent:nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   934
        next notNil ifTrue:[ model selectedItem:next ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   935
      ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
   936
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   937
87bb1815460b initial checkin
ca
parents:
diff changeset
   938
    max := prnt size.
87bb1815460b initial checkin
ca
parents:
diff changeset
   939
87bb1815460b initial checkin
ca
parents:
diff changeset
   940
    key == #CursorUp ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   941
        idx := prnt identityIndexOf:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
   942
        idx == 1 ifTrue:[idx := max + 1].
87bb1815460b initial checkin
ca
parents:
diff changeset
   943
        model selectedItem:(prnt at:idx - 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
   944
      ^ self.
87bb1815460b initial checkin
ca
parents:
diff changeset
   945
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   946
87bb1815460b initial checkin
ca
parents:
diff changeset
   947
    key == #CursorDown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   948
        idx := prnt identityIndexOf:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
   949
        idx == max ifTrue:[idx := 0].
87bb1815460b initial checkin
ca
parents:
diff changeset
   950
        model selectedItem:(prnt at:idx + 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
   951
      ^ self.
87bb1815460b initial checkin
ca
parents:
diff changeset
   952
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   953
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   954
87bb1815460b initial checkin
ca
parents:
diff changeset
   955
processMappedView:aView
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   956
    "process a mapped event"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   957
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   958
    |parent anchor|
87bb1815460b initial checkin
ca
parents:
diff changeset
   959
87bb1815460b initial checkin
ca
parents:
diff changeset
   960
    parent := self listOfItems detectItemRespondsToView:aView.
87bb1815460b initial checkin
ca
parents:
diff changeset
   961
    parent isNil ifTrue:[ ^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   962
87bb1815460b initial checkin
ca
parents:
diff changeset
   963
    NotFoundSignal handle:[:ex|
87bb1815460b initial checkin
ca
parents:
diff changeset
   964
        "contained subvies used by spec are not yet created;
87bb1815460b initial checkin
ca
parents:
diff changeset
   965
         thus we have to wait until last used subview is build
87bb1815460b initial checkin
ca
parents:
diff changeset
   966
        "
87bb1815460b initial checkin
ca
parents:
diff changeset
   967
        anchor := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   968
    ] do:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   969
        anchor := parent class buildViewsFrom:(parent widget).
87bb1815460b initial checkin
ca
parents:
diff changeset
   970
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   971
    anchor notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
   972
        parent updateFromChildren:anchor children.
87bb1815460b initial checkin
ca
parents:
diff changeset
   973
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   974
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
   975
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
   976
!ViewTreeInspectorApplication methodsFor:'initialization & release'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   977
87bb1815460b initial checkin
ca
parents:
diff changeset
   978
closeDownViews
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   979
    "release the grapped application"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   980
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   981
    process := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
   982
    super closeDownViews.
87bb1815460b initial checkin
ca
parents:
diff changeset
   983
    self doUnpick.
87bb1815460b initial checkin
ca
parents:
diff changeset
   984
!
87bb1815460b initial checkin
ca
parents:
diff changeset
   985
87bb1815460b initial checkin
ca
parents:
diff changeset
   986
initialize
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   987
    "setup my model and channels"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
   988
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
   989
    super initialize.
87bb1815460b initial checkin
ca
parents:
diff changeset
   990
87bb1815460b initial checkin
ca
parents:
diff changeset
   991
    hasSingleSelectionHolder := false asValue.
87bb1815460b initial checkin
ca
parents:
diff changeset
   992
    followFocusChannel       := false asValue.
87bb1815460b initial checkin
ca
parents:
diff changeset
   993
87bb1815460b initial checkin
ca
parents:
diff changeset
   994
    model := ViewTreeModel new.
87bb1815460b initial checkin
ca
parents:
diff changeset
   995
    model inputEventAction:[:ev| self processEvent:ev ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   996
    model mappedViewAction:[:vw| self processMappedView:vw ].
87bb1815460b initial checkin
ca
parents:
diff changeset
   997
    model application:self.
2458
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   998
    model addDependent:self.
64d8f3c973b3 *** empty log message ***
ca
parents: 2455
diff changeset
   999
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1000
2451
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1001
    showNamesHolder := false asValue.
cbda60900ced *** empty log message ***
ca
parents: 2177
diff changeset
  1002
    showNamesHolder addDependent:self.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1003
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1004
87bb1815460b initial checkin
ca
parents:
diff changeset
  1005
postBuildTree:aTree
87bb1815460b initial checkin
ca
parents:
diff changeset
  1006
    treeView := aTree scrolledView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1007
    treeView hasConstantHeight:true.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1008
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1009
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1010
!ViewTreeInspectorApplication methodsFor:'menu queries'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1011
87bb1815460b initial checkin
ca
parents:
diff changeset
  1012
hasApplication
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1013
    "returns true if the current selected view has an application"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1014
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1015
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1016
87bb1815460b initial checkin
ca
parents:
diff changeset
  1017
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1018
  ^ (view notNil and:[view application notNil])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1019
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1020
87bb1815460b initial checkin
ca
parents:
diff changeset
  1021
hasController
87bb1815460b initial checkin
ca
parents:
diff changeset
  1022
    "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
  1023
     other than nil or the view itself"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1024
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1025
    |view controller|
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
87bb1815460b initial checkin
ca
parents:
diff changeset
  1029
    view notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1030
        controller := view controller.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1031
      ^ (controller notNil and:[controller ~~ view])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1032
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1033
    ^ false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1034
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1035
87bb1815460b initial checkin
ca
parents:
diff changeset
  1036
hasModel
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1037
    "returns true if the current selected view has a model"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1038
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1039
    |view|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1040
87bb1815460b initial checkin
ca
parents:
diff changeset
  1041
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1042
  ^ (view notNil and:[view model notNil])
87bb1815460b initial checkin
ca
parents:
diff changeset
  1043
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1044
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1045
!ViewTreeInspectorApplication methodsFor:'menu specs'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1046
87bb1815460b initial checkin
ca
parents:
diff changeset
  1047
middleButtonMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1048
    "returns the middleButton menu for the single selected item or nil"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1049
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1050
    ^ [ model selectedItem notNil ifTrue:[self class middleButtonMenu]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1051
                                 ifFalse:[nil]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1052
      ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1053
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1054
87bb1815460b initial checkin
ca
parents:
diff changeset
  1055
submenuApplications:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1056
    |applications menu item list addBlock|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1057
87bb1815460b initial checkin
ca
parents:
diff changeset
  1058
    item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1059
                                              ifFalse:[model rootItem].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1060
    item isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1061
87bb1815460b initial checkin
ca
parents:
diff changeset
  1062
    applications := IdentityDictionary new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1063
87bb1815460b initial checkin
ca
parents:
diff changeset
  1064
    addBlock := [:el| |cls ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1065
        cls := self resolveApplicationClassFor:el.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1066
87bb1815460b initial checkin
ca
parents:
diff changeset
  1067
        cls notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1068
            ctr := applications at:cls ifAbsent:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1069
            applications at:cls put:(ctr + 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1070
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1071
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1072
    item recursiveDo:addBlock.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1073
    addBlock value:item.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1074
87bb1815460b initial checkin
ca
parents:
diff changeset
  1075
    applications isEmpty ifTrue:[^ nil ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1076
    list := SortedCollection sortBlock:[:a :b| a title < b title ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1077
87bb1815460b initial checkin
ca
parents:
diff changeset
  1078
    applications keysAndValuesDo:[:cls :ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1079
       list add:(MenuDesc title:(cls name)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1080
                          value:(ctr printString)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1081
                         action:[self doSelectNextOfApplicationClass:cls startingIn:item]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1082
                 ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1083
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1084
87bb1815460b initial checkin
ca
parents:
diff changeset
  1085
    menu := MenuDesc buildFromList:list onGC:aMenu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1086
    menu do:[:el|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1087
        el hideMenuOnActivated:false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1088
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1089
    ^ menu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1090
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1091
87bb1815460b initial checkin
ca
parents:
diff changeset
  1092
submenuComponents:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1093
    |widgets list total menu item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1094
87bb1815460b initial checkin
ca
parents:
diff changeset
  1095
    item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1096
                                              ifFalse:[model rootItem].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1097
    item isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1098
87bb1815460b initial checkin
ca
parents:
diff changeset
  1099
    widgets := IdentityDictionary new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1100
    total   := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1101
87bb1815460b initial checkin
ca
parents:
diff changeset
  1102
    item recursiveDo:[:el| |cls ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1103
        cls := el widget.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1104
87bb1815460b initial checkin
ca
parents:
diff changeset
  1105
        cls notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1106
            cls := cls class.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1107
            ctr := widgets at:cls ifAbsent:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1108
            widgets at:cls put:(ctr + 1).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1109
            total := total + 1.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1110
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1111
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1112
    total == 0 ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1113
    list := SortedCollection sortBlock:[:a :b| a title < b title ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1114
87bb1815460b initial checkin
ca
parents:
diff changeset
  1115
    widgets keysAndValuesDo:[:cls :ctr|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1116
        list add:(MenuDesc title:(cls name)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1117
                           value:(ctr printString)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1118
                          action:[self doSelectNextOfClass:cls startingIn:item]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1119
                 ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1120
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1121
    list := list asOrderedCollection.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1122
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1123
    list add:(MenuDesc title:'Total' value:(total printString)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1124
    menu := MenuDesc buildFromList:list onGC:aMenu.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1125
    menu do:[:el|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1126
        el hideMenuOnActivated:false
87bb1815460b initial checkin
ca
parents:
diff changeset
  1127
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1128
    ^ menu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1129
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1130
87bb1815460b initial checkin
ca
parents:
diff changeset
  1131
submenuGeometry:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1132
    "builds and returns the geometry submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1133
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1134
    |view point inst list x y|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1135
87bb1815460b initial checkin
ca
parents:
diff changeset
  1136
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1137
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1138
87bb1815460b initial checkin
ca
parents:
diff changeset
  1139
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1140
87bb1815460b initial checkin
ca
parents:
diff changeset
  1141
    "/ origin
87bb1815460b initial checkin
ca
parents:
diff changeset
  1142
    point := view relativeOrigin.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1143
    point isNil ifTrue:[ point := view origin ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1144
87bb1815460b initial checkin
ca
parents:
diff changeset
  1145
    x := view left.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1146
    y := view top.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1147
87bb1815460b initial checkin
ca
parents:
diff changeset
  1148
    (x == point x and:[y == point y]) ifTrue:[ inst := point ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1149
                                     ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1150
87bb1815460b initial checkin
ca
parents:
diff changeset
  1151
    list add:(MenuDesc title:'origin' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1152
87bb1815460b initial checkin
ca
parents:
diff changeset
  1153
    "/ corner
87bb1815460b initial checkin
ca
parents:
diff changeset
  1154
    point := view relativeCorner.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1155
    point isNil ifTrue:[ point := view corner ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1156
87bb1815460b initial checkin
ca
parents:
diff changeset
  1157
    x := view right.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1158
    y := view bottom.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1159
87bb1815460b initial checkin
ca
parents:
diff changeset
  1160
    (x == point x and:[y == point y]) ifTrue:[ inst := point ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1161
                                     ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1162
87bb1815460b initial checkin
ca
parents:
diff changeset
  1163
    list add:(MenuDesc title:'corner' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1164
87bb1815460b initial checkin
ca
parents:
diff changeset
  1165
    "/ extent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1166
    (point := view relativeExtent) isNil ifTrue:[point := view extent].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1167
    list add:(MenuDesc title:'extent' value:point).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1168
87bb1815460b initial checkin
ca
parents:
diff changeset
  1169
    "/ preferred extent
87bb1815460b initial checkin
ca
parents:
diff changeset
  1170
    list add:(MenuDesc title:'pref. extent' value:(view preferredExtent)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1171
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1172
87bb1815460b initial checkin
ca
parents:
diff changeset
  1173
    "/ view insets
87bb1815460b initial checkin
ca
parents:
diff changeset
  1174
    inst := 'l:%1  r:%2  t:%3  b:%4' bindWith:(view leftInset)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1175
                                         with:(view rightInset)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1176
                                         with:(view topInset)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1177
                                         with:(view bottomInset).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1178
87bb1815460b initial checkin
ca
parents:
diff changeset
  1179
    list add:(MenuDesc title:'insets'      value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1180
    list add:(MenuDesc title:'borderWidth' value:(view borderWidth)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1181
    list add:(MenuDesc title:'level'       value:(view level)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1182
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1183
87bb1815460b initial checkin
ca
parents:
diff changeset
  1184
    (inst := view layout) notNil ifTrue:[ inst := inst displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1185
    list add:(MenuDesc title:'layout' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1186
87bb1815460b initial checkin
ca
parents:
diff changeset
  1187
    (inst := view transformation) notNil ifTrue:[ inst := inst displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1188
    list add:(MenuDesc title:'transformation' value:inst).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1189
87bb1815460b initial checkin
ca
parents:
diff changeset
  1190
  ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1191
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1192
87bb1815460b initial checkin
ca
parents:
diff changeset
  1193
submenuInspector:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1194
    "builds and returns the inspector submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1195
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1196
    |view list n names label value|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1197
87bb1815460b initial checkin
ca
parents:
diff changeset
  1198
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1199
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1200
87bb1815460b initial checkin
ca
parents:
diff changeset
  1201
    n := view class instSize.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1202
    n > 0 ifFalse:[^ nil ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1203
87bb1815460b initial checkin
ca
parents:
diff changeset
  1204
    list  := OrderedCollection new:n.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1205
    names := view class allInstVarNames.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1206
87bb1815460b initial checkin
ca
parents:
diff changeset
  1207
    1 to:n do:[:i| |action|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1208
        label := (names at:i) printString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1209
        value := view instVarAt:i.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1210
        value isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1211
            value  := '------'.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1212
            action := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1213
        ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1214
            value  := value displayString contractAtEndTo:40.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1215
            action := [(view instVarAt:i) inspect].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1216
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1217
        list add:(MenuDesc title:label value:value action:action).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1218
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1219
87bb1815460b initial checkin
ca
parents:
diff changeset
  1220
    ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1221
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1222
87bb1815460b initial checkin
ca
parents:
diff changeset
  1223
submenuInterface:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1224
    "builds and returns the interface submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1225
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1226
    |view label inst value list|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1227
87bb1815460b initial checkin
ca
parents:
diff changeset
  1228
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1229
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1230
87bb1815460b initial checkin
ca
parents:
diff changeset
  1231
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1232
87bb1815460b initial checkin
ca
parents:
diff changeset
  1233
    inst  := view controller.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1234
    value := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1235
87bb1815460b initial checkin
ca
parents:
diff changeset
  1236
    inst isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1237
        label := nil
87bb1815460b initial checkin
ca
parents:
diff changeset
  1238
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1239
        inst == view ifTrue:[ label := '== view itself' ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1240
                    ifFalse:[ label := inst displayString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1241
                              value := [view controller inspect].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1242
                            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1243
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1244
    list add:(MenuDesc title:'controller' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1245
87bb1815460b initial checkin
ca
parents:
diff changeset
  1246
    inst := view delegate.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1247
    inst notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1248
        list add:(MenuDesc title:'delegate' value:(inst displayString) action:[ view delegate inspect ]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1249
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1250
87bb1815460b initial checkin
ca
parents:
diff changeset
  1251
    inst := view application.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1252
87bb1815460b initial checkin
ca
parents:
diff changeset
  1253
    inst notNil ifTrue:[ |topAppl|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1254
        list add:(MenuDesc title:'application' value:inst action:[ view application inspect ]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1255
87bb1815460b initial checkin
ca
parents:
diff changeset
  1256
        topAppl := inst topApplication.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1257
87bb1815460b initial checkin
ca
parents:
diff changeset
  1258
        (topAppl notNil and:[topAppl ~~ inst]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1259
            list add:(MenuDesc title:'topApplication' value:topAppl action:[ inst topApplication inspect ]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1260
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1261
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1262
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1263
87bb1815460b initial checkin
ca
parents:
diff changeset
  1264
    (view respondsTo:#'model:') ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1265
        inst := model.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1266
87bb1815460b initial checkin
ca
parents:
diff changeset
  1267
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1268
                  ifFalse:[ label := inst displayString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1269
                            value := [ view model 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 title:'model' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1273
87bb1815460b initial checkin
ca
parents:
diff changeset
  1274
        (inst notNil and:[view respondsTo:#modelInterface]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1275
            view modelInterface keysAndValuesDo:[:key : val|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1276
                val isNil ifTrue:[ label := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1277
                         ifFalse:[ label := val displayString ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1278
87bb1815460b initial checkin
ca
parents:
diff changeset
  1279
                list add:(MenuDesc title:('      - ', key) value:label ).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1280
            ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1281
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1282
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1283
87bb1815460b initial checkin
ca
parents:
diff changeset
  1284
    (view respondsTo:#enableChannel) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1285
        inst := view enableChannel.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1286
87bb1815460b initial checkin
ca
parents:
diff changeset
  1287
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1288
                  ifFalse:[ label := inst displayString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1289
                            value := [ view enableChannel inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1290
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1291
87bb1815460b initial checkin
ca
parents:
diff changeset
  1292
        list add:(MenuDesc title:'enableChannel' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1293
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1294
87bb1815460b initial checkin
ca
parents:
diff changeset
  1295
    list last isSeparator ifFalse:[ list add:(MenuDesc separator) ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1296
87bb1815460b initial checkin
ca
parents:
diff changeset
  1297
    (view respondsTo:#listHolder) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1298
        inst := view listHolder.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1299
87bb1815460b initial checkin
ca
parents:
diff changeset
  1300
        inst isNil ifTrue:[ label := value := nil ]
87bb1815460b initial checkin
ca
parents:
diff changeset
  1301
                  ifFalse:[ label := inst class printString.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1302
                            value := [ view listHolder inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1303
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1304
        list add:(MenuDesc title:'listHolder' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1305
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1306
87bb1815460b initial checkin
ca
parents:
diff changeset
  1307
    (view respondsTo:#list) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1308
        inst := view list.
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 := '%1 [%2]' bindWith:(inst class printString) with:(inst size).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1312
                            value := [ view list inspect ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1313
                          ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1314
87bb1815460b initial checkin
ca
parents:
diff changeset
  1315
        list add:(MenuDesc title:'list' value:label action:value).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1316
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1317
87bb1815460b initial checkin
ca
parents:
diff changeset
  1318
    list last isSeparator ifTrue:[ list removeLast ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1319
  ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1320
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1321
87bb1815460b initial checkin
ca
parents:
diff changeset
  1322
submenuVisibility:aMenu
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1323
    "builds and returns the geometry submenu"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1324
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1325
    |view list value|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1326
87bb1815460b initial checkin
ca
parents:
diff changeset
  1327
    view := self selectedView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1328
    view isNil ifTrue:[^ nil].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1329
87bb1815460b initial checkin
ca
parents:
diff changeset
  1330
    list := OrderedCollection new.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1331
87bb1815460b initial checkin
ca
parents:
diff changeset
  1332
    list add:(MenuDesc title:'device'     value:(view device printString)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1333
    list add:(MenuDesc title:'drawableId' value:(view id)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1334
    list add:(MenuDesc title:'gcId'       value:(view gcId)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1335
87bb1815460b initial checkin
ca
parents:
diff changeset
  1336
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1337
87bb1815460b initial checkin
ca
parents:
diff changeset
  1338
    list add:(MenuDesc title:'shown'    value:(view shown)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1339
    list add:(MenuDesc title:'realized' value:(view realized)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1340
87bb1815460b initial checkin
ca
parents:
diff changeset
  1341
    list add:(MenuDesc separator).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1342
87bb1815460b initial checkin
ca
parents:
diff changeset
  1343
    list add:(MenuDesc title:'hiddenOnRealize' value:(view isHiddenOnRealize)).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1344
87bb1815460b initial checkin
ca
parents:
diff changeset
  1345
    (value := view visibilityChannel) isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1346
        list add:(MenuDesc title:'visibilityChannel' value:'------').
87bb1815460b initial checkin
ca
parents:
diff changeset
  1347
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1348
        list add:(MenuDesc title:'visibilityChannel'
87bb1815460b initial checkin
ca
parents:
diff changeset
  1349
                           value:(value displayString)
87bb1815460b initial checkin
ca
parents:
diff changeset
  1350
                          action:[view visibilityChannel inspect]).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1351
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1352
87bb1815460b initial checkin
ca
parents:
diff changeset
  1353
        
87bb1815460b initial checkin
ca
parents:
diff changeset
  1354
  ^ MenuDesc buildFromList:list onGC:aMenu
87bb1815460b initial checkin
ca
parents:
diff changeset
  1355
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1356
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1357
!ViewTreeInspectorApplication methodsFor:'private'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1358
87bb1815460b initial checkin
ca
parents:
diff changeset
  1359
selectFocusView
87bb1815460b initial checkin
ca
parents:
diff changeset
  1360
    |rootView focusItem focusView|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1361
87bb1815460b initial checkin
ca
parents:
diff changeset
  1362
    rootView := model rootView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1363
87bb1815460b initial checkin
ca
parents:
diff changeset
  1364
    (rootView notNil and:[rootView shown]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1365
        focusView := rootView windowGroup focusView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1366
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1367
    focusView isNil ifTrue:[^ self ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1368
87bb1815460b initial checkin
ca
parents:
diff changeset
  1369
    focusItem := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1370
87bb1815460b initial checkin
ca
parents:
diff changeset
  1371
    (focusItem notNil and:[focusItem widget == focusView]) ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1372
        ^ self
87bb1815460b initial checkin
ca
parents:
diff changeset
  1373
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1374
    focusItem := model listOfItems recursiveDetect:[:el| el widget == focusView ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1375
87bb1815460b initial checkin
ca
parents:
diff changeset
  1376
    focusItem notNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1377
        model selectItem:focusItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1378
    ].        
87bb1815460b initial checkin
ca
parents:
diff changeset
  1379
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1380
87bb1815460b initial checkin
ca
parents:
diff changeset
  1381
setRootItem:aRootItemOrNil
87bb1815460b initial checkin
ca
parents:
diff changeset
  1382
    |theProcess|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1383
87bb1815460b initial checkin
ca
parents:
diff changeset
  1384
    aRootItemOrNil isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1385
        process := nil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1386
    ] ifFalse:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1387
        "/ expand tree to level 3
87bb1815460b initial checkin
ca
parents:
diff changeset
  1388
        aRootItemOrNil do:[:aRootChild|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1389
            aRootChild do:[:aSubChild| aSubChild expand ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1390
            aRootChild expand.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1391
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1392
        aRootItemOrNil expand.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1393
87bb1815460b initial checkin
ca
parents:
diff changeset
  1394
        process isNil ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1395
            theProcess := process :=
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1396
                Process for:[   |update testModeChannel|
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1397
87bb1815460b initial checkin
ca
parents:
diff changeset
  1398
                                update := false.
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1399
                                testModeChannel := model testModeChannel.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1400
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1401
                                [process == theProcess] whileTrue:[
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1402
                                    Delay waitForSeconds:0.5.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1403
87bb1815460b initial checkin
ca
parents:
diff changeset
  1404
                                    (treeView notNil and:[process == theProcess and:[treeView shown]]) ifTrue:[
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1405
                                        (testModeChannel value == true and:[followFocusChannel value == true]) ifTrue:[
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1406
                                            self selectFocusView.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1407
                                        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1408
                                        update ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1409
                                            self updateShownStatus.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1410
                                        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1411
                                        update := update not.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1412
                                    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1413
                                ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1414
87bb1815460b initial checkin
ca
parents:
diff changeset
  1415
                             ] priority:8.
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1416
            theProcess name:'ViewTreeInspector - Follow Focus'.
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1417
            theProcess resume.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1418
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1419
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1420
    model rootItem:aRootItemOrNil.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1421
!
87bb1815460b initial checkin
ca
parents:
diff changeset
  1422
87bb1815460b initial checkin
ca
parents:
diff changeset
  1423
updateShownStatus
87bb1815460b initial checkin
ca
parents:
diff changeset
  1424
    |rootItem min max visState listIdx visY0 visY1 height damage|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1425
87bb1815460b initial checkin
ca
parents:
diff changeset
  1426
    rootItem := model rootItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1427
    (rootItem notNil and:[rootItem widget shown]) ifFalse:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1428
87bb1815460b initial checkin
ca
parents:
diff changeset
  1429
    max := 0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1430
    min := 9999999.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1431
87bb1815460b initial checkin
ca
parents:
diff changeset
  1432
    rootItem recursiveEachVisibleItemDo:[:anItem|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1433
        visState := (anItem widget shown).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1434
87bb1815460b initial checkin
ca
parents:
diff changeset
  1435
        visState ~~ anItem isDrawnShown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1436
            anItem isDrawnShown:visState.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1437
            listIdx := treeView identityIndexOf:anItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1438
87bb1815460b initial checkin
ca
parents:
diff changeset
  1439
            listIdx > 0 ifTrue:[    
87bb1815460b initial checkin
ca
parents:
diff changeset
  1440
                max := max max:listIdx.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1441
                min := min min:listIdx.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1442
            ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1443
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1444
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1445
    max < min ifTrue:[^ self].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1446
    max := max + 1.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1447
87bb1815460b initial checkin
ca
parents:
diff changeset
  1448
    visY0  := (treeView yVisibleOfLine:min) max:0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1449
    visY1  := (treeView yVisibleOfLine:max) min:(treeView height).
87bb1815460b initial checkin
ca
parents:
diff changeset
  1450
    height := visY1 - visY0.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1451
    
87bb1815460b initial checkin
ca
parents:
diff changeset
  1452
    height > 2 ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1453
        treeView shown ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1454
            damage := Rectangle left:0 top:visY0 width:(treeView width) height:height.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1455
            treeView invalidateDeviceRectangle:damage repairNow:false.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1456
        ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1457
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1458
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1459
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1460
!ViewTreeInspectorApplication methodsFor:'selection'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1461
87bb1815460b initial checkin
ca
parents:
diff changeset
  1462
selectedView
2455
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1463
    "answer the selected view or nil"
93aaf62a6b95 remove colors from window spec & rework
ca
parents: 2454
diff changeset
  1464
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1465
    |item|
87bb1815460b initial checkin
ca
parents:
diff changeset
  1466
87bb1815460b initial checkin
ca
parents:
diff changeset
  1467
    item := model selectedItem.
87bb1815460b initial checkin
ca
parents:
diff changeset
  1468
    item notNil ifTrue:[ ^ item widget ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1469
  ^ nil
87bb1815460b initial checkin
ca
parents:
diff changeset
  1470
! !
87bb1815460b initial checkin
ca
parents:
diff changeset
  1471
2744
5bee95e91ffd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2458
diff changeset
  1472
!ViewTreeInspectorApplication methodsFor:'testing'!
2177
87bb1815460b initial checkin
ca
parents:
diff changeset
  1473
87bb1815460b initial checkin
ca
parents:
diff changeset
  1474
resolveApplicationClassFor:aTreeItem
87bb1815460b initial checkin
ca
parents:
diff changeset
  1475
    aTreeItem isApplicationClass ifTrue:[
87bb1815460b initial checkin
ca
parents:
diff changeset
  1476
       ^ aTreeItem applicationClass
87bb1815460b initial checkin
ca
parents:
diff changeset
  1477
    ].
87bb1815460b initial checkin
ca
parents:
diff changeset
  1478
    ^ nil
87bb1815460b initial checkin
ca
parents:
diff changeset
  1479
!
87bb1815460b initial checkin
ca
pare