comparison mac/dw.m @ 855:0103a8751ab4

Removed an unnecessary method in the container (rowCount) and implemented container column alignment.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 31 Mar 2011 19:13:24 +0000
parents d44bb4c4902d
children 9dc45928a75f
comparison
equal deleted inserted replaced
854:d44bb4c4902d 855:0103a8751ab4
1074 -(id)getRow:(int)row and:(int)col; 1074 -(id)getRow:(int)row and:(int)col;
1075 -(int)cellType:(int)col; 1075 -(int)cellType:(int)col;
1076 -(int)lastAddPoint; 1076 -(int)lastAddPoint;
1077 -(int)lastQueryPoint; 1077 -(int)lastQueryPoint;
1078 -(void)setLastQueryPoint:(int)input; 1078 -(void)setLastQueryPoint:(int)input;
1079 -(int)rowCount;
1080 -(void)clear; 1079 -(void)clear;
1081 -(void)setup; 1080 -(void)setup;
1082 -(void)setForegroundColor:(NSColor *)input; 1081 -(void)setForegroundColor:(NSColor *)input;
1083 -(void)doubleClicked:(id)sender; 1082 -(void)doubleClicked:(id)sender;
1084 -(void)keyUp:(NSEvent *)theEvent; 1083 -(void)keyUp:(NSEvent *)theEvent;
1216 -(id)getRow:(int)row and:(int)col { if(data) { int index = (int)(row * [tvcols count]) + col; return [data objectAtIndex:index]; } return nil; } 1215 -(id)getRow:(int)row and:(int)col { if(data) { int index = (int)(row * [tvcols count]) + col; return [data objectAtIndex:index]; } return nil; }
1217 -(int)cellType:(int)col { return [[types objectAtIndex:col] intValue]; } 1216 -(int)cellType:(int)col { return [[types objectAtIndex:col] intValue]; }
1218 -(int)lastAddPoint { return lastAddPoint; } 1217 -(int)lastAddPoint { return lastAddPoint; }
1219 -(int)lastQueryPoint { return lastQueryPoint; } 1218 -(int)lastQueryPoint { return lastQueryPoint; }
1220 -(void)setLastQueryPoint:(int)input { lastQueryPoint = input; } 1219 -(void)setLastQueryPoint:(int)input { lastQueryPoint = input; }
1221 -(int)rowCount { return (int)[titles count]; }
1222 -(void)clear { if(data) { [data removeAllObjects]; while([titles count]) { [titles removePointerAtIndex:0]; } } lastAddPoint = 0; } 1220 -(void)clear { if(data) { [data removeAllObjects]; while([titles count]) { [titles removePointerAtIndex:0]; } } lastAddPoint = 0; }
1223 -(void)setup 1221 -(void)setup
1224 { 1222 {
1225 tvcols = [[[NSMutableArray alloc] init] retain]; 1223 tvcols = [[[NSMutableArray alloc] init] retain];
1226 data = [[[NSMutableArray alloc] init] retain]; 1224 data = [[[NSMutableArray alloc] init] retain];
4711 [column setResizingMask:NSTableColumnNoResizing]; 4709 [column setResizingMask:NSTableColumnNoResizing];
4712 [column setWidth:20]; 4710 [column setWidth:20];
4713 } 4711 }
4714 [imagecell release]; 4712 [imagecell release];
4715 } 4713 }
4714 else if(flags[z] & DW_CFA_RIGHT)
4715 {
4716 [(NSCell *)[column dataCell] setAlignment:NSRightTextAlignment];
4717 }
4718 else if(flags[z] & DW_CFA_CENTER)
4719 {
4720 [(NSCell *)[column dataCell] setAlignment:NSCenterTextAlignment];
4721 }
4716 [column setEditable:NO]; 4722 [column setEditable:NO];
4717 [cont addTableColumn:column]; 4723 [cont addTableColumn:column];
4718 [cont addColumn:column andType:(int)flags[z]]; 4724 [cont addColumn:column andType:(int)flags[z]];
4719 [column release]; 4725 [column release];
4720 } 4726 }
5086 void API dw_container_scroll(HWND handle, int direction, long rows) 5092 void API dw_container_scroll(HWND handle, int direction, long rows)
5087 { 5093 {
5088 DWContainer *cont = handle; 5094 DWContainer *cont = handle;
5089 NSScrollView *sv = [cont scrollview]; 5095 NSScrollView *sv = [cont scrollview];
5090 NSScroller *scrollbar = [sv verticalScroller]; 5096 NSScroller *scrollbar = [sv verticalScroller];
5091 int rowcount = [cont rowCount]; 5097 int rowcount = (int)[cont numberOfRowsInTableView:cont];
5092 float currpos = [scrollbar floatValue]; 5098 float currpos = [scrollbar floatValue];
5093 float change; 5099 float change;
5094 5100
5095 /* Safety check */ 5101 /* Safety check */
5096 if(rowcount < 1) 5102 if(rowcount < 1)