detail如何创建新的窗口?
TSharedRef<SWindow> Window = SNew(SWindow)
.Title(LOCTEXT("WindowTitle", "Alembic Cache Import Options"))
.SizingRule(ESizingRule::FixedSize)
.ClientSize(FVector2D(1000.f, 700.f))
.AutoCenter(EAutoCenter::PreferredWorkArea)
.ScreenPosition(FVector2D(0,0))
.IsEnabled(true)
.SupportsMinimize(true)
.SupportsMaximize(true);
Window->SetContent
(
SNew(SImage)
);
在这里通过FSlateApplication::Get()添加该窗口,AddModalWindow或者AddWindow方法都可以。
/*TSharedPtr<SWindow> ParentWindow;
if (FModuleManager::Get().IsModuleLoaded("MainFrame"))
{
IMainFrameModule& MainFrame = FModuleManager::LoadModuleChecked<IMainFrameModule>("MainFrame");
ParentWindow = MainFrame.GetParentWindow();
FSlateApplication::Get().AddModalWindow(Window, ParentWindow, false);
}*/
FSlateApplication::Get().AddWindow(Window);