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

  1. /*
  2.     NSComboBoxCell.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) && !defined(STRICT_41)
  9.  
  10. #import <AppKit/NSTextFieldCell.h>
  11. #import <AppKit/NSTableView.h>
  12.  
  13. @interface NSComboBoxCell : NSTextFieldCell   {
  14.     id _delegate;
  15.     id _dataSource;
  16.     struct __cbcFlags {
  17.     unsigned int usesDataSource:1;
  18.     unsigned int reserved:15;
  19.     unsigned int visibleItems:16;
  20.     } _cbcFlags;
  21.     NSButtonCell *_buttonCell;
  22.     NSTableView *_tableView;
  23.     NSScrollView *_scrollView;
  24.     NSWindow *_popUp;
  25.     NSMutableArray *_popUpList;
  26.     NSRect *_cellFrame;
  27.     void *_reserved;
  28.  }
  29.  
  30. - (BOOL)hasVerticalScroller;
  31. - (void)setHasVerticalScroller:(BOOL)flag;
  32. - (NSSize)intercellSpacing; 
  33. - (void)setIntercellSpacing:(NSSize)aSize; 
  34. - (float)itemHeight;
  35. - (void)setItemHeight:(float)itemHeight; 
  36. - (int)numberOfVisibleItems;
  37. - (void)setNumberOfVisibleItems:(int)visibleItems;
  38.  
  39. - (void)reloadData;
  40. - (void)noteNumberOfItemsChanged;
  41.  
  42. - (void)setUsesDataSource:(BOOL)flag;
  43. - (BOOL)usesDataSource;
  44.  
  45. - (void)scrollItemAtIndexToTop:(int)index;
  46. - (void)scrollItemAtIndexToVisible:(int)index;
  47.  
  48. - (void)selectItemAtIndex:(int)index;
  49. - (void)deselectItemAtIndex:(int)index;
  50. - (int)indexOfSelectedItem;
  51. - (int)numberOfItems;
  52.  
  53. - (void)encodeWithCoder:(NSCoder *)coder;
  54. - (id)initWithCoder:(NSCoder *)coder;
  55.  
  56. /* These two methods can only be used when usesDataSource is YES */
  57. - (id)dataSource;
  58. - (void)setDataSource:(id)aSource; 
  59.  
  60. /* These methods can only be used when usesDataSource is NO */
  61. - (void)addItemWithObjectValue:(id)object;
  62. - (void)addItemsWithObjectValues:(NSArray *)objects;
  63. - (void)insertItemWithObjectValue:(id)object atIndex:(int)index;
  64. - (void)removeItemWithObjectValue:(id)object;
  65. - (void)removeItemAtIndex:(int)index;
  66. - (void)removeAllItems;
  67. - (void)selectItemWithObjectValue:(id)object;
  68. - (id)itemObjectValueAtIndex:(int)index;
  69. - (id)objectValueOfSelectedItem;
  70. - (int)indexOfItemWithObjectValue:(id)object;
  71. - (NSArray *)objectValues;
  72.  
  73. @end
  74.  
  75. @interface NSObject (NSComboBoxCellDataSource)
  76. - (int)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell;
  77. - (id)comboBoxCell:(NSComboBoxCell *)aComboBoxCell objectValueForItemAtIndex:(int)index;
  78. - (unsigned int)comboBoxCell:(NSComboBoxCell *)aComboBoxCell indexOfItemWithStringValue:(NSString *)string;
  79. @end
  80.  
  81. #endif
  82.