Object <- Viewable <- Stamp <- EditableClock |
|
|
AboutToShow Draw DrawClockHand Idle IndexedTime OpeningTinkerWindow RedrawFace SetIndexedTime SetMyTime Touch |
|
Editable HasSecondHand Target TargetTime |
| Field | Type | |
|---|---|---|
| Viewable: | superview: | Viewable |
| relativeOrigin: | Dot | |
| contentSize: | Dot | |
| viewFlags: | Flags | |
| labelStyle: | TextStyle | |
| color: | Unsigned | |
| altColor: | Unsigned | |
| shadow: | Shadow | |
| sound: | Playable | |
| Stamp: | image: | Image |
| EditableClock: | target: | Object |
| displayedTime: | Unsigned | |
| draggingHand: | UnsignedByte | |
| editable: | Boolean | |
| hasSecondHand: | Boolean | |
| dragInterval: | Unsigned |
instance EditableClock tag; relativeOrigin: <0.0,0.0>; contentSize: <0.0,0.0>; viewFlags: 0x00000000; labelStyle: nilObject; color: 0; altColor: 0; shadow: nilObject; sound: nilObject; image: nilObject; target: nilObject; displayedTime: 0; draggingHand: 0; editable: false; hasSecondHand: false; dragInterval: 0; end instance;
Define Class EditableClock; inherits from Stamp; inherits from ClockFace; inherits interface from EditsTarget; field target: Object, getter; // source of clock's time; use iSystem to affect and reflect current time field displayedTime: Unsigned; // time currently displayed on clock field draggingHand: UnsignedByte; // which hand is being dragged field editable: Boolean, getter; field hasSecondHand: Boolean, getter; field dragInterval: Unsigned; // interval (in minutes) to which dragging the minute hand is gridded // getting and setting the time operation IndexedTime(index: Unsigned): Unsigned; operation SetIndexedTime(newTime: Unsigned; index: Unsigned); // getting and setting the target overrides SetTarget; attribute TargetTime: Unsigned, safe; // gets/sets target's start time // clock drawing and manipulation overrides DrawClockHand; // draws hand that's being dragged thicker; draws second hand lighter if unlocked attribute HasSecondHand: Boolean, safe, common; // returns true if clock has a second hand (tests clock flag) attribute Editable: Boolean, safe; // basic viewable stuff overrides AboutToShow; // synchronizes displayed time with target time overrides Draw; // draws clock hands inside image's content rect overrides Idle; // synchronizes displayed time with target time overrides OpeningTinkerWindow; // adds time locked and second hand switches to tinker window overrides Touch; // locks and unlocks the time; moves hands if time unlocked operation RedrawFace(), intrinsic; operation SetMyTime(newTime: Unsigned), intrinsic; end class;