--- a/Tools__ViewTreeApplication.st Tue Jan 16 22:32:41 2018 +0100
+++ b/Tools__ViewTreeApplication.st Tue Jan 16 22:33:10 2018 +0100
@@ -1,6 +1,6 @@
"
COPYRIGHT (c) 2007 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -59,7 +59,7 @@
copyright
"
COPYRIGHT (c) 2007 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -81,18 +81,18 @@
[Instance variables:]
- model <ViewTreeModel> the used ViewTreeModel
- clickedItem <ViewTreeItem> item under the clickedPoint (motion action)
- clickedPoint <Point> point where the motion action started from.
- motionAction <Action> (oneArg-) action called durring buttonMotion.
+ model <ViewTreeModel> the used ViewTreeModel
+ clickedItem <ViewTreeItem> item under the clickedPoint (motion action)
+ clickedPoint <Point> point where the motion action started from.
+ motionAction <Action> (oneArg-) action called durring buttonMotion.
[author:]
- Claus Atzkern
+ Claus Atzkern
[see also:]
- ViewTreeModel
- ViewTreeItem
+ ViewTreeModel
+ ViewTreeItem
"
! !
@@ -115,7 +115,7 @@
"/ icon := ToolbarIconLibrary inspectLocals20x20Icon magnifiedTo:28@28.
"/
-"/ menuItem := MenuItem new
+"/ menuItem := MenuItem new
"/ label: 'View Tree Inspector';
"/ value: [ ViewTreeInspectorApplication open];
"/ isButton: true;
@@ -164,28 +164,28 @@
!ViewTreeInspectorApplication class methodsFor:'help specs'!
-flyByHelpSpec
+helpSpec
<resource: #help>
- ^super flyByHelpSpec addPairsFrom:#(
+ ^super helpSpec addPairsFrom:#(
#doRedraw
'Force the application to redraw its windows'
#doUncatchEvents
-'Release picked view and uncatch events\(currently locked for widget selection)'
+'Release picked view and uncatch events\(currently locked for widget selection)'
#doCatchEvents
-'Lock view and catch events for widget selection\(currently unlocked)'
+'Lock view and catch events for widget selection\(currently unlocked)'
#doInspectApplication
-'Inspect the selected view''s application'
+'Inspect the selected view''s application'
#doBrowseApplication
-'Browse the selected view''s application'
+'Browse the selected view''s application'
#doPickView
-'Pick a widget with the mouse and inspect its view hierarchy'
+'Pick a widget with the mouse and inspect its view hierarchy'
)
! !
@@ -212,8 +212,8 @@
<resource: #image>
^Icon
- constantNamed:'Tools::ViewTreeInspectorApplication lockViewIcon'
- ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+ constantNamed:'Tools::ViewTreeInspectorApplication lockViewIcon'
+ ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@A8^G!!7O3ACP5*P@@A8^G @@@@@@@@@@@A8^@@@OE0/!!P0S#0@@^G @@@@@@@@@@@B (@D''D#48"1.CX5H@(J@@@@@@@@@@@@B (B(>SAT"
''%!!/P7,@(J@@@@@@@@@@@@@%IB0#M"H%IRTQV5P@IRT@@@@@@@@@@@ANSX:U]PANS$8:T80@S$8@@@@@@@@@@@AN&UYWK(EYQ@\FUPQHXT8@@@@@@@@@@@AN
@@ -238,8 +238,8 @@
<resource: #image>
^Icon
- constantNamed:'Tools::ViewTreeInspectorApplication releaseViewIcon'
- ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+ constantNamed:'Tools::ViewTreeInspectorApplication releaseViewIcon'
+ ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@A8^G!!7O3ACP5*P@@A8^G @@@@@@@@@@@A8^@@@OE0/!!P0S#0@@^G @@@@@@@@@@@B (@@''D#48"1.CX5H@(J@@@@@@@@@@@@B (@@@@@@"
''%!!/P7,@(J@@@@@@@@@@@@@%I@@@@BH%IRTQV5P@IRT@@@@@@@@@@@ANSP@@@@ANS$8:T80@S$8@@@@@@@@@@@AN&UYWK(EYQ@\FUPQHXT8@@@@@@@@@@@AN
@@ -266,123 +266,123 @@
<resource: #canvas>
- ^
+ ^
#(FullSpec
name: windowSpec
- window:
+ window:
(WindowSpec
- label: 'View Tree Inspector'
- name: 'View Tree Inspector'
- min: (Point 10 10)
- max: (Point 1024 9999)
- bounds: (Rectangle 0 0 693 643)
- menu: menu
+ label: 'View Tree Inspector'
+ name: 'View Tree Inspector'
+ min: (Point 10 10)
+ max: (Point 1024 9999)
+ bounds: (Rectangle 0 0 693 643)
+ menu: menu
)
- component:
+ component:
(SpecCollection
- collection: (
- (MenuPanelSpec
- name: 'toolbarMenu'
- layout: (LayoutFrame 0 0.0 0 0 0 1.0 40 0)
- menu: toolbarMenu
- textDefault: true
- )
- (VariableVerticalPanelSpec
- name: 'VariableVerticalPanel1'
- layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 0 1.0)
- component:
- (SpecCollection
- collection: (
- (ViewSpec
- name: 'PathAndListPane'
- component:
- (SpecCollection
- collection: (
- (ViewSpec
- name: 'PathPane'
- layout: (LayoutFrame 0 0 0 0 0 1 25 0)
- component:
- (SpecCollection
- collection: (
- (InputFieldSpec
- name: 'Path'
- layout: (LayoutFrame 0 0 0 0 0 1 0 1)
- model: path
- acceptOnReturn: true
- acceptOnTab: true
- acceptOnPointerLeave: true
- emptyFieldReplacementText: 'No View Selected'
- )
- )
-
- )
- )
- (HierarchicalListViewSpec
- name: 'List'
- layout: (LayoutFrame 0 0 25 0 0 1 0 1)
- level: 1
- model: model
- menu: middleButtonMenu
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- miniScrollerHorizontal: true
- miniScrollerVertical: false
- listModel: listOfItems
- multipleSelectOk: true
- useIndex: false
- highlightMode: label
- showLeftIndicators: false
- indicatorSelector: indicatorClicked:
- useDefaultIcons: false
- postBuildCallback: postBuildTree:
- )
- )
-
- )
- )
- (ViewSpec
- name: 'Box2'
- component:
- (SpecCollection
- collection: (
- (TabViewSpec
- name: 'TabHeader1'
- layout: (LayoutFrame 0 0.0 0 0 0 1.0 25 0)
- model: inspectorModeIndexHolder
- menu: inspectorModes
- useIndex: true
- translateLabel: true
- )
- (SubCanvasSpec
- name: 'Browser'
- layout: (LayoutFrame 0 0 26 0 0 1 0 1)
- visibilityChannel: browserVisibleHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- majorKey: #'Tools::NewSystemBrowser'
- minorKey: singleClassWithoutVariableListBrowserSpec
- createNewApplication: true
- createNewBuilder: true
- postBuildCallback: postBuildBrowserCanvas:
- )
- (ViewSpec
- name: 'Inspector'
- layout: (LayoutFrame 0 0 26 0 0 1 0 1)
- visibilityChannel: inspectorVisibleHolder
- postBuildCallback: postBuildInspectorView:
- viewClassName: 'InspectorView'
- )
- )
-
- )
- )
- )
-
- )
- handles: (Any 0.5 1.0)
- )
- )
-
+ collection: (
+ (MenuPanelSpec
+ name: 'toolbarMenu'
+ layout: (LayoutFrame 0 0.0 0 0 0 1.0 40 0)
+ menu: toolbarMenu
+ textDefault: true
+ )
+ (VariableVerticalPanelSpec
+ name: 'VariableVerticalPanel1'
+ layout: (LayoutFrame 0 0.0 40 0.0 0 1.0 0 1.0)
+ component:
+ (SpecCollection
+ collection: (
+ (ViewSpec
+ name: 'PathAndListPane'
+ component:
+ (SpecCollection
+ collection: (
+ (ViewSpec
+ name: 'PathPane'
+ layout: (LayoutFrame 0 0 0 0 0 1 25 0)
+ component:
+ (SpecCollection
+ collection: (
+ (InputFieldSpec
+ name: 'Path'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+ model: path
+ acceptOnReturn: true
+ acceptOnTab: true
+ acceptOnPointerLeave: true
+ emptyFieldReplacementText: 'No View Selected'
+ )
+ )
+
+ )
+ )
+ (HierarchicalListViewSpec
+ name: 'List'
+ layout: (LayoutFrame 0 0 25 0 0 1 0 1)
+ level: 1
+ model: model
+ menu: middleButtonMenu
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ miniScrollerHorizontal: true
+ miniScrollerVertical: false
+ listModel: listOfItems
+ multipleSelectOk: true
+ useIndex: false
+ highlightMode: label
+ showLeftIndicators: false
+ indicatorSelector: indicatorClicked:
+ useDefaultIcons: false
+ postBuildCallback: postBuildTree:
+ )
+ )
+
+ )
+ )
+ (ViewSpec
+ name: 'Box2'
+ component:
+ (SpecCollection
+ collection: (
+ (TabViewSpec
+ name: 'TabHeader1'
+ layout: (LayoutFrame 0 0.0 0 0 0 1.0 25 0)
+ model: inspectorModeIndexHolder
+ menu: inspectorModes
+ useIndex: true
+ translateLabel: true
+ )
+ (SubCanvasSpec
+ name: 'Browser'
+ layout: (LayoutFrame 0 0 26 0 0 1 0 1)
+ visibilityChannel: browserVisibleHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ majorKey: #'Tools::NewSystemBrowser'
+ minorKey: singleClassWithoutVariableListBrowserSpec
+ createNewApplication: true
+ createNewBuilder: true
+ postBuildCallback: postBuildBrowserCanvas:
+ )
+ (ViewSpec
+ name: 'Inspector'
+ layout: (LayoutFrame 0 0 26 0 0 1 0 1)
+ visibilityChannel: inspectorVisibleHolder
+ postBuildCallback: postBuildInspectorView:
+ viewClassName: 'InspectorView'
+ )
+ )
+
+ )
+ )
+ )
+
+ )
+ handles: (Any 0.5 1.0)
+ )
+ )
+
)
)
! !
@@ -394,7 +394,7 @@
by the MenuEditor of ST/X."
"Do not manually edit this!! If it is corrupted,
- the MenuEditor may not be able to read the specification."
+ the MenuEditor may not be able to read the specification."
"
@@ -404,214 +404,214 @@
<resource: #menu>
- ^
+ ^
#(Menu
- (
- (MenuItem
- label: 'File'
- submenu:
- (Menu
- (
- (MenuItem
- label: 'Pick a View'
- itemValue: doPickView
- )
- (MenuItem
- enabled: hasTargetWidgetChannel
- label: 'Release Picked View'
- itemValue: doUnpick
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Settings'
- submenu:
- (Menu
- (
- (MenuItem
- label: 'Test Mode'
- hideMenuOnActivated: false
- indication: testModeChannel
- )
- (MenuItem
- enabled: testModeChannel
- label: 'Follow Focus'
- hideMenuOnActivated: false
- indication: followFocusChannel
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Select on Click'
- hideMenuOnActivated: false
- indication: selectOnClickHolder
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Show Name of Widgets'
- hideMenuOnActivated: false
- indication: showNamesHolder
- )
- )
- nil
- nil
- )
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Exit'
- itemValue: closeRequest
- )
- )
- nil
- nil
- )
- )
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Selection'
- submenuChannel: middleButtonMenu
- )
- (MenuItem
- label: 'Widget'
- submenu:
- (Menu
- (
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Browse'
- itemValue: doBrowse:
- argument: view
- )
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Inspect'
- itemValue: doInspect:
- argument: view
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- enabled: hasTargetWidgetChannel
- label: 'All Components'
- startGroup: right
- submenuChannel: submenuComponents:
- )
- )
- nil
- nil
- )
- )
- (MenuItem
- label: 'Application'
- submenu:
- (Menu
- (
- (MenuItem
- label: 'Redraw'
- itemValue: doRedraw
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Browse'
- itemValue: doBrowse:
- argument: application
- )
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Inspect'
- itemValue: doInspect:
- argument: application
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- enabled: canBrowseWindowSpecMethod
- label: 'Browse Window Spec Method'
- itemValue: doBrowseWindowSpecMethod
- )
- (MenuItem
- enabled: canEditWindowSpec
- label: 'Edit Window Spec'
- itemValue: doEditWindowSpec
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- enabled: hasTargetWidgetChannel
- label: 'All Applications'
- submenuChannel: submenuApplications:
- )
- )
- nil
- nil
- )
- )
- (MenuItem
- label: 'Process'
- submenu:
- (Menu
- (
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Debug'
- itemValue: doDebugProcess
- )
- (MenuItem
- enabled: hasSingleSelectionHolder
- label: 'Inspect'
- itemValue: doInspect:
- argument: process
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Open Process Monitor'
- itemValue: doOpenProcessMonitor
- )
- )
- nil
- nil
- )
- )
- (MenuItem
- label: 'Help'
- startGroup: conditionalRight
- submenu:
- (Menu
- (
- (MenuItem
- label: 'Documentation'
- itemValue: openDocumentation
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'About this Application...'
- itemValue: openAboutThisApplication
- )
- )
- nil
- nil
- )
- )
- )
- nil
- nil
+ (
+ (MenuItem
+ label: 'File'
+ submenu:
+ (Menu
+ (
+ (MenuItem
+ label: 'Pick a View'
+ itemValue: doPickView
+ )
+ (MenuItem
+ enabled: hasTargetWidgetChannel
+ label: 'Release Picked View'
+ itemValue: doUnpick
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Settings'
+ submenu:
+ (Menu
+ (
+ (MenuItem
+ label: 'Test Mode'
+ hideMenuOnActivated: false
+ indication: testModeChannel
+ )
+ (MenuItem
+ enabled: testModeChannel
+ label: 'Follow Focus'
+ hideMenuOnActivated: false
+ indication: followFocusChannel
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Select on Click'
+ hideMenuOnActivated: false
+ indication: selectOnClickHolder
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Show Name of Widgets'
+ hideMenuOnActivated: false
+ indication: showNamesHolder
+ )
+ )
+ nil
+ nil
+ )
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Exit'
+ itemValue: closeRequest
+ )
+ )
+ nil
+ nil
+ )
+ )
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Selection'
+ submenuChannel: middleButtonMenu
+ )
+ (MenuItem
+ label: 'Widget'
+ submenu:
+ (Menu
+ (
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Browse'
+ itemValue: doBrowse:
+ argument: view
+ )
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Inspect'
+ itemValue: doInspect:
+ argument: view
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ enabled: hasTargetWidgetChannel
+ label: 'All Components'
+ startGroup: right
+ submenuChannel: submenuComponents:
+ )
+ )
+ nil
+ nil
+ )
+ )
+ (MenuItem
+ label: 'Application'
+ submenu:
+ (Menu
+ (
+ (MenuItem
+ label: 'Redraw'
+ itemValue: doRedraw
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Browse'
+ itemValue: doBrowse:
+ argument: application
+ )
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Inspect'
+ itemValue: doInspect:
+ argument: application
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ enabled: canBrowseWindowSpecMethod
+ label: 'Browse Window Spec Method'
+ itemValue: doBrowseWindowSpecMethod
+ )
+ (MenuItem
+ enabled: canEditWindowSpec
+ label: 'Edit Window Spec'
+ itemValue: doEditWindowSpec
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ enabled: hasTargetWidgetChannel
+ label: 'All Applications'
+ submenuChannel: submenuApplications:
+ )
+ )
+ nil
+ nil
+ )
+ )
+ (MenuItem
+ label: 'Process'
+ submenu:
+ (Menu
+ (
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Debug'
+ itemValue: doDebugProcess
+ )
+ (MenuItem
+ enabled: hasSingleSelectionHolder
+ label: 'Inspect'
+ itemValue: doInspect:
+ argument: process
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Open Process Monitor'
+ itemValue: doOpenProcessMonitor
+ )
+ )
+ nil
+ nil
+ )
+ )
+ (MenuItem
+ label: 'Help'
+ startGroup: conditionalRight
+ submenu:
+ (Menu
+ (
+ (MenuItem
+ label: 'Documentation'
+ itemValue: openDocumentation
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'About this Application...'
+ itemValue: openAboutThisApplication
+ )
+ )
+ nil
+ nil
+ )
+ )
+ )
+ nil
+ nil
)
!
@@ -630,124 +630,124 @@
<resource: #menu>
- ^
+ ^
#(Menu
- (
- (MenuItem
- label: 'Browse View Class'
- itemValue: doBrowse:
- argument: view
- )
- (MenuItem
- label: 'Browse Model Class'
- itemValue: doBrowse:
- isVisible: hasModel
- argument: model
- )
- (MenuItem
- label: 'Browse Application Class'
- itemValue: doBrowse:
- isVisible: hasApplication
- argument: application
- )
- (MenuItem
- label: 'Browse Controller Class'
- itemValue: doBrowse:
- isVisible: hasController
- argument: controller
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Inspect View'
- itemValue: doInspect:
- argument: view
- )
- (MenuItem
- label: 'Inspect Window Group'
- itemValue: doInspect:
- argument: group
- )
- (MenuItem
- label: 'Inspect Model'
- itemValue: doInspect:
- isVisible: hasModel
- argument: model
- )
- (MenuItem
- label: 'Inspect Application'
- itemValue: doInspect:
- isVisible: hasApplication
- argument: application
- )
- (MenuItem
- label: 'Inspect Controller'
- itemValue: doInspect:
- isVisible: hasController
- argument: controller
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Flash'
- itemValue: doFlash
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Destroy'
- itemValue: doDestroy
- labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Geometry'
- submenuChannel: submenuGeometry:
- keepLinkedMenu: true
- )
- (MenuItem
- label: 'Interface'
- submenuChannel: submenuInterface:
- keepLinkedMenu: true
- )
- (MenuItem
- label: 'Visibility'
- submenuChannel: submenuVisibility:
- keepLinkedMenu: true
- )
- (MenuItem
- label: 'Instance Variables'
- submenuChannel: submenuInspector:
- keepLinkedMenu: true
- )
- (MenuItem
- label: '='
- )
- (MenuItem
- label: ''
- )
- (MenuItem
- enabled: selectedComponentHasChildren
- label: 'Applications'
- nameKey: single
- submenuChannel: submenuApplications:
- keepLinkedMenu: true
- )
- (MenuItem
- enabled: selectedComponentHasChildren
- label: 'Components'
- nameKey: single
- submenuChannel: submenuComponents:
- keepLinkedMenu: true
- )
- )
- nil
- nil
+ (
+ (MenuItem
+ label: 'Browse View Class'
+ itemValue: doBrowse:
+ argument: view
+ )
+ (MenuItem
+ label: 'Browse Model Class'
+ itemValue: doBrowse:
+ isVisible: hasModel
+ argument: model
+ )
+ (MenuItem
+ label: 'Browse Application Class'
+ itemValue: doBrowse:
+ isVisible: hasApplication
+ argument: application
+ )
+ (MenuItem
+ label: 'Browse Controller Class'
+ itemValue: doBrowse:
+ isVisible: hasController
+ argument: controller
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Inspect View'
+ itemValue: doInspect:
+ argument: view
+ )
+ (MenuItem
+ label: 'Inspect Window Group'
+ itemValue: doInspect:
+ argument: group
+ )
+ (MenuItem
+ label: 'Inspect Model'
+ itemValue: doInspect:
+ isVisible: hasModel
+ argument: model
+ )
+ (MenuItem
+ label: 'Inspect Application'
+ itemValue: doInspect:
+ isVisible: hasApplication
+ argument: application
+ )
+ (MenuItem
+ label: 'Inspect Controller'
+ itemValue: doInspect:
+ isVisible: hasController
+ argument: controller
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Flash'
+ itemValue: doFlash
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Destroy'
+ itemValue: doDestroy
+ labelImage: (ResourceRetriever ToolbarIconLibrary erase16x16Icon 'Destroy')
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Geometry'
+ submenuChannel: submenuGeometry:
+ keepLinkedMenu: true
+ )
+ (MenuItem
+ label: 'Interface'
+ submenuChannel: submenuInterface:
+ keepLinkedMenu: true
+ )
+ (MenuItem
+ label: 'Visibility'
+ submenuChannel: submenuVisibility:
+ keepLinkedMenu: true
+ )
+ (MenuItem
+ label: 'Instance Variables'
+ submenuChannel: submenuInspector:
+ keepLinkedMenu: true
+ )
+ (MenuItem
+ label: '='
+ )
+ (MenuItem
+ label: ''
+ )
+ (MenuItem
+ enabled: selectedComponentHasChildren
+ label: 'Applications'
+ nameKey: single
+ submenuChannel: submenuApplications:
+ keepLinkedMenu: true
+ )
+ (MenuItem
+ enabled: selectedComponentHasChildren
+ label: 'Components'
+ nameKey: single
+ submenuChannel: submenuComponents:
+ keepLinkedMenu: true
+ )
+ )
+ nil
+ nil
)
!
@@ -766,33 +766,33 @@
<resource: #menu>
- ^
+ ^
#(Menu
- (
- (MenuItem
- label: 'Browse Menu Item''s Class'
- itemValue: doBrowse:
- argument: menuItem
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Inspect Menu Item'
- itemValue: doInspect:
- argument: menuItem
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Interface'
- submenuChannel: submenuMenuItemInterface:
- keepLinkedMenu: true
- )
- )
- nil
- nil
+ (
+ (MenuItem
+ label: 'Browse Menu Item''s Class'
+ itemValue: doBrowse:
+ argument: menuItem
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Inspect Menu Item'
+ itemValue: doInspect:
+ argument: menuItem
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Interface'
+ submenuChannel: submenuMenuItemInterface:
+ keepLinkedMenu: true
+ )
+ )
+ nil
+ nil
)
"Created: / 16-08-2017 / 13:48:49 / cg"
@@ -813,75 +813,75 @@
<resource: #menu>
- ^
+ ^
#(Menu
- (
- (MenuItem
- enabled: hasTargetWidgetChannel
- label: 'Redraw'
- itemValue: doRedraw
- isButton: true
- labelImage: (ResourceRetriever ToolbarIconLibrary reloadIcon)
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- label: 'Pick a View and Catch Events'
- itemValue: doPickView
- translateLabel: false
- isButton: true
- hideMenuOnActivated: false
- labelImage: (ResourceRetriever ToolbarIconLibrary pickWindowIcon)
- )
- (MenuItem
- enabled: hasTargetWidgetChannel
- isVisible: isNotCatchingEventsChannel
- label: 'Catch Events of Picked View'
- activeHelpKey: doCatchEvents
- itemValue: doCatchEvents
- nameKey: doCatchEvents
- isButton: true
- labelImage: (ResourceRetriever nil releaseViewIcon)
- )
- (MenuItem
- enabled: hasTargetWidgetChannel
- isVisible: isCatchingEventsChannel
- label: 'Release Picked View and Uncatch Events'
- activeHelpKey: doUncatchEvents
- itemValue: doUncatchEvents
- nameKey: doUncatchEvents
- isButton: true
- labelImage: (ResourceRetriever nil lockViewIcon)
- )
- (MenuItem
- label: '-'
- )
- (MenuItem
- activeHelpKey: doBrowseApplication
- enabled: hasSingleSelectionHolder
- label: 'Browse Application'
- itemValue: doBrowse:
- translateLabel: false
- isButton: true
- hideMenuOnActivated: false
- labelImage: (ResourceRetriever ToolbarIconLibrary systemBrowser24x24Icon2)
- argument: application
- )
- (MenuItem
- activeHelpKey: doInspectApplication
- enabled: hasSingleSelectionHolder
- label: 'Inspect Application'
- itemValue: doInspect:
- translateLabel: false
- isButton: true
- hideMenuOnActivated: false
- labelImage: (ResourceRetriever ToolbarIconLibrary inspect22x24Icon)
- argument: application
- )
- )
- nil
- nil
+ (
+ (MenuItem
+ enabled: hasTargetWidgetChannel
+ label: 'Redraw'
+ itemValue: doRedraw
+ isButton: true
+ labelImage: (ResourceRetriever ToolbarIconLibrary reloadIcon)
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ label: 'Pick a View and Catch Events'
+ itemValue: doPickView
+ translateLabel: false
+ isButton: true
+ hideMenuOnActivated: false
+ labelImage: (ResourceRetriever ToolbarIconLibrary pickWindowIcon)
+ )
+ (MenuItem
+ enabled: hasTargetWidgetChannel
+ isVisible: isNotCatchingEventsChannel
+ label: 'Catch Events of Picked View'
+ activeHelpKey: doCatchEvents
+ itemValue: doCatchEvents
+ nameKey: doCatchEvents
+ isButton: true
+ labelImage: (ResourceRetriever nil releaseViewIcon)
+ )
+ (MenuItem
+ enabled: hasTargetWidgetChannel
+ isVisible: isCatchingEventsChannel
+ label: 'Release Picked View and Uncatch Events'
+ activeHelpKey: doUncatchEvents
+ itemValue: doUncatchEvents
+ nameKey: doUncatchEvents
+ isButton: true
+ labelImage: (ResourceRetriever nil lockViewIcon)
+ )
+ (MenuItem
+ label: '-'
+ )
+ (MenuItem
+ activeHelpKey: doBrowseApplication
+ enabled: hasSingleSelectionHolder
+ label: 'Browse Application'
+ itemValue: doBrowse:
+ translateLabel: false
+ isButton: true
+ hideMenuOnActivated: false
+ labelImage: (ResourceRetriever ToolbarIconLibrary systemBrowser24x24Icon2)
+ argument: application
+ )
+ (MenuItem
+ activeHelpKey: doInspectApplication
+ enabled: hasSingleSelectionHolder
+ label: 'Inspect Application'
+ itemValue: doInspect:
+ translateLabel: false
+ isButton: true
+ hideMenuOnActivated: false
+ labelImage: (ResourceRetriever ToolbarIconLibrary inspect22x24Icon)
+ argument: application
+ )
+ )
+ nil
+ nil
)
! !
@@ -926,13 +926,13 @@
item := model listOfItems at:anIndex ifAbsent:nil.
item notNil ifTrue:[
- ( (sensor := self window sensor) notNil
- and:[(sensor ctrlDown or:[sensor shiftDown])]
- ) ifTrue:[
- item recursiveToggleExpand
- ] ifFalse:[
- item toggleExpand
- ]
+ ( (sensor := self window sensor) notNil
+ and:[(sensor ctrlDown or:[sensor shiftDown])]
+ ) ifTrue:[
+ item recursiveToggleExpand
+ ] ifFalse:[
+ item toggleExpand
+ ]
].
! !
@@ -944,14 +944,14 @@
2->Application
3->WindowGroup
4->Sensor
- 5->Model
- 6->Widget Class
- 7->Application Class
+ 5->Model
+ 6->Widget Class
+ 7->Application Class
"
^ BlockValue
- with:[:v | self inspectorMode == #widgetClass or:[self inspectorMode == #applicationClass] ]
- argument:self inspectorModeIndexHolder
+ with:[:v | self inspectorMode == #widgetClass or:[self inspectorMode == #applicationClass] ]
+ argument:self inspectorModeIndexHolder
!
canBrowseWindowSpecMethod
@@ -986,9 +986,9 @@
2->application
3->WindowGroup
4->Sensor
- 5->Model
- 6->Widget Class
- 7->Application Class
+ 5->Model
+ 6->Widget Class
+ 7->Application Class
"
|mode|
@@ -1004,9 +1004,9 @@
2->Application
3->WindowGroup
4->Sensor
- 5->Model
- 6->Widget Class
- 7->Application Class
+ 5->Model
+ 6->Widget Class
+ 7->Application Class
"
^ inspectorModeIndexHolder
@@ -1027,14 +1027,14 @@
2->Application
3->WindowGroup
4->Sensor
- 5->Model
- 6->Widget Class
- 7->Application Class
+ 5->Model
+ 6->Widget Class
+ 7->Application Class
"
^ BlockValue
- with:[:v | v not ]
- argument:self browserVisibleHolder
+ with:[:v | v not ]
+ argument:self browserVisibleHolder
!
isCatchingEventsChannel
@@ -1061,10 +1061,10 @@
<resource: #uiAspect>
path isNil ifTrue:[
- path := PluggableAdaptor
- on: self model
- getter:[ :model | model path ]
- setter:[ :model :newValue | ]
+ path := PluggableAdaptor
+ on: self model
+ getter:[ :model | model path ]
+ setter:[ :model :newValue | ]
].
^ path.
@@ -1099,16 +1099,16 @@
spec builder specSelector implementors|
item := model selectedItem.
- item isNil ifTrue:[^ nil].
+ item isNil ifTrue:[^ nil].
view := item widget.
- view isNil ifTrue:[^ nil].
+ view isNil ifTrue:[^ nil].
app := view application.
- app isNil ifTrue:[^ nil].
-
+ app isNil ifTrue:[^ nil].
+
builder := app builder.
- builder isNil ifTrue:[^ nil].
+ builder isNil ifTrue:[^ nil].
spec := builder spec.
spec isNil ifTrue:[^ nil].
@@ -1117,25 +1117,25 @@
specSelector isNil ifTrue:[^ nil].
((nonMeta := app class theNonMetaclass) canUnderstand:specSelector) ifTrue:[
- ^ nonMeta lookupMethodFor:specSelector.
+ ^ nonMeta lookupMethodFor:specSelector.
].
((meta := app class theMetaclass) canUnderstand:specSelector) ifTrue:[
- ^ meta lookupMethodFor:specSelector.
+ ^ meta lookupMethodFor:specSelector.
].
"/ maybe a simple dialog given a spec
(masterApp := app masterApplication) notNil ifTrue:[
- ((nonMeta := masterApp class theNonMetaclass) canUnderstand:specSelector) ifTrue:[
- ^ nonMeta lookupMethodFor:specSelector.
- ].
- ((meta := masterApp class theMetaclass) canUnderstand:specSelector) ifTrue:[
- ^ meta lookupMethodFor:specSelector.
- ].
+ ((nonMeta := masterApp class theNonMetaclass) canUnderstand:specSelector) ifTrue:[
+ ^ nonMeta lookupMethodFor:specSelector.
+ ].
+ ((meta := masterApp class theMetaclass) canUnderstand:specSelector) ifTrue:[
+ ^ meta lookupMethodFor:specSelector.
+ ].
].
implementors := Smalltalk allImplementorsOf: specSelector.
implementors size == 1 ifTrue:[
- ^ implementors first compiledMethodAt:specSelector.
+ ^ implementors first compiledMethodAt:specSelector.
].
^ nil
@@ -1153,28 +1153,28 @@
|info view item|
item := model selectedItem.
- item notNil ifTrue:[
- |state|
-
- view := item widget.
- view isNil ifTrue:[
- info := '%1 [%2]' bindWith:(item menuItem label asString)
- with:(item menuItem value asString).
- ] ifFalse:[
- view id isNil ifTrue:[
- state := 'no ID'.
- ] ifFalse:[
- view shown ifTrue:[
- state := 'visible'.
- ] ifFalse:[
- state := 'invisible'
- ].
- ].
- info := '%1 [%2] - %3' bindWith:(view class name)
- with:(view name ? '') with:state allBold.
- ]
+ item notNil ifTrue:[
+ |state|
+
+ view := item widget.
+ view isNil ifTrue:[
+ info := '%1 [%2]' bindWith:(item menuItem label asString)
+ with:(item menuItem value asString).
+ ] ifFalse:[
+ view id isNil ifTrue:[
+ state := 'no ID'.
+ ] ifFalse:[
+ view shown ifTrue:[
+ state := 'visible'.
+ ] ifFalse:[
+ state := 'invisible'
+ ].
+ ].
+ info := '%1 [%2] - %3' bindWith:(view class name)
+ with:(view name ? '') with:state allBold.
+ ]
] ifFalse:[
- info := ''
+ info := ''
].
hasSingleSelectionHolder value:(view notNil).
self updateInspector
@@ -1186,16 +1186,16 @@
|oldSelection|
aModel == showNamesHolder ifTrue:[
- oldSelection := model selectedItem.
- model selectedItem:nil.
- self listOfItems showWidgetNames:(aModel value).
- model selectedItem:oldSelection.
- ^ self
+ oldSelection := model selectedItem.
+ model selectedItem:nil.
+ self listOfItems showWidgetNames:(aModel value).
+ model selectedItem:oldSelection.
+ ^ self
].
aModel == model ifTrue:[
- self selectionChanged.
- ^ self
+ self selectionChanged.
+ ^ self
].
super update:something with:someArgument from:aModel.
@@ -1205,13 +1205,13 @@
|cls widget|
widget := self selectedView.
-
+
"/ update the browser
self inspectorMode == #widgetClass ifTrue:[
- cls := widget class.
+ cls := widget class.
] ifFalse:[
- cls := widget application class
- ].
+ cls := widget application class
+ ].
browser switchToClass:cls selector:nil.
!
@@ -1220,25 +1220,25 @@
view := self selectedView.
mode := self inspectorMode.
-
+
((mode == #widgetClass) or:[(mode == #applicationClass)]) ifTrue:[
- "/ update the browser
- view notNil ifTrue:[
- self updateBrowser.
- ].
- ^ self.
+ "/ update the browser
+ view notNil ifTrue:[
+ self updateBrowser.
+ ].
+ ^ self.
].
-
+
(view isNil or:[mode == #widget]) ifTrue:[
- obj := view.
+ obj := view.
] ifFalse:[ (mode == #group) ifTrue:[
- obj := view windowGroup
+ obj := view windowGroup
] ifFalse:[ (mode == #sensor) ifTrue:[
- obj := view sensor
+ obj := view sensor
] ifFalse:[ (mode == #model) ifTrue:[
- obj := view model
+ obj := view model
] ifFalse:[
- obj := view application.
+ obj := view application.
]]]].
inspectorView inspect:obj.
inspectorView headLineLabel:(obj class nameWithoutPrefix)
@@ -1254,19 +1254,19 @@
motionAction isNil ifTrue:[^ self].
(rootView := model rootView) isNil ifTrue:[
- clickedItem := motionAction := nil.
- ^ self
+ clickedItem := motionAction := nil.
+ ^ self
].
click := rootView device
- translatePoint:((ev x)@ (ev y))
- fromView:(ev view)
- toView:rootView.
+ translatePoint:((ev x)@ (ev y))
+ fromView:(ev view)
+ toView:rootView.
click = clickedPoint ifFalse:[
- (clickedItem isNil or:[(click dist:clickedPoint) > 5.0]) ifTrue:[
- motionAction value:click
- ]
+ (clickedItem isNil or:[(click dist:clickedPoint) > 5.0]) ifTrue:[
+ motionAction value:click
+ ]
].
!
@@ -1278,37 +1278,37 @@
clickedItem := model listOfItems detectItemRespondsToView:(ev view).
(sensor ctrlDown or:[sensor shiftDown]) ifTrue:[
- clickedItem notNil ifTrue:[
- self selectOnClickHolder value ifTrue:[
- model toggleSelectItem:clickedItem
- ].
- ].
- clickedItem := motionAction := nil.
- ^ self
+ clickedItem notNil ifTrue:[
+ self selectOnClickHolder value ifTrue:[
+ model toggleSelectItem:clickedItem
+ ].
+ ].
+ clickedItem := motionAction := nil.
+ ^ self
].
clickedPoint := rootView device translatePoint:((ev x)@ (ev y)) fromView:(ev view) toView:rootView.
lastRectangle := nil.
motionAction :=[:p|
- rootView := model rootView device rootView.
- rootView := model rootView.
- clickedItem := nil.
-
- rootView xoring:[
- lastRectangle notNil ifTrue:[ rootView displayRectangle:lastRectangle ]
- ifFalse:[ rootView clippedByChildren:false ].
-
- p isNil ifTrue:[
- rootView clippedByChildren:true.
- motionAction := nil.
- ] ifFalse:[
- lastRectangle := Rectangle origin:(clickedPoint min:p) corner:(clickedPoint max:p).
- rootView displayRectangle:lastRectangle.
- ].
- rootView flush.
- ].
- lastRectangle
+ rootView := model rootView device rootView.
+ rootView := model rootView.
+ clickedItem := nil.
+
+ rootView xoring:[
+ lastRectangle notNil ifTrue:[ rootView displayRectangle:lastRectangle ]
+ ifFalse:[ rootView clippedByChildren:false ].
+
+ p isNil ifTrue:[
+ rootView clippedByChildren:true.
+ motionAction := nil.
+ ] ifFalse:[
+ lastRectangle := Rectangle origin:(clickedPoint min:p) corner:(clickedPoint max:p).
+ rootView displayRectangle:lastRectangle.
+ ].
+ rootView flush.
+ ].
+ lastRectangle
].
!
@@ -1316,8 +1316,8 @@
|rootView rectangle newItems widget origin|
(rootView := model rootView) isNil ifTrue:[
- clickedItem := motionAction := nil.
- ^ self
+ clickedItem := motionAction := nil.
+ ^ self
].
motionAction isNil ifTrue:[ ^ self ].
clickedItem notNil ifTrue:[ ^ model selectItem:clickedItem ].
@@ -1328,14 +1328,14 @@
newItems := OrderedCollection new.
model rootItem recursiveDo:[:anItem|
- widget := anItem widget.
- widget notNil ifTrue:[
- origin := widget originRelativeTo:rootView.
-
- (rectangle containsRect:(Rectangle origin:origin extent:(widget extent))) ifTrue:[
- newItems add:anItem.
- ]
- ].
+ widget := anItem widget.
+ widget notNil ifTrue:[
+ origin := widget originRelativeTo:rootView.
+
+ (rectangle containsRect:(Rectangle origin:origin extent:(widget extent))) ifTrue:[
+ newItems add:anItem.
+ ]
+ ].
].
model value:newItems.
@@ -1351,37 +1351,37 @@
button := anEvent button.
(button == 2 or:[button == #menu]) ifTrue:[
- motionAction isNil ifTrue:[
- anEvent isButtonPressEvent ifTrue:[
- self selectOnClickHolder value ifTrue:[
- menu := self middleButtonMenu value.
- menu notNil ifTrue:[
- menu := MenuPanel
- menu:(Menu new fromLiteralArrayEncoding:menu)
- receiver:self.
- menu startUp.
- ]
- ].
- ].
- clickedItem := nil.
- ].
- ^ self
+ motionAction isNil ifTrue:[
+ anEvent isButtonPressEvent ifTrue:[
+ self selectOnClickHolder value ifTrue:[
+ menu := self middleButtonMenu value.
+ menu notNil ifTrue:[
+ menu := MenuPanel
+ menu:(Menu new fromLiteralArrayEncoding:menu)
+ receiver:self.
+ menu startUp.
+ ]
+ ].
+ ].
+ clickedItem := nil.
+ ].
+ ^ self
].
anEvent isButtonPressEvent ifTrue:[ self processButtonPressEvent:anEvent. ^ self ].
anEvent isButtonMotionEvent ifTrue:[ self processButtonMotionEvent:anEvent. ^ self ].
anEvent isButtonReleaseEvent ifTrue:[
- self selectOnClickHolder value ifTrue:[
- self processButtonReleaseEvent:anEvent
- ].
+ self selectOnClickHolder value ifTrue:[
+ self processButtonReleaseEvent:anEvent
+ ].
].
clickedItem := motionAction := nil.
anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
- self selectOnClickHolder value ifTrue:[
- self doInspect:#view.
- ].
+ self selectOnClickHolder value ifTrue:[
+ self doInspect:#view.
+ ].
].
!
@@ -1399,44 +1399,44 @@
or:[key == #CursorLeft
or:[key == #CursorRight]]]
) ifFalse:[
- ^ self
+ ^ self
].
item := model selectedItem.
item isNil ifTrue:[
- ^ model selectedItem:(model first ? model rootItem)
+ ^ model selectedItem:(model first ? model rootItem)
].
prnt := item parent.
prnt isNil ifTrue:[
- "/ is the root item
- (key == #CursorUp or:[key == #CursorLeft]) ifTrue:[item := model listOfItems last]
- ifFalse:[item := item at:1 ifAbsent:item].
-
- ^ model selectedItem:item
+ "/ is the root item
+ (key == #CursorUp or:[key == #CursorLeft]) ifTrue:[item := model listOfItems last]
+ ifFalse:[item := item at:1 ifAbsent:item].
+
+ ^ model selectedItem:item
].
key == #CursorLeft ifTrue:[ ^ model selectedItem:prnt ].
key == #CursorRight ifTrue:[
- next := item at:1 ifAbsent:nil.
- next notNil ifTrue:[ model selectedItem:next ].
- ^ self
+ next := item at:1 ifAbsent:nil.
+ next notNil ifTrue:[ model selectedItem:next ].
+ ^ self
].
max := prnt size.
key == #CursorUp ifTrue:[
- idx := prnt identityIndexOf:item.
- idx == 1 ifTrue:[idx := max + 1].
- model selectedItem:(prnt at:idx - 1).
- ^ self.
+ idx := prnt identityIndexOf:item.
+ idx == 1 ifTrue:[idx := max + 1].
+ model selectedItem:(prnt at:idx - 1).
+ ^ self.
].
key == #CursorDown ifTrue:[
- idx := prnt identityIndexOf:item.
- idx == max ifTrue:[idx := 0].
- model selectedItem:(prnt at:idx + 1).
- ^ self.
+ idx := prnt identityIndexOf:item.
+ idx == max ifTrue:[idx := 0].
+ model selectedItem:(prnt at:idx + 1).
+ ^ self.
].
!
@@ -1447,15 +1447,15 @@
parent isNil ifTrue:[ ^ self ].
NotFoundSignal handle:[:ex|
- "contained subvies used by spec are not yet created;
- thus we have to wait until last used subview is build
- "
- anchor := nil.
+ "contained subvies used by spec are not yet created;
+ thus we have to wait until last used subview is build
+ "
+ anchor := nil.
] do:[
- anchor := parent class buildViewsFrom:(parent widget).
+ anchor := parent class buildViewsFrom:(parent widget).
].
anchor notNil ifTrue:[
- parent updateFromChildren:anchor children.
+ parent updateFromChildren:anchor children.
].
! !
@@ -1536,7 +1536,7 @@
view := self selectedView.
view notNil ifTrue:[
- controller := view controller.
+ controller := view controller.
^ (controller notNil and:[controller ~~ view])
].
^ false
@@ -1556,16 +1556,16 @@
middleButtonMenu
"returns the middleButton menu for the single selected item or nil"
- ^ [
- model selectedItem notNil ifTrue:[
- model selectedItem isView ifTrue:[
- self class middleButtonMenu
- ] ifFalse:[
- self class middleButtonMenuForMenuItems
- ].
- ] ifFalse:[
- nil
- ]
+ ^ [
+ model selectedItem notNil ifTrue:[
+ model selectedItem isView ifTrue:[
+ self class middleButtonMenu
+ ] ifFalse:[
+ self class middleButtonMenuForMenuItems
+ ].
+ ] ifFalse:[
+ nil
+ ]
]
"Modified: / 16-08-2017 / 13:48:31 / cg"
@@ -1575,18 +1575,18 @@
|applications menu item list addBlock|
item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
- ifFalse:[model rootItem].
+ ifFalse:[model rootItem].
item isNil ifTrue:[^ nil].
applications := IdentityDictionary new.
addBlock := [:el| |cls ctr|
- cls := self resolveApplicationClassFor:el.
-
- cls notNil ifTrue:[
- ctr := applications at:cls ifAbsent:0.
- applications at:cls put:(ctr + 1).
- ].
+ cls := self resolveApplicationClassFor:el.
+
+ cls notNil ifTrue:[
+ ctr := applications at:cls ifAbsent:0.
+ applications at:cls put:(ctr + 1).
+ ].
].
item recursiveDo:addBlock.
addBlock value:item.
@@ -1596,14 +1596,14 @@
applications keysAndValuesDo:[:cls :ctr|
list add:(MenuDesc title:(cls name)
- value:(ctr printString)
- action:[self doSelectNextOfApplicationClass:cls startingIn:item]
- ).
+ value:(ctr printString)
+ action:[self doSelectNextOfApplicationClass:cls startingIn:item]
+ ).
].
menu := MenuDesc buildFromList:list onGC:aMenu.
menu do:[:el|
- el hideMenuOnActivated:false
+ el hideMenuOnActivated:false
].
^ menu
!
@@ -1612,37 +1612,37 @@
|widgets list total menu item|
item := aMenu selection nameKey == #single ifTrue:[model selectedItem]
- ifFalse:[model rootItem].
+ ifFalse:[model rootItem].
item isNil ifTrue:[^ nil].
widgets := IdentityDictionary new.
total := 0.
item recursiveDo:[:el| |cls ctr|
- cls := el widget.
-
- cls notNil ifTrue:[
- cls := cls class.
- ctr := widgets at:cls ifAbsent:0.
- widgets at:cls put:(ctr + 1).
- total := total + 1.
- ].
+ cls := el widget.
+
+ cls notNil ifTrue:[
+ cls := cls class.
+ ctr := widgets at:cls ifAbsent:0.
+ widgets at:cls put:(ctr + 1).
+ total := total + 1.
+ ].
].
total == 0 ifTrue:[^ nil].
list := SortedCollection sortBlock:[:a :b| a title < b title ].
widgets keysAndValuesDo:[:cls :ctr|
- list add:(MenuDesc title:(cls name)
- value:(ctr printString)
- action:[self doSelectNextOfClass:cls startingIn:item]
- ).
+ list add:(MenuDesc title:(cls name)
+ value:(ctr printString)
+ action:[self doSelectNextOfClass:cls startingIn:item]
+ ).
].
list := list asOrderedCollection.
list add:(MenuDesc separator).
list add:(MenuDesc title:'Total' value:(total printString)).
menu := MenuDesc buildFromList:list onGC:aMenu.
menu do:[:el|
- el hideMenuOnActivated:false
+ el hideMenuOnActivated:false
].
^ menu
!
@@ -1665,7 +1665,7 @@
y := view top.
(x == point x and:[y == point y]) ifTrue:[ inst := point ]
- ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
+ ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
list add:(MenuDesc title:'origin' value:inst).
@@ -1677,7 +1677,7 @@
y := view bottom.
(x == point x and:[y == point y]) ifTrue:[ inst := point ]
- ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
+ ifFalse:[ inst := '%1 --> (%2@%3)' bindWith:point with:x with:y ].
list add:(MenuDesc title:'corner' value:inst).
@@ -1691,9 +1691,9 @@
"/ view insets
inst := 'l:%1 r:%2 t:%3 b:%4' bindWith:(view leftInset)
- with:(view rightInset)
- with:(view topInset)
- with:(view bottomInset).
+ with:(view rightInset)
+ with:(view topInset)
+ with:(view bottomInset).
list add:(MenuDesc title:'insets' value:inst).
list add:(MenuDesc title:'borderWidth' value:(view borderWidth)).
@@ -1707,16 +1707,16 @@
list add:(MenuDesc title:'transformation' value:inst).
(view isKindOf:Label) ifTrue:[
- list add:(MenuDesc separator).
- (inst := view adjust) notNil ifTrue:[ inst := inst displayString ].
- list add:(MenuDesc title:'adjust' value:inst).
+ list add:(MenuDesc separator).
+ (inst := view adjust) notNil ifTrue:[ inst := inst displayString ].
+ list add:(MenuDesc title:'adjust' value:inst).
].
(view isKindOf:PanelView) ifTrue:[
- list add:(MenuDesc separator).
- (inst := view horizontalLayout ) notNil ifTrue:[ inst := inst displayString ].
- list add:(MenuDesc title:'horizontalLayout' value:inst).
- (inst := view verticalLayout ) notNil ifTrue:[ inst := inst displayString ].
- list add:(MenuDesc title:'verticalLayout' value:inst).
+ list add:(MenuDesc separator).
+ (inst := view horizontalLayout ) notNil ifTrue:[ inst := inst displayString ].
+ list add:(MenuDesc title:'horizontalLayout' value:inst).
+ (inst := view verticalLayout ) notNil ifTrue:[ inst := inst displayString ].
+ list add:(MenuDesc title:'verticalLayout' value:inst).
].
^ MenuDesc buildFromList:list onGC:aMenu
@@ -1739,16 +1739,16 @@
names sortWith:indices.
1 to:n do:[:i| |action|
- label := (names at:i) printString.
- value := view instVarAt:(indices at:i).
- value isNil ifTrue:[
- value := '------'.
- action := nil.
- ] ifFalse:[
- value := value displayString contractAtEndTo:40.
- action := [(view instVarAt:i) inspect].
- ].
- list add:(MenuDesc title:label value:value action:action).
+ label := (names at:i) printString.
+ value := view instVarAt:(indices at:i).
+ value isNil ifTrue:[
+ value := '------'.
+ action := nil.
+ ] ifFalse:[
+ value := value displayString contractAtEndTo:40.
+ action := [(view instVarAt:i) inspect].
+ ].
+ list add:(MenuDesc title:label value:value action:action).
].
^ MenuDesc buildFromList:list onGC:aMenu
@@ -1770,108 +1770,108 @@
value := nil.
inst isNil ifTrue:[
- label := nil
+ label := nil
] ifFalse:[
- inst == view ifTrue:[
- label := '== view itself'
- ] ifFalse:[
- label := inst displayString.
- value := [view controller inspect].
- ].
+ inst == view ifTrue:[
+ label := '== view itself'
+ ] ifFalse:[
+ label := inst displayString.
+ value := [view controller inspect].
+ ].
].
list add:(MenuDesc title:'controller' value:label action:value).
inst := view delegate.
inst notNil ifTrue:[
- list add:(MenuDesc title:'delegate' value:(inst displayString) action:[ view delegate inspect ]).
+ list add:(MenuDesc title:'delegate' value:(inst displayString) action:[ view delegate inspect ]).
].
inst := view application.
- inst notNil ifTrue:[
- |topAppl|
-
- list add:(MenuDesc title:'application' value:inst action:[ view application inspect ]).
-
- topAppl := inst topApplication.
-
- (topAppl notNil and:[topAppl ~~ inst]) ifTrue:[
- list add:(MenuDesc title:'topApplication' value:topAppl action:[ inst topApplication inspect ]).
- ].
+ inst notNil ifTrue:[
+ |topAppl|
+
+ list add:(MenuDesc title:'application' value:inst action:[ view application inspect ]).
+
+ topAppl := inst topApplication.
+
+ (topAppl notNil and:[topAppl ~~ inst]) ifTrue:[
+ list add:(MenuDesc title:'topApplication' value:topAppl action:[ inst topApplication inspect ]).
+ ].
].
list add:(MenuDesc separator).
(view respondsTo:#'model') ifTrue:[
- inst := view model.
-
- inst isNil
- ifTrue:[ label := value := nil ]
- ifFalse:[ label := inst displayString.
- label := label,(self aspectLabelFor:inst inApplicationOf:view).
- value := [ view model inspect ].
- ].
-
- list add:(MenuDesc title:'model' value:label action:value).
-
- (inst notNil and:[view respondsTo:#modelInterface]) ifTrue:[
- view modelInterface keysAndValuesDo:[:key : val|
- val isNil ifTrue:[ label := nil ]
- ifFalse:[ label := val displayString ].
-
- list add:(MenuDesc title:(' - ', key) value:label ).
- ]
- ].
+ inst := view model.
+
+ inst isNil
+ ifTrue:[ label := value := nil ]
+ ifFalse:[ label := inst displayString.
+ label := label,(self aspectLabelFor:inst inApplicationOf:view).
+ value := [ view model inspect ].
+ ].
+
+ list add:(MenuDesc title:'model' value:label action:value).
+
+ (inst notNil and:[view respondsTo:#modelInterface]) ifTrue:[
+ view modelInterface keysAndValuesDo:[:key : val|
+ val isNil ifTrue:[ label := nil ]
+ ifFalse:[ label := val displayString ].
+
+ list add:(MenuDesc title:(' - ', key) value:label ).
+ ]
+ ].
].
(view respondsTo:#enableChannel) ifTrue:[
- inst := view enableChannel.
-
- inst isNil ifTrue:[ label := value := nil ]
- ifFalse:[ label := inst displayString.
- label := label,(self aspectLabelFor:inst inApplicationOf:view).
- value := [ view enableChannel inspect ].
- ].
-
- list add:(MenuDesc title:'enableChannel' value:label action:value).
+ inst := view enableChannel.
+
+ inst isNil ifTrue:[ label := value := nil ]
+ ifFalse:[ label := inst displayString.
+ label := label,(self aspectLabelFor:inst inApplicationOf:view).
+ value := [ view enableChannel inspect ].
+ ].
+
+ list add:(MenuDesc title:'enableChannel' value:label action:value).
].
#( #action #pressAction #releaseAction ) do:[:actionSelector |
- (view respondsTo:actionSelector) ifTrue:[
- inst := view perform:actionSelector.
-
- inst isNil
- ifTrue:[ label := value := nil ]
- ifFalse:[ label := inst displayString.
- value := [ (view perform:actionSelector) inspect ].
- ].
-
- list add:(MenuDesc title:actionSelector"'action'" value:label action:value).
- ].
+ (view respondsTo:actionSelector) ifTrue:[
+ inst := view perform:actionSelector.
+
+ inst isNil
+ ifTrue:[ label := value := nil ]
+ ifFalse:[ label := inst displayString.
+ value := [ (view perform:actionSelector) inspect ].
+ ].
+
+ list add:(MenuDesc title:actionSelector"'action'" value:label action:value).
+ ].
].
list last isSeparator ifFalse:[ list add:(MenuDesc separator) ].
(view respondsTo:#listHolder) ifTrue:[
- inst := view listHolder.
-
- inst isNil ifTrue:[ label := value := nil ]
- ifFalse:[ label := inst class printString.
- label := label,(self aspectLabelFor:inst inApplicationOf:view).
- value := [ view listHolder inspect ].
- ].
- list add:(MenuDesc title:'listHolder' value:label action:value).
+ inst := view listHolder.
+
+ inst isNil ifTrue:[ label := value := nil ]
+ ifFalse:[ label := inst class printString.
+ label := label,(self aspectLabelFor:inst inApplicationOf:view).
+ value := [ view listHolder inspect ].
+ ].
+ list add:(MenuDesc title:'listHolder' value:label action:value).
].
(view respondsTo:#list) ifTrue:[
- inst := view list.
-
- inst isNil ifTrue:[ label := value := nil ]
- ifFalse:[ label := '%1 [%2]' bindWith:(inst class printString) with:(inst size).
- label := label,(self aspectLabelFor:inst inApplicationOf:view).
- value := [ view list inspect ].
- ].
-
- list add:(MenuDesc title:'list' value:label action:value).
+ inst := view list.
+
+ inst isNil ifTrue:[ label := value := nil ]
+ ifFalse:[ label := '%1 [%2]' bindWith:(inst class printString) with:(inst size).
+ label := label,(self aspectLabelFor:inst inApplicationOf:view).
+ value := [ view list inspect ].
+ ].
+
+ list add:(MenuDesc title:'list' value:label action:value).
].
list last isSeparator ifTrue:[ list removeLast ].
@@ -1890,13 +1890,13 @@
list := OrderedCollection new.
- list add:(MenuDesc
- title:'itemValue'
- value:(item itemValue)
- action:[
- UserPreferences systemBrowserClass
- browseImplementorsOf:item itemValue
- ]).
+ list add:(MenuDesc
+ title:'itemValue'
+ value:(item itemValue)
+ action:[
+ UserPreferences systemBrowserClass
+ browseImplementorsOf:item itemValue
+ ]).
^ MenuDesc buildFromList:list onGC:aMenu
@@ -1927,11 +1927,11 @@
list add:(MenuDesc title:'hiddenOnRealize' value:(view isHiddenOnRealize)).
(value := view visibilityChannel) isNil ifTrue:[
- list add:(MenuDesc title:'visibilityChannel' value:'------').
+ list add:(MenuDesc title:'visibilityChannel' value:'------').
] ifFalse:[
- list add:(MenuDesc title:'visibilityChannel'
- value:(value displayString)
- action:[view visibilityChannel inspect]).
+ list add:(MenuDesc title:'visibilityChannel'
+ value:(value displayString)
+ action:[view visibilityChannel inspect]).
].
^ MenuDesc buildFromList:list onGC:aMenu
@@ -1946,10 +1946,10 @@
aView isNil ifTrue:[^ ''].
(app := aView application) isNil ifTrue:[^ ''].
app builder bindings keysAndValuesDo:[:aspect :value |
- value == aModel ifTrue:[^ ' [aspect: ',aspect,']'].
+ value == aModel ifTrue:[^ ' [aspect: ',aspect,']'].
].
- app class allInstVarNames do:[:nm |
- (app instVarNamed:nm) == aModel ifTrue:[^ ' [instvar: ',nm,']']
+ app class allInstVarNames do:[:nm |
+ (app instVarNamed:nm) == aModel ifTrue:[^ ' [instvar: ',nm,']']
].
^ ''
@@ -1963,7 +1963,7 @@
rootView := model rootView.
(rootView notNil and:[rootView shown]) ifTrue:[
- focusView := rootView windowGroup focusView.
+ focusView := rootView windowGroup focusView.
].
focusView isNil ifTrue:[^ self ].
@@ -1976,55 +1976,55 @@
currentItem := model selectedItem.
(currentItem notNil and:[currentItem widget == aView]) ifTrue:[
- ^ self
+ ^ self
].
viewItem := model listOfItems recursiveDetect:[:el| el widget == aView ].
viewItem notNil ifTrue:[
- model selectItem:viewItem.
- ].
+ model selectItem:viewItem.
+ ].
!
setRootItem:aRootItemOrNil
|theProcess|
aRootItemOrNil isNil ifTrue:[
- process := nil.
+ process := nil.
] ifFalse:[
- "/ expand tree to level 3
- aRootItemOrNil do:[:aRootChild|
- aRootChild do:[:aSubChild| aSubChild expand ].
- aRootChild expand.
- ].
- aRootItemOrNil expand.
-
- process isNil ifTrue:[
- theProcess := process :=
- Process
- for:[
- |update testModeChannel|
-
- update := false.
- testModeChannel := model testModeChannel.
-
- [process == theProcess] whileTrue:[
- Delay waitForSeconds:0.5.
-
- (treeView notNil and:[process == theProcess and:[treeView shown]]) ifTrue:[
- (testModeChannel value == true and:[followFocusChannel value == true]) ifTrue:[
- self selectFocusView.
- ].
- update ifTrue:[
- self updateShownStatus.
- ].
- update := update not.
- ].
- ].
- ]
- priority:(Processor userSchedulingPriority).
- theProcess name:'ViewTreeInspector - Focus Follower'.
- theProcess resume.
- ].
+ "/ expand tree to level 3
+ aRootItemOrNil do:[:aRootChild|
+ aRootChild do:[:aSubChild| aSubChild expand ].
+ aRootChild expand.
+ ].
+ aRootItemOrNil expand.
+
+ process isNil ifTrue:[
+ theProcess := process :=
+ Process
+ for:[
+ |update testModeChannel|
+
+ update := false.
+ testModeChannel := model testModeChannel.
+
+ [process == theProcess] whileTrue:[
+ Delay waitForSeconds:0.5.
+
+ (treeView notNil and:[process == theProcess and:[treeView shown]]) ifTrue:[
+ (testModeChannel value == true and:[followFocusChannel value == true]) ifTrue:[
+ self selectFocusView.
+ ].
+ update ifTrue:[
+ self updateShownStatus.
+ ].
+ update := update not.
+ ].
+ ].
+ ]
+ priority:(Processor userSchedulingPriority).
+ theProcess name:'ViewTreeInspector - Focus Follower'.
+ theProcess resume.
+ ].
].
model rootItem:aRootItemOrNil.
@@ -2041,19 +2041,19 @@
min := 9999999.
rootItem recursiveEachVisibleItemDo:[:anItem|
- anItem widget notNil ifTrue:[
- visState := (anItem widget shown).
-
- visState ~~ anItem isDrawnShown ifTrue:[
- anItem isDrawnShown:visState.
- listIdx := treeView identityIndexOf:anItem.
-
- listIdx > 0 ifTrue:[
- max := max max:listIdx.
- min := min min:listIdx.
- ].
- ].
- ].
+ anItem widget notNil ifTrue:[
+ visState := (anItem widget shown).
+
+ visState ~~ anItem isDrawnShown ifTrue:[
+ anItem isDrawnShown:visState.
+ listIdx := treeView identityIndexOf:anItem.
+
+ listIdx > 0 ifTrue:[
+ max := max max:listIdx.
+ min := min min:listIdx.
+ ].
+ ].
+ ].
].
max < min ifTrue:[^ self].
max := max + 1.
@@ -2061,12 +2061,12 @@
visY0 := (treeView yVisibleOfLine:min) max:0.
visY1 := (treeView yVisibleOfLine:max) min:(treeView height).
height := visY1 - visY0.
-
+
height > 2 ifTrue:[
- treeView shown ifTrue:[
- damage := Rectangle left:0 top:visY0 width:(treeView width) height:height.
- treeView invalidateDeviceRectangle:damage repairNow:false.
- ].
+ treeView shown ifTrue:[
+ damage := Rectangle left:0 top:visY0 width:(treeView width) height:height.
+ treeView invalidateDeviceRectangle:damage repairNow:false.
+ ].
].
"Modified: / 16-08-2017 / 12:29:15 / cg"
@@ -2118,10 +2118,10 @@
doBrowse:what
"open browser on:
- #view browse class
- #model browse model class
- #application browse application class
- #controller browse controller class
+ #view browse class
+ #model browse model class
+ #application browse application class
+ #controller browse controller class
"
|inst|
@@ -2141,7 +2141,7 @@
doCatchEvents
model catchEvents:true.
isCatchingEventsChannel value:true.
-"/ ((builder componentAt:'toolbarMenu') itemAt:#doUncatchEvents)
+"/ ((builder componentAt:'toolbarMenu') itemAt:#doUncatchEvents)
"/ enabled:true;
"/ label:(self class releaseViewIcon);
"/ activeHelpKey:#doUncatchEvents.
@@ -2169,28 +2169,28 @@
parent := item parent.
parent isNil ifTrue:[
- "/ the root
- model withSelectionHiddenDo:[item deleteAll].
+ "/ the root
+ model withSelectionHiddenDo:[item deleteAll].
^ self
].
model withSelectionHiddenDo:[
- |idx nsel|
-
- idx := parent identityIndexOf:item.
-
- idx == parent size ifTrue:[
- nsel := parent at:(idx - 1) ifAbsent:parent
- ] ifFalse:[
- nsel := parent at:(idx + 1)
- ].
- model setValue:nil.
- item delete.
-
- parent isLayoutContainer ifTrue:[
- parent widget sizeChanged:nil
- ].
- model value:nsel.
+ |idx nsel|
+
+ idx := parent identityIndexOf:item.
+
+ idx == parent size ifTrue:[
+ nsel := parent at:(idx - 1) ifAbsent:parent
+ ] ifFalse:[
+ nsel := parent at:(idx + 1)
+ ].
+ model setValue:nil.
+ item delete.
+
+ parent isLayoutContainer ifTrue:[
+ parent widget sizeChanged:nil
+ ].
+ model value:nsel.
].
!
@@ -2210,20 +2210,20 @@
view isNil ifTrue:[ ^ self].
view shown ifTrue:[
- model withSelectionHiddenDo:[
- view perform:#flash ifNotUnderstood:nil.
- ].
+ model withSelectionHiddenDo:[
+ view perform:#flash ifNotUnderstood:nil.
+ ].
].
!
doInspect:what
"open inspector on:
- #view inspect class
- #group inspect windowGroup
- #model inspect model
- #application inspect application
- #controller inspect controller
- #process inspect application's process
+ #view inspect class
+ #group inspect windowGroup
+ #model inspect model
+ #application inspect application
+ #controller inspect controller
+ #process inspect application's process
"
|inst|
@@ -2258,7 +2258,7 @@
( topWindow == Screen current rootView
or:[topWindow == self window topView]
) ifTrue:[
- ^ self
+ ^ self
].
self showWindow:clickedView.
@@ -2268,9 +2268,9 @@
"redraw the app"
|rootView|
-
+
(rootView := model rootView) notNil ifTrue:[
- rootView withAllSubViewsDo:[:v | v "redraw; "invalidate].
+ rootView withAllSubViewsDo:[:v | v "redraw; "invalidate].
]
"Modified: / 16-08-2017 / 12:02:11 / cg"
@@ -2280,25 +2280,25 @@
|startItem firstFound searchNext|
startItem := model last.
- searchNext := startItem notNil.
+ searchNext := startItem notNil.
firstFound := nil.
anItem recursiveDo:[:el|
- el == startItem ifTrue:[
- searchNext := false
- ] ifFalse:[
- (aBlock value:el) ifTrue:[
- searchNext ifFalse:[^ model selectItem:el].
-
- firstFound isNil ifTrue:[
- firstFound := el
- ]
- ]
- ]
+ el == startItem ifTrue:[
+ searchNext := false
+ ] ifFalse:[
+ (aBlock value:el) ifTrue:[
+ searchNext ifFalse:[^ model selectItem:el].
+
+ firstFound isNil ifTrue:[
+ firstFound := el
+ ]
+ ]
+ ]
].
firstFound notNil ifTrue:[
- self window beep.
- model selectItem:firstFound
+ self window beep.
+ model selectItem:firstFound
].
!
@@ -2315,7 +2315,7 @@
model catchEvents:false.
isCatchingEventsChannel value:false.
-"/ ((builder componentAt:'toolbarMenu') itemAt:#doUncatchEvents)
+"/ ((builder componentAt:'toolbarMenu') itemAt:#doUncatchEvents)
"/ label:(self class releaseViewIcon);
"/ enabled:false;
"/ activeHelpKey:#doCatchEvents.
@@ -2330,19 +2330,19 @@
objectToInspectOrBrowse:what
"return one of:
- #view for inspect/browse view/widget
- #group for inspect/browse windowGroup
- #model for inspect/browse model
- #application for inspect/browse application
- #controller for inspect/browse controller
- #process for inspect/browse application's process
- #widgetClass for inspect/browse widget's class
- #menuItem for inspect/browse menuItem
+ #view for inspect/browse view/widget
+ #group for inspect/browse windowGroup
+ #model for inspect/browse model
+ #application for inspect/browse application
+ #controller for inspect/browse controller
+ #process for inspect/browse application's process
+ #widgetClass for inspect/browse widget's class
+ #menuItem for inspect/browse menuItem
"
|view|
- what == #menuItem ifTrue:[
- ^ model selectedItem menuItem
+ what == #menuItem ifTrue:[
+ ^ model selectedItem menuItem
].
view := self selectedView.
@@ -2397,7 +2397,7 @@
menu := Menu new.
aList do:[:el|
- menu addItem:(el asMenuItemWithTabulatorSpecification:tabSpec).
+ menu addItem:(el asMenuItemWithTabulatorSpecification:tabSpec).
].
menuPanel := MenuPanel menu:menu.
^ menuPanel
@@ -2433,12 +2433,12 @@
array := Array with:(title, ':') with:'------'.
value notNil ifTrue:[
- array at:2 put:(value printString, ' ')
+ array at:2 put:(value printString, ' ')
].
- ^ MenuItem
- label:(MultiColListEntry fromStrings:array tabulatorSpecification:aTabSpec)
- value:action
+ ^ MenuItem
+ label:(MultiColListEntry fromStrings:array tabulatorSpecification:aTabSpec)
+ value:action
! !
!ViewTreeInspectorApplication::MenuDesc methodsFor:'instance creation'!
@@ -2450,12 +2450,12 @@
action := anAction.
aValue notNil ifTrue:[
- value := aValue printString.
-
- value size > 70 ifTrue:[
- value := value copyFrom:1 to:70.
- value := value, '...'
- ]
+ value := aValue printString.
+
+ value size > 70 ifTrue:[
+ value := value copyFrom:1 to:70.
+ value := value, '...'
+ ]
].
! !
@@ -2483,9 +2483,9 @@
item := self forMenuItem:aMenuItem.
subItems := OrderedCollection new.
(subMenu := aMenuItem submenuOrNil) notNil ifTrue:[
- subMenu items do:[:eachMenuItem |
- subItems add:(self buildMenuItemsFrom:eachMenuItem)
- ].
+ subMenu items do:[:eachMenuItem |
+ subItems add:(self buildMenuItemsFrom:eachMenuItem)
+ ].
].
item children:subItems.
^ item
@@ -2506,18 +2506,18 @@
subItems := OrderedCollection new.
subViews notEmptyOrNil ifTrue:[
- subViews do:[:aSubView|
- subItems add:(self buildViewsFrom:aSubView).
- ].
+ subViews do:[:aSubView|
+ subItems add:(self buildViewsFrom:aSubView).
+ ].
].
(aView isKindOf:MenuPanel) ifTrue:[
- (aView items ? #()) do:[:eachMenuItem |
- subItems add:(self buildMenuItemsFrom:eachMenuItem)
- ].
- ].
+ (aView items ? #()) do:[:eachMenuItem |
+ subItems add:(self buildMenuItemsFrom:eachMenuItem)
+ ].
+ ].
item children:subItems.
-
+
^ item
"Modified: / 16-08-2017 / 12:43:35 / cg"
@@ -2531,19 +2531,19 @@
The class is used to build up the hierarchical tree.
[Instance variables:]
- widget <View> the widget represented by the item
- spec <UISpecification> the UISpecification or nil
+ widget <View> the widget represented by the item
+ spec <UISpecification> the UISpecification or nil
[Class variables:]
- HandleExtent <Point> keeps the extent of a handle
+ HandleExtent <Point> keeps the extent of a handle
[author:]
- Claus Atzkern
+ Claus Atzkern
[see also:]
- HierarchicalItem
- ViewTreeModel
+ HierarchicalItem
+ ViewTreeModel
"
!
@@ -2600,8 +2600,8 @@
|appl|
widget notNil ifTrue:[
- appl := widget application.
- appl notNil ifTrue:[^ appl class ].
+ appl := widget application.
+ appl notNil ifTrue:[^ appl class ].
].
^ nil
!
@@ -2638,7 +2638,7 @@
"returns the spec-class assigned to the item
"
widget isNil ifTrue:[
- ^ MenuPanelSpec
+ ^ MenuPanelSpec
].
^ widget specClass
@@ -2684,26 +2684,26 @@
|layout specClass superView|
(superView := widget superView) isNil ifTrue:[
- ^ #Extent
+ ^ #Extent
].
-
+
specClass := superView specClass.
(specClass notNil and:[specClass isLayoutContainer]) ifTrue:[
- ^ specClass canResizeSubComponents ifTrue:[#Extent] ifFalse:[nil]
+ ^ specClass canResizeSubComponents ifTrue:[#Extent] ifFalse:[nil]
].
(layout := widget geometryLayout) isNil ifTrue:[
- ^ #Extent
+ ^ #Extent
].
layout isLayout ifTrue:[
- layout isLayoutFrame ifTrue:[ ^ #LayoutFrame ].
- layout isAlignmentOrigin ifTrue:[ ^ #AlignmentOrigin ].
- layout isLayoutOrigin ifTrue:[ ^ #LayoutOrigin ].
+ layout isLayoutFrame ifTrue:[ ^ #LayoutFrame ].
+ layout isAlignmentOrigin ifTrue:[ ^ #AlignmentOrigin ].
+ layout isLayoutOrigin ifTrue:[ ^ #LayoutOrigin ].
] ifFalse:[
- layout isRectangle ifTrue:[ ^ #Rectangle ].
- layout isPoint ifTrue:[ ^ #Point ].
+ layout isRectangle ifTrue:[ ^ #Rectangle ].
+ layout isPoint ifTrue:[ ^ #Point ].
].
Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
@@ -2730,32 +2730,32 @@
|subViews list item subMenu|
children isNil ifTrue:[
- isExpanded := false.
-
- list := OrderedCollection new.
-
- "/ it's either a widget or a menuItem
- widget notNil ifTrue:[
- subViews := widget subViews.
- subViews notEmptyOrNil ifTrue:[
- subViews do:[:aSubView|
- item := self class buildViewsFrom:aSubView.
- item parent:self.
- list add:item.
- ].
- ].
- ].
-
- menuItem notNil ifTrue:[
- (subMenu := menuItem submenuOrNil) notNil ifTrue:[
- subMenu items do:[:aSubItem|
- item := self class buildMenuItemsFrom:aSubItem.
- item parent:self.
- list add:item.
- ].
- ].
- ].
- children := list.
+ isExpanded := false.
+
+ list := OrderedCollection new.
+
+ "/ it's either a widget or a menuItem
+ widget notNil ifTrue:[
+ subViews := widget subViews.
+ subViews notEmptyOrNil ifTrue:[
+ subViews do:[:aSubView|
+ item := self class buildViewsFrom:aSubView.
+ item parent:self.
+ list add:item.
+ ].
+ ].
+ ].
+
+ menuItem notNil ifTrue:[
+ (subMenu := menuItem submenuOrNil) notNil ifTrue:[
+ subMenu items do:[:aSubItem|
+ item := self class buildMenuItemsFrom:aSubItem.
+ item parent:self.
+ list add:item.
+ ].
+ ].
+ ].
+ children := list.
].
^ children notEmpty
@@ -2774,7 +2774,7 @@
"answer an additional label for an Item"
parent notNil ifTrue:[
- ^ parent additionalLabelForItem:anItem
+ ^ parent additionalLabelForItem:anItem
].
^ nil
!
@@ -2785,19 +2785,19 @@
super displayIcon:anIcon atX:x y:y on:aGC.
self exists ifFalse:[
- aGC paint:(Color red).
-
- y0 := y + 1.
- y1 := y + anIcon height - 2.
-
- x0 := x - 1.
- w := anIcon width.
-
- 2 timesRepeat:[
- aGC displayLineFromX:x0 y:y0 toX:(x0 + w) y:y1.
- aGC displayLineFromX:x0 y:y1 toX:(x0 + w) y:y0.
- x0 := x0 + 1.
- ].
+ aGC paint:(Color red).
+
+ y0 := y + 1.
+ y1 := y + anIcon height - 2.
+
+ x0 := x - 1.
+ w := anIcon width.
+
+ 2 timesRepeat:[
+ aGC displayLineFromX:x0 y:y0 toX:(x0 + w) y:y1.
+ aGC displayLineFromX:x0 y:y1 toX:(x0 + w) y:y0.
+ x0 := x0 + 1.
+ ].
].
!
@@ -2808,39 +2808,39 @@
label isEmptyOrNil ifTrue:[^ self].
widget isNil ifTrue:[
- isValidAndShown := true.
+ isValidAndShown := true.
] ifFalse:[
- widget id isNil ifTrue:[
- isDrawnShown := false.
-
- self exists ifFalse:[
- xOffsetAdditionalName := nil.
- ].
- isValidAndShown := false.
- ] ifFalse:[
- isValidAndShown := widget shown.
- ].
+ widget id isNil ifTrue:[
+ isDrawnShown := false.
+
+ self exists ifFalse:[
+ xOffsetAdditionalName := nil.
+ ].
+ isValidAndShown := false.
+ ] ifFalse:[
+ isValidAndShown := widget shown.
+ ].
].
-
+
isValidAndShown ifFalse:[
- label := Text string:label emphasis:#italic.
- label colorizeAllWith:Color gray.
+ label := Text string:label emphasis:#italic.
+ label colorizeAllWith:Color gray.
].
labelHeight := self heightOn:aGC.
self displayLabel:label h:labelHeight on:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected.
xOffsetAdditionalName notNil ifTrue:[
- additionalName := self additionalLabelForItem:self.
-
- additionalName notNil ifTrue:[
- self displayLabel:additionalName
- h:labelHeight on:aGC
- x:(x + xOffsetAdditionalName) y:y
- h:h.
- ] ifFalse:[
- xOffsetAdditionalName := nil.
- ].
+ additionalName := self additionalLabelForItem:self.
+
+ additionalName notNil ifTrue:[
+ self displayLabel:additionalName
+ h:labelHeight on:aGC
+ x:(x + xOffsetAdditionalName) y:y
+ h:h.
+ ] ifFalse:[
+ xOffsetAdditionalName := nil.
+ ].
].
"Modified (format): / 16-08-2017 / 12:57:39 / cg"
@@ -2850,7 +2850,7 @@
width := xOffsetAdditionalName := nil.
children notNil ifTrue:[
- children do:[:each| each recursiveAdditionalNameBehaviourChanged ]
+ children do:[:each| each recursiveAdditionalNameBehaviourChanged ]
].
!
@@ -2860,18 +2860,18 @@
|additionalName|
width isNil ifTrue:[
- width := self widthOf:(self label) on:aGC.
- width := width + 2.
-
- additionalName := self additionalLabelForItem:self.
-
- additionalName notNil ifTrue:[
- xOffsetAdditionalName := width + 10.
- width := xOffsetAdditionalName + (self widthOf:additionalName on:aGC).
- width := width + 2.
- ] ifFalse:[
- xOffsetAdditionalName := nil.
- ].
+ width := self widthOf:(self label) on:aGC.
+ width := width + 2.
+
+ additionalName := self additionalLabelForItem:self.
+
+ additionalName notNil ifTrue:[
+ xOffsetAdditionalName := width + 10.
+ width := xOffsetAdditionalName + (self widthOf:additionalName on:aGC).
+ width := width + 2.
+ ] ifFalse:[
+ xOffsetAdditionalName := nil.
+ ].
].
^ width
! !
@@ -2884,17 +2884,17 @@
set to nil if not resizeable.
TYPES: type position( X - Y )
- -------------------------
- #LT Left - Top
- #LC Left - Center
- #LB Left - Bottom
- #CT Center - Top
- #CB Center - Bottom
- #RT Right - Top
- #RC Right - Center
- #RB Right - Bottom
-
- nil ** handle not pickable **
+ -------------------------
+ #LT Left - Top
+ #LC Left - Center
+ #LB Left - Bottom
+ #CT Center - Top
+ #CB Center - Bottom
+ #RT Right - Top
+ #RC Right - Center
+ #RB Right - Bottom
+
+ nil ** handle not pickable **
"
|type relOrg relCrn maxExt rootView w h
xL "{ Class:SmallInteger }"
@@ -2929,14 +2929,14 @@
h := HandleExtent y.
(type == #LayoutFrame or:[type == #Rectangle]) ifTrue:[
- aTwoArgAction value:(Rectangle left:xL top:yT width:w height:h) value:#LT.
- aTwoArgAction value:(Rectangle left:xL top:yC width:w height:h) value:#LC.
- aTwoArgAction value:(Rectangle left:xL top:yB width:w height:h) value:#LB.
- aTwoArgAction value:(Rectangle left:xC top:yT width:w height:h) value:#CT.
- aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
- aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:#RT.
- aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
- aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
+ aTwoArgAction value:(Rectangle left:xL top:yT width:w height:h) value:#LT.
+ aTwoArgAction value:(Rectangle left:xL top:yC width:w height:h) value:#LC.
+ aTwoArgAction value:(Rectangle left:xL top:yB width:w height:h) value:#LB.
+ aTwoArgAction value:(Rectangle left:xC top:yT width:w height:h) value:#CT.
+ aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
+ aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:#RT.
+ aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
+ aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
^ self
].
@@ -2945,9 +2945,9 @@
aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:nil.
type == #Extent ifTrue:[
- aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
- aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
- aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
+ aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
+ aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
+ aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
^ self
].
aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:nil.
@@ -2959,22 +2959,22 @@
"recursive evaluate the block on each child which is visible
"
(isExpanded and:[children size > 0]) ifTrue:[
- children do:[:aChild|
- anOneArgBlock value:aChild.
- aChild recursiveEachVisibleItemDo:anOneArgBlock.
- ]
+ children do:[:aChild|
+ anOneArgBlock value:aChild.
+ aChild recursiveEachVisibleItemDo:anOneArgBlock.
+ ]
].
!
subViewsDo:aOneArgBlock
- "evaluate aBlock for all subviews other than InputView's
+ "evaluate aBlock for all subviews other than InputView's
"
|subViews|
subViews := widget subViews.
subViews notNil ifTrue:[
- subViews do:aOneArgBlock
+ subViews do:aOneArgBlock
].
! !
@@ -3006,12 +3006,12 @@
in case of rootView, only the children are deleted
"
parent isHierarchicalItem ifTrue:[
- self criticalDo:[
- parent remove:self.
- widget destroy.
- ]
+ self criticalDo:[
+ parent remove:self.
+ widget destroy.
+ ]
] ifFalse:[
- self deleteAll
+ self deleteAll
].
!
@@ -3021,8 +3021,8 @@
children size == 0 ifTrue:[^ self].
self criticalDo:[
- self nonCriticalDo:[:el| el widget destroy ].
- self removeAll
+ self nonCriticalDo:[:el| el widget destroy ].
+ self removeAll
].
! !
@@ -3036,25 +3036,25 @@
layout := widget geometryLayout.
layout isNil ifTrue:[
- ^ widget bounds asLayout
+ ^ widget bounds asLayout
].
layout isLayout ifFalse:[
- layout isRectangle ifTrue:[
- ^ LayoutFrame leftOffset:(layout left) rightOffset:(layout right)
- topOffset:(layout top) bottomOffset:(layout bottom)
- ].
- layout isPoint ifTrue:[
- extent := widget extent.
- ^ LayoutFrame leftOffset:(layout x) rightOffset:(layout x + extent x)
- topOffset:(layout y) bottomOffset:(layout y + extent y)
- ].
-
- Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
+ layout isRectangle ifTrue:[
+ ^ LayoutFrame leftOffset:(layout left) rightOffset:(layout right)
+ topOffset:(layout top) bottomOffset:(layout bottom)
+ ].
+ layout isPoint ifTrue:[
+ extent := widget extent.
+ ^ LayoutFrame leftOffset:(layout x) rightOffset:(layout x + extent x)
+ topOffset:(layout y) bottomOffset:(layout y + extent y)
+ ].
+
+ Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
^ nil
].
- layout isLayoutFrame ifTrue:[ ^ layout copy ].
+ layout isLayoutFrame ifTrue:[ ^ layout copy ].
lftFrc := layout leftFraction.
lftOff := layout leftOffset.
@@ -3063,26 +3063,26 @@
extent := widget extent.
newLyt := LayoutFrame leftFraction:lftFrc offset:lftOff
- rightFraction:lftFrc offset:(lftOff + extent x)
- topFraction:topFrc offset:topOff
- bottomFraction:topFrc offset:(topOff + extent y).
+ rightFraction:lftFrc offset:(lftOff + extent x)
+ topFraction:topFrc offset:topOff
+ bottomFraction:topFrc offset:(topOff + extent y).
( layout isAlignmentOrigin
and:[(layout leftAlignmentFraction ~= 0 or:[layout topAlignmentFraction ~= 0])]
) ifTrue:[
- |svRc prBd dlta|
-
- svRc := widget superView viewRectangle.
- prBd := widget preferredBounds.
-
- dlta := ( ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
- - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
- ) rounded.
-
- newLyt leftOffset:(lftOff + dlta x).
- newLyt rightOffset:(lftOff + extent x + dlta x).
- newLyt topOffset:(topOff + dlta y).
- newLyt bottomOffset:(topOff + extent y + dlta y).
+ |svRc prBd dlta|
+
+ svRc := widget superView viewRectangle.
+ prBd := widget preferredBounds.
+
+ dlta := ( ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
+ - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
+ ) rounded.
+
+ newLyt leftOffset:(lftOff + dlta x).
+ newLyt rightOffset:(lftOff + extent x + dlta x).
+ newLyt topOffset:(topOff + dlta y).
+ newLyt bottomOffset:(topOff + extent y + dlta y).
].
^ newLyt
!
@@ -3095,30 +3095,30 @@
self isMoveable ifFalse:[ ^ self ].
(layout := widget geometryLayout) isNil ifTrue:[
- "Extent"
- widget origin:(widget origin + (l@t)).
+ "Extent"
+ widget origin:(widget origin + (l@t)).
^ self
].
layout := layout copy.
layout isLayout ifTrue:[
- layout leftOffset:(layout leftOffset + l)
- topOffset:(layout topOffset + t).
-
- layout isLayoutFrame ifTrue:[
- layout rightOffset:(layout rightOffset + l).
- layout bottomOffset:(layout bottomOffset + t).
- ]
+ layout leftOffset:(layout leftOffset + l)
+ topOffset:(layout topOffset + t).
+
+ layout isLayoutFrame ifTrue:[
+ layout rightOffset:(layout rightOffset + l).
+ layout bottomOffset:(layout bottomOffset + t).
+ ]
] ifFalse:[
- layout isRectangle ifTrue:[
- layout setLeft:(layout left + l).
- layout setTop:(layout top + t).
- ] ifFalse:[
- layout isPoint ifFalse:[^ self].
- layout x:(layout x + l) y:(layout y + t).
- ]
+ layout isRectangle ifTrue:[
+ layout setLeft:(layout left + l).
+ layout setTop:(layout top + t).
+ ] ifFalse:[
+ layout isPoint ifFalse:[^ self].
+ layout x:(layout x + l) y:(layout y + t).
+ ]
].
widget geometryLayout:layout.
!
@@ -3129,35 +3129,35 @@
|layout|
self isResizeable ifFalse:[
- ^ self
+ ^ self
].
(layout := widget geometryLayout) isNil ifTrue:[
- "Extent"
- (r == l and:[b == t]) ifFalse:[
- widget extent:(widget computeExtent + ((r-l) @ (b-t))).
- ].
- ^ self
+ "Extent"
+ (r == l and:[b == t]) ifFalse:[
+ widget extent:(widget computeExtent + ((r-l) @ (b-t))).
+ ].
+ ^ self
].
layout isLayout ifTrue:[
- layout := layout copy.
-
- layout leftOffset:(layout leftOffset + l)
- topOffset:(layout topOffset + t).
-
- layout isLayoutFrame ifTrue:[
- layout bottomOffset:(layout bottomOffset + b).
- layout rightOffset:(layout rightOffset + r).
- ]
+ layout := layout copy.
+
+ layout leftOffset:(layout leftOffset + l)
+ topOffset:(layout topOffset + t).
+
+ layout isLayoutFrame ifTrue:[
+ layout bottomOffset:(layout bottomOffset + b).
+ layout rightOffset:(layout rightOffset + r).
+ ]
] ifFalse:[
- layout isRectangle ifFalse:[^ self].
- layout := layout copy.
-
- layout left:(layout left + l)
- right:(layout right + r)
- top:(layout top + t)
- bottom:(layout bottom + b).
+ layout isRectangle ifFalse:[^ self].
+ layout := layout copy.
+
+ layout left:(layout left + l)
+ right:(layout right + r)
+ top:(layout top + t)
+ bottom:(layout bottom + b).
].
widget geometryLayout:layout.
! !
@@ -3171,23 +3171,23 @@
queue add:self.
self criticalDo:[
- [queue notEmpty] whileTrue:[
- |toRemove elProcessed|
-
- elProcessed := queue removeFirst.
- toRemove := nil.
- elProcessed nonCriticalDo:[:el|
- el exists ifTrue:[
- queue add:el.
- ] ifFalse:[
- toRemove isNil ifTrue:[toRemove := OrderedCollection new].
- toRemove add:el.
- ]
- ].
- toRemove notNil ifTrue:[
- toRemove do:[:el| elProcessed remove:el ].
- ].
- ].
+ [queue notEmpty] whileTrue:[
+ |toRemove elProcessed|
+
+ elProcessed := queue removeFirst.
+ toRemove := nil.
+ elProcessed nonCriticalDo:[:el|
+ el exists ifTrue:[
+ queue add:el.
+ ] ifFalse:[
+ toRemove isNil ifTrue:[toRemove := OrderedCollection new].
+ toRemove add:el.
+ ]
+ ].
+ toRemove notNil ifTrue:[
+ toRemove do:[:el| elProcessed remove:el ].
+ ].
+ ].
].
!
@@ -3200,20 +3200,20 @@
children size == 0 ifTrue:[ ^ self addAll:mergedList ].
self criticalDo:[
- self nonCriticalDo:[:el| |wdg|
- wdg := el widget.
- mergedList detect:[:e2| e2 widget == wdg ] ifNone:[ self remove:el ].
- ].
-
- mergedList keysAndValuesDo:[:i :el| |wdg e2|
- wdg := el widget.
-
- e2 := self at:i ifAbsent:nil.
-
- (e2 isNil or:[e2 widget ~~ wdg]) ifTrue:[
- self add:el beforeIndex:i
- ]
- ]
+ self nonCriticalDo:[:el| |wdg|
+ wdg := el widget.
+ mergedList detect:[:e2| e2 widget == wdg ] ifNone:[ self remove:el ].
+ ].
+
+ mergedList keysAndValuesDo:[:i :el| |wdg e2|
+ wdg := el widget.
+
+ e2 := self at:i ifAbsent:nil.
+
+ (e2 isNil or:[e2 widget ~~ wdg]) ifTrue:[
+ self add:el beforeIndex:i
+ ]
+ ]
].
! !
@@ -3225,17 +3225,17 @@
|specClass model|
menuItem notNil ifTrue:[
- menuItem label isImage ifTrue:[
- ^ menuItem label magnifiedTo:20@20.
- ].
+ menuItem label isImage ifTrue:[
+ ^ menuItem label magnifiedTo:20@20.
+ ].
].
-
+
specClass := self specClass.
specClass isNil ifTrue:[^ nil].
model := self treeModel.
model notNil ifTrue:[
- ^ model iconAt:specClass ifNonePut:[specClass icon]
+ ^ model iconAt:specClass ifNonePut:[specClass icon]
].
^ specClass icon
@@ -3258,8 +3258,8 @@
"get the string
"
widget isNil ifTrue:[
- ^ menuItem class name
- ].
+ ^ menuItem class name
+ ].
^ widget class name.
"Modified: / 16-08-2017 / 13:45:39 / cg"
@@ -3282,7 +3282,7 @@
specClass := self specClass.
specClass notNil ifTrue:[
- ^ specClass canResizeSubComponents
+ ^ specClass canResizeSubComponents
].
^ false
!
@@ -3292,13 +3292,13 @@
widget id notNil ifTrue:[^ true ].
exists ~~ false ifTrue:[
- exists := false.
-
- widget superView notNil ifTrue:[
- (parent isHierarchicalItem and:[parent exists]) ifTrue:[
- exists := (parent widget subViews includesIdentical:widget).
- ].
- ].
+ exists := false.
+
+ widget superView notNil ifTrue:[
+ (parent isHierarchicalItem and:[parent exists]) ifTrue:[
+ exists := (parent widget subViews includesIdentical:widget).
+ ].
+ ].
].
^ exists
@@ -3311,9 +3311,9 @@
cls := widget class.
^ ( cls == ApplicationSubView
- or:[cls == ApplicationWindow
- or:[cls == SubCanvas]]
- )
+ or:[cls == ApplicationWindow
+ or:[cls == SubCanvas]]
+ )
!
isSelected
@@ -3330,12 +3330,12 @@
|specClass|
widget isScrollWrapper ifTrue:[
- ^ false
+ ^ false
].
specClass := self specClass.
specClass notNil ifTrue:[
- ^ specClass supportsSubComponents
+ ^ specClass supportsSubComponents
].
^ false
! !
@@ -3350,11 +3350,11 @@
sv := widget superView.
sv notNil ifTrue:[
- specClass := sv specClass.
-
- specClass notNil ifTrue:[
- ^ specClass isLayoutContainer
- ].
+ specClass := sv specClass.
+
+ specClass notNil ifTrue:[
+ ^ specClass isLayoutContainer
+ ].
].
^ false
!
@@ -3368,7 +3368,7 @@
specClass := self specClass.
specClass notNil ifTrue:[
- ^ specClass isLayoutContainer
+ ^ specClass isLayoutContainer
].
^ false
!
@@ -3377,7 +3377,7 @@
"returns true if the widget is not in a layout container
"
self isInLayoutContainer ifFalse:[
- ^ widget superView notNil
+ ^ widget superView notNil
].
^ false
!
@@ -3390,11 +3390,11 @@
sv := widget superView.
sv notNil ifTrue:[
- specClass := sv specClass.
-
- specClass notNil ifTrue:[
- ^ specClass canResizeSubComponents
- ].
+ specClass := sv specClass.
+
+ specClass notNil ifTrue:[
+ ^ specClass canResizeSubComponents
+ ].
].
^ false
! !
@@ -3411,41 +3411,41 @@
[Instance variables:]
- lockSema <Semaphore> lock selection notifications and redraws
-
- testModeChannel <ValueHolder> true, than running in test mode.
-
- hasTargetWidgetChannel <ValueHolder> true, than any target view is grapped
-
- selection <Sequence or nil> selected items or nil
-
- hiddenLevel <Integer> internal use; redrawing the selection
- only is done if the counter is 0.
-
- listOfItems <HierarchicalList> hiearchical list build from existing items.
-
- selectedSuperItems <Sequence> list of selected super items; items selected
- but not contained in another selected item.
-
- inputEventAction <Action> called for each InputEvent
-
- mappedViewAction <Action> called for a new mapped view which
- can not be found in the current item list.
-
- beforeSelectionChangedAction <Action> called before the selection changed
+ lockSema <Semaphore> lock selection notifications and redraws
+
+ testModeChannel <ValueHolder> true, than running in test mode.
+
+ hasTargetWidgetChannel <ValueHolder> true, than any target view is grapped
+
+ selection <Sequence or nil> selected items or nil
+
+ hiddenLevel <Integer> internal use; redrawing the selection
+ only is done if the counter is 0.
+
+ listOfItems <HierarchicalList> hiearchical list build from existing items.
+
+ selectedSuperItems <Sequence> list of selected super items; items selected
+ but not contained in another selected item.
+
+ inputEventAction <Action> called for each InputEvent
+
+ mappedViewAction <Action> called for a new mapped view which
+ can not be found in the current item list.
+
+ beforeSelectionChangedAction <Action> called before the selection changed
[author:]
- Claus Atzkern
+ Claus Atzkern
[see also:]
- ViewTreeItem
+ ViewTreeItem
"
!
examples
"
example 1: pick any window and show views and contained views
- [exBegin]
+ [exBegin]
|top sel model panel|
model := ViewTreeModel new.
@@ -3459,15 +3459,15 @@
Button label:'Exit' action:[model rootItem:nil. top destroy] in:panel.
Button label:'Pick Views' action:[ |win|
- ( (win := Screen current viewFromUser) notNil
- and:[(win := win topView) ~~ Screen current rootView
- and:[win ~~ top]]
- ) ifTrue:[
- model rootItem:(ViewTreeItem buildViewsFrom:win)
- ] ifFalse:[
- model rootItem:nil
- ]
- ] in:panel.
+ ( (win := Screen current viewFromUser) notNil
+ and:[(win := win topView) ~~ Screen current rootView
+ and:[win ~~ top]]
+ ) ifTrue:[
+ model rootItem:(ViewTreeItem buildViewsFrom:win)
+ ] ifFalse:[
+ model rootItem:nil
+ ]
+ ] in:panel.
sel multipleSelectOk:true.
sel list:model listOfItems.
@@ -3475,27 +3475,27 @@
sel useIndex:false.
sel doubleClickAction:[:i| |el|
- el := model listOfItems at:i.
- el spec notNil ifTrue:[ el spec inspect ] ifFalse:[ el widget inspect ]
+ el := model listOfItems at:i.
+ el spec notNil ifTrue:[ el spec inspect ] ifFalse:[ el widget inspect ]
].
sel indicatorAction:[:i| (model listOfItems at:i) toggleExpand ].
model inputEventAction:[:anEvent| |item|
- anEvent isButtonEvent ifTrue:[
- anEvent isButtonPressEvent ifTrue:[
- model selectedItem:(model listOfItems detectItemRespondsToView:(anEvent view)).
- ] ifFalse:[
- anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
- (item := model selectedItem) notNil ifTrue:[item widget inspect]
- ]
- ]
- ]
+ anEvent isButtonEvent ifTrue:[
+ anEvent isButtonPressEvent ifTrue:[
+ model selectedItem:(model listOfItems detectItemRespondsToView:(anEvent view)).
+ ] ifFalse:[
+ anEvent type == #'buttonMultiPress:x:y:' ifTrue:[
+ (item := model selectedItem) notNil ifTrue:[item widget inspect]
+ ]
+ ]
+ ]
].
top openAndWait.
[[top shown] whileTrue:[Delay waitForSeconds:0.5]. model rootItem:nil] forkAt:8
- [exEnd]
+ [exEnd]
"
! !
@@ -3508,7 +3508,7 @@
catchEvents:aBoolean
catchEvents := aBoolean.
aBoolean ifFalse:[
- self redrawUnselected:selection andLock:false checkTestMode:false.
+ self redrawUnselected:selection andLock:false checkTestMode:false.
].
!
@@ -3518,25 +3518,25 @@
| view views|
selection isNil ifTrue:[ ^ nil ].
- selection isCollection ifTrue:[
- selection size ~~ 1 ifTrue:[ ^ nil ].
- view := selection anElement widget.
- ] ifFalse:[
- view := selection widget.
+ selection isCollection ifTrue:[
+ selection size ~~ 1 ifTrue:[ ^ nil ].
+ view := selection anElement widget.
+ ] ifFalse:[
+ view := selection widget.
].
view isNil ifTrue:[^ nil].
-
+
views := OrderedCollection new.
- [ view notNil ] whileTrue:[
- views add: view.
- view := view superView.
+ [ view notNil ] whileTrue:[
+ views add: view.
+ view := view superView.
].
views removeLast.
^ String streamContents:[ :s|
- views reverseDo:[:each |
- s nextPutAll:'/'.
- s nextPutAll: each name asString "storeString".
- ].
+ views reverseDo:[:each |
+ s nextPutAll:'/'.
+ s nextPutAll: each name asString "storeString".
+ ].
]
"Created: / 19-05-2014 / 18:15:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -3558,21 +3558,21 @@
self deselect.
lockSema critical:[
- anItem notNil ifTrue:[ expanded := anItem isExpanded ]
- ifFalse:[ expanded := false ].
-
- self value:nil.
- listOfItems root:anItem.
-
- anItem notNil ifTrue:[
- timedUpdateTask := Process for:[ self timedUpdateTaskCycle ] priority:8.
- timedUpdateTask name:'Update'.
- timedUpdateTask resume.
- ].
+ anItem notNil ifTrue:[ expanded := anItem isExpanded ]
+ ifFalse:[ expanded := false ].
+
+ self value:nil.
+ listOfItems root:anItem.
+
+ anItem notNil ifTrue:[
+ timedUpdateTask := Process for:[ self timedUpdateTaskCycle ] priority:8.
+ timedUpdateTask name:'Update'.
+ timedUpdateTask resume.
+ ].
].
(expanded and:[anItem notNil]) ifTrue:[
- anItem expand
+ anItem expand
].
^ anItem
!
@@ -3641,7 +3641,7 @@
icon := icon copy onDevice:(view device).
icon isImage ifTrue:[
- icon clearMaskedPixels.
+ icon clearMaskedPixels.
].
icons at:aKey put:icon.
^ icon
@@ -3654,8 +3654,8 @@
see: #waitHiddenLevel
"
(hiddenLevel := hiddenLevel - 1) < 1 ifTrue:[
- hiddenLevel := 0.
- self invalidateSelection.
+ hiddenLevel := 0.
+ self invalidateSelection.
].
!
@@ -3670,11 +3670,11 @@
"apply block with selection hidden
"
- [
- self waitHiddenLevel.
- aZeroArgumentBlock value
+ [
+ self waitHiddenLevel.
+ aZeroArgumentBlock value
] ensure:[
- self signalHiddenLevel.
+ self signalHiddenLevel.
].
"Modified (format): / 17-07-2017 / 10:44:01 / cg"
@@ -3722,37 +3722,37 @@
myTaskId := timedUpdateTask.
listOfItems root notNil ifTrue:[
- view := listOfItems root widget.
+ view := listOfItems root widget.
].
[ view notNil ] whileTrue:[
- Delay waitForSeconds:0.5.
-
- (myTaskId == timedUpdateTask and:[view id notNil]) ifFalse:[
- view := nil.
- ] ifTrue:[
- (view sensor hasUserEvent:#updateChildren for:self) ifFalse:[
- view sensor pushUserEvent:#updateChildren for:self.
- ].
- ].
+ Delay waitForSeconds:0.5.
+
+ (myTaskId == timedUpdateTask and:[view id notNil]) ifFalse:[
+ view := nil.
+ ] ifTrue:[
+ (view sensor hasUserEvent:#updateChildren for:self) ifFalse:[
+ view sensor pushUserEvent:#updateChildren for:self.
+ ].
+ ].
].
timedUpdateTask == myTaskId ifTrue:[
- timedUpdateTask := nil.
- listOfItems root:nil.
+ timedUpdateTask := nil.
+ listOfItems root:nil.
].
!
update:something with:someArgument from:aModel
aModel == testModeChannel ifTrue:[
- (hiddenLevel == 0 and:[selection size > 0]) ifTrue:[
- testModeChannel value ifTrue:[
- self redrawUnselected:selection andLock:false checkTestMode:false.
- ] ifFalse:[
- self invalidateSelection.
- ].
- ].
- ^ self
+ (hiddenLevel == 0 and:[selection size > 0]) ifTrue:[
+ testModeChannel value ifTrue:[
+ self redrawUnselected:selection andLock:false checkTestMode:false.
+ ] ifFalse:[
+ self invalidateSelection.
+ ].
+ ].
+ ^ self
].
super update:something with:someArgument from:aModel.
!
@@ -3764,9 +3764,9 @@
rootItem isNil ifTrue:[^ self].
rootItem exists ifFalse:[
- listOfItems root:nil.
+ listOfItems root:nil.
] ifTrue:[
- rootItem updateChildren.
+ rootItem updateChildren.
].
! !
@@ -3783,71 +3783,71 @@
evView := anEvent view.
evView isNil ifTrue:[
- (anEvent isMessageSendEvent not or:[anEvent receiver ~~ self]) ifTrue:[
- ^ false
- ].
- anEvent value.
- ^ true.
+ (anEvent isMessageSendEvent not or:[anEvent receiver ~~ self]) ifTrue:[
+ ^ false
+ ].
+ anEvent value.
+ ^ true.
].
rootView := listOfItems rootView.
rootView isNil ifTrue:[ ^ false ].
anEvent isConfigureEvent ifTrue:[
- hiddenLevel == 0 ifTrue:[
- self redrawUnselected:selection andLock:false.
- ].
- ^ false
+ hiddenLevel == 0 ifTrue:[
+ self redrawUnselected:selection andLock:false.
+ ].
+ ^ false
].
"/ check whether view is contained within the rootView
(evView == rootView or:[evView isComponentOf:rootView]) ifFalse:[
- ^ false
+ ^ false
].
anEvent isInputEvent ifFalse:[
- anEvent isDamage ifTrue:[
- hiddenLevel == 0 ifTrue:[self invalidateSelection].
- ^ false
- ].
-
- anEvent isMapEvent ifTrue:[
- mappedViewAction notNil ifTrue:[
- item := listOfItems recursiveDetect:[:el| el widget == evView].
- item isNil ifTrue:[ mappedViewAction value:evView ]
- ].
- ^ false
- ].
-
- anEvent type == #terminate ifTrue:[
- item := listOfItems recursiveDetect:[:el| el widget == evView].
- item notNil ifTrue:[ self processTerminateForItem:item ].
- ^ false
- ].
- ^ false
+ anEvent isDamage ifTrue:[
+ hiddenLevel == 0 ifTrue:[self invalidateSelection].
+ ^ false
+ ].
+
+ anEvent isMapEvent ifTrue:[
+ mappedViewAction notNil ifTrue:[
+ item := listOfItems recursiveDetect:[:el| el widget == evView].
+ item isNil ifTrue:[ mappedViewAction value:evView ]
+ ].
+ ^ false
+ ].
+
+ anEvent type == #terminate ifTrue:[
+ item := listOfItems recursiveDetect:[:el| el widget == evView].
+ item notNil ifTrue:[ self processTerminateForItem:item ].
+ ^ false
+ ].
+ ^ false
].
testMode := testModeChannel value.
anEvent isFocusEvent ifTrue:[
- evView == rootView ifTrue:[
- self invalidateSelection
- ].
- ^ testMode not.
+ evView == rootView ifTrue:[
+ self invalidateSelection
+ ].
+ ^ testMode not.
].
anEvent isPointerEnterLeaveEvent ifTrue:[ ^ testMode not ].
testMode ifFalse:[
- inputEventAction notNil ifTrue:[ inputEventAction value:anEvent ].
+ inputEventAction notNil ifTrue:[ inputEventAction value:anEvent ].
] ifTrue:[
- anEvent isButtonPressEvent ifTrue:[
- selectOnClickHolder value ifTrue:[
- self selectItem:(listOfItems detectItemRespondsToView:evView).
- ].
- ]
+ anEvent isButtonPressEvent ifTrue:[
+ selectOnClickHolder value ifTrue:[
+ self selectItem:(listOfItems detectItemRespondsToView:evView).
+ ].
+ ]
].
(hiddenLevel ~~ 0 and:[anEvent isButtonReleaseEvent]) ifTrue:[
- hiddenLevel := 1.
- self signalHiddenLevel.
+ hiddenLevel := 1.
+ self signalHiddenLevel.
].
^ testMode not
@@ -3894,7 +3894,7 @@
and:[(topView := listOfItems rootView) notNil
and:[topView shown]]]
) ifTrue:[
- topView sensor pushUserEvent:#redrawSelection for:self withArguments:#()
+ topView sensor pushUserEvent:#redrawSelection for:self withArguments:#()
]
!
@@ -3919,8 +3919,8 @@
subViews := aView subViews.
subViews size ~~ 0 ifTrue:[
- subViews reverseDo:[:v| self recursiveRepair:theDamages startIn:v relativeTo:aRootView ].
- theDamages isEmpty ifTrue:[ ^ self ].
+ subViews reverseDo:[:v| self recursiveRepair:theDamages startIn:v relativeTo:aRootView ].
+ theDamages isEmpty ifTrue:[ ^ self ].
].
relOrg := aView originRelativeTo:aRootView.
@@ -3934,42 +3934,42 @@
height := aView height + bwWidth + bwWidth.
size to:1 by:-1 do:[:anIndex|
- repaired := damage := theDamages at:anIndex.
-
- "/ compute the rectangle into the view
- y := damage top - relOrgY.
- x := damage left - relOrgX.
- w := damage width.
- h := damage height.
-
- x < 0 ifTrue:[ w := w + x. x := 0. repaired := nil ].
- y < 0 ifTrue:[ h := h + y. y := 0. repaired := nil ].
- x + w > width ifTrue:[ w := width - x. repaired := nil ].
- y + h > height ifTrue:[ h := height - y. repaired := nil ].
-
- (w > 0 and:[h > 0]) ifTrue:[
- bwWidth ~~ 0 ifTrue:[
- color isNil ifTrue:[
- "/ must force redraw of border
- color := aView borderColor.
- aView borderColor:(Color colorId:1).
- aView borderColor:color.
- ].
- w := w - bwWidth.
- h := h - bwWidth.
-
- (x := x - bwWidth) < 0 ifTrue:[w := w + x. x := 0].
- (y := y - bwWidth) < 0 ifTrue:[h := h + y. y := 0].
-
- h > 0 ifFalse:[w := 0]. "/ later testing on width only
- ].
-
- w > 0 ifTrue:[
- aView clearRectangleX:x y:y width:w height:h.
- aView exposeX:x y:y width:w height:h
- ].
- repaired notNil ifTrue:[ theDamages removeFromIndex:anIndex toIndex:anIndex ].
- ]
+ repaired := damage := theDamages at:anIndex.
+
+ "/ compute the rectangle into the view
+ y := damage top - relOrgY.
+ x := damage left - relOrgX.
+ w := damage width.
+ h := damage height.
+
+ x < 0 ifTrue:[ w := w + x. x := 0. repaired := nil ].
+ y < 0 ifTrue:[ h := h + y. y := 0. repaired := nil ].
+ x + w > width ifTrue:[ w := width - x. repaired := nil ].
+ y + h > height ifTrue:[ h := height - y. repaired := nil ].
+
+ (w > 0 and:[h > 0]) ifTrue:[
+ bwWidth ~~ 0 ifTrue:[
+ color isNil ifTrue:[
+ "/ must force redraw of border
+ color := aView borderColor.
+ aView borderColor:(Color colorId:1).
+ aView borderColor:color.
+ ].
+ w := w - bwWidth.
+ h := h - bwWidth.
+
+ (x := x - bwWidth) < 0 ifTrue:[w := w + x. x := 0].
+ (y := y - bwWidth) < 0 ifTrue:[h := h + y. y := 0].
+
+ h > 0 ifFalse:[w := 0]. "/ later testing on width only
+ ].
+
+ w > 0 ifTrue:[
+ aView clearRectangleX:x y:y width:w height:h.
+ aView exposeX:x y:y width:w height:h
+ ].
+ repaired notNil ifTrue:[ theDamages removeFromIndex:anIndex toIndex:anIndex ].
+ ]
].
!
@@ -3986,28 +3986,28 @@
and:[topView shown
and:[(topView sensor hasEvent:#redrawSelection for:self) not]]]]
) ifFalse:[
- ^ self
+ ^ self
].
lockSema critical:[
- |list|
-
- list := selection.
-
- list size > 0 ifTrue:[
- topView paint:(Color black).
- topView clippedByChildren:false.
-
- list keysAndValuesReverseDo:[:anIndex :anItem|
- (anIndex == 1 and:[size > 1]) ifTrue:[ topView paint:(Color red) ].
-
- anItem handlesDo:[:aRect :what|
- what isNil ifTrue:[topView displayRectangle:aRect]
- ifFalse:[topView fillRectangle:aRect]
- ]
- ].
- topView clippedByChildren:true.
- ].
+ |list|
+
+ list := selection.
+
+ list size > 0 ifTrue:[
+ topView paint:(Color black).
+ topView clippedByChildren:false.
+
+ list keysAndValuesReverseDo:[:anIndex :anItem|
+ (anIndex == 1 and:[size > 1]) ifTrue:[ topView paint:(Color red) ].
+
+ anItem handlesDo:[:aRect :what|
+ what isNil ifTrue:[topView displayRectangle:aRect]
+ ifFalse:[topView fillRectangle:aRect]
+ ]
+ ].
+ topView clippedByChildren:true.
+ ].
].
!
@@ -4025,54 +4025,54 @@
|rootView damages subViews x y w h|
doLock ifTrue:[
- hiddenLevel := hiddenLevel + 1.
- hiddenLevel ~~ 1 ifTrue:[^ self].
+ hiddenLevel := hiddenLevel + 1.
+ hiddenLevel ~~ 1 ifTrue:[^ self].
] ifFalse:[
- hiddenLevel ~~ 0 ifTrue:[^ self].
+ hiddenLevel ~~ 0 ifTrue:[^ self].
].
checkTestMode ifTrue:[
- testModeChannel value ifTrue:[ ^ self ]. "/ test whether running testMode
+ testModeChannel value ifTrue:[ ^ self ]. "/ test whether running testMode
].
( aList size ~~ 0
and:[(rootView := listOfItems rootView) notNil
and:[rootView shown]]
) ifFalse:[
- ^ self
+ ^ self
].
lockSema critical:[
- damages := OrderedCollection new:(8 * aList size).
-
- aList do:[:item|
- item handlesDo:[:handle :what|
- damages reverseDo:[:el|
- (el intersects:handle) ifTrue:[
- damages removeIdentical:el.
-
- handle left:(handle left min:el left)
- right:(handle right max:el right)
- top:(handle top min:el top)
- bottom:(handle bottom max:el bottom)
- ]
- ].
- damages add:handle
- ]
- ].
-
- damages do:[:el|
- x := el left.
- y := el top.
- w := el width.
- h := el height.
-
- rootView clearRectangleX:x y:y width:w height:h.
- rootView exposeX:x y:y width:w height:h.
- ].
-
- (subViews := rootView subViews) notNil ifTrue:[
- subViews reverseDo:[:v| self recursiveRepair:damages startIn:v relativeTo:rootView ].
- ].
+ damages := OrderedCollection new:(8 * aList size).
+
+ aList do:[:item|
+ item handlesDo:[:handle :what|
+ damages reverseDo:[:el|
+ (el intersects:handle) ifTrue:[
+ damages removeIdentical:el.
+
+ handle left:(handle left min:el left)
+ right:(handle right max:el right)
+ top:(handle top min:el top)
+ bottom:(handle bottom max:el bottom)
+ ]
+ ].
+ damages add:handle
+ ]
+ ].
+
+ damages do:[:el|
+ x := el left.
+ y := el top.
+ w := el width.
+ h := el height.
+
+ rootView clearRectangleX:x y:y width:w height:h.
+ rootView exposeX:x y:y width:w height:h.
+ ].
+
+ (subViews := rootView subViews) notNil ifTrue:[
+ subViews reverseDo:[:v| self recursiveRepair:damages startIn:v relativeTo:rootView ].
+ ].
].
! !
@@ -4091,7 +4091,7 @@
"returns the selected item at an index or nil
"
selection notNil ifTrue:[
- ^ selection at:anIndex ifAbsent:nil
+ ^ selection at:anIndex ifAbsent:nil
].
^ nil
!
@@ -4100,7 +4100,7 @@
"returns the selected item at an index or the result of the block
"
selection notNil ifTrue:[
- ^ selection at:anIndex ifAbsent:aBlock
+ ^ selection at:anIndex ifAbsent:aBlock
].
^ aBlock value
!
@@ -4146,18 +4146,18 @@
item isNil ifTrue:[^ item].
lockSema critical:[
- selection isNil ifTrue:[
- newSelect := Array with:item.
- ] ifFalse:[
- (self includes:item) ifFalse:[
- newSelect := selection copyWith:item
- ]
- ].
-
- newSelect size ~~ selection size ifTrue:[
- item makeVisible.
- self value:newSelect
- ]
+ selection isNil ifTrue:[
+ newSelect := Array with:item.
+ ] ifFalse:[
+ (self includes:item) ifFalse:[
+ newSelect := selection copyWith:item
+ ]
+ ].
+
+ newSelect size ~~ selection size ifTrue:[
+ item makeVisible.
+ self value:newSelect
+ ]
].
^ item
!
@@ -4170,16 +4170,16 @@
aCollectionOfItems size == 0 ifTrue:[ ^ aCollectionOfItems ].
lockSema critical:[
- selection isNil ifTrue:[
- newSelect := Array withAll:aCollectionOfItems.
- ] ifFalse:[
- newSelect := OrderedCollection withAll:selection.
-
- aCollectionOfItems do:[:el|
- (selection includesIdentical:el) ifFalse:[newSelect add:el]
- ].
- ].
- self value:newSelect.
+ selection isNil ifTrue:[
+ newSelect := Array withAll:aCollectionOfItems.
+ ] ifFalse:[
+ newSelect := OrderedCollection withAll:selection.
+
+ aCollectionOfItems do:[:el|
+ (selection includesIdentical:el) ifFalse:[newSelect add:el]
+ ].
+ ].
+ self value:newSelect.
].
^ aCollectionOfItems
!
@@ -4198,12 +4198,12 @@
item isNil ifTrue:[^ nil].
lockSema critical:[
- (selection notNil and:[selection includesIdentical:item]) ifTrue:[
- selection size == 1 ifTrue:[ newSelect := nil ]
- ifFalse:[ newSelect := selection copyWithout:item ].
-
- self value:newSelect
- ].
+ (selection notNil and:[selection includesIdentical:item]) ifTrue:[
+ selection size == 1 ifTrue:[ newSelect := nil ]
+ ifFalse:[ newSelect := selection copyWithout:item ].
+
+ self value:newSelect
+ ].
].
^ item
!
@@ -4223,10 +4223,10 @@
loItems size == 0 ifTrue:[ ^ loItems ].
lockSema critical:[
- selection notNil ifTrue:[
- newSelect := selection select:[:el| (loItems includesIdentical:el) not ].
- self value:newSelect.
- ]
+ selection notNil ifTrue:[
+ newSelect := selection select:[:el| (loItems includesIdentical:el) not ].
+ self value:newSelect.
+ ]
].
^ loItems
!
@@ -4239,10 +4239,10 @@
root := listOfItems root.
root isNil ifTrue:[
- newSelection := nil
+ newSelection := nil
] ifFalse:[
- newSelection := OrderedCollection new.
- root recursiveDo:[:el| newSelection add:el ].
+ newSelection := OrderedCollection new.
+ root recursiveDo:[:el| newSelection add:el ].
].
self value:newSelection.
!
@@ -4270,8 +4270,8 @@
current selection.
"
anItem notNil ifTrue:[
- (self includes:anItem) ifTrue:[self remove:anItem]
- ifFalse:[self add:anItem]
+ (self includes:anItem) ifTrue:[self remove:anItem]
+ ifFalse:[self add:anItem]
].
^ anItem
! !
@@ -4361,47 +4361,47 @@
selSize := selection size.
selSize == 0 ifTrue:[
- selectedSuperItems := #().
+ selectedSuperItems := #().
] ifFalse:[
- selSize == 1 ifTrue:[
- selectedSuperItems := Array with:(selection at:1).
- ] ifFalse:[
- rootItem := listOfItems root.
-
- (selection includesIdentical:rootItem) ifTrue:[
- selectedSuperItems := Array with:rootItem.
- ] ifFalse:[
- selectedSuperItems := OrderedCollection new:selSize.
-
- selection do:[:anItem|
- anItem parentsDetect:[:el| selection includesIdentical:el ]
- ifNone:[ selectedSuperItems add:anItem ].
- ].
- ]
- ]
+ selSize == 1 ifTrue:[
+ selectedSuperItems := Array with:(selection at:1).
+ ] ifFalse:[
+ rootItem := listOfItems root.
+
+ (selection includesIdentical:rootItem) ifTrue:[
+ selectedSuperItems := Array with:rootItem.
+ ] ifFalse:[
+ selectedSuperItems := OrderedCollection new:selSize.
+
+ selection do:[:anItem|
+ anItem parentsDetect:[:el| selection includesIdentical:el ]
+ ifNone:[ selectedSuperItems add:anItem ].
+ ].
+ ]
+ ]
].
( hiddenLevel == 0
and:[(rootView := listOfItems rootView) notNil
and:[rootView shown]]
) ifTrue:[
- selSize == 0 ifTrue:[
- "/ must redraw the old selection unselected
- self redrawUnselected:oldSelection andLock:false
- ] ifFalse:[
- self invalidateSelection.
-
- oldSelection size ~~ 0 ifTrue:[
- "/ must redraw all elements no longer in the selection
- unselected := oldSelection select:[:el| (selection includesIdentical:el) not ].
- self redrawUnselected:unselected andLock:false.
- ]
- ]
+ selSize == 0 ifTrue:[
+ "/ must redraw the old selection unselected
+ self redrawUnselected:oldSelection andLock:false
+ ] ifFalse:[
+ self invalidateSelection.
+
+ oldSelection size ~~ 0 ifTrue:[
+ "/ must redraw all elements no longer in the selection
+ unselected := oldSelection select:[:el| (selection includesIdentical:el) not ].
+ self redrawUnselected:unselected andLock:false.
+ ]
+ ]
].
super changed:aParameter with:oldSelection.
!
-setValue:aNewSelection
+setValue:aNewSelection
"set the selection without notifying
"
|newSelect idx|
@@ -4409,31 +4409,31 @@
newSelect := nil.
aNewSelection notNil ifTrue:[
- lockSema critical:[
- aNewSelection isCollection ifFalse:[
- (selection size == 1 and:[selection first == aNewSelection]) ifTrue:[
- newSelect := selection
- ] ifFalse:[
- newSelect := Array with:aNewSelection.
- ]
- ] ifTrue:[
- aNewSelection notEmpty ifTrue:[
- aNewSelection size ~~ selection size ifTrue:[
- newSelect := aNewSelection copy.
- ] ifFalse:[
- idx := selection findFirst:[:el| (aNewSelection includesIdentical:el) not ].
-
- idx ~~ 0 ifTrue:[newSelect := aNewSelection copy]
- ifFalse:[newSelect := selection ].
- ]
- ]
- ]
- ].
+ lockSema critical:[
+ aNewSelection isCollection ifFalse:[
+ (selection size == 1 and:[selection first == aNewSelection]) ifTrue:[
+ newSelect := selection
+ ] ifFalse:[
+ newSelect := Array with:aNewSelection.
+ ]
+ ] ifTrue:[
+ aNewSelection notEmpty ifTrue:[
+ aNewSelection size ~~ selection size ifTrue:[
+ newSelect := aNewSelection copy.
+ ] ifFalse:[
+ idx := selection findFirst:[:el| (aNewSelection includesIdentical:el) not ].
+
+ idx ~~ 0 ifTrue:[newSelect := aNewSelection copy]
+ ifFalse:[newSelect := selection ].
+ ]
+ ]
+ ]
+ ].
].
newSelect ~~ selection ifTrue:[
- beforeSelectionChangedAction value.
- selection := newSelect.
- selection notNil ifTrue:[selection do:[:el| el makeVisible]]
+ beforeSelectionChangedAction value.
+ selection := newSelect.
+ selection notNil ifTrue:[selection do:[:el| el makeVisible]]
].
!
@@ -4444,9 +4444,9 @@
|oldSelection|
lockSema critical:[
- oldSelection := selection.
- self setValue:aValue.
- self changed:#value with:oldSelection
+ oldSelection := selection.
+ self setValue:aValue.
+ self changed:#value with:oldSelection
]
!
@@ -4463,12 +4463,12 @@
|oldSelection|
lockSema critical:[
- oldSelection := selection.
- self setValue:aValue.
-
- oldSelection == selection ifFalse:[
- self changed:#value with:oldSelection
- ]
+ oldSelection := selection.
+ self setValue:aValue.
+
+ oldSelection == selection ifFalse:[
+ self changed:#value with:oldSelection
+ ]
].
! !
@@ -4544,10 +4544,10 @@
|keptSelection|
aCollection size ~~ 0 ifTrue:[
- "/ the selection may change at any time (may it?)
- (keptSelection := selection) isNil ifTrue:[ ^ false ].
-
- ^ aCollection contains:[:el| (keptSelection includesIdentical:el)]
+ "/ the selection may change at any time (may it?)
+ (keptSelection := selection) isNil ifTrue:[ ^ false ].
+
+ ^ aCollection contains:[:el| (keptSelection includesIdentical:el)]
].
^ true
@@ -4560,10 +4560,10 @@
|keptSelection|
aCollection notNil ifTrue:[
- "/ the selection may change at any time (may it?)
- (keptSelection := selection) notNil ifTrue:[
- ^ aCollection contains:[:el| (keptSelection includesIdentical:el)]
- ]
+ "/ the selection may change at any time (may it?)
+ (keptSelection := selection) notNil ifTrue:[
+ ^ aCollection contains:[:el| (keptSelection includesIdentical:el)]
+ ]
].
^ false
@@ -4602,17 +4602,17 @@
ViewTreeItem's and the root, the anchor of the hierarchical list.
[Instance variables:]
- treeModel <ViewTreeModel> all events are delegated to
- eventHook <BlockValue> save and resore the pre/post -EventHook
+ treeModel <ViewTreeModel> all events are delegated to
+ eventHook <BlockValue> save and resore the pre/post -EventHook
[author:]
- Claus Atzkern
+ Claus Atzkern
[see also:]
- HierarchicalList
- ViewTreeModel
- ViewTreeItem
+ HierarchicalList
+ ViewTreeModel
+ ViewTreeItem
"
! !
@@ -4629,39 +4629,39 @@
super root:theRoot.
rootView notNil ifTrue:[ |wgrp|
- wgrp := rootView windowGroup.
-
- wgrp notNil ifTrue:[
- wgrp removePreEventHook:treeModel.
- wgrp removePostEventHook:self.
- ].
+ wgrp := rootView windowGroup.
+
+ wgrp notNil ifTrue:[
+ wgrp removePreEventHook:treeModel.
+ wgrp removePostEventHook:self.
+ ].
].
super root:theRoot.
rootView := self rootView.
rootView notNil ifTrue:[
- "must setup a task because there might not exist a windowGroup at the moment
- "
- [ |wgrp|
-
- [rootView == self rootView] whileTrue:[
- wgrp := rootView windowGroup.
- wgrp notNil ifTrue:[
- rootView := nil.
- wgrp addPreEventHook:treeModel.
- wgrp addPostEventHook:self.
- ] ifFalse:[
- Delay waitForMilliseconds:100.
- ].
- ].
-
- ] forkAt:(Processor userSchedulingPriority + 2).
+ "must setup a task because there might not exist a windowGroup at the moment
+ "
+ [ |wgrp|
+
+ [rootView == self rootView] whileTrue:[
+ wgrp := rootView windowGroup.
+ wgrp notNil ifTrue:[
+ rootView := nil.
+ wgrp addPreEventHook:treeModel.
+ wgrp addPostEventHook:self.
+ ] ifFalse:[
+ Delay waitForMilliseconds:100.
+ ].
+ ].
+
+ ] forkAt:(Processor userSchedulingPriority + 2).
].
treeModel notNil ifTrue:[
- treeModel targetWidgetChanged.
+ treeModel targetWidgetChanged.
].
-
+
^ root.
!
@@ -4686,26 +4686,26 @@
l := nil.
showWidgetNames == true ifTrue:[
- (widget := anItem widget) notNil ifTrue:[
- l := '"', widget name, '"'
- ] ifFalse:[
- l := '"', anItem menuItem label asString, '"'
- ].
+ (widget := anItem widget) notNil ifTrue:[
+ l := '"', widget name, '"'
+ ] ifFalse:[
+ l := '"', anItem menuItem label asString, '"'
+ ].
].
anItem isApplicationClass ifTrue:[
- applClass := anItem applicationClass.
- applClass notNil ifTrue:[
- applClassName := '[', applClass name allBold, ']'.
- l := (l isNil ifTrue:[''] ifFalse:[l , ' ']) , applClassName
- ].
+ applClass := anItem applicationClass.
+ applClass notNil ifTrue:[
+ applClassName := '[', applClass name allBold, ']'.
+ l := (l isNil ifTrue:[''] ifFalse:[l , ' ']) , applClassName
+ ].
].
application notNil ifTrue:[
- key := application builder namedComponents keyAtValue:widget ifAbsent:nil.
- key notNil ifTrue:[
- l := l , ' #',key
- ].
+ key := application builder namedComponents keyAtValue:widget ifAbsent:nil.
+ key notNil ifTrue:[
+ l := l , ' #',key
+ ].
].
^ l
@@ -4725,12 +4725,12 @@
otherwise the name of the application"
self showWidgetNames == aBoolean ifFalse:[
- showWidgetNames := aBoolean.
-
- root notNil ifTrue:[
- root recursiveAdditionalNameBehaviourChanged.
- self changed.
- ].
+ showWidgetNames := aBoolean.
+
+ root notNil ifTrue:[
+ root recursiveAdditionalNameBehaviourChanged.
+ self changed.
+ ].
].
! !
@@ -4761,25 +4761,25 @@
|view item topView|
root notNil ifTrue:[
- view := aView.
- topView := root widget.
-
- [ view notNil ] whileTrue:[
- topView == view ifTrue:[^ root].
- item := root recursiveDetect:[:el| el widget == view ].
- item notNil ifTrue:[^ item].
- view := view superView
- ]
+ view := aView.
+ topView := root widget.
+
+ [ view notNil ] whileTrue:[
+ topView == view ifTrue:[^ root].
+ item := root recursiveDetect:[:el| el widget == view ].
+ item notNil ifTrue:[^ item].
+ view := view superView
+ ]
].
^ nil
!
recursiveDetect:aOneOrgBlock
- "recursive find the first child, for which evaluation
+ "recursive find the first child, for which evaluation
of the block returns true; if none nil is returned
"
root notNil ifTrue:[
- (aOneOrgBlock value:root) ifTrue:[ ^ root ].
+ (aOneOrgBlock value:root) ifTrue:[ ^ root ].
^ root recursiveDetect:aOneOrgBlock
].
^ nil