Commit graph

256 commits

Author SHA1 Message Date
David Chisnall
a278bc778a Rename HUGE -> GSHUGE to remove conflict with standard library #define.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32352 72102866-910b-0410-8b05-ffd578937521
2011-02-24 13:29:18 +00:00
Fred Kiefer
d83fb0774b Remove direct usage of isa.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32248 72102866-910b-0410-8b05-ffd578937521
2011-02-20 18:24:44 +00:00
Wolfgang Lux
043ca66dd9 Add missing conversion from character indexes to glyph indexes when
computing an attachment cell's frame in a text view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31815 72102866-910b-0410-8b05-ffd578937521
2011-01-01 16:48:08 +00:00
Wolfgang Lux
41923d49c8 Rewrite implementation of drag and drop on a NSTextView so that the
target view is scrolled even when it does not accept the drag
operation. This is useful, e.g., when a subclass considers parts of
the text read only and does not accept a drop in those regions.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31796 72102866-910b-0410-8b05-ffd578937521
2010-12-29 13:18:02 +00:00
Fred Kiefer
de9abfb7ee Correct the definition of NSDragOperation and all its usages.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31754 72102866-910b-0410-8b05-ffd578937521
2010-12-22 16:16:14 +00:00
Fred Kiefer
49fdc602ba Remove a few compiler warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31587 72102866-910b-0410-8b05-ffd578937521
2010-11-03 20:26:30 +00:00
Riccardo Mottola
7938a855d3 fixed some c99-isms
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31556 72102866-910b-0410-8b05-ffd578937521
2010-10-24 21:22:59 +00:00
David Chisnall
71783836f1 Fix build with gcc.
Sorry!



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31553 72102866-910b-0410-8b05-ffd578937521
2010-10-22 21:23:29 +00:00
David Chisnall
46d64c5822 Fix tooltips.
Morbo says: NSAttributedStrings DO NOT WORK THAT WAY!



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31552 72102866-910b-0410-8b05-ffd578937521
2010-10-22 17:45:45 +00:00
David Chisnall
4600fb5bbf Fixed the point argument to -view:stringForToolTip:point:userData: (should be relative to the tracking rectangle, was relative to the window). Added support for displaying tooltips from NSToolTipAttributeName attributes in NSTextView.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31550 72102866-910b-0410-8b05-ffd578937521
2010-10-22 16:38:29 +00:00
Eric Wasylishen
26fcda321b Replace sel_eq with sel_isEqual
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31285 72102866-910b-0410-8b05-ffd578937521
2010-09-09 23:50:38 +00:00
Wolfgang Lux
cae1d262cf Fix an incorrect range check which prevented the user from copying or
moving the current selection of a text view immediately before itself
with DnD operation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31102 72102866-910b-0410-8b05-ffd578937521
2010-08-09 20:38:32 +00:00
Wolfgang Lux
86ff2f4099 Implement a standard find panel for NSTextView.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31068 72102866-910b-0410-8b05-ffd578937521
2010-08-02 18:57:00 +00:00
Wolfgang Lux
36c6a1a4bb Select text restored by an undo in a NSTextView and set insertion
point to the end of the changed text after a redo.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30498 72102866-910b-0410-8b05-ffd578937521
2010-05-30 21:17:50 +00:00
Wolfgang Lux
724a198f41 Ensure a more consistent initial setup of a new NSTextView and its
text container.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30495 72102866-910b-0410-8b05-ffd578937521
2010-05-30 18:25:17 +00:00
Wolfgang Lux
027baea2fa Replace a bogus workaround to set up the text network of a NSTextView
loaded from a .nib file with a clean solution and fix decoding and
encoding of a few text view flags, which did not match Cocoa.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30493 72102866-910b-0410-8b05-ffd578937521
2010-05-30 18:18:26 +00:00
Fred Kiefer
be6dd7b23a Another small change for gcc 2.95
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30450 72102866-910b-0410-8b05-ffd578937521
2010-05-24 20:09:17 +00:00
Wolfgang Lux
f3b6c1fe6f Usability improvements: When setting the cursor to the beginning of a
line, set the typing attributes to the attributes of the first character
of that line rather than the preceding newline. When deleting text, set
the typing attributes to those of the first deleted character rather
than those of the character preceding the deleted range.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30055 72102866-910b-0410-8b05-ffd578937521
2010-03-27 21:41:29 +00:00
Wolfgang Lux
ca3261653b Allow shift-clicking in a text view to shrink the current selection.
Comes handy when you accidentally selected a few characters too much.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30054 72102866-910b-0410-8b05-ffd578937521
2010-03-27 21:29:02 +00:00
Wolfgang Lux
79ef3c7045 Select pasted text in a text view after a DnD operation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30053 72102866-910b-0410-8b05-ffd578937521
2010-03-27 21:17:00 +00:00
Fred Kiefer
6483053f29 Yet another bit of #include -> #import replacement. Replace includes of Foundation.h.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30034 72102866-910b-0410-8b05-ffd578937521
2010-03-25 09:11:50 +00:00
Fred Kiefer
42b91d0695 Small improvements on XIB loading.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30023 72102866-910b-0410-8b05-ffd578937521
2010-03-23 07:15:17 +00:00
Fred Kiefer
05beafea2e Small improvements to NIB loading.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30010 72102866-910b-0410-8b05-ffd578937521
2010-03-20 17:23:10 +00:00
Fred Kiefer
8f43eb6c4e * Source/NSTextView.m (-readSelectionFromPasteboard:type:): Fix
potential memory leak for colour pasting.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29992 72102866-910b-0410-8b05-ffd578937521
2010-03-17 09:36:19 +00:00
Fred Kiefer
58afda1e08 Small keyed decoing improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29963 72102866-910b-0410-8b05-ffd578937521
2010-03-15 12:55:12 +00:00
Fred Kiefer
a798a9bcc1 Retain teh text view not the layout manager during container replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29960 72102866-910b-0410-8b05-ffd578937521
2010-03-15 11:23:09 +00:00
Doug Simons
cdf59d5e96 Set insertion point _after_ pasted text, don't select it.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29916 72102866-910b-0410-8b05-ffd578937521
2010-03-12 23:38:30 +00:00
Doug Simons
9b229c81f5 fix behavior of simple click within selected text; optimize setNeedsDisplayInRect: when called with empty rect
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29914 72102866-910b-0410-8b05-ffd578937521
2010-03-12 22:50:42 +00:00
Fred Kiefer
c05581a005 Fix up teh includes to compile again after latest changes to base. Still
plenty of warnings and the result isn't working at least on 64 bit
machines :-(


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29685 72102866-910b-0410-8b05-ffd578937521
2010-02-20 10:40:44 +00:00
Wolfgang Lux
61187ead14 Usability improvement: Make color and font panels key only when
necessary. Avoids annoying and unnecessary focus shifts when changing
colors or fonts.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29681 72102866-910b-0410-8b05-ffd578937521
2010-02-20 00:20:30 +00:00
Wolfgang Lux
d10e0c49e5 Add forgotten test to apply smart insert and delete during drag and
drop in a text view only when selection granularity is select by word.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29679 72102866-910b-0410-8b05-ffd578937521
2010-02-19 23:15:13 +00:00
Fred Kiefer
c9d1292563 Small improvements to allow changing of the text container for a text
view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29648 72102866-910b-0410-8b05-ffd578937521
2010-02-15 17:04:17 +00:00
Wolfgang Lux
2de8153b43 Update the typing attributes of a rich text view also if the selected
range has a non-zero length. Fixes a problem where, e.g., corrections
from the spell panel could use wrong attributes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29635 72102866-910b-0410-8b05-ffd578937521
2010-02-15 07:57:11 +00:00
Wolfgang Lux
c076dbd009 Fix issue where the insertion point was not placed in an empty last
line of a text view when clicking with the mouse.
Fix issue where the insertion point was not placed in an empty last
line when using the down arrow key (bug #15893).
Fix issue where the insertion point was placed incorrectly if the last
line of a text view ends in an invisible character (e.g., a tab).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29584 72102866-910b-0410-8b05-ffd578937521
2010-02-12 15:27:02 +00:00
Wolfgang Lux
fc16eea0dd Implement smart insert and delete and use it when cutting, copying,
pasting, and deleting full words in a text view or text field.

Note: I have changed NSTextView initialization to enable smart insert
and delete by default, since this is the default on OS X. (It is even
documented, though in a maybe obscure place, cf. "Text Editing
Programming Guide for Cocoa: Subclassing NSTextView".)  However, this
means that support for this feature will be somewhat inconsistent.
Smart insert and delete is enabled for text views created
programmatically (including the field editor), but not for text views
loaded from existing nib files.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29426 72102866-910b-0410-8b05-ffd578937521
2010-01-27 23:26:09 +00:00
Wolfgang Lux
db53bb1c7f Fix a bug that prevented changing the color of the selected text of a
text view via drag and drop.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29250 72102866-910b-0410-8b05-ffd578937521
2010-01-09 09:09:57 +00:00
Riccardo Mottola
d831e0a199 corrected multi-line string constant
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29167 72102866-910b-0410-8b05-ffd578937521
2009-12-26 21:14:50 +00:00
Wolfgang Lux
425e51363c Prevent a crash when -selectedRange is called for an NSTextView
without a layout manager.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29165 72102866-910b-0410-8b05-ffd578937521
2009-12-23 01:01:57 +00:00
Wolfgang Lux
395f9a293b Implement coalescing of undo actions for typing events in NSTextView.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29164 72102866-910b-0410-8b05-ffd578937521
2009-12-23 00:39:18 +00:00
Fred Kiefer
8bd9424ef9 Move the validateUserIntefaceItem back to NSTextView.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29019 72102866-910b-0410-8b05-ffd578937521
2009-11-16 11:17:20 +00:00
Fred Kiefer
0e3632608f Remove validateUserIntefaceItem:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29018 72102866-910b-0410-8b05-ffd578937521
2009-11-15 18:20:57 +00:00
Gregory John Casamento
5b293ad771 * Source/NSTextView.m: Don't add the text storage if it's nil
in initWithCoder:


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28470 72102866-910b-0410-8b05-ffd578937521
2009-08-19 04:58:31 +00:00
Gregory John Casamento
3a969af071 * Source/NSTextView.m: initWithCoder: change to use text storage
more directly to allow the handling of attributed strings.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28445 72102866-910b-0410-8b05-ffd578937521
2009-08-08 17:07:07 +00:00
Gregory John Casamento
acc0597c97 * Source/GSTextStorage.m: In initWithCoder: don't overwrite the
contents of the text storage by attempting to unarchive when the
	unarchiver is keyed.
	* Source/NSTextView.m: In initWithCoder: retrieve the contents
	of the text storage for display in the text view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28443 72102866-910b-0410-8b05-ffd578937521
2009-08-08 07:08:23 +00:00
Gregory John Casamento
1aa9c676ce * Source/NSTextView.m: initWithCoder: temporarily remove decoding
of NSTextContainer since it is causing a crash when editing a text
	view's that was loaded from a nib file. 


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28442 72102866-910b-0410-8b05-ffd578937521
2009-08-08 04:43:41 +00:00
Fred Kiefer
2ed61072dd * Source/NSTextView.m (-initWithCoder:, -setTextContainer:):
Attempt to resolve the memory issues when coding a text container.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28405 72102866-910b-0410-8b05-ffd578937521
2009-07-24 07:35:38 +00:00
Gregory John Casamento
a145faad11 Added fix suggested by George.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28375 72102866-910b-0410-8b05-ffd578937521
2009-06-29 03:47:10 +00:00
Gregory John Casamento
4991a29743 * Source/GSStandardWindowDecorationView.m: Live window resize changes
for when using GNUstep decorations in resizeWindowStartingWithEvent:.
	* Source/NSLayoutManager.m: Unarchive the text containers into an 
	array in initWithCoder:.
	* Source/NSTextContainer.m: Get the layout manager in initWithCoder:.
	* Source/NSTextView.m: Changes to include text container from nib
	file into the nib loading process in initWithCoder:.   


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28296 72102866-910b-0410-8b05-ffd578937521
2009-05-23 15:50:51 +00:00
Gregory John Casamento
343999460b * Headers/AppKit/NSSpeechSynthesizer.h: Added _module ivar.
* Source/NSDrawer.m: Don't set the timer since it eats a lot of CPU.
	* Source/NSPasteboard.m: Retain the path since it's autoreleased.
	* Source/NSTextView.m: Set the textview to allow undos by default.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28186 72102866-910b-0410-8b05-ffd578937521
2009-04-07 22:52:52 +00:00
Fred Kiefer
48f6a535ad Set values for minSize, maxSize, horizontallyResizable and verticallyResizable
in the initializers consistently.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28132 72102866-910b-0410-8b05-ffd578937521
2009-03-25 08:14:30 +00:00