Commit graph

88 commits

Author SHA1 Message Date
Fred Kiefer
0576f2736b * Source/NSControl.m (-textDidChange:): If there is a binding with
continious update, pass on the changed text.
* Source/GSXibElement.m: Correct the handling of boolean values in attributes.
* Source/GSBindingHelpers.h,
* Source/NSKeyValueBinding.m: Prevent recursion when
reverseSetValue: is used.
* Source/NSTextField.m (-textDidChange:): Remove empty code line.
2021-03-27 21:20:28 +01:00
Fred Kiefer
59b1180d27 * Source/GSXibLoader.m (-awake:inContainer:withContext:): Allow
for subclasses of NSApplication as rootObjects.
        Based on patch by Marcian Lytwyn <gna@advcsi.com>.
        * Source/NSWindow.m (-userSpaceScaleFactor): Handle case where
        _screen is nil.
        Patch by Doug Simons (dsimons@testplant.com).
        * Source/NSWindow.m (-_screenForFrame:): Require real overlapp.
        Patch by Doug Simons (dsimons@testplant.com).
        * Source/NSTextField.m (-textDidChange:): Improve editing
        behavior when formatter returns a new string.
        Patch by Doug Simons (dsimons@testplant.com).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37830 72102866-910b-0410-8b05-ffd578937521
2014-05-03 21:45:47 +00:00
Fred Kiefer
ac6909e871 Merged changes from gnustep_testplant_branch branch and cleaned them up
a bit.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35417 72102866-910b-0410-8b05-ffd578937521
2012-08-17 13:16:12 +00:00
Fred Kiefer
c100baf6b4 Lots of minimal changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33613 72102866-910b-0410-8b05-ffd578937521
2011-07-23 13:43:33 +00:00
Fred Kiefer
a953d2bda0 Release the key value binding as it will be
retained in the binding table.
Leak found by static code analyser.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32484 72102866-910b-0410-8b05-ffd578937521
2011-03-07 13:35:37 +00:00
Fred Kiefer
2d01942e4b Replace #include -> #import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32451 72102866-910b-0410-8b05-ffd578937521
2011-03-04 11:33:22 +00:00
Wolfgang Lux
d94f50de97 Add special case to preserve the current X selection when editing of a
NSTextField is started with a mouse click.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31160 72102866-910b-0410-8b05-ffd578937521
2010-08-15 20:52:09 +00:00
Wolfgang Lux
7f6a94c5bb When editing of a text field ends after pressing the Return key and no
(other) view has become first responder make the text field itself
first responder by selecting its text just like this is done after
pressing Tab and Shift-Tab.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30145 72102866-910b-0410-8b05-ffd578937521
2010-04-14 07:11:50 +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
3ebf818958 Merge bug fix from Doug Simons to trunk.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29058 72102866-910b-0410-8b05-ffd578937521
2009-11-24 23:30:45 +00:00
Fred Kiefer
6c1bfef9f3 Merge changes from Doug Simons to trunk.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29017 72102866-910b-0410-8b05-ffd578937521
2009-11-15 18:04:17 +00:00
Adam Fedor
7afdd32ac1 Revert library license version to 2 until applications can be converted
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26619 72102866-910b-0410-8b05-ffd578937521
2008-06-10 04:01:49 +00:00
Fred Kiefer
f25c62f57b Add some more KVB and move some.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25746 72102866-910b-0410-8b05-ffd578937521
2007-12-15 12:34:39 +00:00
Fred Kiefer
295b663a75 Rewrote KVB to use separate binding class.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25728 72102866-910b-0410-8b05-ffd578937521
2007-12-13 01:10:09 +00:00
Fred Kiefer
5966ffcd3f Key binding patch by Chris Farber <chris@chrisfarber.net>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25724 72102866-910b-0410-8b05-ffd578937521
2007-12-11 18:50:42 +00:00
Fred Kiefer
ec5e0a3c38 Correct colour sliders to work in flipped views and simplified code.
Let text fields and controls pass on not used mouse down events to next
responder.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25707 72102866-910b-0410-8b05-ffd578937521
2007-12-08 22:12:48 +00:00
Fred Kiefer
193e31e678 Change all files to use GPL 3 and LGPL 3.
Prepare for next release.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25536 72102866-910b-0410-8b05-ffd578937521
2007-10-29 21:16:17 +00:00
Fred Kiefer
db20590f24 Add new MacOSX 10.3 methods and constants.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25470 72102866-910b-0410-8b05-ffd578937521
2007-09-09 15:30:06 +00:00
Fred Kiefer
a66882b17b Add new MacOSX 10.4 methods and constants to NSWindow. Requires
recompilation of all applications!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25469 72102866-910b-0410-8b05-ffd578937521
2007-09-09 12:19:01 +00:00
Fred Kiefer
b3dc35f126 Editing patches partly by Andreas Höschler <ahoesch@smartsoft.de>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25426 72102866-910b-0410-8b05-ffd578937521
2007-08-31 10:52:52 +00:00
Fred Kiefer
a7f9a308f4 Report the text field as being flipped.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25302 72102866-910b-0410-8b05-ffd578937521
2007-07-04 10:10:42 +00:00
Fred Kiefer
ebc0de97f3 Added MacOSX 10.4 methods to NSControl and reworked the whole cell
editing mechanism.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24380 72102866-910b-0410-8b05-ffd578937521
2007-01-18 17:24:33 +00:00
Richard Frith-MacDonald
57435da7d5 tidyups and minor theme tiling updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23871 72102866-910b-0410-8b05-ffd578937521
2006-10-15 08:34:47 +00:00
Matt Rice
8dce386f4d * Source/NSTextField.m (-mouseDown:): Check if the control is
disabled. (bug #13916)
        (-acceptFirstResponder:): Return no if disabled.
        (-acceptFirstMouse:): Ditto.
        * Source/NSTextFieldCell.m (-setEnabled:): Reset the string 
	value to an empty string if disabling.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23574 72102866-910b-0410-8b05-ffd578937521
2006-09-20 20:04:31 +00:00
Gregory John Casamento
d68950d71a Nib compatibility code merge.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22957 72102866-910b-0410-8b05-ffd578937521
2006-05-20 22:12:46 +00:00
Fred Kiefer
37be3efd3a GUI patches by Andreas H��schler.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22119 72102866-910b-0410-8b05-ffd578937521
2005-11-29 00:16:10 +00:00
Fabien Vallon
1999cc1666 Improved documentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22094 72102866-910b-0410-8b05-ffd578937521
2005-11-24 13:04:19 +00:00
Fred Kiefer
a350b03662 Two small patches from the current mailing list discussion.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22060 72102866-910b-0410-8b05-ffd578937521
2005-11-21 13:33:59 +00:00
Fabien Vallon
8c11f4903e Improved documentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22033 72102866-910b-0410-8b05-ffd578937521
2005-11-18 11:06:09 +00:00
Adam Fedor
303dd1baf9 Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21259 72102866-910b-0410-8b05-ffd578937521
2005-05-26 02:52:46 +00:00
Alexander Malmberg
f282f87e88 2005-01-18 16:53 Alexander Malmberg <alexander@malmberg.org>
* Source/NSCell.m (-setUpFieldEditorAttributes:): Clear the
	text object's string.
	* Source/NSControl.m (-setDoubleValue:, -setFloatValue:)
	(-setIntValue:, -setStringValue:, -setObjectValue:): If the receiver
	was being edited when the method was called, make it the first
	responder after changing the value.
	(-abortEditing): Don't clear the text object's string.
	* Source/NSMatrix.m (-abortEditing): Don't clear the text object's
	string.
	* Source/NSTableView.m (-abortEditing): Ditto.
	* Source/NSTextField.m (-abortEditing): Ditto.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20580 72102866-910b-0410-8b05-ffd578937521
2005-01-18 15:48:34 +00:00
Fred Kiefer
93b7e7acf8 Menu reference handlin patch and further keyed archiving.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18547 72102866-910b-0410-8b05-ffd578937521
2004-02-06 00:16:54 +00:00
David Ayers
b18f1c4ac4 Header reorganization - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17408 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:52:10 +00:00
Adam Fedor
6be9174933 Include <> -> ""
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16917 72102866-910b-0410-8b05-ffd578937521
2003-06-13 15:01:12 +00:00
Fred Kiefer
d28626b423 Only accept first mouse when editable.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15857 72102866-910b-0410-8b05-ffd578937521
2003-02-02 16:56:38 +00:00
Richard Frith-Macdonald
a19302360b Fix coding bugs etc.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14808 72102866-910b-0410-8b05-ffd578937521
2002-10-21 17:20:46 +00:00
Richard Frith-Macdonald
92867e201f Documentation tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14760 72102866-910b-0410-8b05-ffd578937521
2002-10-13 10:26:57 +00:00
Nicola Pero
f202a70a7b Fixed [_window makeFirstResponder: aTextField] to actually select the text
in the textfield


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14539 72102866-910b-0410-8b05-ffd578937521
2002-09-24 14:36:59 +00:00
Nicola Pero
48cac53701 Added missing dealloc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14526 72102866-910b-0410-8b05-ffd578937521
2002-09-24 01:22:50 +00:00
Alexander Malmberg
61b91e6b57 Handle becomesKeyOnlyIfNeeded in NSPanel properly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14508 72102866-910b-0410-8b05-ffd578937521
2002-09-21 23:33:37 +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
Nicola Pero
d2d3d03ef4 A little bit of 'end editing' was still done after the end editing notification
was posted ... causing the delegate not to be able to select the text when
receiving the notification ... fixed!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13983 72102866-910b-0410-8b05-ffd578937521
2002-06-27 10:52:01 +00:00
Nicola Pero
d024336615 Post the NSControlTextDidEndEditingNotification *after* actually ending
editing :-)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13979 72102866-910b-0410-8b05-ffd578937521
2002-06-26 17:00:33 +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
Nicola Pero
9dfbbceaf2 Updated for changes in semantics of NSMutableAttributedString -string
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12497 72102866-910b-0410-8b05-ffd578937521
2002-02-11 17:21:13 +00:00
Adam Fedor
d47e202fbe Markup for autogsdoc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11788 72102866-910b-0410-8b05-ffd578937521
2001-12-17 16:51:51 +00:00
Fred Kiefer
618ba42c09 Added and implemented some methods for the handling of richt text.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11488 72102866-910b-0410-8b05-ffd578937521
2001-11-23 00:27:27 +00:00
Fred Kiefer
77b0f2bfb1 Corrected the handling of the cellClass so that every subclass of
NSControl, that uses a cell, has its own implementaion of
[cellClass] and [setCellClass].


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9544 72102866-910b-0410-8b05-ffd578937521
2001-04-09 21:28:49 +00:00
Mirko Viviani
60b8f20ce4 * Source/NSButtonCell.m ([NSButtonCell -setCellAttribute:to:]):
implemented.
([NSButtonCell -cellAttribute:]): implemented.

* Source/NSPopUpButton.m ([NSPopUpButton -keyDown:]): implemented
keyboard selection.
([NSPopUpButton -resignFirstResponder]): implemented.
([NSPopUpButton -resignKeyWindow]): implemented.

* Source/NSPopUpButtonCell.m ([NSPopUpButtonCell
-drawInteriorWithFrame:inView:]): from -drawWithFrame:inView:

* Source/NSButton.m ([NSButton -becomeFirstResponder]): set cell first
responder.
([NSButton -resignFirstResponder]): likewise.
([NSButton -becomeKeyWindow]): likewise.
([NSButton -resignKeyWindow]): likewise.

* Source/NSBrowserCell.m ([NSBrowserCell -drawInteriorWithFrame:
inView:]): draw correct dotted box.

* Source/NSBrowser.m ([NSBrowser -becomeFirstResponder]): make first
responder the latest column.
([NSBrowser -acceptsFirstResponder]): accepts first responder status.
([NSBrowser -keyDown:]): handle tabs to select next/previous key view.
([NSBrowser -moveRight:]): make browser column the first responder.
([NSBrowser -moveUp:]): likewise.
([NSBrowser -moveDown:]): likewise.
([NSBrowser -moveLeft:]): likewise.
([NSBrowser -_unloadFromColumn:]): remove columns from superview and
array.
([NSBrowser -_remapColumnSubviews:]): set the correct first responder.

* Source/NSWindow.m ([NSWindow -sendEvent:]): retain/release first
responder for keyUp/keyDown events. Discard NSLeftMouseDown for closed
windows.
([NSWindow -dealloc]): release _originalResponder

* Source/NSView.m ([NSView -removeSubview:]): remove next responder.

* Source/NSCell.m ([NSCell -setUpFieldEditorAttributes:]): clear
selected range.
([NSCell -editWithFrame:inView:editor:delegate:event:]): redisplay
textObject after invoking mouseDown:
([NSCell -drawInteriorWithFrame:inView:]): draw dotted-line outline
when first responder.
([NSCell -setCellAttribute:to:]): implemented.

* Source/NSTextView.m ([NSTextView -moveUp:]): don't call
_illegalMovement: for the text field editor.
([NSTextView -moveDown:]): likewise.
([NSTextView -moveLeft:]): likewise.
([NSTextView -moveRight:]): likewise.

* Source/NSTextField.m ([NSTextField -textDidEndEditing:]): fixed
return/tab/backtab text movement code.

* Headers/gnustep/gui/NSGraphics.h: added NSDottedFrameRect prototype.

* Headers/gnustep/gui/NSMatrix.h: added ivars for dotted frame rect.
* Source/NSMatrix.m ([NSMatrix -selectCell:]): implemented.
([NSMatrix -_selectCell:atRow:column:]): new method.
([NSMatrix -selectCellAtRow:column:]): call _selectCell:atRow:column:
([NSMatrix -selectCellWithTag:]): likewise.
([NSMatrix -selectAll:]): Do not select disabled or editable cells.
([NSMatrix -textDidEndEditing:]): fixed return/tab/backtab text
movement code.
([NSMatrix -_selectNextSelectableCellAfterRow:column:]): don't select
disabled cells.
([NSMatrix -_selectPreviousSelectableCellBeforeRow:column:]): likewise.
([NSMatrix -_privateFrame:mode:numberOfRows:numberOfColumns:]): set
dottedRow and dottedColumn.
([NSMatrix -insertRow:withCells:]): likewise.
([NSMatrix -removeColumn:]): likewise.
([NSMatrix -removeRow:]): likewise.
([NSMatrix -mouseDown:]): likewise and discard disabled cells.
([NSMatrix -drawRect:]): set shows cell first responder.
([NSMatrix -becomeFirstResponder]): draw dotted box for cell.
([NSMatrix -resignFirstResponder]): likewise.
([NSMatrix -becomeKeyWindow]): likewise.
([NSMatrix -resignKeyWindow]): likewise.
([NSMatrix -_setNeedsDisplayDottedCell]): likewise.
([NSMatrix -selectTextAtRow:column:]): set shows cell first responder.
([NSMatrix -setState:atRow:column:]): likewise. Deselect previous
selected cell in radio mode.

* Source/NSSavePanel.m (createRowsForColumn:): use _gsSavePanelCompare:
and check extension against _requiredFileType and not "app", "bundle",
etc.
([NSString -_gsSavePanelCompare:]): filename compare.
([NSSavePanel -_initWithoutGModel]): set key view for keyboard
interaction.
([NSSavePanel -keyDown:]): removed.
([NSSavePanel -controlTextDidEndEditing:]): removed.

* Source/NSOpenPanel.m ([NSOpenPanel -_shouldShowExtension:isDir:]):
added isDir argument.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9473 72102866-910b-0410-8b05-ffd578937521
2001-03-22 00:27:37 +00:00
Nicola Pero
e07f5fa8c9 Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8401 72102866-910b-0410-8b05-ffd578937521
2000-12-21 17:47:51 +00:00