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.12 date: 2022/01/13 19:42:45
user: cg
file: VUMeter.st directory: libwidg3
module: stx stc-classLibrary: libwidg3

Description:


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


[instance variables:]

[class variables:]

copyright

COPYRIGHT (c) 2009 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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 b|

   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.
   (b:= 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.
       b destroy.
   ] fork.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Thu, 21 Nov 2024 12:04:54 GMT