home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks5 / AppKit.framework / Headers / NSPopUpButton.h < prev    next >
Encoding:
Text File  |  1995-12-21  |  1.9 KB  |  66 lines

  1. /*
  2.     NSPopUpButton.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1994, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <Foundation/Foundation.h>
  8. #import "NSButton.h"
  9.  
  10. @class NSString;
  11. @class NSFont;
  12. @class NSMatrix;
  13. @class NSMenuCell;
  14.  
  15. @interface NSPopUpButton : NSButton
  16. {
  17.     BOOL pullsDown;
  18.     id target;     
  19.     SEL action;     
  20. }
  21.  
  22. - (id)initWithFrame:(NSRect)buttonFrame pullsDown:(BOOL)flag;
  23.  
  24. - setPullsDown:(BOOL)flag;
  25. - (BOOL)pullsDown;
  26.  
  27.     /* Backdoor access for experts, allows "sizeToFit", etc. */
  28. - (NSMatrix *)itemMatrix;    // NSMatrix of NSButtonCells
  29.  
  30. - (int)numberOfItems;
  31. - addItemWithTitle:(NSString *)title;
  32. - (void)addItemsWithTitles:(NSArray *)itemTitles;
  33. - insertItemWithTitle:(NSString *)title atIndex:(int)index;
  34. - removeItemWithTitle:(NSString *)title;
  35. - removeItemAtIndex:(int)index;
  36. - (void)removeAllItems;
  37.     /* This is iffy (good for subclassers). */
  38. - (void)synchronizeTitleAndSelectedItem;
  39. - (void)selectItemWithTitle:(NSString *)title;
  40. - (void)selectItemAtIndex:(int)index;
  41. - (NSButtonCell *)itemAtIndex:(int)index;
  42. - (NSButtonCell *)itemWithTitle:(NSString *)title;
  43. - (NSButtonCell *)selectedItem;
  44. - (NSButtonCell *)lastItem;
  45. - (NSString *)itemTitleAtIndex:(int)index;
  46. - (NSString *)titleOfSelectedItem;
  47. - (int)indexOfSelectedItem;
  48. - (int)indexOfItemWithTitle:(NSString *)title;
  49. - (NSArray *)itemTitles;
  50. - (NSFont *)font;
  51. - setFont:(NSFont *)fontObject;
  52.  
  53.     /* This is a no-op in NSControl, but it is here because we override */
  54.     /* it to return the titleOfSelectedItem. This is useful if there is */
  55.     /* a TextField or something that is supposed to reflect the most */
  56.     /* recent PopUp selection. */
  57. - (NSString *)stringValue;
  58.     /* Adds semantic to NSButton's method that if there is no item in */
  59.     /* popup matching title, then an item of that name is added. */
  60. - setTitle:(NSString *)aString;
  61. - (void)setAutoenablesItems:(BOOL)flag;
  62. - (BOOL)autoenablesItems;
  63.  
  64.  
  65. @end
  66.