mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:17:40 +00:00
Add method to get rects of clicked items.
This commit is contained in:
parent
96b094be5c
commit
925b6f8e1b
2 changed files with 29 additions and 9 deletions
|
@ -41,12 +41,14 @@
|
|||
withFrame:(NSRect)frame
|
||||
inView:(NSView *)view
|
||||
{
|
||||
NSLog(@"Entered...");
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event
|
||||
withFrame:(NSRect)frame
|
||||
inView:(NSView *)view
|
||||
{
|
||||
NSLog(@"Exited...");
|
||||
}
|
||||
|
||||
- (void) setAllowedTypes: (NSArray *)types
|
||||
|
@ -123,14 +125,25 @@
|
|||
withFrame:(NSRect)frame
|
||||
inView:(NSView *)view
|
||||
{
|
||||
return NSZeroRect;
|
||||
NSUInteger index = [_pathComponentCells indexOfObject: cell];
|
||||
NSRect rect = frame;
|
||||
CGFloat cellwidth = rect.size.width / [_pathComponentCells count];
|
||||
NSRect result = NSMakeRect(rect.origin.x,
|
||||
rect.origin.y + (cellwidth * index),
|
||||
cellwidth,
|
||||
rect.size.height);
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSPathComponentCell *)pathComponentCellAtPoint:(NSPoint)point
|
||||
withFrame:(NSRect)frame
|
||||
inView:(NSView *)view
|
||||
{
|
||||
return nil;
|
||||
NSUInteger c = [_pathComponentCells count];
|
||||
NSUInteger woc = frame.size.width / c;
|
||||
NSUInteger item = (NSUInteger)point.x / woc;
|
||||
|
||||
return [_pathComponentCells objectAtIndex: item];
|
||||
}
|
||||
|
||||
- (NSPathComponentCell *) clickedPathComponentCell
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue