unmap previous canvasView; prepare focus sequence
authorca
Sat, 22 Jan 2000 15:19:50 +0100
changeset 1301 dc5c4a8e6e6e
parent 1300 7514e12ff1b8
child 1302 f13d0e144c82
unmap previous canvasView; prepare focus sequence
MenuEditor.st
--- a/MenuEditor.st	Sat Jan 22 15:00:14 2000 +0100
+++ b/MenuEditor.st	Sat Jan 22 15:19:50 2000 +0100
@@ -1090,19 +1090,11 @@
           #name: 'Image Item'
           #min: #(#Point 10 10)
           #max: #(#Point 1280 1024)
-          #bounds: #(#Rectangle 11 177 407 454)
+          #bounds: #(#Rectangle 15 153 411 430)
         )
         #component: 
        #(#SpecCollection
           #collection: #(
-           #(#CheckBoxSpec
-              #label: 'Image & Label'
-              #name: 'iconAndLabelCheckBox'
-              #layout: #(#LayoutOrigin 20 0 215 0)
-              #activeHelpKey: #imageImageAndLabel
-              #tabable: true
-              #model: #iconAndLabel
-            )
            #(#LabelSpec
               #label: 'Retriever:'
               #name: 'retrieverLabel'
@@ -1112,6 +1104,10 @@
               #adjust: #right
             )
            #(#ComboBoxSpec
+              #attributes: 
+             #(#tabable
+                true
+              )
               #name: 'retrieverField'
               #layout: #(#LayoutFrame 110 0 15 0 0 1.0 37 0)
               #activeHelpKey: #imageRetriever
@@ -1133,6 +1129,10 @@
               #adjust: #right
             )
            #(#InputFieldSpec
+              #attributes: 
+             #(#tabable
+                true
+              )
               #name: 'iconField'
               #layout: #(#LayoutFrame 110 0 40 0 -31 1.0 62 0)
               #activeHelpKey: #imageSelector
@@ -1147,17 +1147,22 @@
               #acceptOnPointerLeave: false
             )
            #(#ActionButtonSpec
-              #label: 'Image Editor'
-              #name: 'imageEditorButton'
-              #layout: #(#LayoutFrame 19 0.6 128 0 -5 1 152 0)
-              #activeHelpKey: #imageImageEditor
+              #attributes: 
+             #(#tabable
+                true
+              )
+              #label: '...'
+              #name: 'browseButton'
+              #layout: #(#LayoutFrame -26 1 41 0 -2 1 63 0)
+              #activeHelpKey: #browseResource
               #tabable: true
-              #model: #doEditImage
+              #model: #doBrowseForImageResource
             )
            #(#SequenceViewSpec
               #name: 'systemOrUserImagesList'
               #layout: #(#LayoutFrame 22 0 67 0 11 0.6 200 0)
               #activeHelpKey: #imageImageList
+              #tabable: true
               #model: #selectionOfImage
               #menu: #menuEditImage
               #hasHorizontalScrollBar: true
@@ -1169,11 +1174,28 @@
               #sequenceList: #listOfImages
             )
            #(#ActionButtonSpec
-              #label: '...'
-              #name: 'browseButton'
-              #layout: #(#LayoutFrame -26 1 41 0 -2 1 63 0)
-              #activeHelpKey: #browseResource
-              #model: #doBrowseForImageResource
+              #attributes: 
+             #(#tabable
+                true
+              )
+              #label: 'Image Editor'
+              #name: 'imageEditorButton'
+              #layout: #(#LayoutFrame 19 0.6 128 0 -5 1 152 0)
+              #activeHelpKey: #imageImageEditor
+              #tabable: true
+              #model: #doEditImage
+            )
+           #(#CheckBoxSpec
+              #attributes: 
+             #(#tabable
+                true
+              )
+              #label: 'Image & Label'
+              #name: 'iconAndLabelCheckBox'
+              #layout: #(#LayoutOrigin 20 0 215 0)
+              #activeHelpKey: #imageImageAndLabel
+              #tabable: true
+              #model: #iconAndLabel
             )
            )
          
@@ -2002,7 +2024,7 @@
     |holder|
 
     (holder := builder bindingAt:#tabCanvasHolder) isNil ifTrue:[
-        builder aspectAt:#tabCanvasHolder put: (holder := nil asValue).
+        builder aspectAt:#tabCanvasHolder put: (holder := ValueHolder new).
     ].
     ^ holder
 
@@ -2235,7 +2257,11 @@
 !MenuEditor methodsFor:'selection'!
 
 clearSelection
-    tabSelection := 0.
+
+    tabSelection ~~ 0 ifTrue:[
+        tabSelection := 0.
+        self tabCanvasHolder value:nil
+    ].
     typeOfCanvas := nil.
 !
 
@@ -2304,43 +2330,44 @@
 
 !
 
-tabSelection: aSelection
+tabSelection:aSelection
     "put the section aSelection into the note book
     "
-    |view canvasView|
-
-    tabSelection = aSelection ifTrue:[
-        ^ self
-    ].
-    typeOfCanvas := nil.
-
-    (tabSelection := aSelection) ~~ 0 ifTrue:[
-        typeOfCanvas := (slices at:tabSelection) last.
-
-        self isHelpToolSelected ifTrue:[
-            view := self helpTool window.
-        ] ifFalse:[
-            self updateImageView.
-            view := listOfCanvas at:typeOfCanvas ifAbsentPut:[View new client:self spec:typeOfCanvas].
-        ]
+    |view spec|
+
+    aSelection == tabSelection ifTrue:[^self].
+
+    (tabSelection := aSelection) isNil ifTrue:[
+        tabSelection == 0 ifTrue:[^ self].
+        tabSelection := 0.
     ].
 
     "/ before bringing up the new notebook page,
     "/ we must disable all now invisible input fields ...
     "/ (otherwise, those would fire on #accept.
 
-    canvasView := self tabCanvasHolder value.
-
-    canvasView notNil ifTrue:[
-        canvasView unmap.
-
-        canvasView allSubViewsDo:[:aComponent |
+    (view := self tabCanvasHolder value) notNil ifTrue:[
+        view allSubViewsDo:[:aComponent |
             aComponent isInputField ifTrue:[
                 aComponent disableIfInvisible:true
             ]
         ]
     ].
 
+    tabSelection == 0 ifTrue:[
+        ^ self tabCanvasHolder value:nil.
+    ].
+
+    typeOfCanvas := (slices at:tabSelection) last.
+
+    self isHelpToolSelected ifTrue:[
+        view := self helpTool window.
+    ] ifFalse:[
+        self updateImageView.
+
+        view := listOfCanvas at:typeOfCanvas
+                    ifAbsentPut:[SimpleView new client:self spec:typeOfCanvas builder:(self builder)].
+    ].
     self tabCanvasHolder value:view.
 
 ! !