home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / NSPopUpButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-09  |  2.2 KB  |  81 lines

  1. /*
  2.     NSPopUpButton.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8. #import <Foundation/Foundation.h>
  9. #import <AppKit/NSButton.h>
  10. #import <AppKit/NSMenuItem.h>
  11. #import <AppKit/AppKitDefines.h>
  12.  
  13. @class NSString;
  14. @class NSFont;
  15. @class NSMatrix;
  16.  
  17. @interface NSPopUpButton : NSButton
  18. {
  19.     id            _target;     
  20.     SEL            _action;
  21.     struct __popUpButtonFlags {
  22.         unsigned int    pullsDown:1;
  23.         unsigned int    usingColorizedImages:1;
  24.         unsigned int    reservedPopUpButton:30;
  25.     } _pbFlags;
  26. }
  27.  
  28. - (id)initWithFrame:(NSRect)buttonFrame pullsDown:(BOOL)flag;
  29.  
  30. - (void)setPullsDown:(BOOL)flag;
  31. - (BOOL)pullsDown;
  32.  
  33. - (NSArray *)itemArray;
  34.  
  35. - (int)numberOfItems;
  36. - (void)addItemWithTitle:(NSString *)title;
  37. - (void)addItemsWithTitles:(NSArray *)itemTitles;
  38. - (void)insertItemWithTitle:(NSString *)title atIndex:(int)index;
  39. - (void)removeItemWithTitle:(NSString *)title;
  40. - (void)removeItemAtIndex:(int)index;
  41. - (void)removeAllItems;
  42. - (void)synchronizeTitleAndSelectedItem;
  43. - (void)selectItemWithTitle:(NSString *)title;
  44. - (void)selectItemAtIndex:(int)index;
  45. - (id <NSMenuItem>)itemAtIndex:(int)index;
  46. - (id <NSMenuItem>)itemWithTitle:(NSString *)title;
  47. - (id <NSMenuItem>)selectedItem;
  48. - (id <NSMenuItem>)lastItem;
  49. - (NSString *)itemTitleAtIndex:(int)index;
  50. - (NSString *)titleOfSelectedItem;
  51. - (int)indexOfSelectedItem;
  52. - (int)indexOfItemWithTitle:(NSString *)title;
  53. - (NSArray *)itemTitles;
  54. - (void)setFont:(NSFont *)fontObject;
  55.  
  56.     /* This is a no-op in NSControl, but it is here because we override */
  57.     /* it to return the titleOfSelectedItem. This is useful if there is */
  58.     /* a TextField or something that is supposed to reflect the most */
  59.     /* recent PopUp selection. */
  60. - (NSString *)stringValue;
  61.     /* Adds semantic to NSButton's method that if there is no item in */
  62.     /* popup matching title, then an item of that name is added. */
  63. - (void)setTitle:(NSString *)aString;
  64. - (id)target;
  65. - (void)setTarget:(id)anObject;
  66. - (SEL)action;
  67. - (void)setAction:(SEL)aSelector;
  68. - (void)setAutoenablesItems:(BOOL)flag;
  69. - (BOOL)autoenablesItems;
  70.  
  71. @end
  72.  
  73.  
  74. #ifndef STRICT_OPENSTEP
  75.  
  76. /* Notifications */
  77. APPKIT_EXTERN NSString *NSPopUpButtonWillPopUpNotification;
  78.  
  79. #endif
  80.  
  81.