eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'VUMeter':

Home

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

Class: VUMeter


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--VUMeter

Package:
stx:libwidg3
Category:
Views-Misc
Version:
rev: 1.10 date: 2018/11/10 07:47:23
user: cg
file: VUMeter.st directory: libwidg3
module: stx stc-classLibrary: libwidg3
Author:
cg (cg@CG-VOSTRO)

Description:


nice display of a measurement value or simular...
model value must be 0..1


[instance variables:]

[class variables:]


Related information:



Class protocol:

image specs
o  offImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self offImage inspect
     ImageEditor openOnClass:self andSelector:#offImage
     Icon flushCachedIcons

o  onImage
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self onImage inspect
     ImageEditor openOnClass:self andSelector:#onImage
     Icon flushCachedIcons

o  poti1
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self poti1 inspect
     ImageEditor openOnClass:self andSelector:#poti1
     Icon flushCachedIcons

o  poti2
This resource specification was automatically generated
by the ImageEditor of ST/X.

usage example(s):

     self poti2 inspect
     ImageEditor openOnClass:self andSelector:#poti2
     Icon flushCachedIcons


Instance protocol:

change & update
o  update: something with: aParameter from: changedObject
Invoked when an object that I depend upon sends a change notification.

drawing
o  redrawValue
map 0..1 into 0..pi scaling and shifting the phase

o  redrawX: x y: y width: w height: h
called to redraw a part of the widgets area. x/y define the origin, w/h the size of
that area. The clipping region has already been set by the caller, so even if the code
below draws outside the redraw-area, it will not affect what is on the screen.
Therefore, the example below can fill the rectangle in the redraw area, but still draw
the cross in the outside regions.

initialization & release
o  initialize
self new open

queries
o  computePreferredExtent
(comment from inherited method)
return my computed preferred extent - this is the minimum size I would like to have.
If there are any components, a rectangle enclosing them
is returned. Otherwise, the actual extent is returned.


Examples:


Notice that everything between [exBegin] and [exEnd] is extracted by the html-doc generator to create nicely formatted and clickable executable examples in the generated html-doc. (see the browsers class-documentation menu items for more) trying the widget as standAlone view:
   VUMeter new open
embedded in another view:
   |top v|

   top := StandardSystemView new.
   top extent:300@300.
   v := VUMeter new.
   v origin:10@10 corner:150@150.
   top add:v.
   top open
   |m top v stop|

   m := 0 asValue.

   top := StandardSystemView new.
   top extent:300@300.
   v := VUMeter new.
   v model:m.
   v origin:10@10 corner:150@150.
   top add:v.
   top open.

   stop := false asValue.
   (Button label:'stop') model:stop; open.
   [
       [stop value] whileFalse:[
         0 to:1 by:0.1 do:[:v  |
           m value:v.
           Delay waitForSeconds:0.5
         ]
       ].
       top destroy.
   ] fork.


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 22:00:41 GMT