@@ -158,6 +158,11 @@ public: | |||||
*/ | */ | ||||
virtual ~Window(); | virtual ~Window(); | ||||
/** | |||||
TEST. | |||||
*/ | |||||
Window* createPopup(); | |||||
/** | /** | ||||
Whether this Window is embed into another (usually not DGL-controlled) Window. | Whether this Window is embed into another (usually not DGL-controlled) Window. | ||||
*/ | */ | ||||
@@ -574,6 +579,9 @@ private: | |||||
bool usesSizeRequest, | bool usesSizeRequest, | ||||
bool doPostInit); | bool doPostInit); | ||||
/** @internal */ | |||||
explicit Window(Application& app, Window& transientParentWindow, uint type); | |||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window) | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window) | ||||
}; | }; | ||||
@@ -111,6 +111,15 @@ Window::Window(Application& app, | |||||
pData->initPost(); | pData->initPost(); | ||||
} | } | ||||
Window::Window(Application& app, Window& transientParentWindow, const uint type) | |||||
: pData(new PrivateData(app, this, transientParentWindow.pData)) | |||||
{ | |||||
if (pData->view != nullptr) | |||||
puglSetViewHint(pData->view, PUGL_VIEW_TYPE, type); | |||||
pData->initPost(); | |||||
} | |||||
Window::Window(Application& app, | Window::Window(Application& app, | ||||
const uintptr_t parentWindowHandle, | const uintptr_t parentWindowHandle, | ||||
const uint width, | const uint width, | ||||
@@ -132,6 +141,11 @@ Window::~Window() | |||||
delete pData; | delete pData; | ||||
} | } | ||||
Window* Window::createPopup() | |||||
{ | |||||
return new Window(pData->app, *this, PUGL_VIEW_TYPE_UTILITY); | |||||
} | |||||
bool Window::isEmbed() const noexcept | bool Window::isEmbed() const noexcept | ||||
{ | { | ||||
return pData->isEmbed; | return pData->isEmbed; | ||||
@@ -49,6 +49,8 @@ public: | |||||
static const uint kInitialWidth = 600; | static const uint kInitialWidth = 600; | ||||
static const uint kInitialHeight = 350; | static const uint kInitialHeight = 350; | ||||
ScopedPointer<Window> win; | |||||
FileHandlingExampleUI() | FileHandlingExampleUI() | ||||
: UI(kInitialWidth, kInitialHeight), | : UI(kInitialWidth, kInitialHeight), | ||||
fButton1(this, this), | fButton1(this, this), | ||||
@@ -70,6 +72,11 @@ public: | |||||
#endif | #endif | ||||
setGeometryConstraints(kInitialWidth, kInitialHeight, false); | setGeometryConstraints(kInitialWidth, kInitialHeight, false); | ||||
win = getWindow().createPopup(); | |||||
win->setTitle("test1"); | |||||
win->setSize(300, 300); | |||||
win->runAsModal(); | |||||
} | } | ||||
protected: | protected: | ||||