Commit graph

138 commits

Author SHA1 Message Date
Alexander Malmberg
368c851e38 (-sizeToFit): Add the extra line frag rect. (-scrollRangeToVisible:): Reimplement using the new insertion point positioning methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16120 72102866-910b-0410-8b05-ffd578937521
2003-03-03 18:36:07 +00:00
Alexander Malmberg
e4329b4ff9 (-sizeToFit): Add the extra line frag rect. (-scrollRangeToVisible:): Reimplement using the new insertion point positioning methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16119 72102866-910b-0410-8b05-ffd578937521
2003-03-03 18:33:46 +00:00
Alexander Malmberg
6027271a4f Change the way the text view is told about layout invalidation. Change NSTextView to update its state as late as possible before displaying, and make sure it's updated when it's resized.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15967 72102866-910b-0410-8b05-ffd578937521
2003-02-15 17:30:52 +00:00
Alexander Malmberg
85ff161e72 Keep track of the original index of a sequence of moves in one dimension. Pass it to the layout manager when moving the insertion point to prevent drifting.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15956 72102866-910b-0410-8b05-ffd578937521
2003-02-14 16:58:59 +00:00
Alexander Malmberg
05d3343c45 (-setSelectedRange:affinity:stillSelecting:): Clamp the selected range to the text storage's length.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15937 72102866-910b-0410-8b05-ffd578937521
2003-02-11 15:40:21 +00:00
Alexander Malmberg
87a4e8d28d Many minor bug and behavior fixes to get the text system to work with several text containers attached to one layout manager.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15924 72102866-910b-0410-8b05-ffd578937521
2003-02-10 14:14:34 +00:00
Alexander Malmberg
39744f3b2f Rewrite insertion point movement actions properly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15904 72102866-910b-0410-8b05-ffd578937521
2003-02-08 16:55:51 +00:00
Alexander Malmberg
20ab4fa2df Add -insertionPointRectForCharacterIndex:inTextContainer: method to NSLayoutManager and use it in NSTextView.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15863 72102866-910b-0410-8b05-ffd578937521
2003-02-03 01:52:27 +00:00
Alexander Malmberg
94ecd621eb Clarify comments about user attribute changing now that I've figured out a way for it to work. Rewrite the actions to match.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15852 72102866-910b-0410-8b05-ffd578937521
2003-02-02 01:37:27 +00:00
Alexander Malmberg
6f524e43b8 (-shouldChangeTextInRange:replacementString:, -didChangeText): Allow changes even if we're not the first responder, but end the editing session right away.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15844 72102866-910b-0410-8b05-ffd578937521
2003-02-01 14:14:53 +00:00
Alexander Malmberg
58fb330d35 Guard against a nil _layoutManager in a few places.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15761 72102866-910b-0410-8b05-ffd578937521
2003-01-29 20:19:20 +00:00
Alexander Malmberg
c90372a21a Remove debugging code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15757 72102866-910b-0410-8b05-ffd578937521
2003-01-29 00:43:43 +00:00
Alexander Malmberg
6546c340e8 Implement basic drawing of insertion point.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15756 72102866-910b-0410-8b05-ffd578937521
2003-01-29 00:42:29 +00:00
Alexander Malmberg
e9ebe98664 (-setConstrainedFrameSize:):Fix calculation of effective minimum size. (-sizeToFit): Use maximum x and y of used rect to calculate size, not used rect's own size.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15753 72102866-910b-0410-8b05-ffd578937521
2003-01-28 22:32:18 +00:00
Alexander Malmberg
eaec5ebcea (-initWithFrame:textContainer:): Make the default text container inset (2,0).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15751 72102866-910b-0410-8b05-ffd578937521
2003-01-28 21:23:51 +00:00
Alexander Malmberg
314e298be1 Avoid making calls to the layout manager with invalid arguments.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15748 72102866-910b-0410-8b05-ffd578937521
2003-01-28 17:00:28 +00:00
Alexander Malmberg
31c38c8183 (-mouseDown:): Handle empty text views. (-drawRect:): Always draw glyphs' backgrounds.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15740 72102866-910b-0410-8b05-ffd578937521
2003-01-27 15:19:15 +00:00
Alexander Malmberg
5b78652c15 Make sure the typing attributes are always a mutable dictionary that we can modify.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15724 72102866-910b-0410-8b05-ffd578937521
2003-01-26 19:42:03 +00:00
Alexander Malmberg
66c63d5580 Make sure the typing attributes are always a mutable dictionary that we can modify.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15722 72102866-910b-0410-8b05-ffd578937521
2003-01-26 19:36:57 +00:00
Alexander Malmberg
9407b0bfca Merge in text-system-branch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15718 72102866-910b-0410-8b05-ffd578937521
2003-01-26 19:21:40 +00:00
Fred Kiefer
f10e76e245 Changed all the internal methods ([replaceCharacterRange:withString:],
[setFont:range:], [setTextColor:range:], [setalignment:range:],
[replaceRange:withAttributedString:], [setAtrributes:range:]) not
to call [shouldChangeTextInRange:replacementString:], so that they
can be called for a non editable text view.
Added this call to the methods: [insertText:], [transpose:],
[changeColor:], [alignCenter:], [alignLeft:], [alignRight:],
[alignJustified:], [readSelectionFromPasteboard:type:].


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15546 72102866-910b-0410-8b05-ffd578937521
2003-01-08 16:35:28 +00:00
Nicola Pero
9cdaef32c7 Renamed setFont:ofRange: to setFont:range:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15333 72102866-910b-0410-8b05-ffd578937521
2002-12-25 16:58:28 +00:00
Adam Fedor
e43ebddc33 Remove comment of set editable, not ready to make this yet.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14908 72102866-910b-0410-8b05-ffd578937521
2002-11-02 23:20:58 +00:00
Adam Fedor
52b116f1f4 Add dragging of ruler markers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14907 72102866-910b-0410-8b05-ffd578937521
2002-11-02 23:17:23 +00:00
Adam Fedor
77dde4b8bc Remove typo
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14865 72102866-910b-0410-8b05-ffd578937521
2002-10-29 04:54:44 +00:00
Adam Fedor
06a5c62fa5 Load prolog.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14863 72102866-910b-0410-8b05-ffd578937521
2002-10-29 03:46:39 +00:00
Richard Frith-Macdonald
63ed41067f Attempted fix for multiple dealloc problems.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14855 72102866-910b-0410-8b05-ffd578937521
2002-10-28 08:08:57 +00:00
Richard Frith-Macdonald
20247dac50 Rewrite key view handling
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14805 72102866-910b-0410-8b05-ffd578937521
2002-10-21 13:03:23 +00:00
Richard Frith-Macdonald
d73d397164 Fix error in last mod.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14759 72102866-910b-0410-8b05-ffd578937521
2002-10-13 10:13:38 +00:00
Richard Frith-Macdonald
47ee0f0312 Tidied for documentation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14758 72102866-910b-0410-8b05-ffd578937521
2002-10-13 09:16:17 +00:00
Nicola Pero
72d35ad13a Implemented pageUp: and pageDown:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14709 72102866-910b-0410-8b05-ffd578937521
2002-10-10 19:05:02 +00:00
Nicola Pero
4c709da872 Fixed sending out the controlTextDidBeginEditingNotification
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14626 72102866-910b-0410-8b05-ffd578937521
2002-10-02 10:36:37 +00:00
Nicola Pero
e660df30bf Fixed moving to the end of the 'one before the last' line
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14618 72102866-910b-0410-8b05-ffd578937521
2002-10-01 16:17:23 +00:00
Nicola Pero
dc4ff73bed Added FIXME
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14528 72102866-910b-0410-8b05-ffd578937521
2002-09-24 01:29:14 +00:00
Alexander Malmberg
6b9b10409f Don't set uses_font_panel and uses_ruler to YES until initialization is done.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14511 72102866-910b-0410-8b05-ffd578937521
2002-09-22 14:35:22 +00:00
Pierre-Yves Rivaille
f9bdd044b1 * Source/NSSplitView.m ([NSSplitView -initWithCoder:]):
set _never_displayed_before to YES.
* Source/NSFont.m: rearrange the last change to make
  it look like other classes' initWithCoder/encodeWithCoder
* Source/NSTextView.m: do not call _blink directly
  (suggested by Nicola Pero).
* Source/NSButtonCell.m
  ([NSButtonCell -drawInteriorWithFrame:inView:]):
  if the button is NSImageOnly, draw the dotted frame at
  the right location.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14483 72102866-910b-0410-8b05-ffd578937521
2002-09-18 18:00:30 +00:00
Pierre-Yves Rivaille
46630bd6de * Source/NSText.m ([NSText -initWithCoder:]):
Retain the decoded background color.

	* Source/NSTextView.m :
	multiple location: don't ignore textContainer's inset
	([NSTextView -initWithCoder:])
	([NSTextView -encodeWithCoder:])
	Encode caret color, textContainer's size and whether the
	textContainer has widthTracksTextView or heightTracksTextView set.
	([NSTextView -sizeToFit]) Change width (height) only if
	is_horizontally_resizable (is_vertically_resizable).
	([NSTextView -scrollRangeToVisible:]) scrolls to the first char of
	the range.
	([NSTextView -invalidateTextContainerOrigin]): Don't ignore inset,
	set the origin so that the justification is preserved even if the
	textContainer's width is larger that the textview's width.
	([NSTextView -updateInsertionPointStateAndRestartTimer:]):
	update and place the insertion point properly.
	([NSTextView -moveDown:]) & ([NSTextView -moveUp:]):
	Don't ignore inset. Make insertion point visible.

	* Source/NSTextField.m ([NSTextField -acceptsFirstResponder:]):
	responds NO if the editing is still in progrss.

	* Source/NSLayoutManager.m
	([NSLayoutManager -drawBackgroundForGlyphRange:atPoint:]):
	Don't ignore textContainer's inset.

	* Source/GSSimpleLayoutManager.m
	Replaced [-drawLinesInLineRange:] with [-drawLinesInLineRange:atPoint:].
	Replaced [-drawSelectionAsRangeNoCaret:] with
	[-drawSelectionAsRangeNoCaret:atPoint:].
	Those replacements make it easier to take inset into account.
	([-lineFragmentUsedRectForGlyphAtIndex:effectiveRange:])
	([-locationForGlyphAtIndex:])
	([-boundingRectForGlyphRange:inTextContainer:])
	([-rectForCharacterIndex:])
	([-setNeedsDisplayForLineRange:inTextContainer:]):
	Various fixes.
	([-textStorage:edited:range:changeInLength:invalidatedRange:])
	Update insertion point if needed (useful when alignment changes).
	([-rebuildForRange:delta:inTextContainer:]):
	Update layout mechanism.

	* Source/NSCell.m
	([NSCell -highlight:withFrame:inView:]):
	Ask the control to draw the background if we are not opaque.
	([NSCell -editWithFrame:inView:editor:delegate:event:]):
	([NSCell -selectWithFrame:inView:editor:delegate:start:length:]):
	([NSCell -endEditing:]):
	instantiate (and remove) the textview so that it can be scrolled.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14429 72102866-910b-0410-8b05-ffd578937521
2002-09-11 20:26:27 +00:00
Fred Kiefer
b5c268588a Corrected includes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14415 72102866-910b-0410-8b05-ffd578937521
2002-09-06 23:39:52 +00:00
Nicola Pero
1766f31c27 Make sure to start blinking of insertion point from the 'on' - makes much
nicer typing


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14398 72102866-910b-0410-8b05-ffd578937521
2002-09-05 10:42:07 +00:00
Adam Fedor
f51c1bbf10 Merge from 0.8.0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14232 72102866-910b-0410-8b05-ffd578937521
2002-08-03 03:32:19 +00:00
Nicola Pero
2347af5422 Implemented becomeKeyWindow
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14164 72102866-910b-0410-8b05-ffd578937521
2002-07-17 13:29:41 +00:00
Nicola Pero
a3a02d0f05 Added resignKeyWindow so that we don't try blinking when we are no longer
the key window


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14007 72102866-910b-0410-8b05-ffd578937521
2002-07-02 15:07:08 +00:00
Nicola Pero
aebc25e676 Removed check for height of line being 0, which should not be needed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13959 72102866-910b-0410-8b05-ffd578937521
2002-06-24 12:16:07 +00:00
Nicola Pero
4dcab12c71 More clean up in dealloc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13633 72102866-910b-0410-8b05-ffd578937521
2002-05-12 11:23:12 +00:00
Nicola Pero
be371e47d7 Added missing #includes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13442 72102866-910b-0410-8b05-ffd578937521
2002-04-11 23:17:42 +00:00
Fred Kiefer
bef97ec33b In [updateRuler] set the client view of the ruler view.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13381 72102866-910b-0410-8b05-ffd578937521
2002-04-06 23:36:40 +00:00
Fred Kiefer
5c40c0f312 Made [updateRuler] save against missing rulers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13332 72102866-910b-0410-8b05-ffd578937521
2002-04-03 00:30:38 +00:00
Richard Frith-Macdonald
c1ffddcdc8 Rename middl toother mouse
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12948 72102866-910b-0410-8b05-ffd578937521
2002-03-02 07:23:18 +00:00
Nicola Pero
9bd438fbd4 Fixed bug in deleting characters in a textfield
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12865 72102866-910b-0410-8b05-ffd578937521
2002-02-28 01:25:49 +00:00
Fred Kiefer
cfc7234d1a Implemented [moveToBeginningOfParagraph:] and [moveToEndOfParagraph:].
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12858 72102866-910b-0410-8b05-ffd578937521
2002-02-27 23:36:13 +00:00