mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 17:10:37 +00:00
Correct Window linking problem and add support for dynamically changing
colour slides. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25710 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b3029c6bb0
commit
8ae77cbbb3
9 changed files with 406 additions and 277 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2007-12-10 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* ColorPickers/GSColorSliderCell.h,
|
||||||
|
* ColorPickers/GSColorSliderCell.m: New files split off from
|
||||||
|
GSStandardColorPicker.h and GSStandardColorPicker.m.
|
||||||
|
* ColorPickers/GNUmakefile: Add the new files.
|
||||||
|
* ColorPickers/GSStandardColorPicker.h,
|
||||||
|
* ColorPickers/GSStandardColorPicker.m: Remove split off code.
|
||||||
|
* ColorPickers/GSRGBColorPicker.m,
|
||||||
|
* ColorPickers/GSHSBColorPicker.m,
|
||||||
|
* ColorPickers/GSColorSliderCell.m: Add support for dynamically
|
||||||
|
displayed colour changes.
|
||||||
|
|
||||||
2007-12-09 Fred Kiefer <FredKiefer@gmx.de>
|
2007-12-09 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Documentation/gclose.1,
|
* Documentation/gclose.1,
|
||||||
|
|
|
@ -44,9 +44,10 @@ StandardPicker_OBJC_FILES = GSStandardColorPicker.m \
|
||||||
GSRGBColorPicker.m \
|
GSRGBColorPicker.m \
|
||||||
GSCMYKColorPicker.m \
|
GSCMYKColorPicker.m \
|
||||||
GSHSBColorPicker.m \
|
GSHSBColorPicker.m \
|
||||||
GSGrayColorPicker.m
|
GSGrayColorPicker.m \
|
||||||
|
GSColorSliderCell.m
|
||||||
NamedPicker_OBJC_FILES = GSNamedColorPicker.m
|
NamedPicker_OBJC_FILES = GSNamedColorPicker.m
|
||||||
WheelPicker_OBJC_FILES = GSWheelColorPicker.m
|
WheelPicker_OBJC_FILES = GSWheelColorPicker.m GSColorSliderCell.m
|
||||||
|
|
||||||
# The class to load
|
# The class to load
|
||||||
StandardPicker_PRINCIPAL_CLASS = GSStandardColorPicker
|
StandardPicker_PRINCIPAL_CLASS = GSStandardColorPicker
|
||||||
|
|
|
@ -31,16 +31,16 @@
|
||||||
@implementation GSCMYKColorPicker
|
@implementation GSCMYKColorPicker
|
||||||
|
|
||||||
- (id)initWithPickerMask:(int)aMask
|
- (id)initWithPickerMask:(int)aMask
|
||||||
colorPanel:(NSColorPanel *)colorPanel
|
colorPanel:(NSColorPanel *)colorPanel
|
||||||
{
|
{
|
||||||
if (aMask & NSColorPanelCMYKModeMask)
|
if (aMask & NSColorPanelCMYKModeMask)
|
||||||
{
|
{
|
||||||
NSBundle *b;
|
NSBundle *b;
|
||||||
|
|
||||||
self = [super initWithPickerMask: aMask
|
self = [super initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (!self)
|
if (!self)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
numFields = 4;
|
numFields = 4;
|
||||||
currentMode = NSColorPanelCMYKModeMask;
|
currentMode = NSColorPanelCMYKModeMask;
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
c = [color colorUsingColorSpaceName: NSDeviceCMYKColorSpace];
|
c = [color colorUsingColorSpaceName: NSDeviceCMYKColorSpace];
|
||||||
[c getCyan: &cyan magenta: &magenta yellow: &yellow
|
[c getCyan: &cyan magenta: &magenta yellow: &yellow
|
||||||
black: &black alpha: &alpha];
|
black: &black alpha: &alpha];
|
||||||
|
|
||||||
values[0] = cyan * 100;
|
values[0] = cyan * 100;
|
||||||
values[1] = magenta * 100;
|
values[1] = magenta * 100;
|
||||||
|
@ -81,6 +81,20 @@
|
||||||
values[3] = black * 100;
|
values[3] = black * 100;
|
||||||
[self _valuesChanged];
|
[self _valuesChanged];
|
||||||
|
|
||||||
|
// FIXME: No way to store black in slider cell
|
||||||
|
[(GSColorSliderCell *)[sliders[0] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[(GSColorSliderCell *)[sliders[1] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[(GSColorSliderCell *)[sliders[2] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[(GSColorSliderCell *)[sliders[3] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[sliders[0] setNeedsDisplay: YES];
|
||||||
|
[sliders[1] setNeedsDisplay: YES];
|
||||||
|
[sliders[2] setNeedsDisplay: YES];
|
||||||
|
[sliders[3] setNeedsDisplay: YES];
|
||||||
|
|
||||||
updating = NO;
|
updating = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,11 +106,25 @@
|
||||||
float black = values[3] / 100;
|
float black = values[3] / 100;
|
||||||
float alpha = [_colorPanel alpha];
|
float alpha = [_colorPanel alpha];
|
||||||
NSColor *c = [NSColor colorWithDeviceCyan: cyan
|
NSColor *c = [NSColor colorWithDeviceCyan: cyan
|
||||||
magenta: magenta
|
magenta: magenta
|
||||||
yellow: yellow
|
yellow: yellow
|
||||||
black: black
|
black: black
|
||||||
alpha: alpha];
|
alpha: alpha];
|
||||||
[_colorPanel setColor: c];
|
[_colorPanel setColor: c];
|
||||||
|
|
||||||
|
// FIXME: No way to store black in slider cell
|
||||||
|
[(GSColorSliderCell *)[sliders[0] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[(GSColorSliderCell *)[sliders[1] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[(GSColorSliderCell *)[sliders[2] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[(GSColorSliderCell *)[sliders[3] cell]
|
||||||
|
_setColorSliderCellValues: cyan : magenta : yellow];
|
||||||
|
[sliders[0] setNeedsDisplay: YES];
|
||||||
|
[sliders[1] setNeedsDisplay: YES];
|
||||||
|
[sliders[2] setNeedsDisplay: YES];
|
||||||
|
[sliders[3] setNeedsDisplay: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
43
ColorPickers/GSColorSliderCell.h
Normal file
43
ColorPickers/GSColorSliderCell.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/* GSColorSliderCell.h
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
Date: December 2007
|
||||||
|
Author: Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
Date: May 2002
|
||||||
|
|
||||||
|
This file is part of GNUstep.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; see the file COPYING.LIB.
|
||||||
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||||
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GSColorSliderCell_h
|
||||||
|
#define GSColorSliderCell_h
|
||||||
|
|
||||||
|
#include <AppKit/NSSliderCell.h>
|
||||||
|
|
||||||
|
@interface GSColorSliderCell : NSSliderCell
|
||||||
|
{
|
||||||
|
int mode;
|
||||||
|
float values[3];
|
||||||
|
}
|
||||||
|
-(void) _setColorSliderCellMode: (int)m;
|
||||||
|
-(void) _setColorSliderCellValues: (float)a : (float)b : (float)c;
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif
|
194
ColorPickers/GSColorSliderCell.m
Normal file
194
ColorPickers/GSColorSliderCell.m
Normal file
|
@ -0,0 +1,194 @@
|
||||||
|
/* GSStandardColorPicker.m
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
Date: December 2007
|
||||||
|
Author: Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
Date: May 2002
|
||||||
|
|
||||||
|
This file is part of GNUstep.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; see the file COPYING.LIB.
|
||||||
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||||
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Foundation/Foundation.h>
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
#include "GSColorSliderCell.h"
|
||||||
|
|
||||||
|
#define KNOB_WIDTH 6
|
||||||
|
|
||||||
|
@implementation GSColorSliderCell : NSSliderCell
|
||||||
|
|
||||||
|
-(void) _setColorSliderCellMode: (int)m
|
||||||
|
{
|
||||||
|
mode = m;
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 10:
|
||||||
|
[_titleCell setTextColor: [NSColor whiteColor]];
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
[_titleCell setTextColor: [NSColor blackColor]];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
[_titleCell setAlignment: NSLeftTextAlignment];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void) _setColorSliderCellValues: (float)a : (float)b : (float)c
|
||||||
|
{
|
||||||
|
values[0] = a;
|
||||||
|
values[1] = b;
|
||||||
|
values[2] = c;
|
||||||
|
if (mode == 8 || mode == 9)
|
||||||
|
{
|
||||||
|
if (c > 0.7)
|
||||||
|
[_titleCell setTextColor: [NSColor blackColor]];
|
||||||
|
else
|
||||||
|
[_titleCell setTextColor: [NSColor whiteColor]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSRect) knobRectFlipped: (BOOL)flipped
|
||||||
|
{
|
||||||
|
NSPoint origin;
|
||||||
|
float floatValue = [self floatValue];
|
||||||
|
|
||||||
|
if (_isVertical && flipped)
|
||||||
|
{
|
||||||
|
floatValue = _maxValue + _minValue - floatValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
floatValue = (floatValue - _minValue) / (_maxValue - _minValue);
|
||||||
|
|
||||||
|
origin = _trackRect.origin;
|
||||||
|
if (_isVertical == YES)
|
||||||
|
{
|
||||||
|
origin.y += (_trackRect.size.height - KNOB_WIDTH) * floatValue;
|
||||||
|
return NSMakeRect (origin.x, origin.y, _trackRect.size.width, KNOB_WIDTH);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
origin.x += (_trackRect.size.width - KNOB_WIDTH) * floatValue;
|
||||||
|
return NSMakeRect (origin.x, origin.y, KNOB_WIDTH, _trackRect.size.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) drawKnob: (NSRect)knobRect
|
||||||
|
{
|
||||||
|
[[NSColor blackColor] set];
|
||||||
|
NSDrawButton(knobRect, knobRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void) drawBarInside: (NSRect)r flipped: (BOOL)flipped
|
||||||
|
{
|
||||||
|
float i, f;
|
||||||
|
|
||||||
|
if (_isVertical)
|
||||||
|
{
|
||||||
|
for (i = 0; i < r.size.height; i += 1)
|
||||||
|
{
|
||||||
|
f = (0.5 + i) / r.size.height;
|
||||||
|
if (flipped)
|
||||||
|
{
|
||||||
|
f = 1 - f;
|
||||||
|
}
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case 0: PSsetgray(f); break;
|
||||||
|
|
||||||
|
case 1: PSsetrgbcolor(f, values[1], values[2]); break;
|
||||||
|
case 2: PSsetrgbcolor(values[0], f, values[2]); break;
|
||||||
|
case 3: PSsetrgbcolor(values[0], values[1], f); break;
|
||||||
|
|
||||||
|
case 4: PSsetcmykcolor(f, values[1], values[2], 0); break;
|
||||||
|
case 5: PSsetcmykcolor(values[0], f, values[2], 0); break;
|
||||||
|
case 6: PSsetcmykcolor(values[0], values[1], f, 0); break;
|
||||||
|
case 7: PSsetcmykcolor(values[0], values[1], values[2], f); break;
|
||||||
|
|
||||||
|
case 8: PSsethsbcolor(f, values[1], values[2]); break;
|
||||||
|
case 9: PSsethsbcolor(values[0], f, values[2]); break;
|
||||||
|
case 10: PSsethsbcolor(values[0], values[1], f); break;
|
||||||
|
}
|
||||||
|
if (i + 1 < r.size.height)
|
||||||
|
PSrectfill(r.origin.x, i + r.origin.y, r.size.width, 1);
|
||||||
|
else
|
||||||
|
PSrectfill(r.origin.x, i + r.origin.y, r.size.width, r.size.height - i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < r.size.width; i += 1)
|
||||||
|
{
|
||||||
|
f = (0.5 + i) / r.size.width;
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case 0: PSsetgray(f); break;
|
||||||
|
|
||||||
|
case 1: PSsetrgbcolor(f, values[1], values[2]); break;
|
||||||
|
case 2: PSsetrgbcolor(values[0], f, values[2]); break;
|
||||||
|
case 3: PSsetrgbcolor(values[0], values[1], f); break;
|
||||||
|
|
||||||
|
case 4: PSsetcmykcolor(f, values[1], values[2], 0); break;
|
||||||
|
case 5: PSsetcmykcolor(values[0], f, values[2], 0); break;
|
||||||
|
case 6: PSsetcmykcolor(values[0], values[1], f, 0); break;
|
||||||
|
case 7: PSsetcmykcolor(values[0], values[1], values[2], f); break;
|
||||||
|
|
||||||
|
case 8: PSsethsbcolor(f, values[1], values[2]); break;
|
||||||
|
case 9: PSsethsbcolor(values[0], f, values[2]); break;
|
||||||
|
case 10: PSsethsbcolor(values[0], values[1], f); break;
|
||||||
|
}
|
||||||
|
if (i + 1 < r.size.width)
|
||||||
|
PSrectfill(i, r.origin.y, 1, r.size.height);
|
||||||
|
else
|
||||||
|
PSrectfill(i, r.origin.y, r.size.width - i, r.size.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
[_titleCell drawInteriorWithFrame: r inView: _control_view];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
|
||||||
|
{
|
||||||
|
_isVertical = (cellFrame.size.height > cellFrame.size.width);
|
||||||
|
cellFrame = [self drawingRectForBounds: cellFrame];
|
||||||
|
|
||||||
|
cellFrame.origin.x -= 1;
|
||||||
|
cellFrame.origin.y -= 1;
|
||||||
|
cellFrame.size.width += 2;
|
||||||
|
cellFrame.size.height += 2;
|
||||||
|
|
||||||
|
_trackRect = cellFrame;
|
||||||
|
|
||||||
|
[self drawBarInside: cellFrame flipped: [controlView isFlipped]];
|
||||||
|
|
||||||
|
[self drawKnob];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (float) knobThickness
|
||||||
|
{
|
||||||
|
return KNOB_WIDTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -31,16 +31,16 @@
|
||||||
@implementation GSHSBColorPicker
|
@implementation GSHSBColorPicker
|
||||||
|
|
||||||
- (id)initWithPickerMask:(int)aMask
|
- (id)initWithPickerMask:(int)aMask
|
||||||
colorPanel:(NSColorPanel *)colorPanel
|
colorPanel:(NSColorPanel *)colorPanel
|
||||||
{
|
{
|
||||||
if (aMask & NSColorPanelHSBModeMask)
|
if (aMask & NSColorPanelHSBModeMask)
|
||||||
{
|
{
|
||||||
NSBundle *b;
|
NSBundle *b;
|
||||||
|
|
||||||
self = [super initWithPickerMask: aMask
|
self = [super initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (!self)
|
if (!self)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
numFields = 3;
|
numFields = 3;
|
||||||
currentMode = NSColorPanelHSBModeMask;
|
currentMode = NSColorPanelHSBModeMask;
|
||||||
|
@ -97,9 +97,9 @@
|
||||||
float brightness = values[2] / 100;
|
float brightness = values[2] / 100;
|
||||||
float alpha = [_colorPanel alpha];
|
float alpha = [_colorPanel alpha];
|
||||||
NSColor *c = [NSColor colorWithCalibratedHue: hue
|
NSColor *c = [NSColor colorWithCalibratedHue: hue
|
||||||
saturation: saturation
|
saturation: saturation
|
||||||
brightness: brightness
|
brightness: brightness
|
||||||
alpha: alpha];
|
alpha: alpha];
|
||||||
[_colorPanel setColor: c];
|
[_colorPanel setColor: c];
|
||||||
|
|
||||||
[(GSColorSliderCell *)[sliders[0] cell]
|
[(GSColorSliderCell *)[sliders[0] cell]
|
||||||
|
|
|
@ -31,15 +31,15 @@
|
||||||
@implementation GSRGBColorPicker
|
@implementation GSRGBColorPicker
|
||||||
|
|
||||||
- (id)initWithPickerMask:(int)aMask
|
- (id)initWithPickerMask:(int)aMask
|
||||||
colorPanel:(NSColorPanel *)colorPanel
|
colorPanel:(NSColorPanel *)colorPanel
|
||||||
{
|
{
|
||||||
if (aMask & NSColorPanelRGBModeMask)
|
if (aMask & NSColorPanelRGBModeMask)
|
||||||
{
|
{
|
||||||
NSBundle *b;
|
NSBundle *b;
|
||||||
self = [super initWithPickerMask: aMask
|
self = [super initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (!self)
|
if (!self)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
b = [NSBundle bundleForClass: [self class]];
|
b = [NSBundle bundleForClass: [self class]];
|
||||||
|
|
||||||
|
@ -78,6 +78,16 @@
|
||||||
values[2] = blue * 255;
|
values[2] = blue * 255;
|
||||||
[self _valuesChanged];
|
[self _valuesChanged];
|
||||||
|
|
||||||
|
[(GSColorSliderCell *)[sliders[0] cell]
|
||||||
|
_setColorSliderCellValues: red : green : blue];
|
||||||
|
[(GSColorSliderCell *)[sliders[1] cell]
|
||||||
|
_setColorSliderCellValues: red : green : blue];
|
||||||
|
[(GSColorSliderCell *)[sliders[2] cell]
|
||||||
|
_setColorSliderCellValues: red : green : blue];
|
||||||
|
[sliders[0] setNeedsDisplay: YES];
|
||||||
|
[sliders[1] setNeedsDisplay: YES];
|
||||||
|
[sliders[2] setNeedsDisplay: YES];
|
||||||
|
|
||||||
updating = NO;
|
updating = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,10 +98,20 @@
|
||||||
float blue = values[2] / 255;
|
float blue = values[2] / 255;
|
||||||
float alpha = [_colorPanel alpha];
|
float alpha = [_colorPanel alpha];
|
||||||
NSColor *c = [NSColor colorWithCalibratedRed: red
|
NSColor *c = [NSColor colorWithCalibratedRed: red
|
||||||
green: green
|
green: green
|
||||||
blue: blue
|
blue: blue
|
||||||
alpha: alpha];
|
alpha: alpha];
|
||||||
[_colorPanel setColor: c];
|
[_colorPanel setColor: c];
|
||||||
|
|
||||||
|
[(GSColorSliderCell *)[sliders[0] cell]
|
||||||
|
_setColorSliderCellValues: red : green : blue];
|
||||||
|
[(GSColorSliderCell *)[sliders[1] cell]
|
||||||
|
_setColorSliderCellValues: red : green : blue];
|
||||||
|
[(GSColorSliderCell *)[sliders[2] cell]
|
||||||
|
_setColorSliderCellValues: red : green : blue];
|
||||||
|
[sliders[0] setNeedsDisplay: YES];
|
||||||
|
[sliders[1] setNeedsDisplay: YES];
|
||||||
|
[sliders[2] setNeedsDisplay: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,26 @@
|
||||||
#ifndef GSStandardColorPicker_h
|
#ifndef GSStandardColorPicker_h
|
||||||
#define GSStandardColorPicker_h
|
#define GSStandardColorPicker_h
|
||||||
|
|
||||||
@class GSTable,NSSlider,NSTextField;
|
#include <AppKit/NSColorPicker.h>
|
||||||
|
#include "GSColorSliderCell.h"
|
||||||
|
|
||||||
|
@class GSTable, NSSlider, NSTextField;
|
||||||
|
@class NSBox, NSButtonCell, NSMatrix;
|
||||||
|
|
||||||
|
@interface GSStandardColorPicker: NSColorPicker <NSColorPickingCustom>
|
||||||
|
{
|
||||||
|
GSTable *baseView;
|
||||||
|
NSBox *pickerBox;
|
||||||
|
NSButtonCell *imageCell;
|
||||||
|
NSMatrix *pickerMatrix;
|
||||||
|
NSMutableArray *pickers;
|
||||||
|
id<NSColorPickingCustom, NSColorPickingDefault> currentPicker;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) loadViews;
|
||||||
|
- (void) _showNewPicker: (id) sender;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@interface GSStandardCSColorPicker: NSColorPicker <NSColorPickingCustom>
|
@interface GSStandardCSColorPicker: NSColorPicker <NSColorPickingCustom>
|
||||||
{
|
{
|
||||||
|
@ -59,14 +78,5 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSColorSliderCell : NSSliderCell
|
|
||||||
{
|
|
||||||
int mode;
|
|
||||||
float values[3];
|
|
||||||
}
|
|
||||||
-(void) _setColorSliderCellMode: (int)m;
|
|
||||||
-(void) _setColorSliderCellValues: (float)a : (float)b : (float)c;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -36,21 +36,6 @@
|
||||||
#include "GSGrayColorPicker.h"
|
#include "GSGrayColorPicker.h"
|
||||||
#include "GSStandardColorPicker.h"
|
#include "GSStandardColorPicker.h"
|
||||||
|
|
||||||
@interface GSStandardColorPicker: NSColorPicker <NSColorPickingCustom>
|
|
||||||
{
|
|
||||||
GSTable *baseView;
|
|
||||||
NSBox *pickerBox;
|
|
||||||
NSButtonCell *imageCell;
|
|
||||||
NSMatrix *pickerMatrix;
|
|
||||||
NSMutableArray *pickers;
|
|
||||||
id<NSColorPickingCustom, NSColorPickingDefault> currentPicker;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) loadViews;
|
|
||||||
- (void) _showNewPicker: (id) sender;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation GSStandardColorPicker
|
@implementation GSStandardColorPicker
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
@ -63,46 +48,46 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithPickerMask:(int)aMask
|
- (id)initWithPickerMask:(int)aMask
|
||||||
colorPanel:(NSColorPanel *)colorPanel
|
colorPanel:(NSColorPanel *)colorPanel
|
||||||
{
|
{
|
||||||
if (aMask & (NSColorPanelRGBModeMask | NSColorPanelHSBModeMask |
|
if (aMask & (NSColorPanelRGBModeMask | NSColorPanelHSBModeMask |
|
||||||
NSColorPanelCMYKModeMask | NSColorPanelGrayModeMask))
|
NSColorPanelCMYKModeMask | NSColorPanelGrayModeMask))
|
||||||
{
|
{
|
||||||
NSColorPicker *picker;
|
NSColorPicker *picker;
|
||||||
|
|
||||||
pickers = [[NSMutableArray alloc] init];
|
pickers = [[NSMutableArray alloc] init];
|
||||||
picker = [[GSGrayColorPicker alloc] initWithPickerMask: aMask
|
picker = [[GSGrayColorPicker alloc] initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (picker != nil)
|
if (picker != nil)
|
||||||
{
|
{
|
||||||
[pickers addObject: picker];
|
[pickers addObject: picker];
|
||||||
RELEASE(picker);
|
RELEASE(picker);
|
||||||
}
|
}
|
||||||
picker = [[GSRGBColorPicker alloc] initWithPickerMask: aMask
|
picker = [[GSRGBColorPicker alloc] initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (picker != nil)
|
if (picker != nil)
|
||||||
{
|
{
|
||||||
[pickers addObject: picker];
|
[pickers addObject: picker];
|
||||||
RELEASE(picker);
|
RELEASE(picker);
|
||||||
}
|
}
|
||||||
picker = [[GSCMYKColorPicker alloc] initWithPickerMask: aMask
|
picker = [[GSCMYKColorPicker alloc] initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (picker != nil)
|
if (picker != nil)
|
||||||
{
|
{
|
||||||
[pickers addObject: picker];
|
[pickers addObject: picker];
|
||||||
RELEASE(picker);
|
RELEASE(picker);
|
||||||
}
|
}
|
||||||
picker = [[GSHSBColorPicker alloc] initWithPickerMask: aMask
|
picker = [[GSHSBColorPicker alloc] initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
if (picker != nil)
|
if (picker != nil)
|
||||||
{
|
{
|
||||||
[pickers addObject: picker];
|
[pickers addObject: picker];
|
||||||
RELEASE(picker);
|
RELEASE(picker);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentPicker = [pickers lastObject];
|
currentPicker = [pickers lastObject];
|
||||||
return [super initWithPickerMask: aMask
|
return [super initWithPickerMask: aMask
|
||||||
colorPanel: colorPanel];
|
colorPanel: colorPanel];
|
||||||
}
|
}
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -125,29 +110,29 @@
|
||||||
{
|
{
|
||||||
if ([[pickers objectAtIndex: i] supportsMode: mode])
|
if ([[pickers objectAtIndex: i] supportsMode: mode])
|
||||||
{
|
{
|
||||||
[pickerMatrix selectCellWithTag: i];
|
[pickerMatrix selectCellWithTag: i];
|
||||||
[self _showNewPicker: pickerMatrix];
|
[self _showNewPicker: pickerMatrix];
|
||||||
[currentPicker setMode: mode];
|
[currentPicker setMode: mode];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)supportsMode:(int)mode
|
- (BOOL)supportsMode:(int)mode
|
||||||
{
|
{
|
||||||
return ((mode == NSGrayModeColorPanel) ||
|
return ((mode == NSGrayModeColorPanel) ||
|
||||||
(mode == NSRGBModeColorPanel) ||
|
(mode == NSRGBModeColorPanel) ||
|
||||||
(mode == NSCMYKModeColorPanel) ||
|
(mode == NSCMYKModeColorPanel) ||
|
||||||
(mode == NSHSBModeColorPanel));
|
(mode == NSHSBModeColorPanel));
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)insertNewButtonImage:(NSImage *)newImage
|
- (void)insertNewButtonImage:(NSImage *)newImage
|
||||||
in:(NSButtonCell *)newButtonCell
|
in:(NSButtonCell *)newButtonCell
|
||||||
{
|
{
|
||||||
// Store the image button cell
|
// Store the image button cell
|
||||||
imageCell = newButtonCell;
|
imageCell = newButtonCell;
|
||||||
[super insertNewButtonImage: newImage
|
[super insertNewButtonImage: newImage
|
||||||
in: newButtonCell];
|
in: newButtonCell];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSView *)provideNewView:(BOOL)initialRequest
|
- (NSView *)provideNewView:(BOOL)initialRequest
|
||||||
|
@ -194,10 +179,10 @@
|
||||||
[cell setBordered: YES];
|
[cell setBordered: YES];
|
||||||
|
|
||||||
pickerMatrix = [[NSMatrix alloc] initWithFrame: NSMakeRect(0,0,0,0)
|
pickerMatrix = [[NSMatrix alloc] initWithFrame: NSMakeRect(0,0,0,0)
|
||||||
mode: NSRadioModeMatrix
|
mode: NSRadioModeMatrix
|
||||||
prototype: cell
|
prototype: cell
|
||||||
numberOfRows: 0
|
numberOfRows: 0
|
||||||
numberOfColumns: 0];
|
numberOfColumns: 0];
|
||||||
RELEASE(cell);
|
RELEASE(cell);
|
||||||
[pickerMatrix setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
|
[pickerMatrix setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
[pickerMatrix setIntercellSpacing: NSMakeSize(1, 0)];
|
[pickerMatrix setIntercellSpacing: NSMakeSize(1, 0)];
|
||||||
|
@ -223,17 +208,17 @@
|
||||||
pickerBox = [[NSBox alloc] init];
|
pickerBox = [[NSBox alloc] init];
|
||||||
[pickerBox setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
[pickerBox setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||||
[baseView putView: pickerBox
|
[baseView putView: pickerBox
|
||||||
atRow: 0
|
atRow: 0
|
||||||
column: 0
|
column: 0
|
||||||
withMargins: 0];
|
withMargins: 0];
|
||||||
[pickerBox setTitlePosition: NSNoTitle];
|
[pickerBox setTitlePosition: NSNoTitle];
|
||||||
[pickerBox setBorderType: NSNoBorder];
|
[pickerBox setBorderType: NSNoBorder];
|
||||||
[pickerBox setContentView: [currentPicker provideNewView: NO]];
|
[pickerBox setContentView: [currentPicker provideNewView: NO]];
|
||||||
|
|
||||||
[baseView putView: pickerMatrix
|
[baseView putView: pickerMatrix
|
||||||
atRow: 1
|
atRow: 1
|
||||||
column: 0
|
column: 0
|
||||||
withMargins: 0];
|
withMargins: 0];
|
||||||
|
|
||||||
{
|
{
|
||||||
NSBox *b = [[NSBox alloc] initWithFrame: NSMakeRect(0,0,0,2)];
|
NSBox *b = [[NSBox alloc] initWithFrame: NSMakeRect(0,0,0,2)];
|
||||||
|
@ -241,12 +226,12 @@
|
||||||
[b setTitlePosition: NSNoTitle];
|
[b setTitlePosition: NSNoTitle];
|
||||||
[b setBorderType: NSGrooveBorder];
|
[b setBorderType: NSGrooveBorder];
|
||||||
[baseView putView: b
|
[baseView putView: b
|
||||||
atRow: 2
|
atRow: 2
|
||||||
column: 0
|
column: 0
|
||||||
withMinXMargin: 0
|
withMinXMargin: 0
|
||||||
maxXMargin: 0
|
maxXMargin: 0
|
||||||
minYMargin: 4
|
minYMargin: 4
|
||||||
maxYMargin: 0];
|
maxYMargin: 0];
|
||||||
DESTROY(b);
|
DESTROY(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,9 +245,9 @@
|
||||||
[currentPicker setColor: [_colorPanel color]];
|
[currentPicker setColor: [_colorPanel color]];
|
||||||
//NSLog(@"Base View size %@", NSStringFromRect([baseView frame]));
|
//NSLog(@"Base View size %@", NSStringFromRect([baseView frame]));
|
||||||
/* [baseView putView: [currentPicker provideNewView: NO]
|
/* [baseView putView: [currentPicker provideNewView: NO]
|
||||||
atRow: 0
|
atRow: 0
|
||||||
column: 0
|
column: 0
|
||||||
withMargins: 0];*/
|
withMargins: 0];*/
|
||||||
[pickerBox setContentView: [currentPicker provideNewView: NO]];
|
[pickerBox setContentView: [currentPicker provideNewView: NO]];
|
||||||
currentView = [currentPicker provideNewView: NO];
|
currentView = [currentPicker provideNewView: NO];
|
||||||
|
|
||||||
|
@ -275,170 +260,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define KNOB_WIDTH 6
|
|
||||||
|
|
||||||
@implementation GSColorSliderCell : NSSliderCell
|
|
||||||
|
|
||||||
-(void) _setColorSliderCellMode: (int)m
|
|
||||||
{
|
|
||||||
mode = m;
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
case 3:
|
|
||||||
case 10:
|
|
||||||
[_titleCell setTextColor: [NSColor whiteColor]];
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
case 5:
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
[_titleCell setTextColor: [NSColor blackColor]];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
[_titleCell setAlignment: NSLeftTextAlignment];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void) _setColorSliderCellValues: (float)a : (float)b : (float)c
|
|
||||||
{
|
|
||||||
values[0] = a;
|
|
||||||
values[1] = b;
|
|
||||||
values[2] = c;
|
|
||||||
if (mode == 8 || mode == 9)
|
|
||||||
{
|
|
||||||
if (c>0.7)
|
|
||||||
[_titleCell setTextColor: [NSColor blackColor]];
|
|
||||||
else
|
|
||||||
[_titleCell setTextColor: [NSColor whiteColor]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSRect) knobRectFlipped: (BOOL)flipped
|
|
||||||
{
|
|
||||||
NSPoint origin;
|
|
||||||
float floatValue = [self floatValue];
|
|
||||||
|
|
||||||
if (_isVertical && flipped)
|
|
||||||
{
|
|
||||||
floatValue = _maxValue + _minValue - floatValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
floatValue = (floatValue - _minValue) / (_maxValue - _minValue);
|
|
||||||
|
|
||||||
origin = _trackRect.origin;
|
|
||||||
if (_isVertical == YES)
|
|
||||||
{
|
|
||||||
origin.y += (_trackRect.size.height - KNOB_WIDTH) * floatValue;
|
|
||||||
return NSMakeRect (origin.x, origin.y, _trackRect.size.width, KNOB_WIDTH);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
origin.x += (_trackRect.size.width - KNOB_WIDTH) * floatValue;
|
|
||||||
return NSMakeRect (origin.x, origin.y, KNOB_WIDTH, _trackRect.size.height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) drawKnob: (NSRect)knobRect
|
|
||||||
{
|
|
||||||
[[NSColor blackColor] set];
|
|
||||||
NSDrawButton(knobRect, knobRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void) drawBarInside: (NSRect)r flipped: (BOOL)flipped
|
|
||||||
{
|
|
||||||
float i, f;
|
|
||||||
|
|
||||||
if (_isVertical)
|
|
||||||
{
|
|
||||||
for (i = 0; i < r.size.height; i += 1)
|
|
||||||
{
|
|
||||||
f = (0.5 + i) / r.size.height;
|
|
||||||
if (flipped)
|
|
||||||
{
|
|
||||||
f = 1 - f;
|
|
||||||
}
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case 0: PSsetgray(f); break;
|
|
||||||
|
|
||||||
case 1: PSsetrgbcolor(f, 0, 0); break;
|
|
||||||
case 2: PSsetrgbcolor(0, f, 0); break;
|
|
||||||
case 3: PSsetrgbcolor(0, 0, f); break;
|
|
||||||
|
|
||||||
case 4: PSsetcmykcolor(f, 0, 0, 0); break;
|
|
||||||
case 5: PSsetcmykcolor(0, f, 0, 0); break;
|
|
||||||
case 6: PSsetcmykcolor(0, 0, f, 0); break;
|
|
||||||
case 7: PSsetcmykcolor(0, 0, 0, f); break;
|
|
||||||
|
|
||||||
case 8: PSsethsbcolor(f, values[1], values[2]); break;
|
|
||||||
case 9: PSsethsbcolor(values[0], f, values[2]); break;
|
|
||||||
case 10: PSsethsbcolor(values[0], values[1], f); break;
|
|
||||||
}
|
|
||||||
if (i + 1 < r.size.height)
|
|
||||||
PSrectfill(r.origin.x, i + r.origin.y, r.size.width, 1);
|
|
||||||
else
|
|
||||||
PSrectfill(r.origin.x, i + r.origin.y, r.size.width, r.size.height - i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (i = 0; i < r.size.width; i += 1)
|
|
||||||
{
|
|
||||||
f = (0.5 + i) / r.size.width;
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case 0: PSsetgray(f); break;
|
|
||||||
|
|
||||||
case 1: PSsetrgbcolor(f, 0, 0); break;
|
|
||||||
case 2: PSsetrgbcolor(0, f, 0); break;
|
|
||||||
case 3: PSsetrgbcolor(0, 0, f); break;
|
|
||||||
|
|
||||||
case 4: PSsetcmykcolor(f, 0, 0, 0); break;
|
|
||||||
case 5: PSsetcmykcolor(0, f, 0, 0); break;
|
|
||||||
case 6: PSsetcmykcolor(0, 0, f, 0); break;
|
|
||||||
case 7: PSsetcmykcolor(0, 0, 0, f); break;
|
|
||||||
|
|
||||||
case 8: PSsethsbcolor(f, values[1], values[2]); break;
|
|
||||||
case 9: PSsethsbcolor(values[0], f, values[2]); break;
|
|
||||||
case 10: PSsethsbcolor(values[0], values[1], f); break;
|
|
||||||
}
|
|
||||||
if (i + 1 < r.size.width)
|
|
||||||
PSrectfill(i, r.origin.y, 1, r.size.height);
|
|
||||||
else
|
|
||||||
PSrectfill(i, r.origin.y, r.size.width - i, r.size.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
[_titleCell drawInteriorWithFrame: r inView: _control_view];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
|
|
||||||
{
|
|
||||||
_isVertical = (cellFrame.size.height > cellFrame.size.width);
|
|
||||||
cellFrame = [self drawingRectForBounds: cellFrame];
|
|
||||||
|
|
||||||
cellFrame.origin.x -= 1;
|
|
||||||
cellFrame.origin.y -= 1;
|
|
||||||
cellFrame.size.width += 2;
|
|
||||||
cellFrame.size.height += 2;
|
|
||||||
|
|
||||||
_trackRect = cellFrame;
|
|
||||||
|
|
||||||
[self drawBarInside: cellFrame flipped: [controlView isFlipped]];
|
|
||||||
|
|
||||||
[self drawKnob];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (float) knobThickness
|
|
||||||
{
|
|
||||||
return KNOB_WIDTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
@implementation GSStandardCSColorPicker
|
@implementation GSStandardCSColorPicker
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
@ -505,12 +326,12 @@
|
||||||
[s setAutoresizingMask: NSViewWidthSizable];
|
[s setAutoresizingMask: NSViewWidthSizable];
|
||||||
|
|
||||||
[baseView putView: s
|
[baseView putView: s
|
||||||
atRow: numFields - i
|
atRow: numFields - i
|
||||||
column: 0
|
column: 0
|
||||||
withMinXMargin: 0
|
withMinXMargin: 0
|
||||||
maxXMargin: 0
|
maxXMargin: 0
|
||||||
minYMargin: 0
|
minYMargin: 0
|
||||||
maxYMargin: i?6:2];
|
maxYMargin: i?6:2];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxValue)
|
if (maxValue)
|
||||||
|
@ -548,9 +369,9 @@
|
||||||
|
|
||||||
[hb setAutoresizingMask: NSViewWidthSizable];
|
[hb setAutoresizingMask: NSViewWidthSizable];
|
||||||
[baseView putView: hb
|
[baseView putView: hb
|
||||||
atRow: numFields + 1
|
atRow: numFields + 1
|
||||||
column: 0
|
column: 0
|
||||||
withMargins: 0];
|
withMargins: 0];
|
||||||
DESTROY(hb);
|
DESTROY(hb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -573,9 +394,9 @@
|
||||||
DESTROY(tv);
|
DESTROY(tv);
|
||||||
v = [[NSView alloc] initWithFrame: frame];
|
v = [[NSView alloc] initWithFrame: frame];
|
||||||
[baseView putView: v
|
[baseView putView: v
|
||||||
atRow: numFields + 1
|
atRow: numFields + 1
|
||||||
column: 0
|
column: 0
|
||||||
withMargins: 0];
|
withMargins: 0];
|
||||||
DESTROY(v);
|
DESTROY(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,12 +410,12 @@
|
||||||
[f setFrameSize: NSMakeSize([f frame].size.width * 1.5, [f frame].size.height)];
|
[f setFrameSize: NSMakeSize([f frame].size.width * 1.5, [f frame].size.height)];
|
||||||
[f setDelegate: self];
|
[f setDelegate: self];
|
||||||
[baseView putView: f
|
[baseView putView: f
|
||||||
atRow: numFields - i
|
atRow: numFields - i
|
||||||
column: 1
|
column: 1
|
||||||
withMinXMargin: 3
|
withMinXMargin: 3
|
||||||
maxXMargin: 0
|
maxXMargin: 0
|
||||||
minYMargin: 0
|
minYMargin: 0
|
||||||
maxYMargin: 0];
|
maxYMargin: 0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,7 +427,7 @@
|
||||||
return;
|
return;
|
||||||
updating = YES;
|
updating = YES;
|
||||||
|
|
||||||
for (i = 0; i <numFields; i++)
|
for (i = 0; i < numFields; i++)
|
||||||
{
|
{
|
||||||
values[i] = [sliders[i] floatValue];
|
values[i] = [sliders[i] floatValue];
|
||||||
[fields[i] setIntValue: (int)values[i]];
|
[fields[i] setIntValue: (int)values[i]];
|
||||||
|
@ -625,7 +446,7 @@
|
||||||
return;
|
return;
|
||||||
updating = YES;
|
updating = YES;
|
||||||
|
|
||||||
for (i = 0; i <numFields; i++)
|
for (i = 0; i < numFields; i++)
|
||||||
{
|
{
|
||||||
values[i] = [fields[i] floatValue];
|
values[i] = [fields[i] floatValue];
|
||||||
[sliders[i] setIntValue: (int)values[i]];
|
[sliders[i] setIntValue: (int)values[i]];
|
||||||
|
@ -640,7 +461,7 @@
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i <numFields; i++)
|
for (i = 0; i < numFields; i++)
|
||||||
{
|
{
|
||||||
[fields[i] setIntValue: (int)values[i]];
|
[fields[i] setIntValue: (int)values[i]];
|
||||||
[sliders[i] setIntValue: (int)values[i]];
|
[sliders[i] setIntValue: (int)values[i]];
|
||||||
|
@ -653,4 +474,3 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue