diff -r ae84facd80be -r 060fc1ac8d82 UISelectionPanel.st --- a/UISelectionPanel.st Wed Jun 11 16:00:53 1997 +0200 +++ b/UISelectionPanel.st Wed Jun 11 16:01:29 1997 +0200 @@ -120,7 +120,7 @@ ^ - + #(#FullSpec #'window:' #(#WindowSpec @@ -137,6 +137,7 @@ #'name:' 'ArrowButton up' #'layout:' #(#LayoutFrame 237 0 20 0 259 0 42 0) #'isTriggerOnDown:' true + #'autoRepeat:' false #'direction:' #up ) #(#ActionButtonSpec @@ -144,12 +145,14 @@ #'layout:' #(#LayoutFrame 20 0 20 0 119 0 42 0) #'label:' 'Button' #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#RadioButtonSpec #'name:' 'RadioButton' #'layout:' #(#LayoutFrame 127 0.0 20 0 226 0 42 0) #'label:' 'RadioButton' #'isTriggerOnDown:' true + #'autoRepeat:' false #'showLamp:' true #'lampColor:' #(#Color 100.0 100.0 0.0) ) @@ -158,6 +161,7 @@ #'layout:' #(#LayoutFrame 238 0 51 0 260 0 73 0) #'hasCharacterOrientedLabel:' false #'isTriggerOnDown:' true + #'autoRepeat:' false #'direction:' #down ) #(#ArrowButtonSpec @@ -165,6 +169,7 @@ #'layout:' #(#LayoutFrame 238 0 82 0 260 0 104 0) #'hasCharacterOrientedLabel:' false #'isTriggerOnDown:' true + #'autoRepeat:' false #'direction:' #left ) #(#ArrowButtonSpec @@ -172,12 +177,14 @@ #'layout:' #(#LayoutFrame 238 0 113 0 260 0 135 0) #'hasCharacterOrientedLabel:' false #'isTriggerOnDown:' true + #'autoRepeat:' false #'direction:' #right ) #(#CheckToggleSpec #'name:' 'CheckToggle' #'layout:' #(#LayoutFrame 297 0 82 0 317 0 102 0) #'isTriggerOnDown:' true + #'autoRepeat:' false #'showLamp:' false #'lampColor:' #(#Color 100.0 100.0 0.0) ) @@ -186,15 +193,14 @@ #'layout:' #(#LayoutFrame 297 0 20 0 396 0 42 0) #'label:' 'Toggle' #'isTriggerOnDown:' true + #'autoRepeat:' false #'showLamp:' true #'lampColor:' #(#Color 100.0 100.0 0.0) ) #(#CheckBoxSpec #'name:' 'CheckBox' - #'layout:' #(#LayoutFrame 295 0 51 0 396 0 73 0) - #'tabable:' false + #'layout:' #(#LayoutFrame 297 0 51 0 398 0 73 0) #'label:' 'CheckBox' - #'translateLabel:' false ) #(#ActionButtonSpec #'name:' 'ok' @@ -202,6 +208,7 @@ #'label:' 'ok' #'model:' #accept #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'cancel' @@ -209,6 +216,7 @@ #'label:' 'cancel' #'model:' #cancel #'isTriggerOnDown:' false + #'autoRepeat:' false ) #(#ActionButtonSpec #'name:' 'help' @@ -216,12 +224,11 @@ #'label:' 'help' #'model:' #help #'isTriggerOnDown:' false + #'autoRepeat:' false ) ) ) ) - - ! menuComboSpec @@ -253,38 +260,38 @@ #( #(#ComboBoxSpec #'name:' 'ComboBox' - #'layout:' #(#LayoutFrame 20 0 20 0 123 0 40 0) - #'immediateAccept:' true + #'layout:' #(#LayoutFrame 20 0 14 0 123 0 34 0) ) #(#ComboListSpec #'name:' 'ComboList' - #'layout:' #(#LayoutFrame 20 0 51 0 123 0 71 0) - #'tabable:' false + #'layout:' #(#LayoutFrame 20 0 71 0 123 0 91 0) + #'useIndex:' false ) #(#PopUpListSpec #'name:' 'PopUpList' - #'layout:' #(#LayoutFrame 147 0 20 0 250 0 42 0) + #'layout:' #(#LayoutFrame 147 0 14 0 250 0 36 0) #'label:' 'PopUpList' + #'useIndex:' false ) #(#MenuPanelSpec #'name:' 'MenuPanel' - #'layout:' #(#LayoutFrame 147 0 67 0 250 0 89 0) + #'layout:' #(#LayoutFrame 147 0 71 0 250 0 91 0) ) #(#TabViewSpec #'name:' 'TabView' - #'layout:' #(#LayoutFrame 269 0 20 0 409 0 56 0) + #'layout:' #(#LayoutFrame 269 0 14 0 409 0 50 0) #'tabWidget:' #Window - #'direction:' #top ) #(#NoteBookViewSpec #'name:' 'noteBookView' - #'layout:' #(#LayoutFrame 269 0 66 0 409 0 182 0) - #'level:' 2 + #'layout:' #(#LayoutFrame 269 0 71 0 409 0 159 0) + #'tabWidget:' #Window ) #(#LabelSpec #'name:' 'label1' - #'layout:' #(#LayoutFrame 147 0 51 0 250 0 67 0) + #'layout:' #(#LayoutFrame 150 0 73 0 236 0 89 0) #'label:' 'MenuPanel' + #'adjust:' #left #'canUIDrag:' false ) ) @@ -581,7 +588,7 @@ #(#LabelSpec #'name:' 'Text Label' #'layout:' #(#LayoutFrame 222 0 138 0 401 0 160 0) - #'label:' 'Text Label' + #'label:' '' ) #(#TextEditorSpec #'name:' 'EditTextView' @@ -603,20 +610,30 @@ ) #(#LabelSpec #'name:' 'HTMLViewLabel' - #'layout:' #(#LayoutFrame 99 0 178 0 164 0 192 0) + #'layout:' #(#LayoutFrame 93 0 179 0 158 0 193 0) #'label:' 'HTMLView' + #'adjust:' #left #'canUIDrag:' false ) #(#LabelSpec #'name:' 'label1' - #'layout:' #(#LayoutFrame 91 0 83 0 153 0 97 0) + #'layout:' #(#LayoutFrame 93 0 83 0 155 0 97 0) #'label:' 'EditText' + #'adjust:' #left #'canUIDrag:' false ) #(#LabelSpec #'name:' 'label2' - #'layout:' #(#LayoutFrame 297 0 83 0 384 0 97 0) + #'layout:' #(#LayoutFrame 295 0 83 0 382 0 97 0) #'label:' 'SelectionInList' + #'adjust:' #left + #'canUIDrag:' false + ) + #(#LabelSpec + #'name:' 'labelInLabel' + #'layout:' #(#LayoutFrame 226 0 142 0 260 0 156 0) + #'label:' 'Label' + #'adjust:' #left #'canUIDrag:' false ) ) @@ -669,8 +686,9 @@ ) #(#LabelSpec #'name:' 'subCanvasLabel' - #'layout:' #(#LayoutFrame 272 0 85 0 343 0 102 0) + #'layout:' #(#LayoutFrame 272 0 86 0 343 0 100 0) #'label:' 'SubCanvas' + #'adjust:' #left #'canUIDrag:' false ) #(#DividerSpec @@ -685,14 +703,16 @@ ) #(#LabelSpec #'name:' 'viewLabel' - #'layout:' #(#LayoutFrame 14 0 116 0 65 0 133 0) + #'layout:' #(#LayoutFrame 19 0 118 0 70 0 135 0) #'label:' 'View' + #'adjust:' #left #'canUIDrag:' false ) #(#LabelSpec #'name:' 'Seperators' - #'layout:' #(#LayoutFrame 199 0 133 0 270 0 151 0) + #'layout:' #(#LayoutFrame 199 0 125 0 270 0 143 0) #'label:' 'Seperators' + #'adjust:' #left #'canUIDrag:' false ) ) @@ -813,7 +833,7 @@ ! selection:aValue - |spec| + |spec canvas| (aValue isNil or:[aValue == 0]) ifTrue:[ ^ self @@ -824,7 +844,8 @@ spec := receiver perform:(selectors at:selection) ] ]. - (builder aspectAt:#canvas) specification:spec + canvas := builder aspectAt:#canvas. + canvas specification:spec. ]. ! ! @@ -854,6 +875,13 @@ specification := UISpecification from:aSpecOrSpecArray. builder := UIBuilder new. specification buildViewFor:builder in:self. + + subViews do:[:v| + (v ~~ inputView and:[(self findSpecFor:v) notNil]) ifTrue:[ + v borderWidth:1. + ] + ]. + self realizeAllSubViews. inputView raise. ] ifFalse:[ @@ -985,22 +1013,24 @@ findObjectAtX:x y:y "find the origin/corner of the currentWidget " - |view viewId point| + |point id p e| + + point := Point x:x y:y. + id := inputView id. - point := Point x:x y:y. - point := device translatePoint:point from:(inputView id) - to:(inputView device rootView id). - inputView lower. - viewId := device viewIdFromPoint:point in:(self id). - view := device viewFromId:viewId. - inputView raise. - - (view ~~ self and:[view ~~ inputView]) ifTrue:[ - (self findSpecFor:view) notNil ifTrue:[ - ^ view + subViews do:[:v| + v ~~ inputView ifTrue:[ + p := device translatePoint:point from:id to:(v id). + ( p x >= 0 and:[p x <= v width + and:[p y >= 0 and:[p y <= v height + and:[(self findSpecFor:v) notNil]]]] + ) ifTrue:[ + ^ v + ] ] ]. - ^ nil + ^ nil + @@ -1123,21 +1153,33 @@ for:aView specification:aSpec "create drop object for a view derived from a specification " - aView topView raise. - aView device sync. - aView invalidate. - aView windowGroup processExposeEvents. - DisplayObject := Image fromView:aView grab:false. + |point extent root device| + + device := aView device. + root := device rootView. + extent := aView extent. + point := device translatePoint:0@0 from:(aView id) to:(root id). + + DisplayObject := nil. - DisplayObject extent ~= aView extent ifTrue:[ - DisplayObject := Form extent:(aView extent) depth:1. + (point x > 0 and:[point y > 0]) ifTrue:[ + point := point + extent. + (point x < root width and:[point y < root height]) ifTrue:[ + aView topView raise. + device sync. + aView invalidate. + aView windowGroup processExposeEvents. + DisplayObject := Image fromView:aView grab:false. + ] + ]. + DisplayObject isNil ifTrue:[ + DisplayObject := Form extent:extent depth:1. DisplayObject colorMap:(Array with:Color white with:Color black). DisplayObject fill:(Color colorId:0). DisplayObject paint:(Color colorId:1). DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y. ]. - - ^ self new theObject:aSpec + ^ self new theObject:aSpec ! !