... <- Viewable <- Control <- Meter <- ChoiceBox <- ImageChoiceBox |
|
|
AboutToHide AboutToShow CalcBoundsBox CalcInsidePart Draw DrawControlMechanism FilterChoices Notice TextFromValue UpdateChoices |
|
Choices EmptyMessage Filter Image Level |
| 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 | |
| Meter: | upDownImages: | Object |
| ChoiceBox: | choices: | Object |
| lastOneEditable: | Boolean | |
| resetValue: | Boolean | |
| transientChoices: | Boolean | |
| choiceObjects: | Boolean | |
| matchByName: | Boolean | |
| useObjectIndex: | Boolean | |
| choiceWrap: | Boolean | |
| maxFromChoices: | Boolean | |
| useObjectAttribute: | Boolean | |
| matchWithSameChoice: | Boolean | |
| neverAdjustBoxSize: | Boolean | |
| lookForGroup: | Boolean | |
| destroyChoices: | Boolean | |
| numericText: | Boolean | |
| hasOtherChoiceObject: | Boolean | |
| ImageChoiceBox: | emptyMessage: | Viewable |
| source: | Object | |
| sourceAttribute: | OperationNumber | |
| filter: | ClassNumber |
instance ImageChoiceBox 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; upDownImages: nilObject; choices: nilObject; lastOneEditable: false; resetValue: false; transientChoices: false; choiceObjects: false; matchByName: false; useObjectIndex: false; choiceWrap: false; maxFromChoices: false; useObjectAttribute: false; matchWithSameChoice: false; neverAdjustBoxSize: false; lookForGroup: false; destroyChoices: false; numericText: false; hasOtherChoiceObject: false; emptyMessage: nilObject; source: nilObject; sourceAttribute: nilOperation; filter: nilClass; end instance;
Define Class ImageChoiceBox; inherits from ChoiceBox; field emptyMessage: Viewable, getter, setter; // used by EmptyMessage attribute field source: Object; // object that determines, along with sourceAttribute, choice list for choicebox field sourceAttribute: OperationNumber; // attribute number used to get choice list for choice box from source; // if zero, choice list for choice box is source object itself field filter: ClassNumber, getter, setter; // used by Filter attribute attribute EmptyMessage: Viewable, safe; // a viewable (typically a text field) that is made visible and brought // to the front when choice list is empty (can be nilObject) attribute Filter: ClassNumber, safe; // a class number or 0; // if non-zero, FilterChoices weeds out all items that do not implement this class number // override occasionally to weed out items differently -- may override FilterChoices // or SetChoices (rarely) as well. operation FilterChoices(newChoices: ObjectList; filter: ClassNumber); // implements the behavior described under Filter (only called if Filter is non-zero) // called from SetChoices // override to do different filtering overrides AboutToHide; // stops observing source overrides AboutToShow; // synchs choice list with source object; // shows or hides empty message as appropriate; // begins observing source overrides CalcBoundsBox; // accounts for image bounds overrides CalcInsidePart; // uses part code returned by InsideImage if any; // otherwise delegates to Viewable_ overrides Draw; // draws nothing at all if no choices; // does not draw control mechanism (left/right arrows) if only 1 choice; // draws image at center of choice box; overrides DrawControlMechanism; // delegates to Meter to draw the left/right arrow ends; // draws light gray background between ends overrides Image; // if item at current level in choice list is image, returns it; // otherwise returns Image() of item at current level in choice list overrides Notice; // synchs choice list with source object if source object changed overrides SetLevel; // handles bounds changing due to different image sizes; overrides SetChoices; // if Filter is non-zero, calls FilterChoices on the new choices // shows or hides empty message as appropriate overrides TextFromValue; // returns nilObject if value as integer is greater than count of choice list; // otherwise returns inherited value; overrides UpdateChoices; // shows or hides empty message as appropriate end class;