home *** CD-ROM | disk | FTP | other *** search
- // EOPopUpAssociation.h
- // Copyright (c) 1995, NeXT Software, Inc. All rights reserved.
- //
- // The EOPopUpAssociation binds item list and seleted item in a NSPopUpButton to
- // a pair of DisplayGroups.
- //
- // Bindings:
- // titles: property of the EOs in the DisplayGroup containing
- // the title for an item in the PopUp list.
- // If not bound, the title list already in the popup is undisturbed.
- // selectedTitle: string property of the EO containing the title to select in the popup.
- // When the popup selection changes, the title of the new selection
- // is assigned to this property.
- // selectedTag: int property of the EO containing the tag to select in the popup.
- // When the popup selection changes, the tag of the new selection
- // is assigned to this property. This might be useful for localization
- // purposes. Titles will be usually set in interface.If the tag was not
- // found and _tagValueForOther is defined the corresponding item will
- // be selected.
- // selectedObject: relationship property of the EO containing the EO to select
- // from the titles display group. selectedObject is usually
- // mutually exclusive with selectedTitle.
- // enabled: BOOL property of EO indicating whether control should be enabled.
- //
- // Example uses:
- // Selecting a string from a static list:
- // Say I have a DisplayGroup of Movies and I want to provide a PopUp for setting
- // the rating. Assume the rating is a string propery of the Movie object rather
- // than a relationship to a Rating EO. In this case I can type the list of ratings
- // into the popup in IB, and then bind the selectedTitle to the "rating" property
- // of the "Movie" Display group.
- // Selecting a string from a dynamic list:
- // Like above, but I want to fill the popup from the "ratingString" property
- // of DisplayGroup contain an array of Rating objects fetched from an external
- // source. In this case I bind the titles aspect to the "ratingString" property
- // of the "Ratings" Display group, and bind the selectedTitle to the "rating" property
- // of the "Movie" Display group.
- // Selecting an EO to assign to a to-one relationship:
- // Say I have a list of employees and want to assign what department each employee
- // belongs to. In terms of the object model, I want to assign a Department EO to
- // the "department" property of and Employee EO. In this case I bind "titles" to
- // the "name" property of a "Department" DisplayGroup, and bind "selectedObject"
- // to the "department" relationship property of the "Employee" DisplayGroup.
-
- #import <EOInterface/EOAssociation.h>
-
- @interface EOPopUpAssociation : EOAssociation
- {
- BOOL _addedTempItem;
- int _tagValueForOther;
- }
-
- - (void)setTagValueForOther:(int)newValue;
- - (int)tagValueForOther;
-
- @end
-