Object <- Viewable <- Control <- BarGraph <- MemoryThermometer |
|
|
UpdateLevel |
|
FreeMemoryInKBytesText PercentMemoryFree UsedMemoryInKBytesText |
| Field | Type | |
|---|---|---|
| Viewable: | superview: | Viewable |
| relativeOrigin: | Dot | |
| contentSize: | Dot | |
| viewFlags: | Flags | |
| labelStyle: | TextStyle | |
| color: | Unsigned | |
| altColor: | Unsigned | |
| shadow: | Shadow | |
| sound: | Playable | |
| HasBorder: | border: | Border |
| Control: | image: | Image |
| textStyle: | TextStyle | |
| controlFlags: | Unsigned | |
| level: | Fixed | |
| min: | Fixed | |
| max: | Fixed | |
| target: | Object | |
| targetAttribute: | OperationNumber | |
| MemoryThermometer: | freeMemory: | Unsigned |
instance MemoryThermometer tag; relativeOrigin: <0.0,0.0>; contentSize: <0.0,0.0>; viewFlags: 0x00000000; labelStyle: nilObject; color: 0; altColor: 0; shadow: nilObject; sound: nilObject; border: nilObject; image: nilObject; textStyle: nilObject; controlFlags: 0; level: 0; min: 0; max: 0; target: nilObject; targetAttribute: nilOperation; freeMemory: 0; end instance;
Define Class MemoryThermometer; inherits from BarGraph; field freeMemory: Unsigned; // cached result of TotalFreeBytes(iSystem) overrides UpdateLevel; // stores free memory in field so other objects can obtain it from // this one without recomputing attribute PercentMemoryFree: Fixed, readOnly; // computes percent from field // this allows target of self to be self, with this attribute attribute FreeMemoryInKBytesText: Text, readOnly; // obtains value from free memory field to avoid recomputation attribute UsedMemoryInKBytesText: Text, readOnly; // obtains value from size of main memory - free memory field to avoid recomputation end class;