1996-05-30 20:03:15 +00:00
|
|
|
/*
|
|
|
|
NSText.m
|
|
|
|
|
|
|
|
The RTFD text class
|
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Date: 1996
|
1998-08-01 15:41:49 +00:00
|
|
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
|
|
|
Date: July 1998
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
1996-10-18 17:14:13 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1996-05-30 20:03:15 +00:00
|
|
|
*/
|
|
|
|
|
1997-09-23 22:43:24 +00:00
|
|
|
#include <gnustep/gui/config.h>
|
1997-08-18 17:10:23 +00:00
|
|
|
#include <Foundation/NSString.h>
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <AppKit/NSText.h>
|
|
|
|
#include <AppKit/NSApplication.h>
|
|
|
|
#include <AppKit/NSWindow.h>
|
|
|
|
#include <AppKit/NSFontPanel.h>
|
|
|
|
#include <AppKit/NSFont.h>
|
|
|
|
#include <AppKit/NSColor.h>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-07-18 19:21:22 +00:00
|
|
|
#define ASSIGN(variable, value) [value retain]; \
|
|
|
|
[variable release]; \
|
|
|
|
variable = value;
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
// NSText implementation
|
|
|
|
//
|
|
|
|
@implementation NSText
|
|
|
|
|
|
|
|
//
|
|
|
|
// Class methods
|
|
|
|
//
|
|
|
|
+ (void)initialize
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if (self == [NSText class])
|
|
|
|
[self setVersion:1]; // Initial version
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Instance methods
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Initialization
|
|
|
|
//
|
|
|
|
- initWithFrame:(NSRect)frameRect
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
[super initWithFrame:frameRect];
|
|
|
|
|
1998-08-04 08:33:31 +00:00
|
|
|
text_contents = @"Text";
|
1998-08-01 15:41:49 +00:00
|
|
|
alignment = NSLeftTextAlignment;
|
|
|
|
is_editable = YES;
|
|
|
|
is_rich_text = NO;
|
|
|
|
is_selectable = YES;
|
|
|
|
imports_graphics = NO;
|
|
|
|
uses_font_panel = YES;
|
|
|
|
is_horizontally_resizable = YES;
|
|
|
|
is_vertically_resizable = YES;
|
|
|
|
is_ruler_visible = NO;
|
|
|
|
is_field_editor = NO;
|
|
|
|
draws_background = YES;
|
|
|
|
background_color = [NSColor whiteColor];
|
|
|
|
text_color = [NSColor blackColor];
|
|
|
|
default_font = [NSFont userFontOfSize:12];
|
|
|
|
|
|
|
|
return self;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
1998-07-18 19:21:22 +00:00
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
|
|
|
[background_color release];
|
|
|
|
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
// Getting and Setting Contents
|
|
|
|
//
|
1998-08-01 15:41:49 +00:00
|
|
|
- (void)replaceRange:(NSRange)range withRTF:(NSData *)rtfData
|
1996-05-30 20:03:15 +00:00
|
|
|
{}
|
|
|
|
|
1998-08-01 15:41:49 +00:00
|
|
|
- (void)replaceRange:(NSRange)range withRTFD:(NSData *)rtfdData
|
1996-05-30 20:03:15 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
- (NSData *)RTFDFromRange:(NSRange)range
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
return nil;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSData *)RTFFromRange:(NSRange)range
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
return nil;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setText:(NSString *)string
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
ASSIGN(text_contents, string);
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-08-01 15:41:49 +00:00
|
|
|
- (void)setText:(NSString *)string range:(NSRange)range
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
[self setSelectedRange:range];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-08-04 08:33:31 +00:00
|
|
|
- (NSString *)text { return text_contents; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Managing Global Characteristics
|
|
|
|
//
|
1998-08-04 08:33:31 +00:00
|
|
|
- (NSTextAlignment)alignment { return alignment; }
|
|
|
|
- (BOOL)drawsBackground { return draws_background; }
|
|
|
|
- (BOOL)importsGraphics { return imports_graphics; }
|
|
|
|
- (BOOL)isEditable { return is_editable; }
|
|
|
|
- (BOOL)isRichText { return is_rich_text; }
|
|
|
|
- (BOOL)isSelectable { return is_selectable; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setAlignment:(NSTextAlignment)mode
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
alignment = mode;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setDrawsBackground:(BOOL)flag
|
1998-08-01 15:41:49 +00:00
|
|
|
{
|
|
|
|
draws_background = flag;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setEditable:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
is_editable = flag;
|
|
|
|
if (flag) // If we are editable then we
|
|
|
|
is_selectable = YES; // are selectable
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setImportsGraphics:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
imports_graphics = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setRichText:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
is_rich_text = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setSelectable:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
is_selectable = flag;
|
|
|
|
if (!flag) // If we are not selectable
|
|
|
|
is_editable = NO; // then we must not be editable
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Managing Font and Color
|
|
|
|
//
|
1998-08-04 08:33:31 +00:00
|
|
|
- (NSColor *)backgroundColor { return background_color; }
|
|
|
|
- (NSFont *)font { return default_font; }
|
|
|
|
- (NSColor *)textColor { return text_color; }
|
|
|
|
- (BOOL)usesFontPanel { return uses_font_panel; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)changeFont:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setBackgroundColor:(NSColor *)color
|
|
|
|
{
|
1998-07-18 19:21:22 +00:00
|
|
|
ASSIGN(background_color, color);
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-08-01 15:41:49 +00:00
|
|
|
- (void)setColor:(NSColor *)color ofRange:(NSRange)range
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setFont:(NSFont *)obj
|
|
|
|
{
|
1998-08-04 08:33:31 +00:00
|
|
|
ASSIGN(default_font, obj);
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-08-01 15:41:49 +00:00
|
|
|
- (void)setFont:(NSFont *)font ofRange:(NSRange)range
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setTextColor:(NSColor *)color
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
text_color = color;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setUsesFontPanel:(BOOL)flag
|
|
|
|
{
|
1998-08-04 08:33:31 +00:00
|
|
|
uses_font_panel = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Managing the Selection
|
|
|
|
//
|
1998-08-04 08:33:31 +00:00
|
|
|
- (NSRange)selectedRange { return selected_range; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setSelectedRange:(NSRange)range
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
selected_range = range;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Sizing the Frame Rectangle
|
|
|
|
//
|
|
|
|
- (void)setFrame:(NSRect)frameRect
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
[super setFrame:frameRect];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-08-04 08:33:31 +00:00
|
|
|
- (BOOL)isHorizontallyResizable { return is_horizontally_resizable; }
|
|
|
|
- (BOOL)isVerticallyResizable { return is_vertically_resizable; }
|
|
|
|
- (NSSize)maxSize { return NSZeroSize; }
|
|
|
|
- (NSSize)minSize { return NSZeroSize; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setHorizontallyResizable:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
is_horizontally_resizable = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setMaxSize:(NSSize)newMaxSize
|
1998-08-01 15:41:49 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setMinSize:(NSSize)newMinSize
|
1998-08-01 15:41:49 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setVerticallyResizable:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
is_vertically_resizable = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)sizeToFit
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Responding to Editing Commands
|
|
|
|
//
|
|
|
|
- (void)alignCenter:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)alignLeft:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)alignRight:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)copy:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)copyFont:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)copyRuler:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)cut:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)delete:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)paste:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)pasteFont:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)pasteRuler:(id)sender
|
1998-08-04 08:33:31 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)selectAll:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)subscript:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)superscript:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)underline:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)unscript:(id)sender
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Managing the Ruler
|
|
|
|
//
|
1998-08-04 08:33:31 +00:00
|
|
|
- (BOOL)isRulerVisible { return NO; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)toggleRuler:(id)sender
|
|
|
|
{}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Spelling
|
|
|
|
//
|
|
|
|
- (void)checkSpelling:(id)sender
|
|
|
|
{}
|
|
|
|
|
|
|
|
- (void)showGuessPanel:(id)sender
|
|
|
|
{}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Scrolling
|
|
|
|
//
|
|
|
|
- (void)scrollRangeToVisible:(NSRange)range
|
|
|
|
{}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Reading and Writing RTFD Files
|
|
|
|
//
|
|
|
|
- (BOOL)readRTFDFromFile:(NSString *)path
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
return NO;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-08-04 08:33:31 +00:00
|
|
|
- (BOOL)writeRTFDToFile:(NSString *)path atomically:(BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
return NO;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Managing the Field Editor
|
|
|
|
//
|
1998-08-04 08:33:31 +00:00
|
|
|
- (BOOL)isFieldEditor { return is_field_editor; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setFieldEditor:(BOOL)flag
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
is_field_editor = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Handling Events
|
|
|
|
//
|
|
|
|
- (void)mouseDown:(NSEvent *)theEvent
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if (!is_selectable) // If not selectable then don't
|
|
|
|
return; // recognize the mouse down
|
|
|
|
[[self window] makeFirstResponder:self];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)mouseUp:(NSEvent *)theEvent
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if (!is_selectable) // If not selectable then don't
|
|
|
|
return; // recognize the mouse up
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)mouseMoved:(NSEvent *)theEvent
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if (!is_selectable) // If not selectable then don't
|
|
|
|
return; // recognize the mouse moved
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)keyDown:(NSEvent *)theEvent
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if (!is_editable) // If not editable then don't
|
|
|
|
return; // recognize the key down
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)keyUp:(NSEvent *)theEvent
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if (!is_editable) // If not editable then don't
|
|
|
|
return; // recognize the key up
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)acceptsFirstResponder
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if ([self isSelectable])
|
|
|
|
return YES;
|
|
|
|
else
|
|
|
|
return NO;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)becomeFirstResponder
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if ([self isEditable])
|
|
|
|
return YES;
|
|
|
|
else
|
|
|
|
return NO;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Managing the Delegate
|
|
|
|
//
|
1998-08-04 08:33:31 +00:00
|
|
|
- (id)delegate { return delegate; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setDelegate:(id)anObject
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
delegate = anObject;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Implemented by the Delegate
|
|
|
|
//
|
|
|
|
- (void)textDidBeginEditing:(NSNotification *)aNotification
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(textDidBeginEditing:)])
|
|
|
|
[delegate textDidBeginEditing:nil];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)textDidChange:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
if ([delegate respondsToSelector:@selector(textDidChange:)])
|
|
|
|
[delegate textDidChange:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)textDidEndEditing:(NSNotification *)aNotification
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(textDidEndEditing:)])
|
|
|
|
[delegate textDidEndEditing:nil];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)textShouldBeginEditing:(NSText *)textObject
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(textShouldBeginEditing:)])
|
|
|
|
return [delegate textShouldBeginEditing:nil];
|
|
|
|
else
|
|
|
|
return YES;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)textShouldEndEditing:(NSText *)textObject
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(textShouldEndEditing:)])
|
|
|
|
return [delegate textShouldEndEditing:nil];
|
|
|
|
else
|
|
|
|
return YES;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Displaying
|
|
|
|
//
|
|
|
|
- (void)drawRect:(NSRect)rect
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// NSCoding protocol
|
|
|
|
//
|
|
|
|
- (void)encodeWithCoder:aCoder
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
[super encodeWithCoder:aCoder];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1997-02-18 00:29:25 +00:00
|
|
|
#if 0
|
1998-08-01 15:41:49 +00:00
|
|
|
[aCoder encodeObjectReference: delegate withName: @"Delegate"];
|
1997-02-18 00:29:25 +00:00
|
|
|
#else
|
1998-08-01 15:41:49 +00:00
|
|
|
[aCoder encodeConditionalObject:delegate];
|
1997-02-18 00:29:25 +00:00
|
|
|
#endif
|
1998-08-01 15:41:49 +00:00
|
|
|
|
|
|
|
[aCoder encodeObject: text_contents];
|
|
|
|
[aCoder encodeValueOfObjCType: "I" at: &alignment];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_editable];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_rich_text];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_selectable];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &imports_graphics];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &uses_font_panel];
|
|
|
|
[aCoder encodeValueOfObjCType:@encode(BOOL) at:&is_horizontally_resizable];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_vertically_resizable];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_ruler_visible];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_field_editor];
|
|
|
|
[aCoder encodeObject: background_color];
|
|
|
|
[aCoder encodeObject: text_color];
|
|
|
|
[aCoder encodeObject: default_font];
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(NSRange) at: &selected_range];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- initWithCoder:aDecoder
|
|
|
|
{
|
1998-08-01 15:41:49 +00:00
|
|
|
[super initWithCoder:aDecoder];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1997-02-18 00:29:25 +00:00
|
|
|
#if 0
|
1998-08-01 15:41:49 +00:00
|
|
|
[aDecoder decodeObjectAt: &delegate withName: NULL];
|
1997-02-18 00:29:25 +00:00
|
|
|
#else
|
1998-08-01 15:41:49 +00:00
|
|
|
delegate = [aDecoder decodeObject];
|
1997-02-18 00:29:25 +00:00
|
|
|
#endif
|
1998-08-01 15:41:49 +00:00
|
|
|
|
|
|
|
text_contents = [aDecoder decodeObject];
|
|
|
|
[aDecoder decodeValueOfObjCType: "I" at: &alignment];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_editable];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_rich_text];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_selectable];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &imports_graphics];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &uses_font_panel];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL)
|
|
|
|
at: &is_horizontally_resizable];
|
|
|
|
[aDecoder decodeValueOfObjCType:@encode(BOOL) at:&is_vertically_resizable];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_ruler_visible];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_field_editor];
|
|
|
|
background_color = [aDecoder decodeObject];
|
|
|
|
text_color = [aDecoder decodeObject];
|
|
|
|
default_font = [aDecoder decodeObject];
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(NSRange) at: &selected_range];
|
|
|
|
|
|
|
|
return self;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1997-01-29 16:07:56 +00:00
|
|
|
//
|
|
|
|
// NSChangeSpelling protocol
|
|
|
|
//
|
|
|
|
- (void) changeSpelling:(id)sender
|
|
|
|
{}
|
|
|
|
|
|
|
|
//
|
|
|
|
// NSIgnoreMisspelledWords protocol
|
|
|
|
//
|
|
|
|
- (void)ignoreSpelling:(id)sender
|
|
|
|
{}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
@end
|