Commit graph

291 commits

Author SHA1 Message Date
David Chisnall
4850a9feac Fix all current compiler warnings on FreeBSD/x86-64.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36038 72102866-910b-0410-8b05-ffd578937521
2013-01-30 09:48:54 +00:00
Fred Kiefer
0f3af93a92 Reworked version of patches by Marcian Lytwyn
<marcian.lytwyn@advcsi.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35899 72102866-910b-0410-8b05-ffd578937521
2012-12-16 22:51:23 +00:00
Wolfgang Lux
1dd7be22f7 Update text storage directly when undoing text changes in a NSTextView
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35175 72102866-910b-0410-8b05-ffd578937521
2012-06-02 22:31:54 +00:00
Fred Kiefer
2d2026e7fc Revert last change and replace with something a little bit better. The
whole ruler handling will need some deeper inspection.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34636 72102866-910b-0410-8b05-ffd578937521
2012-01-26 09:25:29 +00:00
Doug Simons
3e7c9bceef Call setClientView: before calling setMarkers: to fix a problem when a textView's text is set or changed when the textView is not the first responder, such as at windowControllerDidLoadNib: time.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34633 72102866-910b-0410-8b05-ffd578937521
2012-01-25 23:28:51 +00:00
Wolfgang Lux
cc31ecbeda Change the default text container inset for NSTextView to (0,0) to
reduce blank space around text.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34367 72102866-910b-0410-8b05-ffd578937521
2011-12-29 22:16:50 +00:00
Wolfgang Lux
0da1b1f034 Adjust the minimum and maximum sizes of a NSTextView to ensure that
the minimum size is not greater than the current size and the maximum
size is not smaller than the current size.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34362 72102866-910b-0410-8b05-ffd578937521
2011-12-29 16:48:17 +00:00
Fred Kiefer
e740f7b0cc * Source/NSTextView.m (-setFieldEditor:): Use different values for
both cases.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34347 72102866-910b-0410-8b05-ffd578937521
2011-12-22 22:00:42 +00:00
Eric Wasylishen
e395fe88d7 * Source/NSPrinter.m:
* Source/NSPrintOperation.m:
* Source/NSPageLayout.m:
* Source/NSPrintInfo.m:
* Headers/AppKit/NSPrintInfo.h: Migrate printing code to CGFloat
or double.
* Source/NSTextView.m: Rewrite -adjustPageHeightNew🔝bottom:limit:


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34288 72102866-910b-0410-8b05-ffd578937521
2011-12-15 06:51:02 +00:00
Wolfgang Lux
6365fa5127 Reinstate Fred's change with the additional correction to the string
drawing code he proposed on the mailing list.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34241 72102866-910b-0410-8b05-ffd578937521
2011-12-02 21:36:58 +00:00
Eric Wasylishen
f218a41010 * Source/NSTextView.m
(-_scheduleTextCheckingInVisibleRectIfNeeded): Check for
nil before sending -rectValue to avoid crash


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34238 72102866-910b-0410-8b05-ffd578937521
2011-12-02 05:10:54 +00:00
Gregory John Casamento
14d5d889be revert change by fred.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34230 72102866-910b-0410-8b05-ffd578937521
2011-11-30 15:43:04 +00:00
Fred Kiefer
865c22357b * Source/NSTextView.m (-buildUpTextNetwork:): Move setting the
default line framgent padding from here ...
* Source/NSTextContainer.m (-initWithContainerSize:): ... to here.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34227 72102866-910b-0410-8b05-ffd578937521
2011-11-28 17:20:45 +00:00
Gregory John Casamento
e9aaaf4b61 Changes to correct bug#34919. NSTextView should now correctly show the padding set in the lineFragmentPadding attribute of NSTextContainer.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34222 72102866-910b-0410-8b05-ffd578937521
2011-11-28 02:37:58 +00:00
Eric Wasylishen
26567e31d8 * Source/NSColorPanel.m: Always send action and colorChanged: when
the color changes. NSColorPanel is always "continuous" for now...
to support -isContinuous == NO, we need to augment the API between
the color panel and the pickers so they can send a message when
the mouse is released.
* Source/NSTextView.m: Change typing attributes in response to
colorChanged:


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34105 72102866-910b-0410-8b05-ffd578937521
2011-11-01 20:31:24 +00:00
Fred Kiefer
8240c3bb55 * Source/NSTextView.m(currentVersion, -encodeWithCoder:,
-initWithCoder:): Archive missing attributes in non-keyed
mode. This required updating the NSTextView version to 4.
Should fix bug #33884.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33962 72102866-910b-0410-8b05-ffd578937521
2011-10-11 08:21:13 +00:00
Eric Wasylishen
d919131abb * Source/NSTextView.m (-view:stringForToolTip:point:userData:):
Ensure this returns an NSString, even if NSToolTipAttributeName
is set to something else (it calls -description on the value).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33597 72102866-910b-0410-8b05-ffd578937521
2011-07-21 04:56:02 +00:00
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