comparison win/dw.c @ 1760:3bbbb5a55cf8

Fix buttons causing double events when toolbar support is enabled on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 26 Jun 2012 00:54:45 +0000
parents eeec5ceec7a5
children ae7f1a0eb0ea
comparison
equal deleted inserted replaced
1759:e113f9e46fbd 1760:3bbbb5a55cf8
2187 } 2187 }
2188 } 2188 }
2189 #ifdef TOOLBAR 2189 #ifdef TOOLBAR
2190 else if (message == BN_CLICKED && tmp->message == WM_COMMAND && tmp->window == (HWND)mp2) 2190 else if (message == BN_CLICKED && tmp->message == WM_COMMAND && tmp->window == (HWND)mp2)
2191 { 2191 {
2192 result = clickfunc(tmp->window, tmp->data); 2192 TCHAR tmpbuf[100] = {0};
2193 tmp = NULL; 2193
2194 GetClassName((HWND)mp2, tmpbuf, 99);
2195
2196 /* Make sure this isn't a button, because it will have already been handled */
2197 if (_tcsnicmp(tmpbuf, BUTTONCLASSNAME, _tcslen(BUTTONCLASSNAME)+1) != 0)
2198 {
2199 result = clickfunc(tmp->window, tmp->data);
2200 tmp = NULL;
2201 }
2194 } 2202 }
2195 #endif 2203 #endif
2196 else if (tmp->id && passthru == tmp->id) 2204 else if (tmp->id && passthru == tmp->id)
2197 { 2205 {
2198 HMENU hwndmenu = GetMenu(hWnd), menuowner = _menu_owner((HMENU)tmp->window); 2206 HMENU hwndmenu = GetMenu(hWnd), menuowner = _menu_owner((HMENU)tmp->window);