This is DaWindow.m in view mode; [Download] [Up]
/***(DaWindow.m)***************************************************************
*H* Trap keyboard events falling through to main window V0.0 22-JUN-91 *
*C* V0.0 22-JUN-91 Intitial version *
******************************************************************************/
#import "DaWindow.h"
#import "Calculator.h"
void UTL_NxDumpEvent (NXEvent*, int, int, int);
@implementation DaWindow
/******************************************************************************
* INSTANCE METHOD:- initContent:style:backing:buttonMask:defer: *
* This method overrides the Window's superclass method. *
******************************************************************************/
- initContent
/* Arguments */
: (const NXRect*)contentRect
style: (int)aStyle
backing: (int)bufferingType
buttonMask: (int)mask
defer: (BOOL)flag
{ /* Local Variables */
/* BEGIN initContent:style:backing:buttonMask:defer: */
/* Invoke super classes method */
[super initContent:contentRect style:aStyle
backing:bufferingType buttonMask:mask defer:flag];
/* Make this window the key window */
[self makeKeyAndOrderFront:self];
return(self);
}/* END initContent:style:backing:buttonMask:defer: */
/******************************************************************************
* INSTANCE METHOD:- acceptsFirstResponder *
******************************************************************************/
- (BOOL) acceptsFirstResponder
{/* BEGIN:-acceptsFirstResponder */
return(YES);
}/* END:-acceptsFirstResponder */
/******************************************************************************
* INSTANCE METHOD:- keyDown *
* This function captures key down events falling through to the main window *
* of the SciCalc application. Most key down events are sent to the main *
* input processing object Calculator. *
******************************************************************************/
- keyDown:(NXEvent *)event
{/* BEGIN keyDown */
#ifdef DEBUG
printf("DaWindow-keyDown:");
UTL_NxDumpEvent (event, 1, 1, 1);
#endif
[Calculator KeyBoardEquivalent:event];
return self;
}/* END keyDown */
@endThese are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.