eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DigitalClockView':

Home

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

Class: DigitalClockView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--DigitalClockView

Package:
stx:libwidg3
Category:
Views-Misc
Version:
rev: 1.19 date: 2018/11/10 07:48:54
user: cg
file: DigitalClockView.st directory: libwidg3
module: stx stc-classLibrary: libwidg3
Author:
Claus Gittinger

Description:


another clock replacement ...
This is a regular view - it can also be placed into another one.


Related information:

    Clock
    RoundClock
    ClockView
    Time
    ProcessorScheduler
    DigitalLedDisplay

Class protocol:

others
o  version_CVS

startup
o  isVisualStartable
yes, I can be started via double click in the browser

o  open
open a topView containing a digitalClock

usage example(s):

     DigitalClockView open


Instance protocol:

accessing
o  showSeconds: something
set the value of the instance variable 'showSeconds' (automatically generated)

drawing
o  redraw
update my view

o  showTime
executed every second (by timedBlock)

events
o  destroy
the view was destroyed - remove time-scheduled updateBlock

o  mapped
view was mapped - launch a time-scheduled updateBlock

o  sizeChanged: how
(comment from inherited method)
tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)

initialization
o  fetchDeviceResources
fetch device colors, to avoid reallocation at redraw time

o  initialize
DigitalClockView new open

o  startClock
launch a time-scheduled updateBlock

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.


Demonstration:


    DigitalClockView new open


Examples:


in a topView:
 |top clk prefSize|

 top := StandardSystemView new.
 top label:'ST/X clock'.

 clk := DigitalClockView in:top.
 prefSize := clk preferredExtent.
 top extent:prefSize.
 top minExtent:prefSize.
 top maxExtent:prefSize.

 top open
as a component:
 |top frame clk fileList sz|

 top := StandardSystemView new.
 top extent:200@200.

 clk := DigitalClockView new.
 clk showSeconds:false.
 sz := clk preferredExtent.

 frame := View origin:1.0@0.0 corner:1.0@(sz y) in:top.
 frame leftInset:(sz x negated - 4); rightInset:4; topInset:2; bottomInset:-2.
 frame level:-1.

 clk := DigitalClockView in:frame.

 fileList := ScrollableView for:FileSelectionList in:top.
 fileList origin:0@50 corner:1.0@1.0. 

 top open


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 18 Apr 2024 12:45:30 GMT