comparison mac/dw.m @ 702:e9a3d1da3d3e

dw_menu_popup() now uses the coordinates specified instead of the event coorindates.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 11 Mar 2011 05:56:17 +0000
parents c91a1b345f2e
children 329736825f9b
comparison
equal deleted inserted replaced
701:c91a1b345f2e 702:e9a3d1da3d3e
4955 * x: X coordinate. 4955 * x: X coordinate.
4956 * y: Y coordinate. 4956 * y: Y coordinate.
4957 */ 4957 */
4958 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) 4958 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y)
4959 { 4959 {
4960 NSMenu *thismenu = (NSMenu *)*menu; 4960 NSMenu *thismenu = (NSMenu *)*menu;
4961 NSView *view = parent; 4961 NSView *view = parent;
4962 NSWindow *window = [view window];
4962 NSEvent *event = [DWApp currentEvent]; 4963 NSEvent *event = [DWApp currentEvent];
4963 [NSMenu popUpContextMenu:thismenu withEvent:event forView:view]; 4964 NSEvent* fake = [NSEvent mouseEventWithType:NSRightMouseDown
4965 location:[window convertScreenToBase:NSMakePoint(x, y)]
4966 modifierFlags:0
4967 timestamp:[event timestamp]
4968 windowNumber:[window windowNumber]
4969 context:[NSGraphicsContext currentContext]
4970 eventNumber:1
4971 clickCount:1
4972 pressure:0.0];
4973 [NSMenu popUpContextMenu:thismenu withEvent:fake forView:view];
4964 } 4974 }
4965 4975
4966 char _removetilde(char *dest, char *src) 4976 char _removetilde(char *dest, char *src)
4967 { 4977 {
4968 int z, cur=0; 4978 int z, cur=0;