From 9e46108d933191f5b853b51aac86267c9c7940f6 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Fri, 16 Jun 2000 17:36:19 +0000 Subject: [PATCH] Implemented double click git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6705 72102866-910b-0410-8b05-ffd578937521 --- Source/NSTableHeaderView.m | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Source/NSTableHeaderView.m b/Source/NSTableHeaderView.m index 4afe3501c..ade1151b9 100644 --- a/Source/NSTableHeaderView.m +++ b/Source/NSTableHeaderView.m @@ -34,6 +34,7 @@ #include #include #include +#include @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