comparison mac/dw.m @ 690:b93f5cdab37d

Fixes to the color picker... it actually shows the picker now but it still needs more work.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 08 Mar 2011 00:08:25 +0000
parents 4199730e9889
children 578bbfd8c904
comparison
equal deleted inserted replaced
689:4199730e9889 690:b93f5cdab37d
2418 [scrollbar setRange:0.0 andVisible:0.0]; 2418 [scrollbar setRange:0.0 andVisible:0.0];
2419 [scrollbar setKnobProportion:1.0]; 2419 [scrollbar setKnobProportion:1.0];
2420 [scrollbar setTag:cid]; 2420 [scrollbar setTag:cid];
2421 [scrollbar setEnabled:YES]; 2421 [scrollbar setEnabled:YES];
2422 return scrollbar; 2422 return scrollbar;
2423
2424 } 2423 }
2425 2424
2426 /* 2425 /*
2427 * Returns the position of the scrollbar. 2426 * Returns the position of the scrollbar.
2428 * Parameters: 2427 * Parameters:
3209 * Returns: 3208 * Returns:
3210 * The selected color or the current color if cancelled. 3209 * The selected color or the current color if cancelled.
3211 */ 3210 */
3212 unsigned long API dw_color_choose(unsigned long value) 3211 unsigned long API dw_color_choose(unsigned long value)
3213 { 3212 {
3214 /* Create the File Save Dialog class. */ 3213 /* Create the File Save Dialog class. */
3215 DWColorChoose *colorDlg = (DWColorChoose *)[DWColorChoose sharedColorPanel]; 3214 DWColorChoose *colorDlg = (DWColorChoose *)[DWColorChoose sharedColorPanel];
3216 NSColor *color = [NSColor colorWithDeviceRed: DW_RED_VALUE(_foreground)/255.0 green: DW_GREEN_VALUE(_foreground)/255.0 blue: DW_BLUE_VALUE(_foreground)/255.0 alpha: 1]; 3215 NSColor *color = [NSColor colorWithDeviceRed: DW_RED_VALUE(_foreground)/255.0 green: DW_GREEN_VALUE(_foreground)/255.0 blue: DW_BLUE_VALUE(_foreground)/255.0 alpha: 1];
3217 DWDialog *dialog = dw_dialog_new(colorDlg); 3216 DWDialog *dialog = dw_dialog_new(colorDlg);
3218 3217
3219 /* Set defaults for the dialog. */ 3218 /* Set defaults for the dialog. */
3220 [colorDlg setColor:color]; 3219 [colorDlg setColor:color];
3221 [colorDlg setDialog:dialog]; 3220 [colorDlg setDialog:dialog];
3222 3221 [colorDlg setContinuous:YES];
3223 color = (NSColor *)dw_dialog_wait(dialog); 3222 [colorDlg setTarget:colorDlg];
3224 [color release]; 3223 [colorDlg setAction:@selector(changeColor:)];
3225 return _foreground; 3224 [colorDlg makeKeyAndOrderFront:nil];
3225
3226 color = (NSColor *)dw_dialog_wait(dialog);
3227 [color release];
3228 return _foreground;
3226 } 3229 }
3227 3230
3228 /* Draw a point on a window (preferably a render window). 3231 /* Draw a point on a window (preferably a render window).
3229 * Parameters: 3232 * Parameters:
3230 * handle: Handle to the window. 3233 * handle: Handle to the window.