examples
authorClaus Gittinger <cg@exept.de>
Sat, 27 Apr 1996 20:14:40 +0200
changeset 621 decaeae1910d
parent 620 c840b7106a64
child 622 565e2301c064
examples
PseudoV.st
SimpleView.st
StandardSystemView.st
StdSysV.st
View.st
--- a/PseudoV.st	Sat Apr 27 19:56:29 1996 +0200
+++ b/PseudoV.st	Sat Apr 27 20:14:40 1996 +0200
@@ -204,6 +204,19 @@
     ]
 !
 
+viewBackgroundAndClear:something
+    "set the viewBackground to something, a color, image or form.
+     and clear the View.
+     The viewBackground is the color or pattern with which exposed
+     regions are filled - do not confuse this with the drawing background
+     color, which is used with opaque drawing."
+
+    self viewBackground:something.
+    self clear.
+
+    "Created: 27.4.1996 / 14:09:08 / cg"
+!
+
 viewGravity
     "return the views gravity"
 
@@ -1563,5 +1576,5 @@
 !PseudoView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/PseudoV.st,v 1.56 1996-04-25 17:16:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/PseudoV.st,v 1.57 1996-04-27 18:13:12 cg Exp $'
 ! !
--- a/SimpleView.st	Sat Apr 27 19:56:29 1996 +0200
+++ b/SimpleView.st	Sat Apr 27 20:14:40 1996 +0200
@@ -196,8 +196,9 @@
 
 
     [see also:]
-        StandardSystemView
+        StandardSystemView DialogBox
         WindowGroup WindowEvent
+        Layout
         ( introduction to view programming :html: programming/viewintro.html )
 
     [author:]
@@ -211,7 +212,7 @@
      to make the individual subviews visible)
 
     a subView in a topView:
-
+                                                                        [exBegin]
         |top v|
 
         topView := StandardSystemView new.
@@ -219,21 +220,21 @@
         v origin:0.25 @ 0.25 corner:0.75 @ 0.75.
         top addSubView:v.
         top open
-
+                                                                        [exEnd]
 
 
     the same, a bit more compact:
-
+                                                                        [exBegin]
         |top v|
 
         topView := StandardSystemView new.
         v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:topView.
         top open
-
+                                                                        [exEnd]
 
 
     fixed position/size:
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -250,11 +251,11 @@
        v2 viewBackground:(Color yellow).
 
        top open
-
+                                                                        [exEnd]
 
     same, using ST-80 way of bulding up view hierarchies
     (recommended, if you plan to port applications later)
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -276,10 +277,10 @@
        v2 viewBackground:(Color yellow).
 
        top open
-
+                                                                        [exEnd]
 
     fixed origin, variable size:
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -298,11 +299,11 @@
        top add:v2.
 
        top open
-
+                                                                        [exEnd]
 
     fixed origin, variable size, 
     bottomInset for constant distance from bottom:
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -323,10 +324,10 @@
        top add:v2.
 
        top open
-
+                                                                        [exEnd]
 
     variable origin, variable size, 
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -345,11 +346,11 @@
        top add:v2.
 
        top open
-
+                                                                        [exEnd]
 
     variable origin, variable size, 
     insets for some constant distance
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -370,11 +371,11 @@
        top add:v2.
 
        top open
-
+                                                                        [exEnd]
 
     using layout objects (ST-80 style):
     fully specifying the frame
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -398,10 +399,10 @@
                         bottomFraction:0.75).
 
        top open
-
+                                                                        [exEnd]
 
     another one, with offsets:
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -425,11 +426,11 @@
                         bottomFraction:0.75).
 
        top open
-
+                                                                        [exEnd]
 
     specifying origin only. Extent is views preferred
     (notice, that plain views have some defaultExtent of 100@100)
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -449,9 +450,10 @@
                         topFraction:0.5).
 
        top open
+                                                                        [exEnd]
 
     same example, using buttons which compute their preferredBounds:
-
+                                                                        [exBegin]
        |top v1 v2|
 
        top := StandardSystemView new.
@@ -471,7 +473,7 @@
                         topFraction:0.5).
 
        top open
-
+                                                                        [exEnd]
 "
 !
 
@@ -6219,6 +6221,6 @@
 !SimpleView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.80 1996-04-25 17:17:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.81 1996-04-27 18:14:40 cg Exp $'
 ! !
 SimpleView initialize!
--- a/StandardSystemView.st	Sat Apr 27 19:56:29 1996 +0200
+++ b/StandardSystemView.st	Sat Apr 27 20:14:40 1996 +0200
@@ -120,17 +120,17 @@
 examples
 "
     simple, empty topView:
-
+                                                                        [exBegin]
         |topView|
 
         topView := StandardSystemView new.
         topView label:'my first view'.
         topView extent:200 @ 200.
         topView open.
-
+                                                                        [exEnd]
 
     with an icon & iconLabel:
-
+                                                                        [exBegin]
         |topView|
 
         topView := StandardSystemView extent:200 @ 200.
@@ -138,11 +138,11 @@
 
         topView icon:(Image fromFile:'hello_world.icon').
         topView open.
-
+                                                                        [exEnd]
 
 
     with an animated iconView [not supported on all display devices]:
-
+                                                                        [exBegin]
         |iconView topView|
 
         iconView := ClockView new.
@@ -152,11 +152,11 @@
 
         topView iconView:iconView.
         topView open.
-
+                                                                        [exEnd]
 
 
     placing a subView into it:
-
+                                                                        [exBegin]
         |topView button|
 
         topView := StandardSystemView new.
@@ -167,10 +167,10 @@
         button action:[topView destroy].
 
         topView open.
-
+                                                                        [exEnd]
 
     same, relative sized subview:
-
+                                                                        [exBegin]
         |topView button|
 
         topView := StandardSystemView new.
@@ -182,10 +182,10 @@
         button origin:0.25 @ 0.25 corner:0.75 @ 0.75.
 
         topView open.
-
+                                                                        [exEnd]
 
     multiple buttons in a panel in a topView:
-
+                                                                        [exBegin]
         |topView panel button1 button2 button3|
 
         topView := StandardSystemView new.
@@ -206,6 +206,7 @@
         button3 action:[Transcript showCr:'three pressed'].
 
         topView open.
+                                                                        [exEnd]
 "
 ! !
 
@@ -1164,5 +1165,5 @@
 !StandardSystemView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.47 1996-04-25 17:17:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.48 1996-04-27 18:14:07 cg Exp $'
 ! !
--- a/StdSysV.st	Sat Apr 27 19:56:29 1996 +0200
+++ b/StdSysV.st	Sat Apr 27 20:14:40 1996 +0200
@@ -120,17 +120,17 @@
 examples
 "
     simple, empty topView:
-
+                                                                        [exBegin]
         |topView|
 
         topView := StandardSystemView new.
         topView label:'my first view'.
         topView extent:200 @ 200.
         topView open.
-
+                                                                        [exEnd]
 
     with an icon & iconLabel:
-
+                                                                        [exBegin]
         |topView|
 
         topView := StandardSystemView extent:200 @ 200.
@@ -138,11 +138,11 @@
 
         topView icon:(Image fromFile:'hello_world.icon').
         topView open.
-
+                                                                        [exEnd]
 
 
     with an animated iconView [not supported on all display devices]:
-
+                                                                        [exBegin]
         |iconView topView|
 
         iconView := ClockView new.
@@ -152,11 +152,11 @@
 
         topView iconView:iconView.
         topView open.
-
+                                                                        [exEnd]
 
 
     placing a subView into it:
-
+                                                                        [exBegin]
         |topView button|
 
         topView := StandardSystemView new.
@@ -167,10 +167,10 @@
         button action:[topView destroy].
 
         topView open.
-
+                                                                        [exEnd]
 
     same, relative sized subview:
-
+                                                                        [exBegin]
         |topView button|
 
         topView := StandardSystemView new.
@@ -182,10 +182,10 @@
         button origin:0.25 @ 0.25 corner:0.75 @ 0.75.
 
         topView open.
-
+                                                                        [exEnd]
 
     multiple buttons in a panel in a topView:
-
+                                                                        [exBegin]
         |topView panel button1 button2 button3|
 
         topView := StandardSystemView new.
@@ -206,6 +206,7 @@
         button3 action:[Transcript showCr:'three pressed'].
 
         topView open.
+                                                                        [exEnd]
 "
 ! !
 
@@ -1164,5 +1165,5 @@
 !StandardSystemView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/StdSysV.st,v 1.47 1996-04-25 17:17:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/StdSysV.st,v 1.48 1996-04-27 18:14:07 cg Exp $'
 ! !
--- a/View.st	Sat Apr 27 19:56:29 1996 +0200
+++ b/View.st	Sat Apr 27 20:14:40 1996 +0200
@@ -60,8 +60,9 @@
                                             menuHolder and menuPerformer.
 
     [see also:]
-        StandardSystemView TopView
+        StandardSystemView TopView DialogBox
         WindowGroup
+        Model ValueHolder
         ( introduction to view programming :html: programming/viewintro.html )
         
 
@@ -73,7 +74,7 @@
 examples
 "
     a subView in a topView:
-
+                                                                        [exBegin]
         |top v|
 
         topView := StandardSystemView new.
@@ -81,16 +82,18 @@
         v origin:0.25 @ 0.25 corner:0.75 @ 0.75.
         top addSubView:v.
         top open
-
+                                                                        [exEnd]
 
 
     the same, a bit more compact:
-
+                                                                        [exBegin]
         |top v|
 
         topView := StandardSystemView new.
         v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:topView.
         top open
+                                                                        [exEnd]
+
 "
 ! !
 
@@ -481,5 +484,5 @@
 !View class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.50 1996-04-25 17:15:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.51 1996-04-27 18:12:31 cg Exp $'
 ! !