eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DigitalClockView':

Home

everywhere
www.exept.de
for:
[back]

Class: DigitalClockView


Inheritance:

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

Package:
stx:libwidg3
Category:
demos-Applications-Clock
Version:
rev: 1.13 date: 2009/08/05 09:53:51
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:

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

o  open
open a topView containing a digitalClock


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

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

o  initialize

o  startClock
launch a time-scheduled updateBlock

queries
o  preferredExtent


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 6.1.1; WebServer 1.620 at exept:8081; Mon, 21 May 2012 16:07:49 GMT