Direct2DWindow() :GuiWindow(GetCurrentTheme()->CreateWindowStyle()) { SetText(L"Rendering.RawAPI.Direct2D"); SetClientSize(Size(640, 480)); GetBoundsComposition()->SetPreferredMinSize(Size(640, 480)); MoveToScreenCenter(); { GuiDirect2DElement* element=GuiDirect2DElement::Create(); element->Rendering.AttachMethod(this, &Direct2DWindow::element_Rendering); element->BeforeRenderTargetChanged.AttachMethod(this, &Direct2DWindow::element_BeforeRenderTargetChanged); element->AfterRenderTargetChanged.AttachMethod(this, &Direct2DWindow::element_AfterRenderTargetChanged); GuiBoundsComposition* composition=new GuiBoundsComposition; composition->SetAlignmentToParent(Margin(0, 0, 0, 0)); composition->SetOwnedElement(element); GetContainerComposition()->AddChild(composition); } }
void MainWindow::buttonShowWindow_Clicked(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) { auto window = new AnotherWindow; window->MoveToScreenCenter(); window->ShowModalAndDelete(this, [](){}); }