Commit graph

172 commits

Author SHA1 Message Date
fredkiefer
d14a7d4ae8 Remove confusing comments. 2020-01-01 13:28: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
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
Fred Kiefer
be98a77769 * Source/GSThemeDrawing.m (-drawTableViewRect:inView:): Use
correct imp type.
        * Source/NSButtonCell.m (-setBackgroundColor:): Update the
        control view.
        * Source/NSSegmentedCell.m (-drawSegment:inFrame:withView:):
        * Draw
        image if available.
        * Source/NSPopUpButtonCell.m (-initWithCoder:): Add work around
        for NSClassSwapper cell replacement.
        Patches based on changes by Josh Freeman
        <pikopixel@twilightedge.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39006 72102866-910b-0410-8b05-ffd578937521
2015-09-20 21:16:33 +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
Fred Kiefer
fd098d8eda * Source/NSButtonCell.m (-initWithCoder:):
Fix image scaling value extract from XIB.
        * Headers/Additions/GNUstepGUI/GSXibLoading.h
        * Source/GSXibLoading.m
        * Source/GSXibLoader.m
        Add IB defined runtime attribute processing for XIB
        Patch by Marcian Lytwyn <gna@advcsi.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38882 72102866-910b-0410-8b05-ffd578937521
2015-08-13 22:03:03 +00:00
Fred Kiefer
2a7e1fbf65 * ChangeLog: Correct version number in last commit.
* Source/NSButtonCell.m (-encodeWithCoder:): Correct bug with
        image position in NSButtonFlags.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38526 72102866-910b-0410-8b05-ffd578937521
2015-05-22 20:41:31 +00:00
Gregory John Casamento
ea086d02cf Change return of -drawTitle:withFrame:inView to NSRect instead of void.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38049 72102866-910b-0410-8b05-ffd578937521
2014-08-21 02:52:06 +00:00
Eric Wasylishen
74bd902874 * Source/NSButtonCell.m:
* Source/NSMenuItemCell.m: Make a shared -themeControlState in
NSButtonCell and eliminate duplicated code.
* Source/NSPopUpButtonCell.m: Add private declaration for
-[NSButtonCell themeControlState]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37236 72102866-910b-0410-8b05-ffd578937521
2013-10-15 18:41:17 +00:00
Eric Wasylishen
6f4a16835b * Headers/Additions/GNUstepGUI/GSTheme.h: Add three new theme
control state: GSThemeFirstResponderState,
GSThemeHighlightedFirstResponderState,
and GSThemeSelectedFirstResponderState. This lets themes draw
custom first responder tiles, if the desired effect can't be
accomplished by drawing on top of an existing button.
* Source/GSThemeDrawing.m (-drawFocusFrame:inRect:):
Use tiles named "NSFocusRing" if available, else draw dotted
rect.
* Source/GSTheme.m:
* Source/NSButtonCell.m: Use new GSTheme*FirstResponderState
states


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37227 72102866-910b-0410-8b05-ffd578937521
2013-10-14 17:18:38 +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
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
Gregory John Casamento
235cfca2db * Source/NSButtonCell.m: Correct issues when decoding a .gorm
file with key equivalent.  Make sure that the image is properly
	set.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35717 72102866-910b-0410-8b05-ffd578937521
2012-10-19 03:20:44 +00:00
Gregory John Casamento
f248bc9988 * Headers/Additions/GNUstepGUI/GSTheme.h: Add declaration
for method setKeyEquivalent:forButtonCell:
	* Source/GSThemeDrawing.m: Add implementation for method
	setKeyEquivalent:forButtonCell:
	* Source/NSButtonCell.m: Add call to new method.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35702 72102866-910b-0410-8b05-ffd578937521
2012-10-16 21:23:48 +00:00
Gregory John Casamento
9cd6adf8a6 2012-10-15 18:02-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSButtonCell.m



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35696 72102866-910b-0410-8b05-ffd578937521
2012-10-15 22:06:22 +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
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
Riccardo Mottola
115a372c27 minor compiler compatibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34183 72102866-910b-0410-8b05-ffd578937521
2011-11-16 23:33:48 +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
01c4a0be63 * Headers/Additions/GNUstepGUI/GSTheme.h: New GSThemeMargins struct.
Rename buttonBorderForCell:style:state: to buttonMarginsForCell:style:state:
and return the top/bottom/left/right margins instead of just two values.
(This is a theme API break.)
* Source/GSThemeDrawing.m: Implement buttonMarginsForCell:style:state:.
Also reduce the top and left margin of the default button by 1 pt, to
better reflect the button's appearance.
* Source/GSGuiPrivate.h: Add a GSRoundTowardsNegativeInfinity function
* Source/NSButtonCell.m (-drawImage:withFrame:inView:): Round the image
position down and to the right, as this seems to look the best.
* Source/NSButtonCell.m (-cellSize): Call new buttonMarginsForCell: method
* Source/NSButtonCell.m (-drawingRectForBounds:): Call new
buttonMarginsForCell: method


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33743 72102866-910b-0410-8b05-ffd578937521
2011-08-15 23:12:37 +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
Eric Wasylishen
22bfbcc946 * Source/GSGuiPrivate.h: New rounding rounding function
GSRoundTowardsInfinity which is simply floor(x+0.5)
* Source/NSBrowser.m:
* Source/NSSliderCell.m:
* Source/NSButtonCell.m:
* Source/NSClipView.m:
* Source/NSOutlineView.m:
* Source/NSRulerView.m:
Switch rint[f] to GSRoundTowardsInfinity


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33539 72102866-910b-0410-8b05-ffd578937521
2011-07-12 21:12:22 +00:00
Fred Kiefer
2443222fcb * Source/NSButtonCell.m (-setTitle:, -setAttributedTitle:,
-setAlternateImage:, -setImagePosition:): Update the control to
reflect the changes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33350 72102866-910b-0410-8b05-ffd578937521
2011-06-19 16:13:47 +00:00
Fred Kiefer
7606bc7007 Use rint instead of round.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33195 72102866-910b-0410-8b05-ffd578937521
2011-05-29 18:50:43 +00:00
Eric Wasylishen
ea05d7fa37 * Source/NSButtonCell.m (-drawImage:withFrame:inView:): Align
the point at which the image is drawn to the nearest pixel.

r32895 which reimplemented -[NSImage composite..] methods
on top of -[NSImage draw...] methods means that drawing
images with -compositeToPoint: no longer pixel-aligns
the image automatically. The new behaviour matches
Cocoa, however.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33002 72102866-910b-0410-8b05-ffd578937521
2011-05-07 21:37:14 +00:00
Fred Kiefer
d08b23d9b0 First batch of corrections based on David's static analysis.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31337 72102866-910b-0410-8b05-ffd578937521
2010-09-12 16:34:22 +00:00
Wolfgang Lux
a8e617e01f Correct serious nib loading bug on big endian machines.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30472 72102866-910b-0410-8b05-ffd578937521
2010-05-29 08:32:02 +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
63638ee055 Remove compiler warnings from clang.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30117 72102866-910b-0410-8b05-ffd578937521
2010-04-10 17:48:46 +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
0de3edcfe1 Remove includes of GSCategories.h, as this file no longer exists.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30000 72102866-910b-0410-8b05-ffd578937521
2010-03-19 08:18:43 +00:00
Wolfgang Lux
7c2b6e412b Fix NSButtonCell's -setImagePosition: to avoid resetting the button's
image or title. Neither of this is desirable as it prevents
temporarily hiding the image or title by changing the image
position. This makes the behavior of -setImagePosition: now fully
compatible with Mac OS X.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29704 72102866-910b-0410-8b05-ffd578937521
2010-02-22 20:50:08 +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
Eric Wasylishen
82d6f25159 Add GSThemeDisabledState
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29455 72102866-910b-0410-8b05-ffd578937521
2010-02-01 08:26:40 +00:00
Eric Wasylishen
b53c941c37 Treat NSButtonCell's with a bezel style as being non-opaque
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29434 72102866-910b-0410-8b05-ffd578937521
2010-01-29 02:14:25 +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
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
Richard Frith-MacDonald
452ffee567 Small theme update, plus documentation fixes and tweaks to avoid warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28538 72102866-910b-0410-8b05-ffd578937521
2009-08-25 07:46:37 +00:00
Gregory John Casamento
5d839b7f81 * Headers/Additions/GNUstepGUI/GSTheme.h: Add image parameter,
* Source/GSThemeDrawing.m: Add image parameter.   Correctly
	handle disabled buttons.
	* Source/NSButtonCell.m: Change to use new signature.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28523 72102866-910b-0410-8b05-ffd578937521
2009-08-23 18:24:34 +00:00
Gregory John Casamento
bc95107253 * Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration
for drawButtonCell:...
	* Source/GSThemeDrawing.m: Added implementation for new method.  The
	purpose of the method is to allow the theme to override images with
	native images which may be theme dependent.
	* Source/NSButtonCell.m: Use the new method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28522 72102866-910b-0410-8b05-ffd578937521
2009-08-23 18:07:39 +00:00
Fred Kiefer
ee49afcb9b Changed all title methods on NSButtonCell to use the
super string value methods and redefine the local string value
methods to work with the object value. 
Patch by Matt Rice <ratmice@gmail.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27946 72102866-910b-0410-8b05-ffd578937521
2009-02-21 23:15:22 +00:00
Fred Kiefer
5ea2410eb2 Replace the key equivalent when it was set wrongly by Gorm.
Patch by Wolfgang Lux  <wolfgang.lux@gmail.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27579 72102866-910b-0410-8b05-ffd578937521
2009-01-12 14:02:05 +00:00
Richard Frith-MacDonald
62492a9158 Some moves towards making scrollers more themable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27518 72102866-910b-0410-8b05-ffd578937521
2009-01-05 09:43:25 +00:00
Richard Frith-MacDonald
664c7cadd2 Some code for scroller theming
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27498 72102866-910b-0410-8b05-ffd578937521
2009-01-02 12:40:07 +00:00
Fred Kiefer
734a6c759d Make the button redraw after setting the image.
Don't do anything when the same contents view gets set on the window
again.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27308 72102866-910b-0410-8b05-ffd578937521
2008-12-16 19:28:25 +00:00
Gregory John Casamento
7e2e7607b5 * Source/GSNibLoading.m
* Source/NSButtonCell.m
	* Source/NSNibAXAttributeConnector.m
	* Source/NSNibAXRelationshipConnector.m
	* Source/NSNibBindingConnector.m
	* Source/NSNib.m
	* Source/NSProgressIndicator.m: Change to use new headers.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27189 72102866-910b-0410-8b05-ffd578937521
2008-12-02 07:27:14 +00:00
Fred Kiefer
f114baad28 Moved _sizeForBorderType() into GSTheme header and added more methods
for theme abstraction.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26836 72102866-910b-0410-8b05-ffd578937521
2008-09-08 18:59:48 +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
b4d065a9bf Better NIB loading for NSWindow.
Ignore missing image in NSButtonCell drawing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26591 72102866-910b-0410-8b05-ffd578937521
2008-06-02 10:35:42 +00:00
Fred Kiefer
155098ecd8 Add image position decoding and encoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26542 72102866-910b-0410-8b05-ffd578937521
2008-05-19 17:42:23 +00:00