eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'VisualRegion':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: VisualRegion


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--VisualRegion

Package:
stx:libview2
Category:
Views-Special
Version:
rev: 1.11 date: 2015/05/05 11:14:10
user: cg
file: VisualRegion.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


VisualRegion is a passive visual component which provides a rectangular or elliptical
shape. It can take an arbitrary border line thicknesses and can be defined as opaque
with a background color or non opaque.

Notice:
  This is an ST-80 compatibility class, provided to aid porting
  of ST-80 or VisualWorks code;
  it may be incomplete or incompatible to the corresponding ST-80 class. 
  If you encounter any incompatibilities, please forward a note 
  describing the incompatibility verbal (i.e. no code) to the ST/X team.


Instance protocol:

accessing
o  isElliptical
get the outline of the region; elliptical or rectangle

o  isElliptical: aBoolean
set the outline of the region; elliptical or rectangle

o  isOpaque
return true, if the object fully covers its frame (i.e. is rectangular
and has no 'holes'.
Here, get the opaque mode concerning the inner background of the region

o  isOpaque: aBoolean
set opaque mode concerning the inner background of the region

o  lineWidth: aNumber
set the border drawing width in pixels

o  setLineWidth: aNumber
set the line drawing width in pixels without recomputation of the shape

change & update
o  sizeChanged: how
must compute a new shape, when size is changed

initialization
o  initialize
setup default configuration

private
o  layoutChanged
recompute shape and change to invalidate

queries
o  specClass

shape computation
o  computeShape
computes 2 forms, one for the border, the other for the inside area. The border
form is borderwidth*2 pixels larger. Each form gets filled with an ellipse of
1-pixels, to define the shapes (take a look at the XShape spec, for more info)


Examples:


some regions; the blue one has its own cursor, the light-grey and red ones havea popupMenu, however, the red one is almost completely covered by an invisible inputView which provides its own menu (only the far left edge of the red region shows the red-menu)
    |top s1 s2 s3 s4 v1 rd i vh|

    top := StandardSystemView new extent:250@250.

    rd := true.

    v1 := View origin:25@25 extent:50@50 in:top.
    v1 viewBackground:(Color blue).
    v1 cursor:(Cursor thumbsUp).
    vh := ValueHolder new.
    vh onChangeSend:#value to:[ v1 viewBackground:vh value. v1 clear ].
    vh inspect.

    s1 := VisualRegion origin:10@10 extent:30@30 in:top.
    s1 lineWidth:0.
    s1 viewBackground:(Color gray:90).
    s1 isElliptical:rd.
    s1 middleButtonMenu:(PopUpMenu labels:#('foo' 'bar')).

    s2 := VisualRegion origin:60@10 extent:30@30 in:top.
    s2 viewBackground:(Color green).
    s2 lineWidth:1.
    s2 isElliptical:rd.

    s3 := VisualRegion origin:10@60 extent:100@30 in:top.
    s3 viewBackground:(Color gray:70).
    s3 lineWidth:0.
    s3 isOpaque:false.
    s3 isElliptical:rd.

    s4 := VisualRegion origin:60@60 extent:60@30 in:top.
    s4 viewBackground:(Color red).
    s4 lineWidth:3.
    s4 isOpaque:false.
    s4 isElliptical:rd.
    s4 middleButtonMenu:(PopUpMenu labels:#('foo1' 'bar1')).

    i := InputView origin:70@60 extent:60@30 in:top.
    i middleButtonMenu:(PopUpMenu labels:#('foo2' 'bar2')).

    top open


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 16 Apr 2024 15:20:13 GMT