home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / EODEV.Z / EOPopUpAssociation.h < prev    next >
Encoding:
Text File  |  1996-09-09  |  2.9 KB  |  57 lines

  1. // EOPopUpAssociation.h
  2. // Copyright (c) 1995, NeXT Software, Inc. All rights reserved. 
  3. //
  4. // The EOPopUpAssociation binds item list and seleted item in a NSPopUpButton to
  5. // a pair of DisplayGroups.
  6. //
  7. // Bindings:
  8. //     titles:          property of the EOs in the DisplayGroup containing
  9. //                      the title for an item in the PopUp list.
  10. //                      If not bound, the title list already in the popup is undisturbed.
  11. //     selectedTitle:   string property of the EO containing the title to select in the popup.
  12. //                      When the popup selection changes, the title of the new selection
  13. //                      is assigned to this property.
  14. //     selectedTag:     int property of the EO containing the tag to select in the popup.
  15. //                      When the popup selection changes, the tag of the new selection
  16. //                      is assigned to this property. This might be useful for localization
  17. //            purposes. Titles will be usually set in interface.If the tag was not
  18. //            found and _tagValueForOther is defined the corresponding item will
  19. //            be selected.
  20. //     selectedObject:  relationship property of the EO containing the EO to select
  21. //                      from the titles display group.  selectedObject is usually
  22. //                      mutually exclusive with selectedTitle.
  23. //     enabled:         BOOL property of EO indicating whether control should be enabled.
  24. //
  25. // Example uses:
  26. //  Selecting a string from a static list:
  27. //    Say I have a DisplayGroup of Movies and I want to provide a PopUp for setting
  28. //    the rating.  Assume the rating is a string propery of the Movie object rather
  29. //    than a relationship to a Rating EO.  In this case I can type the list of ratings
  30. //    into the popup in IB, and then bind the selectedTitle to the "rating" property
  31. //    of the "Movie" Display group.
  32. //  Selecting a string from a dynamic list:
  33. //    Like above, but I want to fill the popup from the "ratingString" property
  34. //    of DisplayGroup contain an array of Rating objects fetched from an external
  35. //    source.  In this case I bind the titles aspect to the "ratingString" property
  36. //    of the "Ratings" Display group, and bind the selectedTitle to the "rating" property
  37. //    of the "Movie" Display group.
  38. //  Selecting an EO to assign to a to-one relationship:
  39. //   Say I have a list of employees and want to assign what department each employee
  40. //   belongs to.  In terms of the object model, I want to assign a Department EO to
  41. //   the "department" property of and Employee EO.  In this case I bind "titles" to
  42. //   the "name" property of a "Department" DisplayGroup, and bind "selectedObject"
  43. //   to the "department" relationship property of the "Employee" DisplayGroup.
  44.  
  45. #import <EOInterface/EOAssociation.h>
  46.  
  47. @interface EOPopUpAssociation : EOAssociation
  48. {
  49.     BOOL _addedTempItem;
  50.     int _tagValueForOther;
  51. }
  52.  
  53. - (void)setTagValueForOther:(int)newValue;
  54. - (int)tagValueForOther;
  55.  
  56. @end
  57.