ftp.nice.ch/pub/next/science/mathematics/HippoDraw.2.0.s.tar.gz#/HippoDraw/Hippo.bproj/Draw.subproj/graphicsUndo.subproj/StartEditingGraphicsChange.m

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

#import "drawundo.h"

/*
 * This change is created when the user begins editing a text
 * graphic, either by clicking in graphic while in the text tool
 * is selected or by creating a new graphic with the text tool. 
 * Undoing this change inserts the removes the text editing
 * cursor from the text. More significantly, undoing this
 * change swaps the contents of the field editor back into the
 * TextGraphic and redoing this change swaps the contents of the
 * TextGraphic into the field editor.
 */

@interface StartEditingGraphicsChange(PrivateMethods)

@end

@implementation StartEditingGraphicsChange

- initGraphic:aGraphic
{
    [super init];
    graphic = aGraphic;

    return self;
}

- (const char *)changeName
{
    return NXLocalStringFromTable("Operations", "Begin Editing", NULL, "The operation of starting to edit some text.");
}

- undoChange
{
    [graphic resignFieldEditor];
    [NXApp endEditMode];
    return [super undoChange];
}

- redoChange
{
    [graphic prepareFieldEditor];
    [NXApp startEditMode];
    return [super redoChange];
}

@end

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