Commit graph

263 commits

Author SHA1 Message Date
fredkiefer
65445f6e4f Spelling correction and removal of a newline. 2020-01-01 13:24:39 +01:00
fredkiefer
cbda1229ed Improve string shortening for display. 2019-12-14 18:22:03 +01:00
fredkiefer
4b8a25072c Add code from Eggplant to shorten strings when displaying in a rect.
This code has been partially rewritten.
2019-12-10 22:23:51 +01:00
fredkiefer
378c1c4077 Take over the Eggplant code for XIB document decoding,
with slight cleanups to get it working with gcc.
2019-12-08 23:47:53 +01:00
Gregory John Casamento
dd8a79f0df Add code to trim newlines if cell is in single line mode. Add code to encode single line mode 2019-04-13 23:43:27 -04:00
Gregory John Casamento
20b9c44626 Add code to read flag from nib file for usesSingleLineMode 2019-04-13 21:29:29 -04:00
Gregory John Casamento
9fba22c582 Fix issue with new attribute 2019-03-27 00:53:43 -04:00
Gregory John Casamento
4406c7de45 Changes for bug33395: Adds missing setter implementation. Changes to follow for behavioral and archival changes. 2019-03-09 09:47:23 -05:00
Gregory John Casamento
e833084f6d Add method setUsesSingleLineMode: and usesSingleLineMode 2019-03-09 05:43:38 -05:00
fredkiefer
c72d2df3ff * Source/NSButtonCell.m (-setButtonType:): Warn about unsupported
button types.
* Source/NSCell.m (-performClickWithFrame:inView:): Highlight the
cell only if drawing is possible.
2017-08-27 11:23:43 +02:00
fredkiefer
e853f4fdbf Rewrote mouse tracking logic to be closer to the Cocoa definition. 2017-08-27 11:13:17 +02:00
Daniel Ferreira
758d524547 NS{Cell,View}: implement stubs for layout direction handling
Implement stubs for the layout direction properties in NSCell and
NSView. Currently, they default to left-to-right layouting.
2017-07-25 22:33:12 +01:00
Fred Kiefer
0ea4141ac0 * Source/NSCell.m (-trackMouse:...untilMouseUp:): Check enabled
and use isContinuous method.
        * Source/NSSliderCell.m: Replace specific implementation of
        -trackMouse:...untilMouseUp: with super class one and move
        specific code into helper methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39077 72102866-910b-0410-8b05-ffd578937521
2015-10-16 22:01:41 +00:00
Fred Kiefer
59fa666263 * Tests/gui/NSView/NSView_autoresize_and_rounding.m: Add tests
for centerScanRect: with flipped view.
        * Source/NSView.m (-centerScanRect:): Change to get the failed
        tests to pass.
        * Source/GSThemeTools.m (-drawRoundBezel:withColor:): Make round
        bezel look a bit nicer.
        * Source/NSButtonCell.m (-drawImage:withFrame:inView:): Use
        centerScanRect: instead of similar code.
        * Source/NSCell.m: Use imageRectForBounds: and
        titleRectForBounds: in drawInteriorWithFrame:inView:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38929 72102866-910b-0410-8b05-ffd578937521
2015-08-25 21:33:04 +00:00
Gregory John Casamento
971a573445 Add drawing methods for theming NSBrowserCell.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38690 72102866-910b-0410-8b05-ffd578937521
2015-06-26 05:27:12 +00:00
Fred Kiefer
8b6e6bb752 * Source/NSCell.m (-copyWithZone:): Fix copy and paste error.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38352 72102866-910b-0410-8b05-ffd578937521
2015-02-20 22:41:31 +00:00
Gregory John Casamento
0934169b8f Fix issue with saving text contents of a cell.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38053 72102866-910b-0410-8b05-ffd578937521
2014-09-01 05:33:35 +00:00
Fred Kiefer
37e94abc97 * Headers/AppKit/NSCell.h
* Source/NSCell.m: Add hitTestForEvent:inRect:ofView:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37639 72102866-910b-0410-8b05-ffd578937521
2014-01-26 22:34:56 +00:00
Eric Wasylishen
ef5f2cf19f * Source/NSCell.m (-highlight:withFrame:inView:):
Remove call to [controlView displayRect: cellFrame];
There was a comment saying it should be removed, and when
combined with the -[NSButtonCell isOpaque] change, it
was casuing scroller buttons to stay "stuck" down.
* Source/NSBrowser.m (-isOpaque):
* Source/NSButtonCell.m (-isOpaque):
* Source/NSColorWell.m (-isOpaque):
Force -isOpaque to return NO, because it's
possible to make all of these controls semitransparent with
theme tiles. This was visible with the Narcissus theme
(svn://svn.gna.org/svn/etoile/trunk/Etoile/Themes/Narcissus.theme)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37164 72102866-910b-0410-8b05-ffd578937521
2013-09-28 21:38:29 +00:00
Fred Kiefer
b1fc7cb066 Correct coding/decoding after type changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36160 72102866-910b-0410-8b05-ffd578937521
2013-02-17 16:53:48 +00:00
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
d870275b7f * Headers/AppKit/NSCell.h
* Headers/AppKit/NSColor.h
        * Headers/AppKit/NSGraphics.h
        * Headers/AppKit/NSView.h
        * Source/Functions.m
        * Source/GSThemeDrawing.m
        * Source/GSTitleView.m
        * Source/NSApplication.m
        * Source/NSCell.m
        * Source/NSView.m: More NSInteger/NSUInteger/CGFloat cleanup



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36035 72102866-910b-0410-8b05-ffd578937521
2013-01-29 21:57:41 +00:00
Gregory John Casamento
22f55b8c28 * Headers/AppKit/NSTableView.h: Add _isValidating
* Source/NSCell.m (+initialize): Expose title binding.
	* Source/NSOpenPanel.m (-runModal): Use _directory if it is set.
	* Source/NSTableView.m (-validateEditing): Check _isValidating to
	prevent recursive calls into validateEditing.
	* Source/NSTabView.m (-initWithCoder:): Set _selected_item to
	NSNotFound.
	* Source/NSView.m (-addSubview:): Do not throw an exception when
	adding a nil subview, just ignore it.  This matches behavior on
	Cocoa.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35562 72102866-910b-0410-8b05-ffd578937521
2012-09-11 04:16:51 +00:00
Eric Wasylishen
c500d8379f * Source/NSCell.m (_updateFieldEditor:): Fix what I presume is
a typo. The "if (nil == _contents) { contents = @""; }" blocks were
dead code because the contents variable would later
be set to nil if _contents was nil. This was causing an exception
when starting editing an empty text field loaded from a xib.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35011 72102866-910b-0410-8b05-ffd578937521
2012-03-27 19:26:17 +00:00
Fred Kiefer
d570812401 Fix clang compiler warnings as reported by Sebastian Reitenbach
<sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34608 72102866-910b-0410-8b05-ffd578937521
2012-01-23 14:27:58 +00:00
Fred Kiefer
ace1561e52 * Source/NSCell.m (-setStringValue:, setObjectValue:): Always use
ASSIGNCOPY for the contents. This fixes memory leak of last commit.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34585 72102866-910b-0410-8b05-ffd578937521
2012-01-19 08:47:52 +00:00
Riccardo Mottola
9603f29b84 Copy contents before setting it [setObjectValue]
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34584 72102866-910b-0410-8b05-ffd578937521
2012-01-19 00:40:47 +00:00
Fred Kiefer
8ad4aa86c4 Replace some occurences of int with NSInteger
and unsigned with NSUInteger. This allows to recompile gui on 
64 bit systems after the change to NSNotFound in base.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34312 72102866-910b-0410-8b05-ffd578937521
2011-12-17 17:16:09 +00:00
Eric Wasylishen
60674d5076 * Headers/AppKit/NSImageCell.h:
* Headers/AppKit/NSCell.h: Move NSImageScaling constants to NSCell
* Source/NSImageCell.m:
* Source/NSCell.m: Refactor the image scaling logic to a private
method in NSCell, -_scaleImageWithSize:toFitInSize:scalingType:
which can be share by NSImageCell, NSButtonCell, and any other
cell classes that need it.
* Source/NSButtonCell.m:
* Headers/AppKit/NSButtonCell.h: Implement -imageScaling and
-setImageScaling methods. 
* Source/GSThemeDrawing.m:
* Headers/Additions/GNUstepGUI/GSTheme.h: Remove the
-drawImage:inButtonCell:withFrame:position: API intended
to let themes substitute images right before drawing,
as IMHO it's the wrong place to hook in new images (by
the time this method was caleld, sizing/positionging
was already done).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34160 72102866-910b-0410-8b05-ffd578937521
2011-11-11 23:10:15 +00:00
Eric Wasylishen
fde5f243d8 * Source/NSCell.m: Read/write NSLineBreakMode from the bits masked off
by 0xE00 in NSCellFlags2. The previous location they were being
read/written from was giving bogus values such as 7.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34073 72102866-910b-0410-8b05-ffd578937521
2011-10-26 20:01:31 +00:00
Eric Wasylishen
a6788023fb * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Simplify a bit
bit by using
-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]
* Source/NSCell.m (-drawInteriorWithFrame:inView:): Switch from
-[NSImage compositeToPoint...] to
-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33813 72102866-910b-0410-8b05-ffd578937521
2011-09-07 08:18:40 +00:00
Eric Wasylishen
a15066d183 * Source/NSButtonCell.m (-title): Return @"" instead of nil
* Source/NSButtonCell.m (-alternateTitle): Return @"" instead of nil
* Source/NSButtonCell.m (-attributedAlternateTitle): Use
[self alternateTitle] instead of accessing _altContents directly to guard
against _altContents being nil
* Source/NSButtonCell.m (-attributedTitle): Don't return nil. Use
[self title] instead of accessing _contents directly to guard against
_contents being nil
* Source/NSButtonCell.m (-keyEquivalent): Return @"" instead of nil
* Source/NSButtonCell.m (-encodeWithCoder):
For keyEquivelant and alternateTitle, now that the methods never return
nil, instead of checking if they return nil to decide whether to encode them,
check if the string length is > 0.
* Source/NSToolbarItem.m (-label): Return @"" instead of nil.
* Source/NSCell.m (-stringValue): Return @"" instead of nil
* Source/NSCell.m (-attributedStringValue): Don't return nil. Use
[self stringValue] instead of accessing _contents directly to guard against
_contents being nil.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33598 72102866-910b-0410-8b05-ffd578937521
2011-07-21 06:31:34 +00:00
Fred Kiefer
86ff6abf69 Replace direct use of the isa pointer with a call to object_getClass()
to make David happy.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33545 72102866-910b-0410-8b05-ffd578937521
2011-07-14 07:17:24 +00:00
David Chisnall
c6866f8c8a Lots of small tweaks to make -gui compile without warnings with clang.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30119 72102866-910b-0410-8b05-ffd578937521
2010-04-10 20:33:30 +00:00
Fred Kiefer
7e289df84b Yet another set of #include -> #import replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30083 72102866-910b-0410-8b05-ffd578937521
2010-03-31 08:14:50 +00:00
Fred Kiefer
53381f6992 Some more #include -> #import replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30036 72102866-910b-0410-8b05-ffd578937521
2010-03-25 21:30:28 +00:00
Fred Kiefer
9f4fd26405 Change tag to NSInteger.
Patch by Anibal Rindisbacher <anibal784@gmail.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30026 72102866-910b-0410-8b05-ffd578937521
2010-03-23 21:26:24 +00:00
Wolfgang Lux
cdf5175e7c Fix some optimistic coding in NSCell which was causing a crash in
AddressManager.app.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29904 72102866-910b-0410-8b05-ffd578937521
2010-03-11 18:43:15 +00:00
Fred Kiefer
c16eed5d1d Started cleanup of #includes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29833 72102866-910b-0410-8b05-ffd578937521
2010-03-04 10:12:13 +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
Fred Kiefer
43074e4a62 Start cleanup after big base change. Remove the usage of extension
methods.
New 10.5 methods on NSCell.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29656 72102866-910b-0410-8b05-ffd578937521
2010-02-17 09:58:38 +00:00
Riccardo Mottola
f6350f5540 removed c99-ism
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29166 72102866-910b-0410-8b05-ffd578937521
2009-12-26 10:43:09 +00:00
Gregory John Casamento
8bc3ee3cf8 Corrected documentation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29160 72102866-910b-0410-8b05-ffd578937521
2009-12-22 22:29:41 +00:00
Fred Kiefer
34aba2af74 Cleaned up implementation of NSButtonCell title setting. This allowed to
remove special case from NSCell setString:.
Removed unneeded NSSliderCell methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29142 72102866-910b-0410-8b05-ffd578937521
2009-12-19 23:05:48 +00:00
Wolfgang Lux
8b97af9ed3 Phase out the wraps NSCell attribute, since it is implied by the
lineBreakMode attribute. Note that with this change cells now wrap by
default, as has always been the case on OS X.
Also fix a related inconsistency where text that is wrapped by the
cell was displayed in a single line during editing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29134 72102866-910b-0410-8b05-ffd578937521
2009-12-17 01:49:20 +00:00
Wolfgang Lux
786f376f1b Fix various issues when drawing controls with edited cells. This
includes a fix for the problem of properly resizing and redrawing the
editor when the cell is resized or moved during editing (bug #22678).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29133 72102866-910b-0410-8b05-ffd578937521
2009-12-17 01:03:07 +00:00
Wolfgang Lux
9ee683802f Avoid writing back an unchanged string to the cell's field editor.
Fix bug where an attributed string would not be considered a valid
object value of a cell.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29059 72102866-910b-0410-8b05-ffd578937521
2009-11-24 23:53:58 +00:00
Fred Kiefer
40a81ac812 Attempt to correct side effect of last NSActionCell change.
Small cleanup in NSCell.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29020 72102866-910b-0410-8b05-ffd578937521
2009-11-16 11:40:14 +00:00
Wolfgang Lux
036a78c32d Fix NSActionCell implementation so that -setObjectValue: and
-setStringValue: have an effect while the cell is edited.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29010 72102866-910b-0410-8b05-ffd578937521
2009-11-14 22:15:31 +00:00
Fred Kiefer
7c2e8efcd8 Replace nil with [NSDate distantFuture] in calls to nextEventMatchingMask:...dequeue:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28025 72102866-910b-0410-8b05-ffd578937521
2009-03-02 16:26:23 +00:00