GUI hit testing
Hi,
Is there any way to test whether a mouse click has been handled by a Noesis widget? I'm using C++ w/ OgreBindings.
Thanks.
Is there any way to test whether a mouse click has been handled by a Noesis widget? I'm using C++ w/ OgreBindings.
Thanks.
Re: GUI hit testing
Do you want this to know if an input event must be sent to your 3d scene? We use HitTest() in our integration tutorial for this purpose:
Is this what you want?
Code: Select all
static bool captured = false;
switch (uMsg)
{
case WM_MOUSEMOVE:
{
if (gXamlRenderer != 0)
{
gXamlRenderer->MouseMove(LOWORD(lParam), HIWORD(lParam));
}
break;
}
case WM_LBUTTONDOWN:
{
if (gXamlRenderer != 0)
{
gXamlRenderer->MouseButtonDown(LOWORD(lParam), HIWORD(lParam), MouseButton_Left);
if (VisualTreeHelper::HitTest(gXamlRenderer->GetContent(), Point(LOWORD(lParam),
HIWORD(lParam))).visualHit != 0)
{
captured = true;
}
}
break;
}
case WM_LBUTTONUP:
{
if (gXamlRenderer != 0)
{
gXamlRenderer->MouseButtonUp(LOWORD(lParam), HIWORD(lParam), MouseButton_Left);
captured = false;
}
break;
}
}
if (!captured)
{
g_Camera.HandleMessages( hWnd, uMsg, wParam, lParam );
g_MCamera.HandleMessages( hWnd, uMsg, wParam, lParam );
g_LCamera.HandleMessages( hWnd, uMsg, wParam, lParam );
}
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 14 guests