home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSControl.h < prev    next >
Text File  |  1996-10-17  |  4KB  |  143 lines

  1. /*
  2.     NSControl.h
  3.     Application Kit
  4.     Copyright (c) 1994-1996, NeXT Software, Inc.
  5.     All rights reserved.
  6. */
  7.  
  8. #import <AppKit/NSView.h>
  9. #import <AppKit/NSText.h>
  10. #import <AppKit/AppKitDefines.h>
  11.  
  12. @class NSFont;
  13. @class NSCell;
  14. #ifndef STRICT_OPENSTEP
  15. @class NSAttributedString;
  16. @class NSTextView;
  17. #endif
  18.  
  19. @interface NSControl : NSView
  20. {
  21.     int    _tag;
  22.     id    _cell;
  23.     struct __conFlags {
  24.     unsigned int        enabled:1;
  25.     unsigned int        ignoreMultiClick:1;
  26.     unsigned int        calcSize:1;
  27.     unsigned int        drawingAncestor:1;
  28.     unsigned int        reservedControl:28;
  29.     } _conFlags;
  30. }
  31.  
  32. + (void)setCellClass:(Class)factoryId;
  33. + (Class)cellClass;
  34.  
  35. - (id)initWithFrame:(NSRect)frameRect;
  36. - (void)sizeToFit;
  37. - (void)calcSize;
  38. - (id)cell;
  39. - (void)setCell:(NSCell *)aCell;
  40. - (id)selectedCell;
  41. - (id)target;
  42. - (void)setTarget:(id)anObject;
  43. - (SEL)action;
  44. - (void)setAction:(SEL)aSelector;
  45. - (int)tag;
  46. - (void)setTag:(int)anInt;
  47. - (int)selectedTag;
  48. - (void)setIgnoresMultiClick:(BOOL)flag;
  49. - (BOOL)ignoresMultiClick;
  50. - (int)sendActionOn:(int)mask;
  51. - (BOOL)isContinuous;
  52. - (void)setContinuous:(BOOL)flag;
  53. - (BOOL)isEnabled;
  54. - (void)setEnabled:(BOOL)flag;
  55. - (void)setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits right:(unsigned)rightDigits;
  56. - (NSTextAlignment)alignment;
  57. - (void)setAlignment:(NSTextAlignment)mode;
  58. - (NSFont *)font;
  59. - (void)setFont:(NSFont *)fontObj;
  60. #ifndef STRICT_OPENSTEP
  61. - (void)setObjectValue:(id)obj;
  62. #endif STRICT_OPENSTEP
  63. - (void)setStringValue:(NSString *)aString;
  64. - (void)setIntValue:(int)anInt;
  65. - (void)setFloatValue:(float)aFloat;
  66. - (void)setDoubleValue:(double)aDouble;
  67. #ifndef STRICT_OPENSTEP
  68. - (id)objectValue;
  69. #endif STRICT_OPENSTEP
  70. - (NSString *)stringValue;
  71. - (int)intValue;
  72. - (float)floatValue;
  73. - (double)doubleValue;
  74. - (void)setNeedsDisplay;
  75. - (void)updateCell:(NSCell *)aCell;
  76. - (void)updateCellInside:(NSCell *)aCell;
  77. - (void)drawCellInside:(NSCell *)aCell;
  78. - (void)drawCell:(NSCell *)aCell;
  79. - (void)selectCell:(NSCell *)aCell;
  80.  
  81. - (BOOL)sendAction:(SEL)theAction to:(id)theTarget;
  82. - (void)takeIntValueFrom:(id)sender;
  83. - (void)takeFloatValueFrom:(id)sender;
  84. - (void)takeDoubleValueFrom:(id)sender;
  85. - (void)takeStringValueFrom:(id)sender;
  86. #ifndef STRICT_OPENSTEP
  87. - (void)takeObjectValueFrom:(id)sender;
  88. #endif STRICT_OPENSTEP
  89. - (NSText *)currentEditor;
  90. - (BOOL)abortEditing;
  91. - (void)validateEditing;
  92. - (void)mouseDown:(NSEvent *)theEvent;
  93.  
  94. @end
  95.  
  96. #ifndef STRICT_OPENSTEP
  97. @interface NSControl(NSKeyboardUI)
  98. - (void)performClick:sender;
  99. - (void)setRefusesFirstResponder:(BOOL)flag;
  100. - (BOOL)refusesFirstResponder;
  101. @end
  102. #endif
  103.  
  104. @interface NSObject(NSControlSubclassNotifications)
  105.  
  106. - (void)controlTextDidBeginEditing:(NSNotification *)obj;
  107. - (void)controlTextDidEndEditing:(NSNotification *)obj;
  108. - (void)controlTextDidChange:(NSNotification *)obj;
  109.  
  110. @end
  111.  
  112.  
  113.  
  114. @interface NSObject(NSControlSubclassDelegate)
  115.  
  116. // These delegate and notification methods are sent from NSControl subclasses that allow text editing such as NSTextField and NSMatrix.  The classes that need to send these have delegates.  NSControl does not.
  117.  
  118. - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
  119. - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
  120. #ifndef STRICT_OPENSTEP
  121. - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
  122. - (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
  123. - (BOOL)control:(NSControl *)control isValidObject:(id)obj;
  124.  
  125. - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
  126. #endif STRICT_OPENSTEP
  127. @end
  128.  
  129.                                 // userInfo keys:
  130. APPKIT_EXTERN NSString *NSControlTextDidBeginEditingNotification;    //    @"NSFieldEditor"
  131. APPKIT_EXTERN NSString *NSControlTextDidEndEditingNotification;    //    @"NSFieldEditor"
  132. APPKIT_EXTERN NSString *NSControlTextDidChangeNotification;        //    @"NSFieldEditor"
  133.  
  134.  
  135. #ifndef STRICT_OPENSTEP
  136.  
  137. @interface NSControl(NSControlAttributedStringMethods)
  138. - (NSAttributedString *)attributedStringValue;
  139. - (void)setAttributedStringValue:(NSAttributedString *)obj;
  140. @end
  141.  
  142. #endif
  143.