1#import "drawundo.h"
2
3/*
4 * This change is created when the user begins editing a text
5 * graphic, either by clicking in graphic while in the text tool
6 * is selected or by creating a new graphic with the text tool.
7 * Undoing this change inserts the removes the text editing
8 * cursor from the text. More significantly, undoing this
9 * change swaps the contents of the field editor back into the
10 * TextGraphic and redoing this change swaps the contents of the
11 * TextGraphic into the field editor.
12 */
13
14@interface StartEditingGraphicsChange(PrivateMethods)
15
16@end
17
18@implementation StartEditingGraphicsChange
19
20- initGraphic:aGraphic
21{
22    [super init];
23    graphic = aGraphic;
24
25    return self;
26}
27
28- (NSString *)changeName
29{
30    return START_EDITING_OP;
31}
32
33- (void)undoChange
34{
35    [graphic resignFieldEditor];
36    [NSApp endEditMode];
37    [super undoChange];
38}
39
40- (void)redoChange
41{
42    [graphic prepareFieldEditor];
43    [NSApp startEditMode];
44    [super redoChange];
45}
46
47@end
48