ftp.nice.ch/pub/next/tools/screen/Rulers_by_SW.1.2.s.tar.gz#/Rulers_by_SW/Rulers_by_SW-1.2/RulerPanel.m

This is RulerPanel.m in view mode; [Download] [Up]

// RulerPanel.m
// Project: Rulers
//
// Stephan Wacker
// 93-02-16

#if 0	// Purpose

A RulerPanel is a Panel object with the following modifications:
-- It can become the main window.
-- It isn't activated when the user clicks in its contents area.
-- It is a plain window without a title bar.

#endif	// Purpose



#import "RulerPanel.h"


@implementation RulerPanel


- (BOOL) canBecomeMainWindow
{
    return YES;
}

- frameView
// access window's private resource
{
    return _borderView;
}

- initContent: (const NXRect *) contentRect
        style: (int) aStyle
      backing: (int) backingType
   buttonMask: (int) mask
        defer: (BOOL) flag
// Override style parameter with NX_PLAINSTYLE.
{
    NXRect	frameRect = *contentRect;
    
    [super initContent: &frameRect
#ifndef REGULAR_WINDOW
		 style: NX_PLAINSTYLE
#else
		 style: aStyle
#endif
	       backing: backingType
	    buttonMask: mask
		 defer: flag
    ];
    
    [self setAvoidsActivation: YES];
    
    return self;
}


// Forward keystrokes to the RulerControl delegate.
//
- keyDown: (NXEvent *) theEvent
{
    id result = nil;

    if( (theEvent->flags & (NX_COMMANDMASK|NX_HELPMASK)) == 0 ) {
	result = [delegate keyDown: theEvent];
    }
    if( !result ) {
	result = [super keyDown: theEvent];
    }
    return result;
}


// Window can be closed even though it doesn't have a close button.
//
- performClose: sender
{
    if( [delegate respondsTo: @selector( windowWillClose: )] )
	[delegate windowWillClose: self];
    
    return [self close];
}


@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.