class: DialogBox
comment/format in:
#bottomAlign:
#bottomAlignLowerEdge:
category of:12 methods
--- a/DialogBox.st Thu Aug 22 19:23:14 2013 +0200
+++ b/DialogBox.st Fri Aug 23 20:38:40 2013 +0200
@@ -8499,262 +8499,6 @@
"
"Modified: 9.2.1996 / 21:41:23 / cg"
-!
-
-bottomAlign:widgets
- "mhmh - seems similar to out stickAtBottom functionality - to be checked"
-
- 'DialogBox [warning]: unimplemented VW feature: #bottomAlign' infoPrintCR.
-"/ self halt:'unimplemented VW functionality'.
-
- "Created: / 4.2.2000 / 00:10:21 / cg"
- "Modified: / 5.2.2000 / 15:31:23 / cg"
-!
-
-bottomAlignLowerEdge:widget
- "mhmh - seems similar to out stickAtBottom functionality - to be checked"
-
- "/ self halt:'unimplemented VW functionality'.
- self stickAtBottomWithVariableHeight:widget
-
- "Modified: / 5.2.2000 / 15:31:15 / cg"
-!
-
-leftIndent
- "return the current indent
- (current x position - thats where the next component will be located)."
-
- ^ leftIndent
-
- "Modified: 27.1.1996 / 18:21:31 / cg"
-!
-
-leftIndent:aNumber
- "set the left indent
- (current x position - that's where the next component(s) will be located).
- Setting this before adding a component will place it indented"
-
- leftIndent := aNumber.
- needResize := true.
-
- "
- |dialog|
-
- dialog := DialogBox new.
- (dialog addTextLabel:'label1') adjust:#left.
- dialog leftIndent:20.
- (dialog addTextLabel:'label2') adjust:#left.
- dialog leftIndent:40.
- (dialog addTextLabel:'label3') adjust:#left.
- dialog leftIndent:60.
- (dialog addTextLabel:'label4') adjust:#left.
-
- dialog addOkButton.
- dialog open.
- "
-
- "Modified: 9.2.1996 / 21:42:20 / cg"
-!
-
-rightIndent
- "return the current right indent."
-
- ^ rightIndent
-
- "Modified: 27.1.1996 / 18:21:31 / cg"
-!
-
-rightIndent:aNumber
- "set the right indent"
-
- rightIndent := aNumber.
- needResize := true.
-
- "
- |dialog|
-
- dialog := DialogBox new.
- (dialog addTextLabel:'label1') adjust:#right.
- dialog rightIndent:20.
- (dialog addTextLabel:'label2') adjust:#right.
- dialog rightIndent:40.
- (dialog addTextLabel:'label3') adjust:#right.
- dialog rightIndent:60.
- (dialog addTextLabel:'label4') adjust:#right.
-
- dialog addOkButton.
- dialog open.
- "
-
- "Modified: 9.2.1996 / 21:42:46 / cg"
-!
-
-setInitialGap
-
- "Created: / 4.2.2000 / 00:01:44 / cg"
-!
-
-stickAtBottomWithFixHeight:aComponent
- "arrange for a component to be positioned at a constant offset
- from the bottom of the box and its height to remain the same.
- This will keep the component at a constant distance from the bottom
- (without this setup, it would stay at a constant offset from the top).
- ATTENTION: use this as a last step, after all components have been added."
-
- self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0
-
- "
- compare the resizing behavior of:
-
- |box|
-
- box := Dialog new.
- box addTextLabel:'hello'.
- box addTextLabel:'hello2'.
- box addOkButton.
- box show
-
- with:
-
- |box l2|
-
- box := Dialog new.
- box addTextLabel:'hello'.
- l2 := box addTextLabel:'hello2'.
- box addOkButton.
- box stickAtBottomWithFixHeight:l2.
- box show
- "
-
- "Created: / 27.1.1996 / 17:17:41 / cg"
- "Modified: / 18.8.2000 / 21:38:21 / cg"
-!
-
-stickAtBottomWithFixHeight:aComponent left:left right:right
- "arrange for a component to be positioned at a constant offset
- from the bottom of the box and its height to remain the same.
- This will keep the component at a constant distance from the bottom
- (without this setup, it would stay at a constant offset from the top).
- ATTENTION: use this as a last step, after all components have been added."
-
- self resize.
-
- aComponent
- topInset:(self height - aComponent top) negated;
- bottomInset:(self height - aComponent bottom);
- origin:left @ 1.0; corner:right @ 1.0.
-
- "
- compare the resizing behavior of:
-
- |box|
-
- box := Dialog new.
- box addTextLabel:'hello'.
- box addTextLabel:'hello2'.
- box addOkButton.
- box show
-
- with:
-
- |box l2|
-
- box := Dialog new.
- box addTextLabel:'hello'.
- l2 := box addTextLabel:'hello2'.
- box addOkButton.
- box stickAtBottomWithFixHeight:l2.
- box show
- "
-
- "Created: / 27.1.1996 / 17:17:41 / cg"
- "Modified: / 18.8.2000 / 21:38:26 / cg"
-!
-
-stickAtBottomWithVariableHeight:aComponent
- "arrange for a component to be positioned at a constant offset
- from the bottom of the box and its height to be adjusted.
- This will resize the component for a constant distance from the top,
- and the bottom.
- (without this setup, its height would remain constant).
- ATTENTION: use this as a last step, after all components have been added."
-
- self resize.
-
- aComponent
- bottomInset:(self height - aComponent bottom);
- corner:1.0@1.0.
-
- "
- compare the resizing behavior of:
-
- |box|
-
- box := Dialog new.
- box addTextLabel:'hello'.
- (box addComponent:(SelectionInListView new)) level:-1.
- box addOkButton.
- box show
-
- with:
-
- |box list|
-
- box := Dialog new.
- box addTextLabel:'hello'.
- list := (box addComponent:(SelectionInListView new)) level:-1.
- box addOkButton.
- box stickAtBottomWithVariableHeight:list.
- box show
- "
-
- "Modified: / 18.8.2000 / 21:38:35 / cg"
-!
-
-yPosition
- "return the current y position (thats where the next component
- will be located)."
-
- ^ yPosition
-!
-
-yPosition:aNumber
- "set the current y position (thats where the next component
- will be located)."
-
- yPosition := aNumber.
- needResize := true.
-
- "
- |dialog pos|
-
- dialog := DialogBox new.
- pos := dialog yPosition.
- (dialog addTextLabel:'label1') width:0.5.
- dialog yPosition:pos.
- (dialog addTextLabel:'label2') width:0.5; left:0.5.
-
- dialog addOkButton.
- dialog open.
- "
-
- "
- |dialog pos|
-
- dialog := DialogBox new.
- pos := dialog yPosition.
- #('one' 'two' 'three' 'four')
- with:#(0.0 0.25 0.5 0.75) do:[:lbl :x |
- dialog yPosition:pos.
- (dialog addComponent:(Button label:lbl) tabable:true)
- width:0.25; left:x.
- ].
-
- dialog addOkButton.
- dialog open.
- "
-
- "Modified: 9.2.1996 / 21:46:40 / cg"
! !
!DialogBox methodsFor:'construction-lists'!
@@ -9630,6 +9374,264 @@
self resize
! !
+!DialogBox methodsFor:'layout control'!
+
+bottomAlign:widgets
+ "mhmh - seems similar to our stickAtBottom functionality - to be checked"
+
+ 'DialogBox [warning]: unimplemented VW feature: #bottomAlign' infoPrintCR.
+"/ self halt:'unimplemented VW functionality'.
+
+ "Created: / 4.2.2000 / 00:10:21 / cg"
+ "Modified: / 5.2.2000 / 15:31:23 / cg"
+!
+
+bottomAlignLowerEdge:widget
+ "mhmh - seems similar to our stickAtBottom functionality - to be checked"
+
+ "/ self halt:'unimplemented VW functionality'.
+ self stickAtBottomWithVariableHeight:widget
+
+ "Modified: / 5.2.2000 / 15:31:15 / cg"
+!
+
+leftIndent
+ "return the current indent
+ (current x position - thats where the next component will be located)."
+
+ ^ leftIndent
+
+ "Modified: 27.1.1996 / 18:21:31 / cg"
+!
+
+leftIndent:aNumber
+ "set the left indent
+ (current x position - that's where the next component(s) will be located).
+ Setting this before adding a component will place it indented"
+
+ leftIndent := aNumber.
+ needResize := true.
+
+ "
+ |dialog|
+
+ dialog := DialogBox new.
+ (dialog addTextLabel:'label1') adjust:#left.
+ dialog leftIndent:20.
+ (dialog addTextLabel:'label2') adjust:#left.
+ dialog leftIndent:40.
+ (dialog addTextLabel:'label3') adjust:#left.
+ dialog leftIndent:60.
+ (dialog addTextLabel:'label4') adjust:#left.
+
+ dialog addOkButton.
+ dialog open.
+ "
+
+ "Modified: 9.2.1996 / 21:42:20 / cg"
+!
+
+rightIndent
+ "return the current right indent."
+
+ ^ rightIndent
+
+ "Modified: 27.1.1996 / 18:21:31 / cg"
+!
+
+rightIndent:aNumber
+ "set the right indent"
+
+ rightIndent := aNumber.
+ needResize := true.
+
+ "
+ |dialog|
+
+ dialog := DialogBox new.
+ (dialog addTextLabel:'label1') adjust:#right.
+ dialog rightIndent:20.
+ (dialog addTextLabel:'label2') adjust:#right.
+ dialog rightIndent:40.
+ (dialog addTextLabel:'label3') adjust:#right.
+ dialog rightIndent:60.
+ (dialog addTextLabel:'label4') adjust:#right.
+
+ dialog addOkButton.
+ dialog open.
+ "
+
+ "Modified: 9.2.1996 / 21:42:46 / cg"
+!
+
+setInitialGap
+
+ "Created: / 4.2.2000 / 00:01:44 / cg"
+!
+
+stickAtBottomWithFixHeight:aComponent
+ "arrange for a component to be positioned at a constant offset
+ from the bottom of the box and its height to remain the same.
+ This will keep the component at a constant distance from the bottom
+ (without this setup, it would stay at a constant offset from the top).
+ ATTENTION: use this as a last step, after all components have been added."
+
+ self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0
+
+ "
+ compare the resizing behavior of:
+
+ |box|
+
+ box := Dialog new.
+ box addTextLabel:'hello'.
+ box addTextLabel:'hello2'.
+ box addOkButton.
+ box show
+
+ with:
+
+ |box l2|
+
+ box := Dialog new.
+ box addTextLabel:'hello'.
+ l2 := box addTextLabel:'hello2'.
+ box addOkButton.
+ box stickAtBottomWithFixHeight:l2.
+ box show
+ "
+
+ "Created: / 27.1.1996 / 17:17:41 / cg"
+ "Modified: / 18.8.2000 / 21:38:21 / cg"
+!
+
+stickAtBottomWithFixHeight:aComponent left:left right:right
+ "arrange for a component to be positioned at a constant offset
+ from the bottom of the box and its height to remain the same.
+ This will keep the component at a constant distance from the bottom
+ (without this setup, it would stay at a constant offset from the top).
+ ATTENTION: use this as a last step, after all components have been added."
+
+ self resize.
+
+ aComponent
+ topInset:(self height - aComponent top) negated;
+ bottomInset:(self height - aComponent bottom);
+ origin:left @ 1.0; corner:right @ 1.0.
+
+ "
+ compare the resizing behavior of:
+
+ |box|
+
+ box := Dialog new.
+ box addTextLabel:'hello'.
+ box addTextLabel:'hello2'.
+ box addOkButton.
+ box show
+
+ with:
+
+ |box l2|
+
+ box := Dialog new.
+ box addTextLabel:'hello'.
+ l2 := box addTextLabel:'hello2'.
+ box addOkButton.
+ box stickAtBottomWithFixHeight:l2.
+ box show
+ "
+
+ "Created: / 27.1.1996 / 17:17:41 / cg"
+ "Modified: / 18.8.2000 / 21:38:26 / cg"
+!
+
+stickAtBottomWithVariableHeight:aComponent
+ "arrange for a component to be positioned at a constant offset
+ from the bottom of the box and its height to be adjusted.
+ This will resize the component for a constant distance from the top,
+ and the bottom.
+ (without this setup, its height would remain constant).
+ ATTENTION: use this as a last step, after all components have been added."
+
+ self resize.
+
+ aComponent
+ bottomInset:(self height - aComponent bottom);
+ corner:1.0@1.0.
+
+ "
+ compare the resizing behavior of:
+
+ |box|
+
+ box := Dialog new.
+ box addTextLabel:'hello'.
+ (box addComponent:(SelectionInListView new)) level:-1.
+ box addOkButton.
+ box show
+
+ with:
+
+ |box list|
+
+ box := Dialog new.
+ box addTextLabel:'hello'.
+ list := (box addComponent:(SelectionInListView new)) level:-1.
+ box addOkButton.
+ box stickAtBottomWithVariableHeight:list.
+ box show
+ "
+
+ "Modified: / 18.8.2000 / 21:38:35 / cg"
+!
+
+yPosition
+ "return the current y position (thats where the next component
+ will be located)."
+
+ ^ yPosition
+!
+
+yPosition:aNumber
+ "set the current y position (thats where the next component
+ will be located)."
+
+ yPosition := aNumber.
+ needResize := true.
+
+ "
+ |dialog pos|
+
+ dialog := DialogBox new.
+ pos := dialog yPosition.
+ (dialog addTextLabel:'label1') width:0.5.
+ dialog yPosition:pos.
+ (dialog addTextLabel:'label2') width:0.5; left:0.5.
+
+ dialog addOkButton.
+ dialog open.
+ "
+
+ "
+ |dialog pos|
+
+ dialog := DialogBox new.
+ pos := dialog yPosition.
+ #('one' 'two' 'three' 'four')
+ with:#(0.0 0.25 0.5 0.75) do:[:lbl :x |
+ dialog yPosition:pos.
+ (dialog addComponent:(Button label:lbl) tabable:true)
+ width:0.25; left:x.
+ ].
+
+ dialog addOkButton.
+ dialog open.
+ "
+
+ "Modified: 9.2.1996 / 21:46:40 / cg"
+! !
+
!DialogBox methodsFor:'private'!
basicAddComponent:aComponent
@@ -9982,11 +9984,11 @@
!DialogBox class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.341 2013-07-12 12:00:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.342 2013-08-23 18:38:40 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.341 2013-07-12 12:00:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.342 2013-08-23 18:38:40 cg Exp $'
! !