Browse CVS Repository
Annotation of /undmail/guiproto/IconedCell.m
Parent Directory
| Revision Log
| Revision Graph
Revision 1.1.1.1 -
( hide annotations)
( download)
(vendor branch)
Mon Nov 11 15:40:37 2002 UTC
(21 years, 5 months ago)
by footashida
Branch: MAIN, ventor
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
| 1 |
footashida |
1.1 |
|
| 2 |
|
|
#import "IconedCell.h" |
| 3 |
|
|
|
| 4 |
|
|
|
| 5 |
|
|
@implementation IconedCell |
| 6 |
|
|
- (void)drawInteriorWithFrame:(NSRect)cellFrame |
| 7 |
|
|
inView:(NSView*)controlView |
| 8 |
|
|
{ |
| 9 |
|
|
NSString* path; |
| 10 |
|
|
NSRect pathRect; |
| 11 |
|
|
|
| 12 |
|
|
NSImage* iconImage; |
| 13 |
|
|
NSSize iconSize; |
| 14 |
|
|
NSPoint iconPoint; |
| 15 |
|
|
|
| 16 |
|
|
// Draw Image |
| 17 |
|
|
iconImage = [self image]; |
| 18 |
|
|
iconSize = NSZeroSize; |
| 19 |
|
|
iconPoint.x = cellFrame.origin.x; |
| 20 |
|
|
iconPoint.y = cellFrame.origin.y; |
| 21 |
|
|
|
| 22 |
|
|
if(iconImage) { |
| 23 |
|
|
iconSize.width = 26; |
| 24 |
|
|
iconSize.height = 20; |
| 25 |
|
|
iconPoint.x += 3; |
| 26 |
|
|
|
| 27 |
|
|
if([controlView isFlipped]) { |
| 28 |
|
|
iconPoint.y += iconSize.height; |
| 29 |
|
|
} |
| 30 |
|
|
|
| 31 |
|
|
[iconImage setSize:iconSize]; |
| 32 |
|
|
[iconImage compositeToPoint:iconPoint |
| 33 |
|
|
operation:NSCompositeSourceOver]; |
| 34 |
|
|
} |
| 35 |
|
|
|
| 36 |
|
|
// Draw text |
| 37 |
|
|
path = [self stringValue]; |
| 38 |
|
|
pathRect.origin.x = cellFrame.origin.x + 3; |
| 39 |
|
|
if(iconSize.width > 0) { |
| 40 |
|
|
pathRect.origin.x += iconSize.width + 3; |
| 41 |
|
|
} |
| 42 |
|
|
pathRect.origin.y = cellFrame.origin.y; |
| 43 |
|
|
pathRect.size.width = cellFrame.size.width |
| 44 |
|
|
- (pathRect.origin.x - cellFrame.origin.x); |
| 45 |
|
|
pathRect.size.height = cellFrame.size.height; |
| 46 |
|
|
|
| 47 |
|
|
if(path) { |
| 48 |
|
|
[path drawInRect:pathRect withAttributes:nil]; |
| 49 |
|
|
} |
| 50 |
|
|
} |
| 51 |
|
|
|
| 52 |
|
|
@end |
|