mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 18:01:08 +00:00
Implemented double click
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6705 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d76cf6b79b
commit
dba970e103
1 changed files with 26 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <AppKit/NSTableHeaderView.h>
|
||||
#include <AppKit/NSTableColumn.h>
|
||||
#include <AppKit/NSTableView.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
|
||||
@implementation NSTableHeaderView
|
||||
{
|
||||
|
@ -170,7 +171,31 @@
|
|||
}
|
||||
-(void)mouseDown: (NSEvent*)event
|
||||
{
|
||||
// TODO
|
||||
NSPoint location = [event locationInWindow];
|
||||
int clickCount;
|
||||
int columnIndex;
|
||||
|
||||
clickCount = [event clickCount];
|
||||
|
||||
if (clickCount > 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
location = [self convertPoint: location fromView: nil];
|
||||
columnIndex = [self columnAtPoint: location];
|
||||
if (columnIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (clickCount == 2)
|
||||
{
|
||||
[_tableView _sendDoubleActionForColumn: columnIndex];
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO - simple click events
|
||||
[super mouseDown: event];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue