Annotation of Examples/AppKit/Draw/graphicsUndo.subproj/UnlockGraphicsChange.m, revision 1.1

1.1     ! root        1: #import "drawundo.h"
        !             2: 
        !             3: @interface UnlockGraphicsChange(PrivateMethods)
        !             4: 
        !             5: - undoDetails;
        !             6: 
        !             7: @end
        !             8: 
        !             9: @implementation UnlockGraphicsChange
        !            10: 
        !            11: - (const char *)changeName
        !            12: {
        !            13:     return NXLocalStringFromTable("Operations", "Unlock", NULL, "The operation of unlocking all the graphical entities which were previously locked down (see Lock).");
        !            14:     return "Unlock";
        !            15: }
        !            16: 
        !            17: - saveBeforeChange
        !            18: {
        !            19:     List *allGraphics;
        !            20:     int i, count;
        !            21:     id graphic;
        !            22: 
        !            23:     graphics = [[List alloc] init];
        !            24: 
        !            25:     allGraphics = [graphicView graphics];
        !            26:     count = [allGraphics count];
        !            27:     for (i = 0; i < count; i++) {
        !            28:         graphic = [allGraphics objectAt:i];
        !            29:        if ([graphic isLocked])
        !            30:            [graphics addObject:graphic];
        !            31:     }
        !            32: 
        !            33:     if ([graphics count] == 0)
        !            34:         [self disable];
        !            35:        
        !            36:     return self;
        !            37: }
        !            38: 
        !            39: - redoChange
        !            40: {
        !            41:     [graphics makeObjectsPerform:@selector(unlock)];
        !            42:     [graphicView resetLockedFlag];
        !            43: 
        !            44:     return [super redoChange];
        !            45: }
        !            46: 
        !            47: - changeDetailClass
        !            48: {
        !            49:     return nil;
        !            50: }
        !            51: 
        !            52: - undoDetails
        !            53: {
        !            54:     int i, count;
        !            55:     List *selectedGraphics;
        !            56:     id graphic;
        !            57:     
        !            58:     selectedGraphics = [graphicView selectedGraphics];
        !            59:     count = [graphics count];
        !            60:     for (i = 0; i < count; i++) {
        !            61:         graphic = [graphics objectAt:i];
        !            62:        [graphic lock];
        !            63:        [graphic deselect];
        !            64:        [selectedGraphics removeObject:graphic];
        !            65:     }
        !            66:     [graphicView resetLockedFlag];
        !            67: 
        !            68:     return self;
        !            69: }
        !            70: 
        !            71: @end

unix.superglobalmegacorp.com

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