DialogBox.st
changeset 126 40228f4fd66b
parent 125 3ffa271732f7
child 128 06a050529335
equal deleted inserted replaced
125:3ffa271732f7 126:40228f4fd66b
    23 
    23 
    24 !DialogBox class methodsFor:'documentation'!
    24 !DialogBox class methodsFor:'documentation'!
    25 
    25 
    26 version
    26 version
    27 "
    27 "
    28 $Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.12 1995-05-09 01:55:09 claus Exp $
    28 $Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.13 1995-05-10 02:29:19 claus Exp $
    29 "
    29 "
    30 !
    30 !
    31 
    31 
    32 documentation
    32 documentation
    33 "
    33 "
   491 	    Transcript show:'value1: '; showCr:value1 value.
   491 	    Transcript show:'value1: '; showCr:value1 value.
   492 	    Transcript show:'value2: '; showCr:value2 value.
   492 	    Transcript show:'value2: '; showCr:value2 value.
   493 	    Transcript show:'value3: '; showCr:value3 value.
   493 	    Transcript show:'value3: '; showCr:value3 value.
   494 	    Transcript show:'value4: '; showCr:value4 value.
   494 	    Transcript show:'value4: '; showCr:value4 value.
   495 	]
   495 	]
       
   496 
       
   497 
       
   498     a full example:
       
   499 
       
   500 	|box warnSTX allowUnderscore immutableArrays logDoits
       
   501 	 listOfLanguages listOfStyles styleNames 
       
   502 	 frame panel c resourceDir dir |
       
   503 
       
   504 	warnSTX := Compiler warnSTXSpecials asValue.
       
   505 	allowUnderscore := Compiler allowUnderscoreInIdentifier asValue.
       
   506 	immutableArrays := Compiler arraysAreImmutable asValue.
       
   507 
       
   508 	logDoits := Smalltalk logDoits asValue.
       
   509 
       
   510 	listOfLanguages := SelectionInList with:#('english'
       
   511 						  'german'
       
   512 						  'french'
       
   513 						  'spanish'
       
   514 						  'italian'
       
   515 						 ).
       
   516 	listOfLanguages selection:(Language asString).
       
   517 
       
   518 
       
   519 	resourceDir := Smalltalk getSystemFileName:'resources'.
       
   520 	dir := FileDirectory directoryNamed:resourceDir.
       
   521 
       
   522 	styleNames := dir select:[:aFileName | aFileName endsWith:'.style'].
       
   523 	styleNames := styleNames collect:[:aFileName | aFileName copyWithoutLast:6].
       
   524 	listOfStyles := SelectionInList with:styleNames.
       
   525 	listOfStyles selection:(View defaultStyle asString).
       
   526 
       
   527 	box := Dialog new.
       
   528 	box label:'Settings'.
       
   529 
       
   530 	frame := FramedBox label:'Compiler'.
       
   531 	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
       
   532 	panel horizontalLayout:#leftSpace.
       
   533 
       
   534 	panel add:((CheckBox on:warnSTX) label:'warn about ST/X language extensions'; resize).
       
   535 	panel add:((CheckBox on:allowUnderscore) label:'allow underscore in identifiers'; resize).
       
   536 	panel add:((CheckBox on:immutableArrays) label:'literal arrays are immutable'; resize).
       
   537 	box addComponent:frame.
       
   538 
       
   539 	frame := FramedBox label:'Misc'.
       
   540 	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
       
   541 	panel horizontalLayout:#leftSpace.
       
   542 
       
   543 	panel add:((CheckBox on:logDoits) label:'log doIts in changes file'; resize).
       
   544 	box addComponent:frame.
       
   545 
       
   546 	frame := FramedBox label:'Language'.
       
   547 	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
       
   548 	panel horizontalLayout:#leftSpace.
       
   549 
       
   550 	panel add:(PopUpList on:listOfLanguages).
       
   551 	box addComponent:frame.
       
   552 
       
   553 	frame := FramedBox label:'Style'.
       
   554 	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
       
   555 	panel horizontalLayout:#leftSpace.
       
   556 
       
   557 	panel add:(PopUpList on:listOfStyles).
       
   558 	box addComponent:frame.
       
   559 
       
   560 	box addAbortButton; addOkButton.
       
   561 	box showAtPointer.
       
   562 
       
   563 	box accepted ifTrue:[
       
   564 	    Transcript topView withCursor:Cursor wait do:[
       
   565 		Compiler warnSTXSpecials:warnSTX value.
       
   566 		Compiler allowUnderscoreInIdentifier:allowUnderscore value.
       
   567 		Compiler arraysAreImmutable:immutableArrays value.
       
   568 
       
   569 		Smalltalk logDoits:logDoits value.
       
   570 
       
   571 		Transcript showCr:'change language to ' , listOfLanguages selection , ' ...'.
       
   572 		Smalltalk at:#Language put:listOfLanguages selection asSymbol.
       
   573 		Smalltalk changed:#Language.
       
   574 		ResourcePack flushCachedResourcePacks.
       
   575 
       
   576 		Transcript showCr:'change style to ' , listOfStyles selection , ' ...'.
       
   577 		View defaultStyle:listOfStyles selection asSymbol.
       
   578 	    ]
       
   579 	]
       
   580 
   496 "
   581 "
   497 !
   582 !
   498 
   583 
   499 copyright
   584 copyright
   500 "
   585 "