eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Border':

Home

everywhere
www.exept.de
for:
[back]

Class: Border


Inheritance:

   Object
   |
   +--AbstractBorder
      |
      +--Border

Package:
stx:libview
Category:
Graphics-Support
Version:
rev: 1.9 date: 2009/11/04 11:23:14
user: cg
file: Border.st directory: libview
module: stx stc-classLibrary: libview
Author:
Claus Gittinger

Description:


a border holds the values of a view's (or component's) border.
We have only recently started to change the system to use borders instead of separate
borderWidth, borderColor, level, shadow- and lightColors.
Expect more changes here in the near future..


Related information:

    SimpleView

Instance protocol:

accessing
o  bottomColor
return the value of the instance variable 'bottomColor' (automatically generated)

o  bottomColor: aColor
set the bottomColor

o  color: newColor
set all four colors

o  leftColor
return the value of the instance variable 'leftColor' (automatically generated)

o  leftColor: aColor
set the leftColor

o  rightColor
return the value of the instance variable 'rightColor' (automatically generated)

o  rightColor: aColor
set the rightColor

o  topColor
return the value of the instance variable 'topColor' (automatically generated)

o  topColor: aColor
set the topColor

displaying
o  displayOn: aGC forDisplayBox: aRectangle
display the border represented by the receiver in the given rectangle.
colorSource is ignored here, but subclasses (i.e. 3D-borders) may use
it to ask for shadow/lightColors.
The gc's state is restored after the drawing.


Examples:



     |v b|

     v := StandardSystemView extent:10@10.
     v openAndWait.

     b := Border width:2 color:Color red.
     b displayOn:v forDisplayBox:(0@0 corner:9@9).

     Delay waitForSeconds:1.
     b setLeftColor:Color blue.
     b displayOn:v forDisplayBox:(0@0 corner:9@9).
     Delay waitForSeconds:1.
     b setTopColor:Color green.
     b displayOn:v forDisplayBox:(0@0 corner:9@9).
     Delay waitForSeconds:1.
     b setRightColor:Color magenta.
     b displayOn:v forDisplayBox:(0@0 corner:9@9).


     |v b|

     v := StandardSystemView extent:100@100.
     v openAndWait.

     b := Border width:2 color:Color red.
     b displayOn:v forDisplayBox:(0@0 corner:99@99).

     Delay waitForSeconds:1.
     b setLeft:5.
     v clear.
     b displayOn:v forDisplayBox:(0@0 corner:99@99).
     Delay waitForSeconds:1.
     b setTop:3.
     v clear.
     b displayOn:v forDisplayBox:(0@0 corner:99@99).
     Delay waitForSeconds:1.
     b setRight:1.
     v clear.
     b displayOn:v forDisplayBox:(0@0 corner:99@99).


     |v sub1 sub2 sub3|

     v := StandardSystemView extent:200@200.
     v openAndWait.

     sub1 := (View in:v) origin:10@10; corner:90@90.
     sub1 border:(SimpleBorder width:1 color:Color red ).
     sub2 := (View in:v) origin:110@10; corner:190@90.
     sub2 border:(Border new width:1; color:Color blue; leftColor:Color red rightColor:Color red ).
     sub3 := (View in:v) origin:110@110; corner:190@190.
     sub3 border:(SimpleBorder width:1 color:Color green ).

     v open.


ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 07:58:02 GMT