comparison win/dw.c @ 93:98cce029a611

Changed handling of menu item click events.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 25 Apr 2002 02:10:49 +0000
parents eeb98f881663
children 636c37ca7238
comparison
equal deleted inserted replaced
92:0a085f295e81 93:98cce029a611
20 20
21 /* this is the callback handle for the window procedure */ 21 /* this is the callback handle for the window procedure */
22 /* make sure you always match the calling convention! */ 22 /* make sure you always match the calling convention! */
23 int (*filterfunc)(HWND, UINT, WPARAM, LPARAM) = 0L; 23 int (*filterfunc)(HWND, UINT, WPARAM, LPARAM) = 0L;
24 24
25 HWND hwndBubble = (HWND)NULL, hwndBubbleLast, DW_HWND_OBJECT = (HWND)NULL; 25 HWND popup = (HWND)NULL, hwndBubble = (HWND)NULL, hwndBubbleLast, DW_HWND_OBJECT = (HWND)NULL;
26 26
27 HINSTANCE DWInstance = NULL; 27 HINSTANCE DWInstance = NULL;
28 28
29 DWORD dwVersion = 0, dwComctlVer = 0; 29 DWORD dwVersion = 0, dwComctlVer = 0;
30 DWTID _dwtid = -1; 30 DWTID _dwtid = -1;
1497 tmp = NULL; 1497 tmp = NULL;
1498 } 1498 }
1499 } /* Make sure it's the right window, and the right ID */ 1499 } /* Make sure it's the right window, and the right ID */
1500 else if(tmp->window < (HWND)65536 && command == tmp->window) 1500 else if(tmp->window < (HWND)65536 && command == tmp->window)
1501 { 1501 {
1502 result = clickfunc(tmp->window, tmp->data); 1502 result = clickfunc(popup ? popup : tmp->window, tmp->data);
1503 tmp = NULL; 1503 tmp = NULL;
1504 } 1504 }
1505 } 1505 }
1506 break; 1506 break;
1507 case WM_HSCROLL: 1507 case WM_HSCROLL:
3620 */ 3620 */
3621 void dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) 3621 void dw_menu_popup(HMENUI *menu, HWND parent, int x, int y)
3622 { 3622 {
3623 if(menu && *menu) 3623 if(menu && *menu)
3624 { 3624 {
3625 popup = parent;
3625 TrackPopupMenu((*menu)->menu, 0, x, y, 0, parent, NULL); 3626 TrackPopupMenu((*menu)->menu, 0, x, y, 0, parent, NULL);
3626 free(*menu); 3627 free(*menu);
3627 *menu = NULL; 3628 *menu = NULL;
3628 } 3629 }
3629 } 3630 }