comparison mac/dw.m @ 689:4199730e9889

Fixed errors creating scrollbars.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 07 Mar 2011 23:15:55 +0000
parents b52f1d4a60dd
children b93f5cdab37d
comparison
equal deleted inserted replaced
688:b52f1d4a60dd 689:4199730e9889
33 0x00eeee00, /* 11 bright yellow */ 33 0x00eeee00, /* 11 bright yellow */
34 0x000000ff, /* 12 bright blue */ 34 0x000000ff, /* 12 bright blue */
35 0x00ff00ff, /* 13 bright magenta */ 35 0x00ff00ff, /* 13 bright magenta */
36 0x0000eeee, /* 14 bright cyan */ 36 0x0000eeee, /* 14 bright cyan */
37 0x00ffffff, /* 15 bright white */ 37 0x00ffffff, /* 15 bright white */
38 0xff000000 /* 16 default color */ 38 0xff000000 /* 16 default color */
39 }; 39 };
40 40
41 unsigned long _get_color(unsigned long thiscolor) 41 unsigned long _get_color(unsigned long thiscolor)
42 { 42 {
43 if(thiscolor & DW_RGB_COLOR) 43 if(thiscolor & DW_RGB_COLOR)
2401 * increments: Number of increments available. 2401 * increments: Number of increments available.
2402 * id: An ID to be used with dw_window_from_id() or 0L. 2402 * id: An ID to be used with dw_window_from_id() or 0L.
2403 */ 2403 */
2404 HWND API dw_scrollbar_new(int vertical, ULONG cid) 2404 HWND API dw_scrollbar_new(int vertical, ULONG cid)
2405 { 2405 {
2406 DWScrollbar *scrollbar = [[DWScrollbar alloc] init]; 2406 DWScrollbar *scrollbar = [DWScrollbar alloc];
2407 [scrollbar setArrowsPosition: NSScrollerArrowsDefaultSetting]; 2407 if(vertical)
2408 [scrollbar setTarget:scrollbar]; 2408 {
2409 [scrollbar setAction:@selector(changed:)]; 2409 [scrollbar init];
2410 [scrollbar setRange:0.0 andVisible:0.0]; 2410 }
2411 [scrollbar setKnobProportion:1.0]; 2411 else
2412 {
2413 [scrollbar initWithFrame:NSMakeRect(0,0,100,5)];
2414 }
2415 [scrollbar setArrowsPosition:NSScrollerArrowsDefaultSetting];
2416 [scrollbar setTarget:scrollbar];
2417 [scrollbar setAction:@selector(changed:)];
2418 [scrollbar setRange:0.0 andVisible:0.0];
2419 [scrollbar setKnobProportion:1.0];
2412 [scrollbar setTag:cid]; 2420 [scrollbar setTag:cid];
2413 return scrollbar; 2421 [scrollbar setEnabled:YES];
2422 return scrollbar;
2423
2414 } 2424 }
2415 2425
2416 /* 2426 /*
2417 * Returns the position of the scrollbar. 2427 * Returns the position of the scrollbar.
2418 * Parameters: 2428 * Parameters: