Commit graph

274 commits

Author SHA1 Message Date
Eric Wasylishen
de89388c7f * Source/NSTextView.m: Use respectFraction: YES when deciding whether
to do a word selection upon a right click


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33441 72102866-910b-0410-8b05-ffd578937521
2011-07-03 20:53:44 +00:00
Eric Wasylishen
04342f72c6 * Source/NSTextView.m (-_updateState:): Invalidate cursor rects
so the cursor rects over links, for example, are updated when
text is edited.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33434 72102866-910b-0410-8b05-ffd578937521
2011-07-03 04:45:29 +00:00
Eric Wasylishen
91159aa357 * Source/NSTextView.m (-scrollRangeToVisible:): Fix to support scrolling
to the empty range at the end of a document (i.e. {[string length], 0}).
This fixes the scrolling when you repeatedly hit RETURN in TextEdit to
create new pages (in wrap to page mode).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33351 72102866-910b-0410-8b05-ffd578937521
2011-06-19 17:52:05 +00:00
Eric Wasylishen
f2f4ab4076 * Source/NSTextView.m (-scrollRangeToVisible:): Work with ranges
outside the receiver (in a situation with multiple NSTextView's
connected to a layout manager)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33298 72102866-910b-0410-8b05-ffd578937521
2011-06-14 02:32:55 +00:00
Fred Kiefer
783d3d3ae8 Add methods -_becomeRulerClient and -_resignRulerClient to set self as the
ruler client and to resign from that. These get called when self becomes 
first responder or resigns from first responder.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33287 72102866-910b-0410-8b05-ffd578937521
2011-06-12 22:43:08 +00:00
Fred Kiefer
c744492fee Add a few key value bindings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33277 72102866-910b-0410-8b05-ffd578937521
2011-06-11 12:01:59 +00:00
Eric Wasylishen
d199cb565e * Source/NSTextView.m: Use pointing hand cursor for links
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33043 72102866-910b-0410-8b05-ffd578937521
2011-05-15 06:55:33 +00:00
Eric Wasylishen
7e17fa5ca5 * Source/NSTextView.m: Use IBeam cursor if selectable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33041 72102866-910b-0410-8b05-ffd578937521
2011-05-15 05:03:14 +00:00
Eric Wasylishen
a3fe4dcbec * Source/NSTextView.m (-mouseDown:):
Add support for making selections with the mouse which span multiple
text views
* Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:):
Replace the complex display invalidation code with two calls to
-[NSLayoutManager invalidateDisplayForCharacterRange:], which will
take care to invalidate all necessary text views.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32953 72102866-910b-0410-8b05-ffd578937521
2011-04-30 04:49:51 +00:00
Eric Wasylishen
e4458742a1 * Source/NSTextView.m (-setTypingAttributes:) Guard against
nil layout manager


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32952 72102866-910b-0410-8b05-ffd578937521
2011-04-30 04:30:45 +00:00
Eric Wasylishen
ea58698be4 * Source/NSTextView.m (-selectionRangeForProposedRange:granularity:):
Remove a special case which caused this method to refuse to
expand a range {[string length], 0}.
This was why the align left/center/right menu items didn't work
in Ink when the insertion point was at the end of a document.
The behaviour should match OS X now.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32935 72102866-910b-0410-8b05-ffd578937521
2011-04-27 09:19:53 +00:00
Eric Wasylishen
9db8881062 * Source/NSTextView.m (-setRulersVisible:): Create a horizontal ruler on
the scroll view if needed - this seems to be the OS X behaviour.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32932 72102866-910b-0410-8b05-ffd578937521
2011-04-27 04:00:33 +00:00
Riccardo Mottola
cd82d143a3 remove c99-ism
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32725 72102866-910b-0410-8b05-ffd578937521
2011-03-28 14:38:17 +00:00
Eric Wasylishen
fb20ec1095 * Source/NSTextView.m: Add a message in the context menu
if there are no spelling suggestions


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32581 72102866-910b-0410-8b05-ffd578937521
2011-03-14 19:44:58 +00:00
Eric Wasylishen
6af7d4f8b0 NSTextView.m: Attempt to add pagination support so lines aren't cut in half when printing
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32566 72102866-910b-0410-8b05-ffd578937521
2011-03-14 09:04:08 +00:00
Eric Wasylishen
5d165e7db8 tweaks to last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32562 72102866-910b-0410-8b05-ffd578937521
2011-03-14 04:57:02 +00:00
Eric Wasylishen
2d713e6cca * Source/NSLayoutManager.m: Clear temporary attributes
on the modified range when informed of a change in the text
storage
* Source/NSTextView.m: Add a context menu with spelling
suggestions and cut/copy/paste


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32561 72102866-910b-0410-8b05-ffd578937521
2011-03-14 04:19:32 +00:00
Eric Wasylishen
b460081f8c NSTextView continuous spell checking
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32534 72102866-910b-0410-8b05-ffd578937521
2011-03-12 07:45:14 +00:00
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