comparison ios/dw.m @ 2467:4d1f370bf65e

iOS: Pass in the coordinates and row data on container context event.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 14 Apr 2021 22:40:46 +0000
parents 4fba0b9453ee
children 206a0643add6
comparison
equal deleted inserted replaced
2466:cfb14192753c 2467:4d1f370bf65e
469 } 469 }
470 /* Container context menu event */ 470 /* Container context menu event */
471 case 10: 471 case 10:
472 { 472 {
473 int (* API containercontextfunc)(HWND, char *, int, int, void *, void *) = (int (* API)(HWND, char *, int, int, void *, void *))handler->signalfunction; 473 int (* API containercontextfunc)(HWND, char *, int, int, void *, void *) = (int (* API)(HWND, char *, int, int, void *, void *))handler->signalfunction;
474 char *text = (char *)event; 474 void **params = (void **)event;
475 void *user = NULL; 475 char *text = (char *)params[0];
476 LONG x,y; 476 void *user = params[1];
477 477 int x = DW_POINTER_TO_INT(params[2]);
478 dw_pointer_query_pos(&x, &y); 478 int y = DW_POINTER_TO_INT(params[3]);
479 479
480 return containercontextfunc(handler->window, text, (int)x, (int)y, handler->data, user); 480 return containercontextfunc(handler->window, text, x, y, handler->data, user);
481 } 481 }
482 /* Generic selection changed event for several classes */ 482 /* Generic selection changed event for several classes */
483 case 11: 483 case 11:
484 case 14: 484 case 14:
485 { 485 {
2100 } 2100 }
2101 -(UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point 2101 -(UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point
2102 { 2102 {
2103 DWWindow *window = (DWWindow *)[self window]; 2103 DWWindow *window = (DWWindow *)[self window];
2104 UIContextMenuConfiguration *config = nil; 2104 UIContextMenuConfiguration *config = nil;
2105 2105 void *params[4];
2106 _dw_event_handler(self, (UIEvent *)[self getRowTitle:(int)indexPath.row], 10); 2106
2107 params[0] = [self getRowTitle:(int)indexPath.row];
2108 params[1] = [self getRowData:(int)indexPath.row];
2109 params[2] = DW_INT_TO_POINTER((int)point.x);
2110 params[3] = DW_INT_TO_POINTER((int)point.y);
2111
2112 _dw_event_handler(self, (UIEvent *)params, 10);
2107 2113
2108 if(window) 2114 if(window)
2109 { 2115 {
2110 __block UIMenu *popupmenu = [window popupMenu]; 2116 __block UIMenu *popupmenu = [window popupMenu];
2111 config = [UIContextMenuConfiguration configurationWithIdentifier:@"DWContextMenu" 2117 config = [UIContextMenuConfiguration configurationWithIdentifier:@"DWContextMenu"
3643 } 3649 }
3644 nsstr = [object text]; 3650 nsstr = [object text];
3645 3651
3646 if(font) 3652 if(font)
3647 thisheight = (int)[font lineHeight]; 3653 thisheight = (int)[font lineHeight];
3648 3654
3649 /* Spinbuttons need some extra */ 3655 /* Spinbuttons need some extra */
3650 if([handle isMemberOfClass:[DWSpinButton class]]) 3656 if([handle isMemberOfClass:[DWSpinButton class]])
3651 { 3657 {
3652 DWSpinButton *spinbutton = handle; 3658 DWSpinButton *spinbutton = handle;
3653 CGSize size = [[spinbutton stepper] intrinsicContentSize]; 3659 CGSize size = [[spinbutton stepper] intrinsicContentSize];