File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Draw / graphicsUndo.subproj / ResizeGraphicsChange.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:38 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

#import "drawundo.h"

@interface ResizeGraphicsChange(PrivateMethods)

- undoDetails;
- redoDetails;

@end

@implementation ResizeGraphicsChange

- initGraphicView:aGraphicView graphic:aGraphic
{
    [super initGraphicView:aGraphicView];
    graphic = aGraphic;
    return self;
}

- (const char *)changeName
{
    return NXLocalStringFromTable("Operations", "Resize", NULL, "The operation of changing the size of a graphical entity by dragging a corner of it with the mouse.");
}

- saveBeforeChange
{
    graphics = [[List alloc] init];
    [graphics addObject:graphic];
    [graphic getBounds:&oldBounds];
    return self;
}

- changeDetailClass
{
    return nil;
}

- undoDetails
{
    [graphic getBounds:&newBounds];
    [graphic setBounds:&oldBounds];
    return self;
}

- redoDetails
{
    [graphic setBounds:&newBounds];
    return self;
}

@end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.