Event is missing after invoking a modal dialog (MessageBox) ?
Posted: 22 Aug 2017, 12:00
Hi,
To demonstrate the strange thing I observed, I modified the Tutorial05 source code included in the C++ SDK (Src\Samples\D3D11\Tutorial05).
I added the following 3 lines into Tutorial05.cpp to spawn a modal MessageBox anytime mouse is down inside the root grid.
The weird behavior I observed is as follows:
1. Run Tutorial05.exe
2. Click anywhere inside the password box -> MessageBox is shown as modal dialog
3. Click "OK" to close the dialog
4. Click anywhere inside the password box -> MessageBox is not shown ??
5. Click anywhere inside the password box -> MessageBox is shown as modal dialog
I wonder why the MessageBox is not shown in step 4 above. Is there something wrong with the integration layer ?
To demonstrate the strange thing I observed, I modified the Tutorial05 source code included in the C++ SDK (Src\Samples\D3D11\Tutorial05).
I added the following 3 lines into Tutorial05.cpp to spawn a modal MessageBox anytime mouse is down inside the root grid.
Code: Select all
...
// Loads XAML and creates a view with it
Ptr<FrameworkElement> xaml = Noesis::GUI::LoadXaml<FrameworkElement>("PasswordBox.xaml");
g_XamlView = Noesis::GUI::CreateView(xaml.GetPtr());
g_XamlView->SetSize(g_Width, g_Height);
g_XamlView->SetAntialiasingMode(Noesis::Gui::AntialiasingMode_PPAA);
// Added 3 lines of code here, to show a modal message box anytime the mouse is downed
xaml->MouseDown() += [](auto sender, auto args) {
::MessageBox(g_hWnd, L"test", L"test", MB_OK);
};
// Initializes renderer. This could be done in a render thread
Ptr<RenderDevice> device = *new D3D11RenderDevice(g_pImmediateContext);
Ptr<VGContext> context = Noesis::GUI::CreateVGContext(device.GetPtr(), Noesis::VGOptions());
g_XamlView->GetRenderer()->Init(context.GetPtr());
...
1. Run Tutorial05.exe
2. Click anywhere inside the password box -> MessageBox is shown as modal dialog
3. Click "OK" to close the dialog
4. Click anywhere inside the password box -> MessageBox is not shown ??
5. Click anywhere inside the password box -> MessageBox is shown as modal dialog
I wonder why the MessageBox is not shown in step 4 above. Is there something wrong with the integration layer ?