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