UIGalleryView.st
author Claus Gittinger <cg@exept.de>
Tue, 14 May 2019 09:46:21 +0200
changeset 3663 9d49ecf8661a
parent 3510 7c9642b2a0e4
permissions -rw-r--r--
#UI_ENHANCEMENT by cg
class: TabListEditor class
changed:
#canvasSpec
#menu
#windowSpec
     1 "
     2  COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
     3 	      All Rights Reserved
     4 
     5  This software is furnished under a license and may be used
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    11 "
    12 "{ Package: 'stx:libtool2' }"
    13 
    14 "{ NameSpace: Smalltalk }"
    15 
    16 NoteBookView subclass:#UIGalleryView
    17 	instanceVariableNames:'majorKey minorKeys minorKeysHolder'
    18 	classVariableNames:''
    19 	poolDictionaries:''
    20 	category:'Interface-UIPainter'
    21 !
    22 
    23 View subclass:#Palette
    24 	instanceVariableNames:'clientSpecHolder selection specification lastClickPoint
    25 		menuSelector uiBuilder hiddenCounter showBorders
    26 		didWarnAboutUnknownSpecs'
    27 	classVariableNames:''
    28 	poolDictionaries:''
    29 	privateIn:UIGalleryView
    30 !
    31 
    32 DropObject subclass:#DropSpec
    33 	instanceVariableNames:''
    34 	classVariableNames:''
    35 	poolDictionaries:''
    36 	privateIn:UIGalleryView::Palette
    37 !
    38 
    39 !UIGalleryView class methodsFor:'documentation'!
    40 
    41 copyright
    42 "
    43  COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
    44 	      All Rights Reserved
    45 
    46  This software is furnished under a license and may be used
    47  only in accordance with the terms of that license and with the
    48  inclusion of the above copyright notice.   This software may not
    49  be provided or otherwise made available to, or used by, any
    50  other person.  No title to or ownership of the software is
    51  hereby transferred.
    52 "
    53 
    54 
    55 !
    56 
    57 documentation
    58 "
    59     implements a selection panel, keeping widgets which could be placed
    60     into other components by drag & drop or copy @ paste. The objects
    61     which are draged/droped must be kind of UISpecification's.
    62     The UISelectionPanel used by the UIPainter is implemented in this way.
    63 
    64     [author:]
    65 	Claus Gittinger
    66 	Claus Atzkern
    67 
    68     [see also:]
    69 	UIPainter
    70 	UISelectionPanel
    71 "
    72 
    73 !
    74 
    75 examples
    76 "
    77     opens a gallery
    78 
    79 									[exBegin]
    80     |top sel|
    81 
    82     top := StandardSystemView new label:'gallery'; extent:500@300.
    83     sel := UIGalleryView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
    84 
    85     sel labels:#(    'Buttons'
    86 		     'Panels'
    87 		     'Text'
    88 		   ).
    89 
    90     sel minorKeys:#( #standardButtonToggle
    91 		     #standardPanels
    92 		     #standardText
    93 		   ).
    94 
    95     sel majorKey:UISelectionPanel.
    96     top open.
    97 									[exEnd]
    98 "
    99 ! !
   100 
   101 !UIGalleryView methodsFor:'accessing'!
   102 
   103 builder
   104     "get the builder used to setup a window from a specification (or nil in case
   105      of using a new builder)
   106     "
   107   ^ canvas builder
   108 !
   109 
   110 builder:aBuilderOrNil
   111     "set the builder used to setup a window from a specification (or nil in case
   112      of using a new builder)
   113     "
   114     canvas builder:aBuilderOrNil
   115 !
   116 
   117 canvas:aCanvas
   118     ^ self
   119 
   120 !
   121 
   122 labels:listOfLabels minorKeys:listOfMinorKeys majorKey:aMajorKey
   123     "setup for labels, selectors and class provider"
   124 
   125     self list:listOfLabels.
   126     minorKeys := listOfMinorKeys.
   127     majorKey  := aMajorKey.
   128 
   129     "Modified (comment): / 31-03-2017 / 18:06:25 / stefan"
   130 !
   131 
   132 majorKey
   133     "get the class providing the window specifications
   134     "
   135   ^ majorKey
   136 !
   137 
   138 majorKey:aKey
   139     "get the class providing the window specifications
   140     "
   141     |appl|
   142 
   143     appl := self application.
   144 
   145     appl notNil ifTrue:[
   146 	majorKey := appl resolveName:aKey
   147     ] ifFalse:[
   148 	majorKey := Smalltalk resolveName:aKey inClass:self class
   149     ].
   150     self selection:nil
   151 !
   152 
   153 minorKeys
   154     "get the list of selector keys
   155     "
   156   ^ minorKeys
   157 !
   158 
   159 minorKeys:aListOfSelectors
   160     "set the list of selectors
   161     "
   162     minorKeys := aListOfSelectors.
   163     self selection:nil.
   164 !
   165 
   166 showBorders:aBoolean
   167     "show borders around dragable objects"
   168 
   169     canvas showBorders:aBoolean.
   170 ! !
   171 
   172 !UIGalleryView methodsFor:'accessing-color & font'!
   173 
   174 viewBackground:aColor
   175     canvas notNil ifTrue:[
   176         canvas viewBackground:aColor.
   177     ].
   178     ^ super viewBackground:aColor
   179 ! !
   180 
   181 !UIGalleryView methodsFor:'accessing-holders'!
   182 
   183 clientSpecHolder
   184     "get the holder which keeps the current selection or in case of
   185      no selection the specification under the cursor
   186     "
   187   ^ canvas clientSpecHolder
   188 !
   189 
   190 clientSpecHolder:aHolder
   191     "set the holder which keeps the current selection or in case of
   192      no selection the specification under the cursor
   193     "
   194     canvas clientSpecHolder:aHolder
   195 !
   196 
   197 menuSelector
   198     ^ canvas menuSelector
   199 !
   200 
   201 menuSelector:aSelector
   202     ^ canvas menuSelector:aSelector
   203 !
   204 
   205 minorKeysHolder
   206     "get the holder keeping the minor keys; the selectors to access
   207      specifications from a class associated with the majorKey.
   208     "
   209   ^ minorKeysHolder
   210 !
   211 
   212 minorKeysHolder:aValueHolder
   213     "set the holder keeping the minor keys; the selectors to access
   214      specifications from a class associated with the majorKey.
   215     "
   216     minorKeysHolder notNil ifTrue:[
   217 	minorKeysHolder removeDependent:self. 
   218     ].
   219 
   220     (minorKeysHolder := aValueHolder) notNil ifTrue:[
   221 	minorKeysHolder addDependent:self.
   222     ].
   223     self minorKeys:(minorKeysHolder value)
   224 ! !
   225 
   226 !UIGalleryView methodsFor:'change & update'!
   227 
   228 selectionHasChanged
   229     "selection changed
   230     "
   231     |specification selector selection application|
   232 
   233     selection := self listIndexOf:(self selection).
   234 
   235     minorKeysHolder notNil ifTrue:[
   236         minorKeys := minorKeysHolder value.
   237     ].
   238     (selection notNil and:[minorKeys size >= selection]) ifTrue:[
   239         selector := minorKeys at:selection.
   240 
   241         (majorKey respondsTo:selector) ifTrue:[
   242             specification := majorKey perform:selector
   243         ] ifFalse:[
   244             (application := self application) notNil ifTrue:[
   245                 MessageNotUnderstood handle:[:ex|
   246                     (application class respondsTo:selector) ifTrue:[
   247                         specification := application class perform:selector
   248                     ]
   249                 ] do:[
   250                     specification := application aspectFor:selector
   251                 ]
   252             ]
   253         ]
   254     ].
   255 "/    self withWaitCursorDo:[
   256         [
   257             canvas specification:specification.
   258         ] on:NotFoundError do:[:ex|
   259             Transcript showCR:ex description.
   260             ex proceed.
   261         ]
   262 "/    ]
   263 !
   264 
   265 update
   266     self selectionHasChanged.
   267 !
   268 
   269 update:something with:aParameter from:changedObject
   270     "one of my models changed its value
   271     "
   272     changedObject == minorKeysHolder ifTrue:[
   273         ^ self minorKeys:( minorKeysHolder value)
   274     ].
   275     super update:something with:aParameter from:changedObject.
   276 
   277 ! !
   278 
   279 !UIGalleryView methodsFor:'initialization & release'!
   280 
   281 initialize
   282     "setup default attributes
   283     "
   284     canvas := Palette in:self.
   285 
   286     super initialize.
   287 
   288     self action:[:something| self selectionHasChanged ].
   289 !
   290 
   291 release
   292     minorKeysHolder notNil ifTrue:[
   293         minorKeysHolder removeDependent:self. 
   294         minorKeysHolder := nil.
   295     ].
   296     super release.
   297 ! !
   298 
   299 !UIGalleryView::Palette class methodsFor:'documentation'!
   300 
   301 documentation
   302 "
   303     I am the palette of a gallery. Most of what I do is to allow dragging of a widget out
   304     of myself and to care for the drawing of the selection.
   305     The arrangement into multiple pages is done by my container, which holds me
   306     in a subcanvas.
   307 "
   308 ! !
   309 
   310 !UIGalleryView::Palette methodsFor:'accessing'!
   311 
   312 builder
   313     "get the builder used to setup a window from a specification (or nil in case
   314      of using a new builder)
   315     "
   316   ^ uiBuilder
   317 !
   318 
   319 builder:something
   320     "set the builder used to setup a window from a specification (or nil in case
   321      of using a new builder)
   322     "
   323     uiBuilder := something.
   324 !
   325 
   326 clientSpecHolder
   327     "get the holder which keeps the current selection or in case of
   328      no selection the specification under the cursor
   329     "
   330     ^ clientSpecHolder
   331 !
   332 
   333 clientSpecHolder:aHolder
   334     "set the holder which keeps the current selection or in case of
   335      no selection the specification under the cursor
   336     "
   337     |spec|
   338 
   339     spec := clientSpecHolder value.
   340 
   341     aHolder notNil ifTrue:[ clientSpecHolder := aHolder ]
   342                   ifFalse:[ clientSpecHolder := nil asValue ].
   343 
   344     clientSpecHolder value:spec.
   345 !
   346 
   347 menuSelector
   348     "return the value of the instance variable 'menuSelector' (automatically generated)"
   349 
   350     ^ menuSelector
   351 !
   352 
   353 menuSelector:something
   354     "set the value of the instance variable 'menuSelector' (automatically generated)"
   355 
   356     menuSelector := something.
   357 !
   358 
   359 showBorders:aBoolean
   360     showBorders := aBoolean.
   361 !
   362 
   363 specification
   364     "get current specification
   365     "
   366     ^ specification
   367 !
   368 
   369 specification:aSpecOrSpecArray
   370     "set a new specification"
   371 
   372     |builder newSpec|
   373 
   374     self selection:nil.
   375     self destroySubViews.
   376 
   377     specification := nil.
   378     aSpecOrSpecArray isNil ifTrue:[^ self].
   379 
   380     "/ only warn once - otherwise, its annoying
   381     MissingClassInLiteralArrayErrorSignal handle:[:ex |
   382         didWarnAboutUnknownSpecs == true ifFalse:[
   383             Dialog warn:(ex description,'\\(Will not warn again - please check for unloaded classes/packages)' withCRs).
   384         ].
   385         didWarnAboutUnknownSpecs := true.
   386         ex proceed.
   387     ] do:[
   388         newSpec := UISpecification from:aSpecOrSpecArray.
   389     ].
   390     newSpec isNil ifTrue:[^ self].
   391     (newSpec respondsTo:#'buildViewFor:in:') ifFalse:[^ self].
   392     specification := newSpec.
   393 
   394     (builder := uiBuilder) isNil ifTrue:[
   395         builder := UIBuilder new isEditing:true.
   396         builder showDefaults:true.
   397         builder application:self application. "/ for resources like images
   398     ].
   399 
   400     specification buildViewFor:builder in:self.
   401 
   402     "/ components notEmptyOrNil ifTrue:[ self halt ].
   403     subViews size ~~ 0 ifTrue:[
   404         showBorders ifTrue:[
   405             subViews do:[:v|
   406                 (self findSpecFor:v) notNil ifTrue:[
   407                     v borderWidth:1
   408                 ].
   409             ].
   410         ].
   411         realized ifTrue:[ self realizeAllSubViews ].
   412     ].
   413 ! !
   414 
   415 !UIGalleryView::Palette methodsFor:'building'!
   416 
   417 recursiveBuildSpecFromSpecPrototype:aSpec
   418     "build spec out of spec prototype"
   419 
   420     |spec comp coll|
   421 
   422     (aSpec notNil and:[aSpec canUIDrag]) ifFalse:[
   423         ^ nil
   424     ].
   425 
   426     spec := aSpec copy.
   427     (aSpec class supportsSubComponents and:[aSpec component notNil]) ifFalse:[
   428         ^ spec
   429     ].
   430     comp := aSpec component.
   431     spec component:nil.
   432 
   433     comp canUIDrag ifFalse:[
   434         ^ spec
   435     ].
   436     coll := OrderedCollection new.
   437 
   438     comp do:[:anEntry|
   439         |spc|
   440 
   441         (spc := self recursiveBuildSpecFromSpecPrototype:anEntry) notNil ifTrue:[
   442             coll add:spc
   443         ]
   444     ].
   445     coll isEmpty ifTrue:[
   446         ^ spec
   447     ].
   448     comp := comp copy.
   449     comp collection:coll.
   450     spec component:comp.
   451     ^ spec
   452 ! !
   453 
   454 !UIGalleryView::Palette methodsFor:'drag & drop'!
   455 
   456 startDragFrom:evView
   457     "start drag at lastClickPoint"
   458 
   459     |spec dragObj offset clickPos dragAndDropManager|
   460 
   461     clickPos := lastClickPoint.
   462     clickPos isNil ifTrue:[^ self].
   463     lastClickPoint := nil.
   464 
   465     spec := clientSpecHolder value.
   466     spec isNil ifTrue:[^ self].
   467 
   468     self withSelectionHiddenDo:[
   469         spec := self recursiveBuildSpecFromSpecPrototype:spec.
   470         spec name:nil.
   471 
   472         dragObj := DropSpec for:selection specification:spec.
   473         offset  := clickPos - selection origin.
   474     ].
   475 
   476     dragAndDropManager := DragAndDropManager new.
   477     dragAndDropManager giveFocusToTargetWidget:false.
   478 
   479     dragAndDropManager 
   480         startDrag:dragObj
   481         from:self
   482         offset:offset
   483         atEnd:nil
   484         display:nil.
   485 ! !
   486 
   487 !UIGalleryView::Palette methodsFor:'event handling'!
   488 
   489 processEvent:anEvent
   490     "filter keyboard events.
   491      Return true, if I have eaten the event"
   492 
   493     |evView p|
   494 
   495     evView := anEvent view.
   496     evView isNil ifTrue:[ ^ false ].
   497     (evView ~~ self and:[ (evView isComponentOf:self) not ]) ifTrue:[ ^ false ].
   498 
   499     (anEvent isButtonPressEvent or:[anEvent isButtonReleaseEvent])ifTrue:[
   500         lastClickPoint := nil.
   501     ].
   502     anEvent isButtonEvent ifFalse:[
   503         anEvent isInputEvent ifTrue:[^ true].
   504 
   505         anEvent isDamage ifTrue:[ self redrawSelection ].
   506         ^ false
   507     ].
   508 
   509     anEvent isButtonReleaseEvent ifTrue:[ ^ true ].
   510 
   511     anEvent isButtonMotionEvent ifTrue:[
   512         (lastClickPoint notNil and:[anEvent state ~~ 0]) ifTrue:[
   513             p := Point x:(anEvent x) y:(anEvent y).
   514             p := device translatePoint:p fromView:evView toView:self.
   515 
   516             (lastClickPoint dist:p) > 20.0 ifTrue:[
   517                 self startDragFrom:evView.
   518                 lastClickPoint := nil.
   519             ]
   520         ].
   521         ^ true
   522     ].
   523 
   524     anEvent isButtonPressEvent ifTrue:[
   525         |button application|
   526 
   527         button := anEvent button.
   528 
   529         (button == 1 or:[button == #select]) ifTrue:[
   530             p := Point x:(anEvent x) y:(anEvent y).
   531             p := device translatePoint:p fromView:evView toView:self.
   532 
   533             self selection:(self findObjectAt:p).
   534 
   535             selection notNil ifTrue:[
   536                 lastClickPoint := p.
   537             ]
   538         ] ifFalse:[
   539             (menuSelector notNil and:[(application := self application) notNil]) ifTrue:[
   540                 MessageNotUnderstood catch:[
   541                     application aspectFor:menuSelector
   542                 ]
   543             ]
   544         ].
   545         ^ true
   546     ].
   547 
   548     ^ true
   549 ! !
   550 
   551 !UIGalleryView::Palette methodsFor:'focus handling'!
   552 
   553 subviewsInFocusOrder
   554     "returns none views - focus not handled within buildin canvas"
   555 
   556     ^ #()
   557 ! !
   558 
   559 !UIGalleryView::Palette methodsFor:'initialization'!
   560 
   561 destroy
   562     |winGrp|
   563 
   564     winGrp := self windowGroup.
   565     winGrp notNil ifTrue:[
   566         winGrp removePreEventHook:self.
   567     ].
   568     super destroy.
   569 !
   570 
   571 initialize
   572     super initialize.
   573     clientSpecHolder := nil asValue.
   574     hiddenCounter := 0.
   575     showBorders := true.
   576 !
   577 
   578 realize
   579     |winGrp|
   580 
   581     super realize.
   582     winGrp := self windowGroup.
   583     winGrp notNil ifTrue:[
   584         winGrp addPreEventHook:self.
   585    ].
   586 ! !
   587 
   588 !UIGalleryView::Palette methodsFor:'searching'!
   589 
   590 findObjectAt:aPoint
   591     |seeIfWidgetIsHit p x y|
   592 
   593     seeIfWidgetIsHit := 
   594         [:v |
   595             p := device translatePoint:aPoint fromView:self toView:v.
   596             x := p x.
   597             y := p y.
   598 
   599             (     x >= 0 and:[x <= v width
   600              and:[y >= 0 and:[y <= v height
   601              and:[(self findSpecFor:v) notNil]]]]
   602             ) ifTrue:[
   603                 ^ v
   604             ]
   605         ].
   606 
   607     subViews notNil ifTrue:[ subViews do:seeIfWidgetIsHit ].
   608     components notNil ifTrue:[ components do:seeIfWidgetIsHit ].
   609     ^ nil
   610 !
   611 
   612 findSpecFor:aWidget
   613     "returns the spec which is assigned to aWidget or nil"
   614 
   615     |name|
   616 
   617     aWidget notNil ifTrue:[
   618         name := aWidget name.
   619 
   620         specification do:[:aSpec|
   621             (aSpec notNil and:[aSpec name = name]) ifTrue:[
   622                 aSpec canUIDrag ifFalse:[^ nil ].
   623                 ^ aSpec
   624             ]
   625         ]
   626     ].
   627     ^ nil
   628 
   629     "Modified: / 18.5.1999 / 14:47:25 / cg"
   630 ! !
   631 
   632 !UIGalleryView::Palette methodsFor:'selection'!
   633 
   634 handlesOf:aComponent do:aOneArgBlock
   635     "evaluate the block on each handle; the argument to the block is a rectangle"
   636 
   637     |ext|
   638 
   639     ext := 8@8.
   640 
   641     aComponent notNil ifTrue:[
   642         aOneArgBlock value:(aComponent origin       - (3@3) extent:ext).
   643         aOneArgBlock value:(aComponent corner       - (2@2) extent:ext).
   644         aOneArgBlock value:(aComponent topRight     - (2@3) extent:ext).
   645         aOneArgBlock value:(aComponent bottomLeft   - (3@2) extent:ext).
   646         aOneArgBlock value:(aComponent leftCenter rounded   - (3@0) extent:ext).
   647         aOneArgBlock value:(aComponent rightCenter rounded  - (2@0) extent:ext).
   648         aOneArgBlock value:(aComponent topCenter rounded    - (0@3) extent:ext).
   649         aOneArgBlock value:(aComponent bottomCenter rounded - (0@2) extent:ext).
   650     ]
   651 !
   652 
   653 redrawSelection
   654     "redraw all items selected"
   655 
   656     (shown and:[selection notNil and:[hiddenCounter == 0]]) ifTrue:[
   657         gc clippedByChildren:false.
   658 
   659         self handlesOf:selection do:[:aRectangle|
   660             gc paint:self blackColor.
   661             gc fillRectangle:aRectangle.
   662 
   663             gc paint:self whiteColor.
   664             gc displayRectangle:(aRectangle insetBy:0).
   665         ].
   666         gc clippedByChildren:true.
   667     ].
   668 !
   669 
   670 selection:aView
   671     "selection changed"
   672 
   673     |spec|
   674 
   675     selection == aView ifTrue:[^ self].
   676 
   677     self withSelectionHiddenDo:[
   678         spec := self findSpecFor:aView.
   679 
   680         selection := (spec isNil) ifTrue:[nil] ifFalse:[aView].
   681         clientSpecHolder value:spec.
   682     ].
   683 !
   684 
   685 withSelectionHiddenDo:aOneArgBlock
   686     [ 
   687         |r forceExpose|
   688         
   689         hiddenCounter :=  hiddenCounter + 1.
   690         hiddenCounter == 1 ifTrue:[
   691             (shown and:[selection notNil]) ifTrue:[
   692                 gc clippedByChildren:false.
   693 
   694                 self handlesOf:selection do:[:aRectangle|
   695                     self clearRectangle:aRectangle.
   696                     self invalidateRectangle:aRectangle repairNow:false.
   697                 ].
   698                 gc clippedByChildren:true.
   699 
   700                 r := selection bounds.
   701 
   702                 forceExpose := 
   703                     [:sv|
   704                         |absOrg absFrame|
   705 
   706                         (sv bounds intersects:r) ifTrue:[   
   707                             sv isView ifTrue:[
   708                                 "/ kludge to force a redraw
   709                                 sv borderColor:(self whiteColor). 
   710                                 sv borderColor:(self blackColor).
   711 
   712                                 sv withAllSubViewsDo:[:v|
   713                                     v realized ifTrue:[
   714                                         v fill:v viewBackground.
   715                                         v exposeX:0 y:0 width:v width height:v height.
   716                                     ]
   717                                 ]
   718                             ] ifFalse:[
   719                                 sv invalidate.
   720                             ].
   721                         ]
   722                     ].
   723 
   724                 (subViews ? #()) do:forceExpose.
   725                 (components ? #()) do:forceExpose.
   726             ].
   727         ].
   728         self repairDamage.  "/ ensure that any outstanding clear/redraw of the unselect are done before
   729         aOneArgBlock value.
   730     ] ensure:[
   731         self repairDamage.  "/ ensure that any outstanding clear/redraw of the unselect are done before
   732 
   733         hiddenCounter := hiddenCounter - 1.
   734         self redrawSelection.
   735     ].
   736 ! !
   737 
   738 !UIGalleryView::Palette::DropSpec class methodsFor:'instance creation'!
   739 
   740 for:aWidget specification:aSpec
   741     "create drop object for a widget derived from a specification"
   742 
   743     |point extent rootView widgetsDevice inst displayObject view|
   744 
   745     widgetsDevice   := aWidget device.
   746     rootView := widgetsDevice rootView.
   747     extent   := aWidget extent.
   748     aWidget isView ifTrue:[
   749         view := aWidget.
   750         point := widgetsDevice translatePoint:0@0 fromView:aWidget toView:rootView.
   751     ] ifFalse:[
   752         view := aWidget container.
   753         point := widgetsDevice translatePoint:(aWidget origin) fromView:view toView:rootView.
   754     ].
   755     (point x > 0 and:[point y > 0]) ifTrue:[
   756         point := point + extent.
   757         (point x < rootView width and:[point y < rootView height]) ifTrue:[
   758             aWidget topView raise.
   759             widgetsDevice flush.
   760             aWidget invalidate.
   761             aWidget windowGroup processExposeEvents.
   762             displayObject := Image fromView:aWidget grab:false.
   763         ]
   764     ].
   765     displayObject isNil ifTrue:[
   766         displayObject := Form extent:extent depth:1.
   767         displayObject colorMap:(Array with:Color white with:Color black).
   768         displayObject fill:(Color colorId:0).
   769         displayObject paint:(Color colorId:1).
   770         displayObject displayRectangleX:0 y:0 width:aWidget extent x height:aWidget extent y.
   771     ].
   772     aSpec class == UISubSpecification ifTrue:[
   773         aSpec layout:(LayoutOrigin fromPoint:0@0)
   774     ].
   775 
   776     inst := self new.
   777     inst displayObject:displayObject.
   778     inst theObject:aSpec.
   779     ^ inst.
   780 
   781     "Modified: / 10.10.2001 / 14:03:00 / cg"
   782 ! !
   783 
   784 !UIGalleryView class methodsFor:'documentation'!
   785 
   786 version
   787     ^ '$Header$'
   788 !
   789 
   790 version_CVS
   791     ^ '$Header$'
   792 ! !
   793