ca@181: " ca@181: COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG cg@1120: All Rights Reserved ca@181: ca@181: This software is furnished under a license and may be used ca@181: only in accordance with the terms of that license and with the ca@181: inclusion of the above copyright notice. This software may not ca@181: be provided or otherwise made available to, or used by, any ca@181: other person. No title to or ownership of the software is ca@181: hereby transferred. ca@181: " cg@1399: "{ Package: 'stx:libtool2' }" cg@1399: ca@181: NoteBookView subclass:#UIGalleryView ca@181: instanceVariableNames:'majorKey minorKeys minorKeysHolder' ca@181: classVariableNames:'' ca@181: poolDictionaries:'' ca@181: category:'Interface-UIPainter' ca@181: ! ca@181: cg@2563: View subclass:#Palette ca@1675: instanceVariableNames:'clientSpecHolder selection specification lastClickPoint cg@2542: menuSelector uiBuilder hiddenCounter showBorders cg@2542: didWarnAboutUnknownSpecs' ca@181: classVariableNames:'' ca@181: poolDictionaries:'' ca@181: privateIn:UIGalleryView ca@181: ! ca@181: ca@181: DropObject subclass:#DropSpec ca@181: instanceVariableNames:'' cg@247: classVariableNames:'' ca@181: poolDictionaries:'' cg@2563: privateIn:UIGalleryView::Palette ca@181: ! ca@181: ca@181: !UIGalleryView class methodsFor:'documentation'! ca@181: ca@181: copyright ca@181: " ca@181: COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG cg@1120: All Rights Reserved ca@181: ca@181: This software is furnished under a license and may be used ca@181: only in accordance with the terms of that license and with the ca@181: inclusion of the above copyright notice. This software may not ca@181: be provided or otherwise made available to, or used by, any ca@181: other person. No title to or ownership of the software is ca@181: hereby transferred. ca@181: " ca@181: ca@181: ca@181: ! ca@181: ca@181: documentation ca@181: " ca@181: implements a selection panel, keeping widgets which could be placed ca@181: into other components by drag & drop or copy @ paste. The objects ca@181: which are draged/droped must be kind of UISpecification's. ca@181: The UISelectionPanel used by the UIPainter is implemented in this way. ca@181: ca@181: [author:] cg@1120: Claus Gittinger cg@1120: Claus Atzkern ca@181: ca@181: [see also:] cg@1120: UIPainter cg@1120: UISelectionPanel ca@181: " ca@181: ca@181: ! ca@181: ca@181: examples ca@181: " ca@181: opens a gallery ca@181: cg@1120: [exBegin] ca@181: |top sel| ca@181: ca@181: top := StandardSystemView new label:'gallery'; extent:500@300. ca@181: sel := UIGalleryView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. ca@181: ca@181: sel labels:#( 'Buttons' cg@1120: 'Panels' cg@1120: 'Text' cg@1120: ). ca@181: ca@191: sel minorKeys:#( #standardButtonToggle cg@1120: #standardPanels cg@1120: #standardText cg@1120: ). ca@181: ca@181: sel majorKey:UISelectionPanel. ca@181: top open. cg@1120: [exEnd] ca@181: " ca@181: ! ! ca@181: ca@181: !UIGalleryView methodsFor:'accessing'! ca@181: ca@181: builder ca@181: "get the builder used to setup a window from a specification (or nil in case ca@181: of using a new builder) ca@181: " ca@181: ^ canvas builder ca@181: ! ca@181: ca@181: builder:aBuilderOrNil ca@181: "set the builder used to setup a window from a specification (or nil in case ca@181: of using a new builder) ca@181: " ca@181: canvas builder:aBuilderOrNil ca@181: ! ca@181: ca@181: canvas:aCanvas ca@181: ^ self ca@181: ca@181: ! ca@181: ca@181: labels:listOfLabels minorKeys:listOfMinorKeys majorKey:aMajorKey ca@181: "setup for labels, selectors and class provider ca@181: " ca@181: self labels:listOfLabels. ca@181: minorKeys := listOfMinorKeys. ca@181: majorKey := aMajorKey. ca@181: ! ca@181: ca@181: majorKey ca@181: "get the class providing the window specifications ca@181: " ca@181: ^ majorKey ca@181: ! ca@181: ca@181: majorKey:aKey ca@181: "get the class providing the window specifications ca@181: " ca@335: |appl| ca@335: ca@335: appl := self application. ca@335: ca@335: appl notNil ifTrue:[ cg@1120: majorKey := appl resolveName:aKey ca@335: ] ifFalse:[ cg@1120: majorKey := Smalltalk resolveName:aKey inClass:self class ca@335: ]. ca@181: self selection:nil ca@181: ! ca@181: ca@181: minorKeys ca@181: "get the list of selector keys ca@181: " ca@181: ^ minorKeys ca@181: ! ca@181: ca@181: minorKeys:aListOfSelectors ca@181: "set the list of selectors ca@181: " ca@181: minorKeys := aListOfSelectors. cg@1140: self selection:nil. ca@2200: ! ca@2200: ca@2200: showBorders:aBoolean ca@2200: "show borders around dragable objects" ca@2200: ca@2200: canvas showBorders:aBoolean. ca@2200: ! ! ca@2200: ca@2200: !UIGalleryView methodsFor:'accessing-colors'! ca@2200: ca@2200: viewBackground:aColor ca@2200: canvas notNil ifTrue:[ ca@2200: canvas viewBackground:aColor. ca@2200: ]. ca@2200: ^ super viewBackground:aColor ca@181: ! ! ca@181: cg@1399: !UIGalleryView methodsFor:'accessing-holders'! ca@181: ca@181: clientSpecHolder ca@181: "get the holder which keeps the current selection or in case of ca@181: no selection the specification under the cursor ca@181: " ca@181: ^ canvas clientSpecHolder ca@181: ! ca@181: ca@181: clientSpecHolder:aHolder ca@181: "set the holder which keeps the current selection or in case of ca@181: no selection the specification under the cursor ca@181: " ca@181: canvas clientSpecHolder:aHolder ca@181: ! ca@181: ca@181: menuSelector ca@181: ^ canvas menuSelector ca@181: ! ca@181: ca@181: menuSelector:aSelector ca@181: ^ canvas menuSelector:aSelector ca@181: ! ca@181: ca@181: minorKeysHolder ca@181: "get the holder keeping the minor keys; the selectors to access ca@181: specifications from a class associated with the majorKey. ca@181: " ca@181: ^ minorKeysHolder ca@181: ! ca@181: ca@181: minorKeysHolder:aValueHolder ca@181: "set the holder keeping the minor keys; the selectors to access ca@181: specifications from a class associated with the majorKey. ca@181: " ca@181: minorKeysHolder notNil ifTrue:[ cg@1120: minorKeysHolder removeDependent:self. ca@181: ]. ca@181: ca@181: (minorKeysHolder := aValueHolder) notNil ifTrue:[ cg@1120: minorKeysHolder addDependent:self. ca@181: ]. ca@181: self minorKeys:(minorKeysHolder value) ca@181: ! ! ca@181: ca@181: !UIGalleryView methodsFor:'change & update'! ca@181: cg@1142: selectionHasChanged ca@181: "selection changed ca@181: " ca@181: |specification selector selection application| ca@181: cg@1140: selection := self listIndexOf:(self selection). ca@181: ca@683: minorKeysHolder notNil ifTrue:[ cg@1128: minorKeys := minorKeysHolder value. ca@683: ]. ca@181: (selection notNil and:[minorKeys size >= selection]) ifTrue:[ cg@1128: selector := minorKeys at:selection. ca@181: cg@1128: (majorKey respondsTo:selector) ifTrue:[ cg@1128: specification := majorKey perform:selector cg@1128: ] ifFalse:[ cg@1128: (application := self application) notNil ifTrue:[ ca@1576: MessageNotUnderstood handle:[:ex| cg@1128: (application class respondsTo:selector) ifTrue:[ cg@1128: specification := application class perform:selector cg@1128: ] cg@1128: ] do:[ cg@1128: specification := application aspectFor:selector cg@1128: ] cg@1128: ] cg@1128: ] ca@181: ]. cg@2199: "/ self withWaitCursorDo:[ sv@2242: [ sv@2242: canvas specification:specification. sv@2242: ] on:NotFoundError do:[:ex| sv@2242: Transcript showCR:ex description. sv@2242: ex proceed. sv@2242: ] cg@2199: "/ ] ca@181: ! ca@181: ca@181: update cg@1142: self selectionHasChanged. ca@181: ! ca@181: ca@181: update:something with:aParameter from:changedObject ca@181: "one of my models changed its value ca@181: " ca@181: changedObject == minorKeysHolder ifTrue:[ cg@1128: ^ self minorKeys:( minorKeysHolder value) ca@181: ]. ca@181: super update:something with:aParameter from:changedObject. ca@181: ca@181: ! ! ca@181: cg@1337: !UIGalleryView methodsFor:'initialization & release'! ca@181: ca@181: initialize ca@181: "setup default attributes ca@181: " cg@2563: canvas := Palette in:self. ca@181: ca@181: super initialize. ca@683: cg@1142: self action:[:something| self selectionHasChanged ]. cg@1582: ! cg@1582: cg@1582: release cg@1582: minorKeysHolder notNil ifTrue:[ cg@1582: minorKeysHolder removeDependent:self. cg@1582: minorKeysHolder := nil. cg@1582: ]. cg@1582: super release. ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette class methodsFor:'documentation'! cg@2495: cg@2495: documentation cg@2495: " cg@2563: I am the palette of a gallery. Most of what I do is to allow dragging of a widget out cg@2495: of myself and to care for the drawing of the selection. cg@2495: The arrangement into multiple pages is done by my container, which holds me cg@2495: in a subcanvas. cg@2495: " cg@2495: ! ! cg@2495: cg@2563: !UIGalleryView::Palette methodsFor:'accessing'! ca@181: ca@181: builder ca@181: "get the builder used to setup a window from a specification (or nil in case ca@181: of using a new builder) ca@181: " ca@181: ^ uiBuilder ca@181: ! ca@181: ca@181: builder:something ca@181: "set the builder used to setup a window from a specification (or nil in case ca@181: of using a new builder) ca@181: " ca@181: uiBuilder := something. ca@181: ! ca@181: ca@181: clientSpecHolder ca@181: "get the holder which keeps the current selection or in case of ca@181: no selection the specification under the cursor ca@181: " ca@181: ^ clientSpecHolder ca@181: ! ca@181: ca@181: clientSpecHolder:aHolder ca@181: "set the holder which keeps the current selection or in case of ca@181: no selection the specification under the cursor ca@181: " ca@1674: |spec| ca@1674: ca@1674: spec := clientSpecHolder value. ca@1674: ca@1674: aHolder notNil ifTrue:[ clientSpecHolder := aHolder ] ca@1674: ifFalse:[ clientSpecHolder := nil asValue ]. ca@1674: ca@1674: clientSpecHolder value:spec. ca@181: ! ca@181: ca@181: menuSelector ca@181: "return the value of the instance variable 'menuSelector' (automatically generated)" ca@181: sv@1455: ^ menuSelector sv@1455: ! ca@181: ca@181: menuSelector:something ca@181: "set the value of the instance variable 'menuSelector' (automatically generated)" ca@181: sv@1455: menuSelector := something. sv@1455: ! ca@181: ca@2200: showBorders:aBoolean ca@2200: showBorders := aBoolean. ca@2200: ! ca@2200: ca@181: specification ca@181: "get current specification ca@181: " ca@1674: ^ specification ca@181: ! ca@181: ca@181: specification:aSpecOrSpecArray cg@2542: "set a new specification" cg@2542: cg@2542: |builder newSpec| ca@181: ca@181: self selection:nil. ca@1674: self destroySubViews. ca@181: cg@2542: specification := nil. cg@2542: aSpecOrSpecArray isNil ifTrue:[^ self]. cg@2542: cg@2542: "/ only warn once - otherwise, its annoying cg@2542: Array missingClassInLiteralArrayErrorSignal handle:[:ex | cg@2542: didWarnAboutUnknownSpecs == true ifFalse:[ cg@2542: Dialog warn:(ex description,'\\(Will not warn again - please check for unloaded classes/packages)' withCRs). cg@2542: ]. cg@2542: didWarnAboutUnknownSpecs := true. cg@2542: ex proceed. cg@2542: ] do:[ cg@2542: newSpec := UISpecification from:aSpecOrSpecArray. ca@181: ]. cg@2542: newSpec isNil ifTrue:[^ self]. cg@2542: (newSpec respondsTo:#'buildViewFor:in:') ifFalse:[^ self]. cg@2542: specification := newSpec. ca@181: ca@1674: (builder := uiBuilder) isNil ifTrue:[ ca@1674: builder := UIBuilder new isEditing:true. ca@1674: builder showDefaults:true. cg@2563: builder application:self application. "/ for resources like images ca@1674: ]. ca@205: ca@1674: specification buildViewFor:builder in:self. ca@396: cg@2502: "/ components notEmptyOrNil ifTrue:[ self halt ]. ca@1674: subViews size ~~ 0 ifTrue:[ ca@2200: showBorders ifTrue:[ ca@2200: subViews do:[:v| ca@2200: (self findSpecFor:v) notNil ifTrue:[ ca@2200: v borderWidth:1 ca@2200: ]. ca@2200: ]. cg@1561: ]. ca@1674: realized ifTrue:[ self realizeAllSubViews ]. ca@1674: ]. ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette methodsFor:'building'! ca@181: cg@2502: recursiveBuildSpecFromSpecPrototype:aSpec cg@2502: "build spec out of spec prototype" cg@2495: ca@181: |spec comp coll| ca@181: ca@181: (aSpec notNil and:[aSpec canUIDrag]) ifFalse:[ cg@2495: ^ nil ca@181: ]. ca@181: ca@181: spec := aSpec copy. ca@181: (aSpec class supportsSubComponents and:[aSpec component notNil]) ifFalse:[ cg@2495: ^ spec ca@181: ]. ca@181: comp := aSpec component. ca@181: spec component:nil. ca@181: ca@181: comp canUIDrag ifFalse:[ cg@2495: ^ spec ca@181: ]. ca@181: coll := OrderedCollection new. ca@181: cg@2502: comp do:[:anEntry| cg@2502: |spc| cg@2502: cg@2502: (spc := self recursiveBuildSpecFromSpecPrototype:anEntry) notNil ifTrue:[ cg@2495: coll add:spc cg@2495: ] ca@181: ]. ca@181: coll isEmpty ifTrue:[ cg@2495: ^ spec ca@181: ]. ca@181: comp := comp copy. ca@181: comp collection:coll. ca@181: spec component:comp. cg@2495: ^ spec ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette methodsFor:'drag & drop'! ca@181: ca@1675: startDragFrom:evView cg@2495: "start drag at lastClickPoint" cg@2495: ca@2204: |spec dragObj offset clickPos dragAndDropManager| ca@1671: ca@1671: clickPos := lastClickPoint. ca@1671: clickPos isNil ifTrue:[^ self]. ca@1671: lastClickPoint := nil. ca@1671: ca@1674: spec := clientSpecHolder value. ca@1671: spec isNil ifTrue:[^ self]. ca@181: cg@2495: self withSelectionHiddenDo:[ cg@2502: spec := self recursiveBuildSpecFromSpecPrototype:spec. ca@1675: spec name:nil. ca@1674: ca@1675: dragObj := DropSpec for:selection specification:spec. ca@1675: offset := clickPos - selection origin. ca@1675: ]. cg@278: ca@2204: dragAndDropManager := DragAndDropManager new. ca@2204: dragAndDropManager giveFocusToTargetWidget:false. ca@2204: cg@2495: dragAndDropManager cg@2495: startDrag:dragObj cg@2495: from:self cg@2495: offset:offset cg@2495: atEnd:nil cg@2495: display:nil. ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette methodsFor:'event handling'! ca@181: ca@1671: processEvent:anEvent cg@1895: "filter keyboard events. cg@1895: Return true, if I have eaten the event" cg@1895: ca@1674: |evView p| ca@181: ca@1671: evView := anEvent view. ca@1671: evView isNil ifTrue:[ ^ false ]. cg@2553: (evView ~~ self and:[ (evView isComponentOf:self) not ]) ifTrue:[ ^ false ]. ca@181: ca@2201: (anEvent isButtonPressEvent or:[anEvent isButtonReleaseEvent])ifTrue:[ ca@2201: lastClickPoint := nil. ca@2201: ]. ca@1674: anEvent isButtonEvent ifFalse:[ ca@1674: anEvent isInputEvent ifTrue:[^ true]. ca@2201: ca@1675: anEvent isDamage ifTrue:[ self redrawSelection ]. ca@1671: ^ false ca@1671: ]. ca@181: ca@2201: anEvent isButtonReleaseEvent ifTrue:[ ^ true ]. ca@181: ca@1674: anEvent isButtonMotionEvent ifTrue:[ ca@1674: (lastClickPoint notNil and:[anEvent state ~~ 0]) ifTrue:[ ca@1674: p := Point x:(anEvent x) y:(anEvent y). ca@2201: p := device translatePoint:p fromView:evView toView:self. ca@1671: ca@2201: (lastClickPoint dist:p) > 20.0 ifTrue:[ ca@1675: self startDragFrom:evView. ca@1675: lastClickPoint := nil. ca@1671: ] ca@1671: ]. ca@1671: ^ true ca@1671: ]. ca@1671: cg@2495: anEvent isButtonPressEvent ifTrue:[ cg@2495: |button application| cg@2495: ca@1674: button := anEvent button. ca@1674: ca@1674: (button == 1 or:[button == #select]) ifTrue:[ ca@1674: p := Point x:(anEvent x) y:(anEvent y). ca@1674: p := device translatePoint:p fromView:evView toView:self. ca@1674: ca@1674: self selection:(self findObjectAt:p). ca@1674: ca@1674: selection notNil ifTrue:[ ca@2201: lastClickPoint := p. ca@1674: ] ca@1674: ] ifFalse:[ ca@1674: (menuSelector notNil and:[(application := self application) notNil]) ifTrue:[ ca@1674: MessageNotUnderstood catch:[ ca@1674: application aspectFor:menuSelector ca@1674: ] ca@1671: ] ca@1671: ]. ca@1671: ^ true ca@1671: ]. ca@1671: ca@1671: ^ true ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette methodsFor:'focus handling'! ca@2201: ca@2201: subviewsInFocusOrder ca@2201: "returns none views - focus not handled within buildin canvas" ca@2201: ca@2201: ^ #() ca@2201: ! ! ca@2201: cg@2563: !UIGalleryView::Palette methodsFor:'initialization'! ca@181: ca@2200: destroy ca@2200: |winGrp| ca@2200: ca@2200: winGrp := self windowGroup. ca@2200: winGrp notNil ifTrue:[ ca@2200: winGrp removePreEventHook:self. ca@2200: ]. ca@2200: super destroy. ca@2200: ! ca@2200: ca@181: initialize ca@181: super initialize. ca@1674: clientSpecHolder := nil asValue. ca@1675: hiddenCounter := 0. ca@2200: showBorders := true. cg@1128: ! cg@1128: ca@1671: realize ca@2200: |winGrp| ca@2200: ca@1671: super realize. ca@2200: winGrp := self windowGroup. ca@2200: winGrp notNil ifTrue:[ ca@2200: winGrp addPreEventHook:self. ca@2200: ]. ca@1671: ! ! ca@1671: cg@2563: !UIGalleryView::Palette methodsFor:'searching'! ca@181: ca@1674: findObjectAt:aPoint cg@2495: |seeIfWidgetIsHit p x y| ca@181: cg@2495: seeIfWidgetIsHit := cg@2495: [:v | cg@2495: p := device translatePoint:aPoint fromView:self toView:v. cg@2495: x := p x. cg@2495: y := p y. ca@181: cg@2495: ( x >= 0 and:[x <= v width cg@2495: and:[y >= 0 and:[y <= v height cg@2495: and:[(self findSpecFor:v) notNil]]]] cg@2495: ) ifTrue:[ cg@2495: ^ v cg@2495: ] cg@2495: ]. cg@239: cg@2495: subViews notNil ifTrue:[ subViews do:seeIfWidgetIsHit ]. cg@2495: components notNil ifTrue:[ components do:seeIfWidgetIsHit ]. ca@1671: ^ nil ca@181: ! ca@181: cg@2495: findSpecFor:aWidget cg@2495: "returns the spec which is assigned to aWidget or nil" cg@2495: cg@239: |name| ca@181: cg@2495: aWidget notNil ifTrue:[ cg@2495: name := aWidget name. ca@181: cg@1127: specification do:[:aSpec| ca@1674: (aSpec notNil and:[aSpec name = name]) ifTrue:[ cg@2502: aSpec canUIDrag ifFalse:[^ nil ]. cg@2502: ^ aSpec cg@1127: ] cg@1127: ] ca@181: ]. ca@181: ^ nil ca@181: cg@1127: "Modified: / 18.5.1999 / 14:47:25 / cg" ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette methodsFor:'selection'! ca@181: ca@181: handlesOf:aComponent do:aOneArgBlock cg@2534: "evaluate the block on each handle; the argument to the block is a rectangle" cg@2534: cg@2534: |ext| cg@2534: cg@2561: ext := 8@8. cg@2534: ca@181: aComponent notNil ifTrue:[ cg@2561: aOneArgBlock value:(aComponent origin - (3@3) extent:ext). cg@2561: aOneArgBlock value:(aComponent corner - (2@2) extent:ext). cg@2561: aOneArgBlock value:(aComponent topRight - (2@3) extent:ext). cg@2561: aOneArgBlock value:(aComponent bottomLeft - (3@2) extent:ext). cg@2561: aOneArgBlock value:(aComponent leftCenter rounded - (3@0) extent:ext). cg@2561: aOneArgBlock value:(aComponent rightCenter rounded - (2@0) extent:ext). cg@2561: aOneArgBlock value:(aComponent topCenter rounded - (0@3) extent:ext). cg@2561: aOneArgBlock value:(aComponent bottomCenter rounded - (0@2) extent:ext). ca@181: ] ca@181: ! ca@181: ca@1675: redrawSelection cg@2495: "redraw all items selected" cg@2495: ca@1675: (shown and:[selection notNil and:[hiddenCounter == 0]]) ifTrue:[ ca@1675: self clippedByChildren:false. ca@181: ca@1675: self handlesOf:selection do:[:aRectangle| cg@2534: self paint:Color black. cg@2534: self fillRectangle:aRectangle. cg@2534: cg@2534: self paint:Color white. cg@2561: self displayRectangle:(aRectangle insetBy:0). ca@1675: ]. ca@1675: self clippedByChildren:true. ca@1671: ]. ca@1671: ! ca@1671: ca@1674: selection:aView cg@2495: "selection changed" cg@2495: ca@1671: |spec| ca@1671: ca@1674: selection == aView ifTrue:[^ self]. ca@1671: cg@2495: self withSelectionHiddenDo:[ ca@1675: spec := self findSpecFor:aView. cg@2502: cg@2495: selection := (spec isNil) ifTrue:[nil] ifFalse:[aView]. ca@1675: clientSpecHolder value:spec. ca@1675: ]. ca@1675: ! ca@1675: cg@2495: withSelectionHiddenDo:aOneArgBlock cg@2502: [ cg@2502: |r forceExpose| cg@2502: cg@2495: hiddenCounter := hiddenCounter + 1. ca@1675: hiddenCounter == 1 ifTrue:[ ca@1675: (shown and:[selection notNil]) ifTrue:[ ca@1675: self clippedByChildren:false. ca@1675: ca@1675: self handlesOf:selection do:[:aRectangle| cg@2495: self clearRectangle:aRectangle. cg@2495: self invalidateRectangle:aRectangle repairNow:false. ca@1675: ]. ca@1675: self clippedByChildren:true. ca@1671: ca@1675: r := selection bounds. cg@2502: cg@2502: forceExpose := cg@2502: [:sv| cg@2495: |absOrg absFrame| ca@1675: cg@2502: (sv bounds intersects:r) ifTrue:[ cg@2502: sv isView ifTrue:[ cg@2502: sv borderColor:(Color white). "/ kludge to force a redraw cg@2502: sv borderColor:(Color black). ca@1671: cg@2502: sv withAllSubViewsDo:[:v| cg@2502: v realized ifTrue:[ cg@2502: v fill:v viewBackground. cg@2502: v exposeX:0 y:0 width:v width height:v height. cg@2502: ] cg@2495: ] cg@2502: ] ifFalse:[ cg@2502: sv invalidate. cg@2502: ]. ca@1675: ] cg@2502: ]. cg@2502: cg@2502: (subViews ? #()) do:forceExpose. cg@2502: (components ? #()) do:forceExpose. ca@1675: ]. ca@1675: ]. cg@2502: self repairDamage. "/ ensure that any outstanding clear/redraw of the unselect are done before ca@1675: aOneArgBlock value. ca@1675: ] ensure:[ cg@2495: self repairDamage. "/ ensure that any outstanding clear/redraw of the unselect are done before cg@2495: ca@1675: hiddenCounter := hiddenCounter - 1. ca@1675: self redrawSelection. ca@1675: ]. ca@181: ! ! ca@181: cg@2563: !UIGalleryView::Palette::DropSpec class methodsFor:'instance creation'! ca@181: cg@2495: for:aWidget specification:aSpec cg@2495: "create drop object for a widget derived from a specification" cg@2495: cg@2495: |point extent rootView device inst displayObject view| ca@181: cg@2495: device := aWidget device. cg@1501: rootView := device rootView. cg@2495: extent := aWidget extent. cg@2495: aWidget isView ifTrue:[ cg@2495: view := aWidget. cg@2495: point := device translatePoint:0@0 fromView:aWidget toView:rootView. cg@2495: ] ifFalse:[ cg@2495: view := aWidget container. cg@2495: point := device translatePoint:(aWidget origin) fromView:view toView:rootView. cg@2495: ]. ca@181: (point x > 0 and:[point y > 0]) ifTrue:[ cg@1501: point := point + extent. cg@1501: (point x < rootView width and:[point y < rootView height]) ifTrue:[ cg@2495: aWidget topView raise. cg@1568: device flush. cg@2495: aWidget invalidate. cg@2495: aWidget windowGroup processExposeEvents. cg@2495: displayObject := Image fromView:aWidget grab:false. cg@1501: ] ca@181: ]. ca@806: displayObject isNil ifTrue:[ cg@1501: displayObject := Form extent:extent depth:1. cg@1501: displayObject colorMap:(Array with:Color white with:Color black). cg@1501: displayObject fill:(Color colorId:0). cg@1501: displayObject paint:(Color colorId:1). cg@2495: displayObject displayRectangleX:0 y:0 width:aWidget extent x height:aWidget extent y. ca@181: ]. ca@181: aSpec class == UISubSpecification ifTrue:[ cg@1501: aSpec layout:(LayoutOrigin fromPoint:0@0) ca@181: ]. cg@240: ca@806: inst := self new. ca@806: inst displayObject:displayObject. ca@806: inst theObject:aSpec. cg@2495: ^ inst. cg@1501: cg@1501: "Modified: / 10.10.2001 / 14:03:00 / cg" ca@181: ! ! ca@181: ca@181: !UIGalleryView class methodsFor:'documentation'! ca@181: ca@181: version ca@181: ^ '$Header$' ca@181: ! !