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