mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Fixes to the text network.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4641 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d305ee4fe0
commit
aa3258aa39
6 changed files with 879 additions and 257 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
1999-07-24 Michael Hanni <mhanni@sprintmail.com>
|
||||||
|
|
||||||
|
* Headers/NSTextView.h: redid ivars.
|
||||||
|
* Source/NSTextView.m: complete rewrite. more methods written.
|
||||||
|
* Source/GSServicesManager.m: minor temp debug NSlog.
|
||||||
|
* Source/NSMenuView.m: debug logs.
|
||||||
|
* Source/NSText.m: debug logs.
|
||||||
|
|
||||||
|
Look at core/Testing/gstextnetwork.app. That is the text
|
||||||
|
application for NSTextView/TextNetwork. Edit.app has been
|
||||||
|
modified to use NSText directly and not NSTextView.
|
||||||
|
|
||||||
1999-07-23 Adam Fedor <fedor@gnu.org>
|
1999-07-23 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Model/GMAppKit.m: Added ifndef's to comment out areas of code
|
* Model/GMAppKit.m: Added ifndef's to comment out areas of code
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
* GNUTextView.h
|
* GNUTextView.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// GNUTextView is a NSText subclass that displays the glyphs laid out in one NSTextContainer.
|
#ifndef _GNUstep_H_NSTextView
|
||||||
|
#define _GNUstep_H_NSTextView
|
||||||
|
|
||||||
#import <AppKit/NSText.h>
|
#import <AppKit/NSText.h>
|
||||||
#import <AppKit/NSTextAttachment.h>
|
#import <AppKit/NSTextAttachment.h>
|
||||||
|
@ -18,15 +19,32 @@
|
||||||
|
|
||||||
@interface NSTextView : NSText
|
@interface NSTextView : NSText
|
||||||
{
|
{
|
||||||
NSTextContainer *textContainer;
|
NSTextContainer *textContainer;
|
||||||
NSColor *insertionPointColor;
|
NSLayoutManager *layoutManager;
|
||||||
BOOL smartInsertDeleteEnabled;
|
NSTextStorage *textStorage;
|
||||||
NSSelectionAffinity selectionAffinity;
|
NSSize textContainerInset;
|
||||||
NSSelectionGranularity selectionGranularity;
|
NSPoint textContainerOrigin;
|
||||||
NSSize textContainerInset;
|
BOOL tv_resetTextContainerOrigin;
|
||||||
NSPoint textContainerOrigin;
|
NSColor *tv_backGroundColor;
|
||||||
NSLayoutManager *layoutManager;
|
BOOL tv_drawsBackground;
|
||||||
NSTextStorage *textStorage;
|
BOOL tv_shouldDrawInsertionPoint;
|
||||||
|
BOOL tv_selectable;
|
||||||
|
BOOL tv_editable;
|
||||||
|
BOOL tv_fieldEditor;
|
||||||
|
BOOL tv_acceptDraggedFiles;
|
||||||
|
BOOL tv_richText;
|
||||||
|
BOOL tv_usesFontPanel;
|
||||||
|
BOOL tv_usesRuler;
|
||||||
|
BOOL tv_rulerVisible;
|
||||||
|
BOOL tv_smartInsertDelete;
|
||||||
|
NSRange tv_selectedRange;
|
||||||
|
NSColor *tv_caretColor;
|
||||||
|
NSDictionary *tv_selectedTextAttributes;
|
||||||
|
NSDictionary *tv_markedTextAttributes;
|
||||||
|
NSDictionary *tv_typingAttributes;
|
||||||
|
int tv_spellTag;
|
||||||
|
NSSelectionAffinity tv_selectionAffinity;
|
||||||
|
NSSelectionGranularity tv_selectionGranularity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************** Initializing ****************************/
|
/**************************** Initializing ****************************/
|
||||||
|
@ -201,8 +219,10 @@
|
||||||
- (BOOL)smartInsertDeleteEnabled;
|
- (BOOL)smartInsertDeleteEnabled;
|
||||||
- (void)setSmartInsertDeleteEnabled:(BOOL)flag;
|
- (void)setSmartInsertDeleteEnabled:(BOOL)flag;
|
||||||
- (NSRange)smartDeleteRangeForProposedRange:(NSRange)proposedCharRange;
|
- (NSRange)smartDeleteRangeForProposedRange:(NSRange)proposedCharRange;
|
||||||
- (void)smartInsertForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
|
- (void)smartInsertForString:(NSString *)aString
|
||||||
|
replacingRange:(NSRange)charRange
|
||||||
|
beforeString:(NSString *)beforeString
|
||||||
|
afterString:(NSString *)afterString;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// Note that all delegation messages come from the first textView
|
// Note that all delegation messages come from the first textView
|
||||||
|
@ -235,3 +255,4 @@ extern NSString *NSTextViewWillChangeNotifyingTextViewNotification;
|
||||||
extern NSString *NSTextViewDidChangeSelectionNotification;
|
extern NSString *NSTextViewDidChangeSelectionNotification;
|
||||||
// NSOldSelectedCharacterRange -> NSValue with old range.
|
// NSOldSelectedCharacterRange -> NSValue with old range.
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -403,6 +403,8 @@ static NSString *disabledName = @".GNUstepDisabled";
|
||||||
NSWindow *resp = [[application keyWindow] firstResponder];
|
NSWindow *resp = [[application keyWindow] firstResponder];
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
|
|
||||||
|
NSLog(@"doService: called");
|
||||||
|
|
||||||
for (i = 0; i <= es; i++)
|
for (i = 0; i <= es; i++)
|
||||||
{
|
{
|
||||||
NSString *sendType;
|
NSString *sendType;
|
||||||
|
|
|
@ -663,14 +663,12 @@ cell do the following */
|
||||||
|
|
||||||
[self setHighlightedItemIndex: -1];
|
[self setHighlightedItemIndex: -1];
|
||||||
|
|
||||||
// if ([selectedCell action] && ![selectedCell target])
|
|
||||||
if (menuv_menu)
|
if (menuv_menu)
|
||||||
[menuv_menu performActionForItem:
|
[menuv_menu performActionForItem:
|
||||||
[menuv_items_link objectAtIndex: lastIndex]];
|
[menuv_items_link objectAtIndex: lastIndex]];
|
||||||
|
|
||||||
if (menuv_popb)
|
if (menuv_popb)
|
||||||
[menuv_popb performSelector:[selectedCell action] withObject:selectedCell];
|
[menuv_popb performSelector:[selectedCell action] withObject:selectedCell];
|
||||||
// else if ([selectedCell action] && [selectedCell target])
|
|
||||||
|
|
||||||
/* If we are a menu */
|
/* If we are a menu */
|
||||||
|
|
||||||
|
|
|
@ -1190,13 +1190,16 @@ currentCursorY=[self rectForCharacterIndex:NSMaxRange([self selectedRange])].ori
|
||||||
// Handling Events
|
// Handling Events
|
||||||
//
|
//
|
||||||
-(void) mouseDown:(NSEvent *)theEvent
|
-(void) mouseDown:(NSEvent *)theEvent
|
||||||
{ NSSelectionGranularity granularity= NSSelectByCharacter;
|
{
|
||||||
|
NSSelectionGranularity granularity= NSSelectByCharacter;
|
||||||
NSRange chosenRange,prevChosenRange,proposedRange;
|
NSRange chosenRange,prevChosenRange,proposedRange;
|
||||||
NSPoint point,startPoint;
|
NSPoint point,startPoint;
|
||||||
NSEvent *currentEvent;
|
NSEvent *currentEvent;
|
||||||
unsigned startIndex;
|
unsigned startIndex;
|
||||||
BOOL didDragging=NO;
|
BOOL didDragging=NO;
|
||||||
|
|
||||||
|
NSLog(@"mouseDown:");
|
||||||
|
|
||||||
if (!is_selectable) return; // If not selectable then don't recognize the mouse down
|
if (!is_selectable) return; // If not selectable then don't recognize the mouse down
|
||||||
|
|
||||||
[[self window] makeFirstResponder:self];
|
[[self window] makeFirstResponder:self];
|
||||||
|
@ -2058,6 +2061,8 @@ NSLog(@"opti hook 2");
|
||||||
|
|
||||||
redrawLineRange=[self lineRangeForRect:rect];
|
redrawLineRange=[self lineRangeForRect:rect];
|
||||||
|
|
||||||
|
NSLog(@"should be drawing text here. No big deal.\n");
|
||||||
|
|
||||||
if([self drawsBackground]) // clear area under text
|
if([self drawsBackground]) // clear area under text
|
||||||
{ [[self backgroundColor] set]; NSRectFill(rect);
|
{ [[self backgroundColor] set]; NSRectFill(rect);
|
||||||
}
|
}
|
||||||
|
|
1068
Source/NSTextView.m
1068
Source/NSTextView.m
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue