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.18 date: 2017/01/03 13:49:06
user: stefan
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  preferredExtent
(comment from inherited method)
return my preferred extent - this is the minimum size I would like to have.
If the preferredExtent has been set, that one is returned.
Otherwise, 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.1.0.0; WebServer 1.663 at exept.de:8081; Sun, 22 Jul 2018 06:49:44 GMT