home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSComboBox.h < prev    next >
Text File  |  1996-12-20  |  2KB  |  81 lines

  1. /*
  2.     NSComboBox.h
  3.     Application Kit
  4.     Copyright (c) 1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8. #if !defined(STRICT_OPENSTEP) && !defined(STRICT_40)
  9.  
  10. #import <Foundation/NSNotification.h>
  11. #import <AppKit/NSTextField.h>
  12.  
  13. APPKIT_EXTERN NSString *NSComboBoxWillPopUpNotification;
  14. APPKIT_EXTERN NSString *NSComboBoxWillDismissNotification;
  15. APPKIT_EXTERN NSString *NSComboBoxSelectionDidChangeNotification;
  16. APPKIT_EXTERN NSString *NSComboBoxSelectionIsChangingNotification;
  17.  
  18. @interface NSComboBox : NSTextField {
  19.     id _dataSource;
  20. }
  21.  
  22. - (BOOL)hasVerticalScroller;
  23. - (void)setHasVerticalScroller:(BOOL)flag;
  24. - (NSSize)intercellSpacing;
  25. - (void)setIntercellSpacing:(NSSize)aSize;
  26. - (float)itemHeight;
  27. - (void)setItemHeight:(float)itemHeight;
  28. - (int)numberOfVisibleItems;
  29. - (void)setNumberOfVisibleItems:(int)visibleItems;
  30.  
  31. - (void)reloadData;
  32. - (void)noteNumberOfItemsChanged;
  33.  
  34. - (void)setUsesDataSource:(BOOL)flag;
  35. - (BOOL)usesDataSource;
  36.  
  37. - (void)scrollItemAtIndexToTop:(int)index;
  38. - (void)scrollItemAtIndexToVisible:(int)index;
  39.  
  40. - (void)selectItemAtIndex:(int)index;
  41. - (void)deselectItemAtIndex:(int)index;
  42. - (int)indexOfSelectedItem;
  43. - (int)numberOfItems;
  44.  
  45. - (void)encodeWithCoder:(NSCoder *)coder;
  46. - (id)initWithCoder:(NSCoder *)coder;
  47.  
  48. /* These two methods can only be used when usesDataSource is YES */
  49. - (id)dataSource;
  50. - (void)setDataSource:(id)aSource;
  51.  
  52. /* These methods can only be used when usesDataSource is NO */
  53. - (void)addItemWithObjectValue:(id)object;
  54. - (void)addItemsWithObjectValues:(NSArray *)objects;
  55. - (void)insertItemWithObjectValue:(id)object atIndex:(int)index;
  56. - (void)removeItemWithObjectValue:(id)object;
  57. - (void)removeItemAtIndex:(int)index;
  58. - (void)removeAllItems;
  59. - (void)selectItemWithObjectValue:(id)object;
  60. - (id)itemObjectValueAtIndex:(int)index;
  61. - (id)objectValueOfSelectedItem;
  62. - (int)indexOfItemWithObjectValue:(id)object;
  63. - (NSArray *)objectValues;
  64.  
  65. @end
  66.  
  67. @interface NSObject (NSComboBoxDataSource)
  68. - (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
  69. - (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index;
  70. - (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)string;
  71. @end
  72.  
  73. @interface NSObject (NSComboBoxNotifications)
  74. - (void)comboBoxWillPopUp:(NSNotification *)notification;
  75. - (void)comboBoxWillDismiss:(NSNotification *)notification;
  76. - (void)comboBoxSelectionDidChange:(NSNotification *)notification;
  77. - (void)comboBoxSelectionIsChanging:(NSNotification *)notification;
  78. @end
  79.  
  80. #endif
  81.