Commit graph

70 commits

Author SHA1 Message Date
williameveretteggplant
3b02ac1d9d
implement integerValue method in NSSliderCell (#296)
the superclass method integerValue: method in NSCell uses the _object_value to retrieve the result, but the implementation of setObjectValue: in NSSliderCell sets _value. So integerValue: needs to return _value.
2024-10-03 09:14:45 +02:00
fredkiefer
5294a34911 Add macros for encoding/decoding. 2021-01-10 22:40:29 +01:00
fredkiefer
35698d41b6 Change encoding/decoding to protect against differences in integer size. 2021-01-08 17:18:36 +01:00
fredkiefer
5756e5f396 * Source/NSSliderCell.m: Fix encoding/decoding as the types don't match.
* Source/NSApplication.m (-targetForAction:to:from:): Warn only in
debug mode about the target not responding to the action.
2019-07-28 20:12:26 +02:00
fredkiefer
760cfa6d62 * Headers/AppKit/NSSliderCell.h,
* Source/NSSliderCell.m: Rewrite this class to store and access
the value directly. This brings the behaviour closer to Apple's
horrible implementation.
2018-03-11 19:09:08 +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
Eric Wasylishen
9dfd31dc6e * Source/NSSliderCell.m (-drawKnob:): Don't fill the knob
with a background color before drawing the cell. Seems pointless
- GNUstep's default knob image is opaque, but filling with a solid
color prevents transparent knob images from looking good.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37224 72102866-910b-0410-8b05-ffd578937521
2013-10-14 04:16:30 +00:00
Eric Wasylishen
5cd9dd8b7e * Source/NSSliderCell.m: Support themeing the circular slider
with the image @"common_CircularSlider". Draw the dimple
with @"common_Dimple" instead of an NSBezierPath.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37186 72102866-910b-0410-8b05-ffd578937521
2013-10-03 06:55:45 +00:00
Eric Wasylishen
2347347cf9 * Headers/Additions/GNUstepGUI/GSTheme.h:
* Source/GSTheme.m:
Declare GSSliderHorizontalTrack and GSSliderVerticalTrack
part names for themeing the background of NSSlider
* Source/GSThemeDrawing.m:
Add new drawSliderBorderAndBackground:frame:inCell:isHorizontal:
method to draw the slider border and background.
* Source/GSThemePrivate.h:
* Source/GSThemeTools.m:
Add a -size method on GSDrawTiles which returns the total
original size of the tiles, so we can easily compute a rect
that scales the tiles in only one dimension.
* Source/NSSliderCell.m:
Override _drawBorderAndBackgroundWithFrame: to call new
GSTheme method. Also, tweak the knob drawing code; the knob
is now centered and drawn at its native size. This still looks
correct with the default slider sizes create by Gorm.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37185 72102866-910b-0410-8b05-ffd578937521
2013-10-03 04:51:10 +00:00
Fred Kiefer
0c95f32580 More CGFloat, NSUInteger and NSInteger changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36163 72102866-910b-0410-8b05-ffd578937521
2013-02-17 22:44:47 +00:00
Fred Kiefer
d4f80c2258 Change NSEvent to CGFloat, NSUInteger and NSInteger.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36121 72102866-910b-0410-8b05-ffd578937521
2013-02-13 08:40:36 +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
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
Riccardo Mottola
b7f57fe859 Circular sliders never return the maximum value, tested on Apple
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33432 72102866-910b-0410-8b05-ffd578937521
2011-07-02 22:01:23 +00:00
Riccardo Mottola
d4955c013e tix tick marks in circular sliders
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33429 72102866-910b-0410-8b05-ffd578937521
2011-07-02 19:04:11 +00:00
Gregory John Casamento
5751234b4b Adding methods to draw knob and bar to theme.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31666 72102866-910b-0410-8b05-ffd578937521
2010-11-26 22:48:46 +00:00
Wolfgang Lux
3b077dae8a Fix tick mark related calculations of NSSliderCell to correctly take
into account that the first and last tick marks conincide with the
minimum and maximum values of the slider.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30804 72102866-910b-0410-8b05-ffd578937521
2010-06-21 19:42:08 +00:00
Adam Fedor
4cea0b531e * configure, configure.ac, Headers/Additions/GNUstepGUI/config.h.in,
Source/NSSliderCell.m: Check for atan2f function (not present on
old Solaris systems for instance).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30254 72102866-910b-0410-8b05-ffd578937521
2010-04-28 18:14:43 +00:00
Eric Wasylishen
b81434b7d0 NSSliderCell: implement circular sliders
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29985 72102866-910b-0410-8b05-ffd578937521
2010-03-17 00:18:30 +00:00
Eric Wasylishen
4d192f2eee * Source/NSSliderCell.m: Some more changes to NSSliderCell to get
BezierPathLab working, and a test suite in
 tests/testsuite/gui/NSSliderCell. Set the doubleValue to 0 in -init,
 unarchive the @"NSValue" key and set the floatValue to it when
 unarchiving, adjust setObjectValue: so that when minValue > maxValue,
 the slider cell takes its value to be minValue.
 Also override setContinuous: and isContinuous to use
 NSLeftMouseDraggedMask rather than NSPeriodicMask, which makes
 the continuous setting of sliders in Nibs work properly in GNUstep.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29148 72102866-910b-0410-8b05-ffd578937521
2009-12-20 22:21:40 +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
David Chisnall
141c543e67 * Source/NSSliderCell.m:
Rework the handling of maxValue and minValue. The cell's value is now
clamped to the permisible range when it is set, rather than in
floatValue, matching OS X behaviour. setMinValue: and setMaxValue:
also clamp the current value.
Also make NSSliderCell continuous by default when unarchived (matches
OS X).

Patch by Eric Wasylishen!
(Please someone give him commit access)



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29139 72102866-910b-0410-8b05-ffd578937521
2009-12-19 00:05:52 +00:00
Fred Kiefer
73f0d0ca88 Clean up for NSSlider and NSSliderCell
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29022 72102866-910b-0410-8b05-ffd578937521
2009-11-16 12:26:38 +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
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
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
Matt Rice
4475b975b8 * Source/NSTableView.m (-noteNumberOfRowsChanged:): Post selection
is and did change notifications if changing the selected rows.
        * Source/NSSliderCell.m (-copyWithZone:): Make a little clearer.
        * Source/NSMatrix.m (-_rebuildLayoutAfterResize): Don't change the
        intercell spacing if not autosizing cells.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24080 72102866-910b-0410-8b05-ffd578937521
2006-11-13 05:23:24 +00:00
Matt Rice
586f972d12 * Source/NSSliderCell.m: Implement copyWithZone:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24075 72102866-910b-0410-8b05-ffd578937521
2006-11-11 18:11:21 +00:00
Matt Rice
49923f47c7 * Source/NSSlider.m (-keyDown:): Implement, Fixes bug #14000.
* Source/NSSliderCell.m (-trackMouse:...): Fix allows tick marks
        only mouse tracking.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24031 72102866-910b-0410-8b05-ffd578937521
2006-11-05 19:22:00 +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
Fred Kiefer
ccc72cc74f Moved tracking code from controll to cell class to allow the use in a
matrix.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23255 72102866-910b-0410-8b05-ffd578937521
2006-08-11 14:08:32 +00:00
Gregory John Casamento
b4ed61fce1 2006-06-20 20:58 Gregory John Casamento <greg_casamento@yahoo.com>
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added
	declarations for classes and names methods and change return
	type for objects method.
	* Source/GSNibCompatibility.m: Properly return the pointer in
	objects method and also add methods for names, and classes
	maps in the nib file.
	* Source/NSDocument.m: Refuse to write a file for a type which isn't
	native.  If the class method isNativeType: returns YES, then write the
	file in writeToFile:ofType:saveOperation:.
	* Source/NSSliderCell.m: Make the cell non-bordered in initWithCoder:



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23095 72102866-910b-0410-8b05-ffd578937521
2006-06-21 01:02:25 +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
Nicolas Roard
dd5173a47a Replaced the slider's images with alpha-channel ones. Modified NSSliderCell to draw the background behind
the button using [NSColor controlBackgroundColor]. (images from Ingolf Jandt)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22685 72102866-910b-0410-8b05-ffd578937521
2006-03-19 18:59:38 +00:00
Fred Kiefer
ef9e46d09d Protect against knob image being nil.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22251 72102866-910b-0410-8b05-ffd578937521
2006-01-04 12:41:05 +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
3b55bfe195 Improved documentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22032 72102866-910b-0410-8b05-ffd578937521
2005-11-18 09:14:44 +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
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
d49f634d96 Basic implementation of the tick mark methods. Added en-/decoding
for tick marks. [setKnobThickness:], [setNumberOfTickMarks:] and
[setTickMarkPosition:] now update the control.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16543 72102866-910b-0410-8b05-ffd578937521
2003-04-25 22:55:18 +00:00
Nicola Pero
ba494c7cd9 Lock focus / unlock focus optimizations and fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15839 72102866-910b-0410-8b05-ffd578937521
2003-02-01 05:10:00 +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
4796b2e906 Added methods to handle ticks with a dummy implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11291 72102866-910b-0410-8b05-ffd578937521
2001-11-02 13:06:20 +00:00
Nicola Pero
37d07659ee Fixed displaying a title in the slider
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7356 72102866-910b-0410-8b05-ffd578937521
2000-09-03 19:27:02 +00:00
Richard Frith-MacDonald
13ef454d9c Fixed dumb error.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6464 72102866-910b-0410-8b05-ffd578937521
2000-04-14 03:43:35 +00:00
Richard Frith-MacDonald
ba2e62d6de Window level corrections and tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6459 72102866-910b-0410-8b05-ffd578937521
2000-04-13 07:55:19 +00:00
Jonathan Gapen
937e09c22d corrected version of previous change
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6457 72102866-910b-0410-8b05-ffd578937521
2000-04-12 21:44:07 +00:00
Jonathan Gapen
338507c3c2 Account for border/bezel and draw title cell properly
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6454 72102866-910b-0410-8b05-ffd578937521
2000-04-12 17:20:21 +00:00
Nicola Pero
279ef7c545 Fixed typo
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5766 72102866-910b-0410-8b05-ffd578937521
2000-01-13 23:17:05 +00:00