double click support in demo code for Windows platforms
This commit is contained in:
parent
d9a57d42cd
commit
edac63b81e
@ -131,6 +131,7 @@ int main(void)
|
||||
|
||||
/* Win32 */
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.style = CS_DBLCLKS;
|
||||
wc.lpfnWndProc = WindowProc;
|
||||
wc.hInstance = GetModuleHandleW(0);
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
|
@ -316,6 +316,7 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
return 1;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
nk_input_button(&d3d11.ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
|
||||
nk_input_button(&d3d11.ctx, NK_BUTTON_LEFT, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
|
||||
ReleaseCapture();
|
||||
return 1;
|
||||
@ -347,6 +348,10 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
case WM_MOUSEMOVE:
|
||||
nk_input_motion(&d3d11.ctx, (short)LOWORD(lparam), (short)HIWORD(lparam));
|
||||
return 1;
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
nk_input_button(&d3d11.ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -74,6 +74,7 @@ int main(void)
|
||||
|
||||
/* Win32 */
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.style = CS_DBLCLKS;
|
||||
wc.lpfnWndProc = WindowProc;
|
||||
wc.hInstance = GetModuleHandleW(0);
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
|
@ -627,6 +627,7 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
return 1;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
nk_input_button(&gdi.ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
|
||||
nk_input_button(&gdi.ctx, NK_BUTTON_LEFT, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
|
||||
ReleaseCapture();
|
||||
return 1;
|
||||
@ -658,6 +659,10 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
case WM_MOUSEMOVE:
|
||||
nk_input_motion(&gdi.ctx, (short)LOWORD(lparam), (short)HIWORD(lparam));
|
||||
return 1;
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
nk_input_button(&gdi.ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -69,6 +69,7 @@ int main(void)
|
||||
|
||||
/* Win32 */
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.style = CS_DBLCLKS;
|
||||
wc.lpfnWndProc = WindowProc;
|
||||
wc.hInstance = GetModuleHandleW(0);
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
|
@ -999,6 +999,7 @@ nk_gdip_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
return 1;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
nk_input_button(&gdip.ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
|
||||
nk_input_button(&gdip.ctx, NK_BUTTON_LEFT, (short)LOWORD(lparam), (short)HIWORD(lparam), 0);
|
||||
ReleaseCapture();
|
||||
return 1;
|
||||
@ -1030,6 +1031,10 @@ nk_gdip_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
case WM_MOUSEMOVE:
|
||||
nk_input_motion(&gdip.ctx, (short)LOWORD(lparam), (short)HIWORD(lparam));
|
||||
return 1;
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
nk_input_button(&gdip.ctx, NK_BUTTON_DOUBLE, (short)LOWORD(lparam), (short)HIWORD(lparam), 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user