UIBuilder.st
changeset 270 229eb729da57
parent 223 b65dc250db8d
child 344 42ae71c13eef
equal deleted inserted replaced
269:6c70d392634b 270:229eb729da57
   302 self halt.
   302 self halt.
   303 "
   303 "
   304 !
   304 !
   305 
   305 
   306 yDefaultable:args view:aView frame:frameView
   306 yDefaultable:args view:aView frame:frameView
   307     'defaultable ignored' printNL
   307     'defaultable ignored' printCR
       
   308 
       
   309     "Modified: 20.5.1996 / 10:29:24 / cg"
   308 !
   310 !
   309 
   311 
   310 yFlags:args view:aView frame:frameView
   312 yFlags:args view:aView frame:frameView
   311     'flags: ' print. args print. ' for ' print. aView print. ' ignored' printNL
   313     'flags: ' print. args print. ' for ' print. aView print. ' ignored' printCR
   312 "
   314 "
   313 32 : initially disabled
   315 32 : initially disabled
   314 16 : initially invisible
   316 16 : initially invisible
   315  8 : border
   317  8 : border
   316  4 : menuBar
   318  4 : menuBar
   317  2 : hScroll
   319  2 : hScroll
   318  1 : vScroll
   320  1 : vScroll
   319 "
   321 "
   320 
   322 
   321     "Modified: 2.9.1995 / 15:44:15 / claus"
   323     "Modified: 2.9.1995 / 15:44:15 / claus"
       
   324     "Modified: 20.5.1996 / 10:29:26 / cg"
   322 !
   325 !
   323 
   326 
   324 yIsDefault:args view:aView frame:frameView
   327 yIsDefault:args view:aView frame:frameView
   325     aView isReturnButton:args
   328     aView isReturnButton:args
   326 !
   329 !
   327 
   330 
   328 yIsOpaque:args view:aView frame:frameView
   331 yIsOpaque:args view:aView frame:frameView
   329     'isOpaque ignored' printNL.
   332     'isOpaque ignored' printCR.
       
   333 
       
   334     "Modified: 20.5.1996 / 10:29:29 / cg"
   330 !
   335 !
   331 
   336 
   332 yIsReadOnly:args view:aView frame:frameView
   337 yIsReadOnly:args view:aView frame:frameView
   333     args ifTrue:[
   338     args ifTrue:[
   334 	aView readOnly
   339 	aView readOnly
   338 yLayout:args view:aView frame:frameView
   343 yLayout:args view:aView frame:frameView
   339     |value r org corn orgInset cornInset what|
   344     |value r org corn orgInset cornInset what|
   340 
   345 
   341     value := self getArg:args.
   346     value := self getArg:args.
   342     value isLayout ifTrue:[
   347     value isLayout ifTrue:[
   343 	frameView geometryLayout:value.
   348         frameView geometryLayout:value.
   344 	^ self
   349         ^ self
   345     ].
   350     ].
   346 
   351 
   347     what := value at:1.
   352     what := value at:1.
   348     what == #point ifTrue:[
   353     what == #point ifTrue:[
   349 	Verbose ifTrue:[frameView print. ' ' print. 'origin: ' print. (value at:2) printNL].
   354         Verbose ifTrue:[frameView print. ' ' print. 'origin: ' print. (value at:2) printCR].
   350 	frameView origin:(value at:2).
   355         frameView origin:(value at:2).
   351 	^ self
   356         ^ self
   352     ].
   357     ].
   353     what == #rectangle ifTrue:[
   358     what == #rectangle ifTrue:[
   354 	r := value at:2.
   359         r := value at:2.
   355 	Verbose ifTrue:[
   360         Verbose ifTrue:[
   356 	    frameView print. ' ' print. 'origin: ' print. r origin print.
   361             frameView print. ' ' print. 'origin: ' print. r origin print.
   357 			     ' corner: ' print. r corner printNL.
   362                              ' corner: ' print. r corner printCR.
   358 	].
   363         ].
   359 	frameView origin:r origin corner:r corner.
   364         frameView origin:r origin corner:r corner.
   360 	^ self
   365         ^ self
   361     ].
   366     ].
   362     what == #layoutOrigin ifTrue:[
   367     what == #layoutOrigin ifTrue:[
   363 	"/ #layoutOrigin relOrg orgInset
   368         "/ #layoutOrigin relOrg orgInset
   364 	org := value at:2.       "/ relative origin
   369         org := value at:2.       "/ relative origin
   365 	org := org x asFloat @ org y asFloat.
   370         org := org x asFloat @ org y asFloat.
   366 	orgInset := self fixExtentFor:(value at:3).
   371         orgInset := self fixExtentFor:(value at:3).
   367 	Verbose ifTrue:[
   372         Verbose ifTrue:[
   368 	    frameView print. ' ' print. 'origin: ' print. org printNL
   373             frameView print. ' ' print. 'origin: ' print. org printCR
   369 	].
   374         ].
   370 	frameView origin:org.
   375         frameView origin:org.
   371 	frameView 
   376         frameView 
   372 	      leftInset:orgInset x;
   377               leftInset:orgInset x;
   373 	      topInset:orgInset y.
   378               topInset:orgInset y.
   374 	^ self
   379         ^ self
   375     ].
   380     ].
   376     what == #layoutFrame ifTrue:[
   381     what == #layoutFrame ifTrue:[
   377 	"/ #layoutFrame orgInset cornInset relOrg relCorner
   382         "/ #layoutFrame orgInset cornInset relOrg relCorner
   378 
   383 
   379 	org := value at:4.       "/ relative origin
   384         org := value at:4.       "/ relative origin
   380 	orgInset := self fixExtentFor:(value at:2).
   385         orgInset := self fixExtentFor:(value at:2).
   381 
   386 
   382 	org := org x asFloat @ org y asFloat.
   387         org := org x asFloat @ org y asFloat.
   383 "/        org = (0@0) ifTrue:[
   388 "/        org = (0@0) ifTrue:[
   384 "/            org := value at:2    "/ absolute origin
   389 "/            org := value at:2    "/ absolute origin
   385 "/        ].
   390 "/        ].
   386 
   391 
   387 	corn := value at:5.      "/ relative corner
   392         corn := value at:5.      "/ relative corner
   388 	cornInset := self fixExtentFor:(value at:3).
   393         cornInset := self fixExtentFor:(value at:3).
   389 	corn := corn x asFloat @ corn y asFloat.
   394         corn := corn x asFloat @ corn y asFloat.
   390 "/        corn = (0@0) ifTrue:[
   395 "/        corn = (0@0) ifTrue:[
   391 "/            corn := value at:3   "/ absolute corner
   396 "/            corn := value at:3   "/ absolute corner
   392 "/        ].
   397 "/        ].
   393 	Verbose ifTrue:[
   398         Verbose ifTrue:[
   394 	    frameView print. ' ' print. 'origin: ' print. org print.
   399             frameView print. ' ' print. 'origin: ' print. org print.
   395 			     ' corner: ' print. corn printNL.
   400                              ' corner: ' print. corn printCR.
   396 	].
   401         ].
   397 	frameView origin:org corner:corn.
   402         frameView origin:org corner:corn.
   398 	frameView leftInset:orgInset x;
   403         frameView leftInset:orgInset x;
   399 	      topInset:orgInset y;
   404               topInset:orgInset y;
   400 	      rightInset:cornInset x negated;
   405               rightInset:cornInset x negated;
   401 	      bottomInset:cornInset y negated.
   406               bottomInset:cornInset y negated.
   402 	frameView sizeFixed:true.
   407         frameView sizeFixed:true.
   403 	^ self
   408         ^ self
   404     ].
   409     ].
   405     what == #alignmentOrigin ifTrue:[
   410     what == #alignmentOrigin ifTrue:[
   406 	org := value at:3.       "/ relative origin
   411         org := value at:3.       "/ relative origin
   407 	org = (0@0) ifTrue:[
   412         org = (0@0) ifTrue:[
   408 	    org := value at:2    "/ absolute origin
   413             org := value at:2    "/ absolute origin
   409 	].
   414         ].
   410 	Verbose ifTrue:[frameView print. ' ' print. 'origin: ' print. org printNL].
   415         Verbose ifTrue:[frameView print. ' ' print. 'origin: ' print. org printCR].
   411 	frameView origin:org.
   416         frameView origin:org.
   412 	^ self
   417         ^ self
   413     ].
   418     ].
   414 
   419 
   415     self halt:'unimplemented'.
   420     self halt:'unimplemented'.
       
   421 
       
   422     "Modified: 20.5.1996 / 10:29:35 / cg"
   416 !
   423 !
   417 
   424 
   418 yMax:args view:aView frame:frameView
   425 yMax:args view:aView frame:frameView
   419     |value|
   426     |value|
   420 
   427 
   467 yName:args view:aView frame:frameView
   474 yName:args view:aView frame:frameView
   468     self componentAt:args put:aView
   475     self componentAt:args put:aView
   469 !
   476 !
   470 
   477 
   471 yOrientation:args view:aView frame:frameView
   478 yOrientation:args view:aView frame:frameView
   472     'orientation ignored' printNL.
   479     'orientation ignored' printCR.
       
   480 
       
   481     "Modified: 20.5.1996 / 10:29:37 / cg"
   473 !
   482 !
   474 
   483 
   475 ySelectionStyle:args view:aView frame:frameView
   484 ySelectionStyle:args view:aView frame:frameView
   476     'selectionStyle ignored' printNL.
   485     'selectionStyle ignored' printCR.
   477 
   486 
       
   487     "Modified: 20.5.1996 / 10:29:41 / cg"
   478 !
   488 !
   479 
   489 
   480 yStart:args view:aView frame:frameView
   490 yStart:args view:aView frame:frameView
   481     (aView isKindOf:Scroller) ifTrue:[
   491     (aView isKindOf:Scroller) ifTrue:[
   482 	aView start:args.
   492         aView start:args.
   483 	^ self
   493         ^ self
   484     ].
   494     ].
   485     'start ignored' printNL.
   495     'start ignored' printCR.
       
   496 
       
   497     "Modified: 20.5.1996 / 10:29:42 / cg"
   486 !
   498 !
   487 
   499 
   488 yStep:args view:aView frame:frameView
   500 yStep:args view:aView frame:frameView
   489     'step ignored' printNL.
   501     'step ignored' printCR.
   490 
   502 
       
   503     "Modified: 20.5.1996 / 10:29:44 / cg"
   491 !
   504 !
   492 
   505 
   493 yStop:args view:aView frame:frameView
   506 yStop:args view:aView frame:frameView
   494     (aView isKindOf:Scroller) ifTrue:[
   507     (aView isKindOf:Scroller) ifTrue:[
   495 	aView stop:args.
   508         aView stop:args.
   496 	^ self
   509         ^ self
   497     ].
   510     ].
   498     'stop ignored' printNL.
   511     'stop ignored' printCR.
       
   512 
       
   513     "Modified: 20.5.1996 / 10:29:46 / cg"
   499 !
   514 !
   500 
   515 
   501 yStyle:args view:aView frame:frameView
   516 yStyle:args view:aView frame:frameView
   502     'name ignored' printNL.
   517     'name ignored' printCR.
   503 
   518 
       
   519     "Modified: 20.5.1996 / 10:29:48 / cg"
   504 !
   520 !
   505 
   521 
   506 ySubmenu:aSpec view:menu frame:frameView
   522 ySubmenu:aSpec view:menu frame:frameView
   507     |items lines selectors labels|
   523     |items lines selectors labels|
   508 
   524 
   534     "Modified: 9.12.1995 / 23:08:15 / cg"
   550     "Modified: 9.12.1995 / 23:08:15 / cg"
   535 !
   551 !
   536 
   552 
   537 yTabable:args view:aView frame:frameView
   553 yTabable:args view:aView frame:frameView
   538     args == true ifTrue:[
   554     args == true ifTrue:[
   539 	focusSequence isNil ifTrue:[
   555         focusSequence isNil ifTrue:[
   540 	    focusSequence := OrderedCollection new.
   556             focusSequence := OrderedCollection new.
   541 	].
   557         ].
   542 	focusSequence add:aView.
   558         focusSequence add:aView.
   543 	'tabable element added' printNL.
   559         'tabable element added' printCR.
   544     ]
   560     ]
       
   561 
       
   562     "Modified: 20.5.1996 / 10:29:53 / cg"
   545 !
   563 !
   546 
   564 
   547 yType:args view:aView frame:frameView
   565 yType:args view:aView frame:frameView
   548     (aView isMemberOf:EditField) ifTrue:[
   566     (aView isMemberOf:EditField) ifTrue:[
   549 	args == #number ifTrue:[
   567         args == #number ifTrue:[
   550 	    aView converter:(PrintConverter new initForNumber).
   568             aView converter:(PrintConverter new initForNumber).
   551 	    ^ self
   569             ^ self
   552 	]
   570         ]
   553     ].
   571     ].
   554 
   572 
   555     'type ignored' printNL.
   573     'type ignored' printCR.
       
   574 
       
   575     "Modified: 20.5.1996 / 10:29:55 / cg"
   556 !
   576 !
   557 
   577 
   558 yWindow:args view:aView frame:frameView
   578 yWindow:args view:aView frame:frameView
   559     self readSpec:args view:aView frame:frameView.
   579     self readSpec:args view:aView frame:frameView.
   560 ! !
   580 ! !
   789 !
   809 !
   790 
   810 
   791 xTableViewSpec:aSpec view:aView
   811 xTableViewSpec:aSpec view:aView
   792     |l|
   812     |l|
   793 
   813 
   794     'tableView ignored' printNL.
   814     'tableView ignored' printCR.
   795     l := Label label:'TableView' in:aView.
   815     l := Label label:'TableView' in:aView.
   796     l level:-1.
   816     l level:-1.
   797     self doSpec:aSpec for:l 
   817     self doSpec:aSpec for:l
       
   818 
       
   819     "Modified: 20.5.1996 / 10:29:20 / cg"
   798 !
   820 !
   799 
   821 
   800 xVerticalPanelViewSpec:aSpec view:aView
   822 xVerticalPanelViewSpec:aSpec view:aView
   801     |v|
   823     |v|
   802 
   824 
   817     self readSpec:aSpec
   839     self readSpec:aSpec
   818 !
   840 !
   819 
   841 
   820 doSingleSpec:selector args:args for:aView frame:frame
   842 doSingleSpec:selector args:args for:aView frame:frame
   821     Verbose ifTrue:[
   843     Verbose ifTrue:[
   822 	'doSingle (' print. aView print. ' -> ' print. selector print.
   844         'doSingle (' print. aView print. ' -> ' print. selector print.
   823 	' ' print. args printString printNL.
   845         ' ' print. args printString printCR.
   824     ].
   846     ].
   825 
   847 
   826     self perform:('y' , selector asString asUppercaseFirst , 'view:frame:') asSymbol 
   848     self perform:('y' , selector asString asUppercaseFirst , 'view:frame:') asSymbol 
   827 	    with:args
   849             with:args
   828 	    with:aView
   850             with:aView
   829 	    with:frame.
   851             with:frame.
   830 
   852 
       
   853     "Modified: 20.5.1996 / 10:29:17 / cg"
   831 !
   854 !
   832 
   855 
   833 doSpec:aSpec for:aView
   856 doSpec:aSpec for:aView
   834     ^ self doSpec:aSpec for:aView frame:aView
   857     ^ self doSpec:aSpec for:aView frame:aView
   835 !
   858 !
   888 ! !
   911 ! !
   889 
   912 
   890 !UIBuilder class methodsFor:'documentation'!
   913 !UIBuilder class methodsFor:'documentation'!
   891 
   914 
   892 version
   915 version
   893     ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.13 1996-04-25 16:43:47 cg Exp $'
   916     ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.14 1996-05-20 08:40:29 cg Exp $'
   894 ! !
   917 ! !
   895 UIBuilder initialize!
   918 UIBuilder initialize!