Implement buttonNumber

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12950 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-03-02 09:38:17 +00:00
parent c1ffddcdc8
commit 8f96915e63
3 changed files with 8 additions and 5 deletions

View file

@ -2,7 +2,7 @@
* Headers/AppKit/NSEvent.h: Rename 'middle' mouse to 'other' as * Headers/AppKit/NSEvent.h: Rename 'middle' mouse to 'other' as
MacOS-X has caught up with the functionality but not adopted our MacOS-X has caught up with the functionality but not adopted our
names. names. Add -buttonNumber
* Headers/AppKit/NSResponder.h: ditto * Headers/AppKit/NSResponder.h: ditto
* Source/Functions.m: ditto * Source/Functions.m: ditto
* Source/GSComboSupport.m: ditto * Source/GSComboSupport.m: ditto

View file

@ -114,7 +114,8 @@ enum {
struct struct
{ {
int event_num; int event_num;
int click; short click;
short button;
float pressure; float pressure;
} mouse; } mouse;
struct struct

View file

@ -444,7 +444,7 @@ static Class eventClass;
/* /*
* Getting Mouse Event Information * Getting Mouse Event Information
*/ */
+ (NSPoint)mouseLocation + (NSPoint) mouseLocation
{ {
float x, y; float x, y;
@ -454,8 +454,10 @@ static Class eventClass;
- (int) buttonNumber - (int) buttonNumber
{ {
/* FIXME */ if (event_type < NSLeftMouseDown || event_type > NSMouseExited)
return 0; [NSException raise: NSInvalidArgumentException
format: @"buttonNumber requested for non-mouse event"];
return event_data.mouse.button;
} }
- (int) clickCount - (int) clickCount