DialogBox.st
changeset 4193 bfcc66744c84
parent 4183 c775db615fdf
child 4208 d0f960563da8
equal deleted inserted replaced
4192:0bc8b69bb610 4193:bfcc66744c84
  6719      The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
  6719      The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
  6720      The labels string is defined by labelString and adjusted according to labelAdjust.
  6720      The labels string is defined by labelString and adjusted according to labelAdjust.
  6721      The inputField gets model as its model.
  6721      The inputField gets model as its model.
  6722      Return the inputField."
  6722      Return the inputField."
  6723 
  6723 
  6724     |y lbl max relW|
  6724     |y lbl max relW wLabel|
  6725 
  6725 
  6726     y := self yPosition.
  6726     y := self yPosition.
  6727     lbl := Label label:labelString.
  6727     lbl := Label label:labelString.
  6728     max := lbl preferredHeight max:(aView preferredHeight).
  6728     max := lbl preferredHeight max:(aView preferredHeight).
  6729 
  6729 
  6730     relW := rightX - leftX.
  6730     relW := rightX - leftX.
  6731 
  6731 
  6732     self addComponent:lbl indent:leftIndent withHeight:max.
  6732     self addComponent:lbl indent:leftIndent withHeight:max.
  6733     lbl rightInset:0.
  6733     lbl rightInset:0.
       
  6734     relativeX isInteger ifTrue:[
       
  6735         wLabel := relativeX.
       
  6736     ] ifFalse:[
       
  6737         wLabel := relW*relativeX.
       
  6738     ].
       
  6739 
  6734     lbl 
  6740     lbl 
  6735         width:(relW*relativeX); 
  6741         width:wLabel; 
  6736         left:leftX; 
  6742         left:leftX; 
  6737         adjust:labelAdjust; borderWidth:0.
  6743         adjust:labelAdjust; 
       
  6744         borderWidth:0.
       
  6745 
       
  6746     relativeX isInteger ifTrue:[
       
  6747         lbl preferredExtent:(wLabel @ lbl preferredExtent y).
       
  6748         lbl extent:(wLabel @ lbl preferredExtent y).
       
  6749         lbl sizeFixed:true.
       
  6750     ].
  6738 
  6751 
  6739     fgColor notNil ifTrue:[
  6752     fgColor notNil ifTrue:[
  6740         lbl foregroundColor:fgColor
  6753         lbl foregroundColor:fgColor
  6741     ].
  6754     ].
  6742 
  6755 
  6743     self yPosition:y.
  6756     self yPosition:y.
  6744     self addComponent:aView tabable:tabable.
  6757     self addComponent:aView tabable:tabable.
  6745     aView 
  6758 
  6746         leftInset:ViewSpacing; 
  6759     relativeX isInteger ifTrue:[
  6747         rightInset:ViewSpacing.
  6760         aView 
  6748 
  6761             leftInset:(ViewSpacing + relativeX); 
  6749     aView 
  6762             left:0.0;
  6750         width:relW*(1.0 - relativeX); 
  6763             rightInset:ViewSpacing; 
  6751         left:leftX+(relW*relativeX).
  6764             right:1.0.
       
  6765     ] ifFalse:[
       
  6766         aView 
       
  6767             leftInset:ViewSpacing; 
       
  6768             rightInset:ViewSpacing;
       
  6769             width:relW*(1.0 - relativeX); 
       
  6770             left:leftX+(relW*relativeX).
       
  6771     ].
  6752 
  6772 
  6753     aView isInputField ifTrue:[
  6773     aView isInputField ifTrue:[
  6754         self addToInputFieldGroup:aView
  6774         self addToInputFieldGroup:aView
  6755     ].
  6775     ].
  6756 
  6776 
  6817      dialog addAbortButton; addOkButton.
  6837      dialog addAbortButton; addOkButton.
  6818      dialog open.
  6838      dialog open.
  6819      dialog accepted ifTrue:[Transcript showCR:model value].
  6839      dialog accepted ifTrue:[Transcript showCR:model value].
  6820     "
  6840     "
  6821 
  6841 
  6822     "Created: 17.7.1996 / 15:03:32 / cg"
  6842     "Created: / 17-07-1996 / 15:03:32 / cg"
  6823     "Modified: 26.7.1996 / 18:11:12 / cg"
  6843     "Modified: / 17-11-2010 / 19:59:10 / cg"
  6824 !
  6844 !
  6825 
  6845 
  6826 addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX
  6846 addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX
  6827     "add a label and some view side-by-side.
  6847     "add a label and some view side-by-side.
  6828      The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
  6848      The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
  9485 ! !
  9505 ! !
  9486 
  9506 
  9487 !DialogBox class methodsFor:'documentation'!
  9507 !DialogBox class methodsFor:'documentation'!
  9488 
  9508 
  9489 version
  9509 version
  9490     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.303 2010-10-27 09:37:01 cg Exp $'
  9510     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.304 2010-11-17 18:59:22 cg Exp $'
  9491 !
  9511 !
  9492 
  9512 
  9493 version_CVS
  9513 version_CVS
  9494     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.303 2010-10-27 09:37:01 cg Exp $'
  9514     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.304 2010-11-17 18:59:22 cg Exp $'
  9495 ! !
  9515 ! !
  9496 
  9516 
  9497 DialogBox initialize!
  9517 DialogBox initialize!