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