File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Draw / graphicsUndo.subproj / LockGraphicsChange.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:39 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 LockGraphicsChange(PrivateMethods)

- redoDetails;

@end

@implementation LockGraphicsChange

- (const char *)changeName
{
    return NXLocalStringFromTable("Operations", "Lock", NULL, "The operation of locking down all selected graphics so that they can't be edited in anyway until they are unlocked.");
}

- undoChange
{
    [graphics makeObjectsPerform:@selector(unlock)];
    [graphics makeObjectsPerform:@selector(select)];
    [graphicView resetLockedFlag];
    [graphicView getSelection];

    return [super undoChange];
}

- changeDetailClass
{
    return nil;
}

- redoDetails
{
    int i, count;
    List *selectedGraphics;
    id graphic;
    
    selectedGraphics = [graphicView selectedGraphics];
    count = [graphics count];
    for (i = 0; i < count; i++) {
        graphic = [graphics objectAt:i];
	[graphic lock];
	[graphic deselect];
	[selectedGraphics removeObject:graphic];
    }
    [graphicView resetLockedFlag];

    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.