2001-12-17 16:51:51 +00:00
|
|
|
|
/** <title>NSText</title>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
|
<abstract>The RTFD text class</abstract>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
Date: 1996
|
2001-12-17 16:51:51 +00:00
|
|
|
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
1998-08-01 15:41:49 +00:00
|
|
|
|
Date: July 1998
|
2002-01-26 04:14:38 +00:00
|
|
|
|
Author: Daniel B<EFBFBD>hringer <boehring@biomed.ruhr-uni-bochum.de>
|
1998-08-20 09:56:26 +00:00
|
|
|
|
Date: August 1998
|
2000-03-16 14:16:46 +00:00
|
|
|
|
Author: Fred Kiefer <FredKiefer@gmx.de>
|
|
|
|
|
Date: March 2000
|
|
|
|
|
Reorganised and cleaned up code, added some action methods
|
2000-12-20 17:00:32 +00:00
|
|
|
|
Author: Nicola Pero <n.pero@mi.flashnet.it>
|
|
|
|
|
Date: December 2000
|
|
|
|
|
Made class abstract, moved most code to NSTextView.
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
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.
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
|
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,
|
1999-11-02 07:58:11 +00:00
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA.
|
1999-06-22 23:37:24 +00:00
|
|
|
|
*/
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
1999-11-14 03:23:54 +00:00
|
|
|
|
#include <Foundation/NSNotification.h>
|
1997-08-18 17:10:23 +00:00
|
|
|
|
#include <Foundation/NSString.h>
|
2000-09-18 23:33:30 +00:00
|
|
|
|
#include <Foundation/NSArchiver.h>
|
|
|
|
|
#include <Foundation/NSValue.h>
|
|
|
|
|
#include <Foundation/NSData.h>
|
1998-08-20 09:56:26 +00:00
|
|
|
|
|
1998-09-02 15:05:13 +00:00
|
|
|
|
#include <AppKit/NSFileWrapper.h>
|
|
|
|
|
#include <AppKit/NSControl.h>
|
1997-02-18 00:29:25 +00:00
|
|
|
|
#include <AppKit/NSText.h>
|
|
|
|
|
#include <AppKit/NSApplication.h>
|
|
|
|
|
#include <AppKit/NSWindow.h>
|
2000-03-08 08:43:15 +00:00
|
|
|
|
#include <AppKit/NSFontManager.h>
|
1997-02-18 00:29:25 +00:00
|
|
|
|
#include <AppKit/NSFont.h>
|
|
|
|
|
#include <AppKit/NSColor.h>
|
2000-03-08 08:43:15 +00:00
|
|
|
|
#include <AppKit/NSParagraphStyle.h>
|
1998-08-20 09:56:26 +00:00
|
|
|
|
#include <AppKit/NSPasteboard.h>
|
1998-09-02 15:05:13 +00:00
|
|
|
|
#include <AppKit/NSSpellChecker.h>
|
2001-12-05 13:02:51 +00:00
|
|
|
|
#include <AppKit/NSScrollView.h>
|
2002-04-02 11:34:24 +00:00
|
|
|
|
#include <AppKit/NSPanel.h>
|
1999-06-22 23:37:24 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
#include <AppKit/NSDragging.h>
|
2000-03-23 11:32:59 +00:00
|
|
|
|
#include <AppKit/NSTextStorage.h>
|
2000-04-23 22:31:25 +00:00
|
|
|
|
#include <AppKit/NSTextContainer.h>
|
2000-10-12 23:02:25 +00:00
|
|
|
|
#include <AppKit/NSLayoutManager.h>
|
1998-09-02 15:05:13 +00:00
|
|
|
|
|
2000-12-18 22:06:53 +00:00
|
|
|
|
static Class abstract;
|
|
|
|
|
static Class concrete;
|
1999-06-22 23:37:24 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
@implementation NSText
|
2000-09-30 23:11:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
2000-12-20 17:00:32 +00:00
|
|
|
|
* Class methods
|
2000-03-16 14:16:46 +00:00
|
|
|
|
*/
|
|
|
|
|
+ (void)initialize
|
|
|
|
|
{
|
|
|
|
|
if (self == [NSText class])
|
|
|
|
|
{
|
2000-10-12 23:02:25 +00:00
|
|
|
|
[self setVersion: 1];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
2000-12-18 22:06:53 +00:00
|
|
|
|
abstract = self;
|
|
|
|
|
concrete = [NSTextView class];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-18 22:06:53 +00:00
|
|
|
|
+ (id) allocWithZone: (NSZone*)zone
|
|
|
|
|
{
|
|
|
|
|
if (self == abstract)
|
|
|
|
|
return NSAllocateObject (concrete, 0, zone);
|
|
|
|
|
else
|
|
|
|
|
return NSAllocateObject (self, 0, zone);
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Instance methods
|
|
|
|
|
*/
|
2000-12-19 18:45:52 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Initialization
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
|
|
|
|
- (id) init
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
return [self initWithFrame: NSMakeRect (0, 0, 100, 100)];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 18:45:52 +00:00
|
|
|
|
- (void) dealloc
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-19 18:45:52 +00:00
|
|
|
|
RELEASE (_background_color);
|
2000-03-08 08:43:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[super dealloc];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
|
|
|
|
* Getting and Setting Contents
|
|
|
|
|
*/
|
2000-12-18 22:06:53 +00:00
|
|
|
|
- (void) replaceCharactersInRange: (NSRange)aRange withRTF: (NSData *)rtfData
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-18 22:06:53 +00:00
|
|
|
|
NSAttributedString *attr;
|
|
|
|
|
|
|
|
|
|
attr = [[NSAttributedString alloc] initWithRTF: rtfData
|
|
|
|
|
documentAttributes: NULL];
|
|
|
|
|
AUTORELEASE (attr);
|
|
|
|
|
[self replaceRange: aRange withAttributedString: attr];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-18 22:06:53 +00:00
|
|
|
|
- (void) replaceCharactersInRange: (NSRange)aRange
|
|
|
|
|
withRTFD: (NSData *)rtfdData
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-18 22:06:53 +00:00
|
|
|
|
NSAttributedString *attr;
|
|
|
|
|
|
|
|
|
|
attr = [[NSAttributedString alloc] initWithRTFD: rtfdData
|
|
|
|
|
documentAttributes: NULL];
|
|
|
|
|
AUTORELEASE (attr);
|
|
|
|
|
[self replaceRange: aRange withAttributedString: attr];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) replaceCharactersInRange: (NSRange)aRange
|
|
|
|
|
withString: (NSString*)aString
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-18 22:06:53 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (NSData*) RTFDFromRange: (NSRange)aRange
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSData*) RTFFromRange: (NSRange)aRange
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setString: (NSString*)aString
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-19 22:37:28 +00:00
|
|
|
|
[self replaceCharactersInRange: NSMakeRange (0, [self textLength])
|
2000-09-18 23:33:30 +00:00
|
|
|
|
withString: aString];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (NSString*) string
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-19 18:45:52 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return nil;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* old OpenStep methods doing the same
|
|
|
|
|
*/
|
2000-12-19 18:45:52 +00:00
|
|
|
|
- (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-19 18:45:52 +00:00
|
|
|
|
[self replaceCharactersInRange: aRange withRTFD: rtfdData];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 18:45:52 +00:00
|
|
|
|
- (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-19 18:45:52 +00:00
|
|
|
|
[self replaceCharactersInRange: aRange withRTF: rtfData];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 18:45:52 +00:00
|
|
|
|
- (void) replaceRange: (NSRange)aRange withString: (NSString*)aString
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-19 18:45:52 +00:00
|
|
|
|
[self replaceCharactersInRange: aRange withString: aString];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 18:45:52 +00:00
|
|
|
|
- (void) setText: (NSString*)aString range: (NSRange)aRange
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-19 18:45:52 +00:00
|
|
|
|
[self replaceCharactersInRange: aRange withString: aString];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setText: (NSString*)string
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[self setString: string];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (NSString*) text
|
|
|
|
|
{
|
|
|
|
|
return [self string];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Graphic attributes
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (NSColor*) backgroundColor
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
return _background_color;
|
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) drawsBackground
|
|
|
|
|
{
|
|
|
|
|
return _tf.draws_background;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setBackgroundColor: (NSColor*)color
|
|
|
|
|
{
|
2001-12-05 13:02:51 +00:00
|
|
|
|
if (![_background_color isEqual: color])
|
|
|
|
|
{
|
|
|
|
|
ASSIGN (_background_color, color);
|
|
|
|
|
|
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
|
|
|
|
|
|
if (!_tf.is_field_editor)
|
|
|
|
|
{
|
|
|
|
|
/* If we are embedded in a scrollview, we might not be
|
|
|
|
|
filling all the scrollview's area (a textview might
|
|
|
|
|
resize itself dynamically in response to user input). If
|
|
|
|
|
this is the case, the scrollview is drawing the rest of
|
|
|
|
|
the background - change that too. */
|
|
|
|
|
NSScrollView *sv = [self enclosingScrollView];
|
|
|
|
|
|
|
|
|
|
if (sv != nil)
|
|
|
|
|
{
|
|
|
|
|
[sv setBackgroundColor: color];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-12-05 13:02:51 +00:00
|
|
|
|
|
|
|
|
|
|
2000-12-19 15:33:34 +00:00
|
|
|
|
- (void) setDrawsBackground: (BOOL)flag
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2001-12-05 13:02:51 +00:00
|
|
|
|
if (_tf.draws_background != flag)
|
|
|
|
|
{
|
|
|
|
|
_tf.draws_background = flag;
|
|
|
|
|
|
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
|
|
|
|
|
|
if (!_tf.is_field_editor)
|
|
|
|
|
{
|
|
|
|
|
/* See comment in setBackgroundColor:. */
|
|
|
|
|
NSScrollView *sv = [self enclosingScrollView];
|
|
|
|
|
|
|
|
|
|
if (sv != nil)
|
|
|
|
|
{
|
|
|
|
|
[sv setDrawsBackground: flag];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Managing Global Characteristics
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) importsGraphics
|
|
|
|
|
{
|
|
|
|
|
return _tf.imports_graphics;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) isEditable
|
|
|
|
|
{
|
|
|
|
|
return _tf.is_editable;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) isFieldEditor
|
|
|
|
|
{
|
|
|
|
|
return _tf.is_field_editor;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) isRichText
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
return _tf.is_rich_text;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) isSelectable
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
return _tf.is_selectable;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 15:33:34 +00:00
|
|
|
|
- (void) setEditable: (BOOL)flag
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
_tf.is_editable = flag;
|
2000-12-19 15:33:34 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
if (flag)
|
2000-03-19 07:33:26 +00:00
|
|
|
|
{
|
|
|
|
|
_tf.is_selectable = YES;
|
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setFieldEditor: (BOOL)flag
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
_tf.is_field_editor = flag;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 15:33:34 +00:00
|
|
|
|
- (void) setImportsGraphics: (BOOL)flag
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
_tf.imports_graphics = flag;
|
2000-12-19 15:33:34 +00:00
|
|
|
|
|
|
|
|
|
if (flag == YES)
|
|
|
|
|
{
|
|
|
|
|
_tf.is_rich_text = YES;
|
|
|
|
|
}
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setRichText: (BOOL)flag
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-03-16 14:16:46 +00:00
|
|
|
|
_tf.is_rich_text = flag;
|
2000-12-19 15:33:34 +00:00
|
|
|
|
|
|
|
|
|
if (flag == NO)
|
1999-11-11 17:17:14 +00:00
|
|
|
|
{
|
2000-12-19 15:33:34 +00:00
|
|
|
|
_tf.imports_graphics = NO;
|
1999-11-11 17:17:14 +00:00
|
|
|
|
}
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setSelectable: (BOOL)flag
|
|
|
|
|
{
|
|
|
|
|
_tf.is_selectable = flag;
|
2000-12-19 15:33:34 +00:00
|
|
|
|
|
|
|
|
|
if (flag == NO)
|
|
|
|
|
{
|
|
|
|
|
_tf.is_editable = NO;
|
|
|
|
|
}
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Using the font panel
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) usesFontPanel
|
|
|
|
|
{
|
|
|
|
|
return _tf.uses_font_panel;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-19 15:33:34 +00:00
|
|
|
|
- (void) setUsesFontPanel: (BOOL)flag
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
_tf.uses_font_panel = flag;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Managing the Ruler
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) isRulerVisible
|
1999-11-11 17:17:14 +00:00
|
|
|
|
{
|
2000-05-04 22:44:20 +00:00
|
|
|
|
return _tf.is_ruler_visible;
|
1999-06-22 23:37:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) toggleRuler: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Managing the Selection
|
|
|
|
|
*/
|
2000-12-19 15:33:34 +00:00
|
|
|
|
- (NSRange) selectedRange
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-19 22:37:28 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return NSMakeRange (NSNotFound, 0);
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
1998-10-15 12:04:53 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setSelectedRange: (NSRange)range
|
1999-11-11 17:17:14 +00:00
|
|
|
|
{
|
2000-12-19 22:37:28 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
1999-11-11 17:17:14 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
|
|
|
|
* Copy and paste
|
|
|
|
|
*/
|
|
|
|
|
- (void) copy: (id)sender
|
2000-12-20 17:00:32 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
1998-09-02 15:05:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/* Copy the current font to the font pasteboard */
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) copyFont: (id)sender
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1998-09-02 15:05:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/* Copy the current ruler settings to the ruler pasteboard */
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) copyRuler: (id)sender
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1999-02-10 15:09:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) delete: (id)sender
|
1999-08-22 04:04:38 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) cut: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self copy: sender];
|
|
|
|
|
[self delete: sender];
|
1998-08-20 09:56:26 +00:00
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) paste: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1999-08-31 09:19:39 +00:00
|
|
|
|
}
|
1999-02-17 09:13:43 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) pasteFont: (id)sender
|
1999-02-17 09:13:43 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1998-08-20 09:56:26 +00:00
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) pasteRuler: (id)sender
|
1999-11-11 17:17:14 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) selectAll: (id)sender
|
1999-11-11 17:17:14 +00:00
|
|
|
|
{
|
2000-12-19 22:37:28 +00:00
|
|
|
|
[self setSelectedRange: NSMakeRange (0, [self textLength])];
|
1999-11-11 17:17:14 +00:00
|
|
|
|
}
|
1998-09-02 15:05:13 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
2000-05-20 16:55:08 +00:00
|
|
|
|
* Managing Font
|
2000-03-16 14:16:46 +00:00
|
|
|
|
*/
|
|
|
|
|
- (NSFont*) font
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return nil;
|
2000-03-08 08:43:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
2000-12-19 22:37:28 +00:00
|
|
|
|
* This action method changes the font of the selection for a rich
|
|
|
|
|
* text object, or of all text for a plain text object. If the
|
|
|
|
|
* receiver doesn't use the Font Panel, however, this method does
|
|
|
|
|
* nothing. */
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) changeFont: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) setFont: (NSFont*)font
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) setFont: (NSFont*)font ofRange: (NSRange)aRange
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1998-10-15 12:04:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
|
|
|
|
* Managing Alingment
|
|
|
|
|
*/
|
|
|
|
|
- (NSTextAlignment) alignment
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return 0;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) setAlignment: (NSTextAlignment)mode
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) alignCenter: (id)sender
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1998-10-15 12:04:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) alignLeft: (id)sender
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) alignRight: (id)sender
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
/*
|
|
|
|
|
* Text colour
|
|
|
|
|
*/
|
|
|
|
|
- (NSColor*) textColor
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
2000-05-20 16:55:08 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) setTextColor: (NSColor*)color
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
1998-10-15 12:04:53 +00:00
|
|
|
|
|
2000-12-20 12:50:37 +00:00
|
|
|
|
- (void) setTextColor: (NSColor*)color range: (NSRange)aRange
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
1998-09-02 15:05:13 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/* Old OpenStep method to do the same */
|
2000-12-20 12:50:37 +00:00
|
|
|
|
- (void) setColor: (NSColor*)color ofRange: (NSRange)aRange
|
1999-11-11 17:17:14 +00:00
|
|
|
|
{
|
2000-12-19 22:37:28 +00:00
|
|
|
|
[self setTextColor: color range: aRange];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
1999-11-11 17:17:14 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Text attributes
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (void) subscript: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) superscript: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) unscript: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) underline: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
2000-03-08 08:43:15 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Reading and Writing RTFD Files
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) readRTFDFromFile: (NSString*)path
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
return NO;
|
|
|
|
|
}
|
2000-02-19 00:40:47 +00:00
|
|
|
|
|
2000-12-19 22:37:28 +00:00
|
|
|
|
- (BOOL) writeRTFDToFile: (NSString*)path atomically: (BOOL)flag
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return NO;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
2000-02-19 00:40:47 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Sizing the Frame Rectangle
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
- (BOOL) isHorizontallyResizable
|
|
|
|
|
{
|
|
|
|
|
return _tf.is_horizontally_resizable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) isVerticallyResizable
|
|
|
|
|
{
|
|
|
|
|
return _tf.is_vertically_resizable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSSize) maxSize
|
|
|
|
|
{
|
|
|
|
|
return _maxSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSSize) minSize
|
|
|
|
|
{
|
|
|
|
|
return _minSize;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) setHorizontallyResizable: (BOOL)flag
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
_tf.is_horizontally_resizable = flag;
|
|
|
|
|
}
|
|
|
|
|
|
2000-11-03 00:22:15 +00:00
|
|
|
|
- (void) setVerticallyResizable: (BOOL)flag
|
|
|
|
|
{
|
|
|
|
|
_tf.is_vertically_resizable = flag;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) setMaxSize: (NSSize)newMaxSize
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
_maxSize = newMaxSize;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) setMinSize: (NSSize)newMinSize
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
_minSize = newMinSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) sizeToFit
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Spelling
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
|
|
|
|
- (void) checkSpelling: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) showGuessPanel: (id)sender
|
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[[sp spellingPanel] orderFront: self];
|
|
|
|
|
}
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Scrolling
|
|
|
|
|
*/
|
|
|
|
|
- (void) scrollRangeToVisible: (NSRange)aRange
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Managing the Delegate
|
|
|
|
|
*/
|
|
|
|
|
- (id) delegate
|
|
|
|
|
{
|
|
|
|
|
return _delegate;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 12:50:37 +00:00
|
|
|
|
- (void) setDelegate: (id)anObject
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 12:50:37 +00:00
|
|
|
|
_delegate = anObject;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* NSView
|
|
|
|
|
*/
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
/* text lays out from top to bottom */
|
|
|
|
|
- (BOOL) isFlipped
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
return YES;
|
2000-03-19 07:33:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (BOOL) isOpaque
|
2000-03-19 07:33:26 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
if (_tf.draws_background == NO
|
|
|
|
|
|| _background_color == nil
|
|
|
|
|
|| [_background_color alphaComponent] < 1.0)
|
|
|
|
|
return NO;
|
|
|
|
|
else
|
|
|
|
|
return YES;
|
2000-03-19 07:33:26 +00:00
|
|
|
|
}
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
//
|
|
|
|
|
// NSCoding protocol
|
|
|
|
|
//
|
|
|
|
|
- (void) encodeWithCoder: (NSCoder *)aCoder
|
2000-03-19 07:33:26 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
BOOL flag;
|
|
|
|
|
[super encodeWithCoder: aCoder];
|
2000-03-19 07:33:26 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[aCoder encodeConditionalObject: _delegate];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
2000-05-13 14:28:02 +00:00
|
|
|
|
flag = _tf.is_field_editor;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
flag = _tf.is_editable;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
flag = _tf.is_selectable;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
flag = _tf.is_rich_text;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
flag = _tf.imports_graphics;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
flag = _tf.draws_background;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
flag = _tf.is_horizontally_resizable;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
flag = _tf.is_vertically_resizable;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
flag = _tf.uses_font_panel;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
flag = _tf.uses_ruler;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
flag = _tf.is_ruler_visible;
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aCoder encodeObject: _background_color];
|
2000-05-20 16:55:08 +00:00
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(NSSize) at: &_minSize];
|
|
|
|
|
[aCoder encodeValueOfObjCType: @encode(NSSize) at: &_maxSize];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-18 22:06:53 +00:00
|
|
|
|
- (id) initWithCoder: (NSCoder *)aDecoder
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
BOOL flag;
|
2000-12-16 20:21:47 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[super initWithCoder: aDecoder];
|
|
|
|
|
|
|
|
|
|
_delegate = [aDecoder decodeObject];
|
|
|
|
|
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
_tf.is_field_editor = flag;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
_tf.is_editable = flag;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
_tf.is_selectable = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
_tf.is_rich_text = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
_tf.imports_graphics = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
_tf.draws_background = flag;
|
2000-03-16 14:16:46 +00:00
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
_tf.is_horizontally_resizable = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
_tf.is_vertically_resizable = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-05-13 14:28:02 +00:00
|
|
|
|
_tf.uses_font_panel = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
|
|
|
|
_tf.uses_ruler = flag;
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
_tf.is_ruler_visible = flag;
|
2000-05-13 14:28:02 +00:00
|
|
|
|
|
2000-03-16 14:16:46 +00:00
|
|
|
|
_background_color = [aDecoder decodeObject];
|
2000-05-20 16:55:08 +00:00
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_minSize];
|
|
|
|
|
[aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_maxSize];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-23 22:58:24 +00:00
|
|
|
|
/*
|
2000-12-20 17:00:32 +00:00
|
|
|
|
* NSChangeSpelling protocol
|
|
|
|
|
*/
|
|
|
|
|
- (void) changeSpelling: (id)sender
|
2000-03-16 14:16:46 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-05-23 22:58:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2000-12-20 17:00:32 +00:00
|
|
|
|
* NSIgnoreMisspelledWords protocol
|
|
|
|
|
*/
|
|
|
|
|
- (void) ignoreSpelling: (id)sender
|
2000-05-23 22:58:24 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-03-16 14:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
@implementation NSText (GNUstepExtensions)
|
2000-03-19 07:33:26 +00:00
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (void) replaceRange: (NSRange)aRange
|
|
|
|
|
withAttributedString: (NSAttributedString*)attrString
|
2000-06-26 19:55:01 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2000-08-07 22:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-20 17:00:32 +00:00
|
|
|
|
- (unsigned) textLength
|
2000-03-08 08:43:15 +00:00
|
|
|
|
{
|
2000-12-20 17:00:32 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return 0;
|
1996-05-30 20:03:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|