mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 14:10:53 +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
4769a17666
commit
9e46108d93
1 changed files with 26 additions and 1 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include <AppKit/NSTableHeaderView.h>
|
#include <AppKit/NSTableHeaderView.h>
|
||||||
#include <AppKit/NSTableColumn.h>
|
#include <AppKit/NSTableColumn.h>
|
||||||
#include <AppKit/NSTableView.h>
|
#include <AppKit/NSTableView.h>
|
||||||
|
#include <AppKit/NSEvent.h>
|
||||||
|
|
||||||
@implementation NSTableHeaderView
|
@implementation NSTableHeaderView
|
||||||
{
|
{
|
||||||
|
@ -170,7 +171,31 @@
|
||||||
}
|
}
|
||||||
-(void)mouseDown: (NSEvent*)event
|
-(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];
|
[super mouseDown: event];
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue