
/*
 * Copyright 1991 RightBrain Software.  All rights reserved.
 *
 * No part of this code may be reproduced in any form, compiled
 * or source code, nor used for any purpose without the express
 * written permission of RightBrain Software.
 * 
 * Entered into the public domain 12/15/93 by RightBrain Software.
 *
 */

#import "MyPanel.h"
#import "Controller.h"
#import <appkit/Application.h>

@implementation MyPanel

- rememberPosition:sender
{
    id control;
    [self getFrame: &currentFrame];
    control = [NXApp delegate];
    [control writeFileList:[control listFileName]];
    return self;
}

- getPosition:(NXRect *)theRect;
{
    theRect->origin.x = currentFrame.origin.x;
    theRect->origin.y = currentFrame.origin.y;
    theRect->size.width = currentFrame.size.width;
    theRect->size.height = currentFrame.size.height;
    return self;
}


- setPosition:(NXRect *)theRect;
{
    [self placeWindow:theRect];
    currentFrame.origin.x = theRect->origin.x;
    currentFrame.origin.y = theRect->origin.y;
    currentFrame.size.width = theRect->size.width;
    currentFrame.size.height = theRect->size.height;
    return self;
}

- keyDown:(NXEvent *)thisEvent;
{
    int			key;
    
    key = thisEvent->data.key.charCode;
    if ( (key == '\177') || (key == '\b') ) {
	[[NXApp delegate] cut:self];
    }

    return self;
}

- windowWillClose:sender;
{
    [NXApp hide:self];
    return nil;
}


@end
