Added Window::SetModal (issue #84)

This commit is contained in:
Vraiment 2017-07-23 23:26:36 -07:00
parent 6556d7a2ee
commit b1f4de7446
2 changed files with 22 additions and 0 deletions

View File

@ -265,6 +265,14 @@ Window& Window::SetResizable(bool resizable) {
return *this;
}
Window& Window::SetModal(Window& parent) {
if (SDL_SetWindowModalFor(window_, parent.window_) != 0) {
throw SDL2pp::Exception("SDL_SetWindowModalFor");
}
return *this;
}
Window::Borders Window::GetBordersSize() const {
int top = 0, left = 0, bottom = 0, right = 0;

View File

@ -578,6 +578,20 @@ public:
///
////////////////////////////////////////////////////////////
Window& SetResizable(bool resizable = true);
////////////////////////////////////////////////////////////
/// \brief Sets the modal to the parent window
///
/// \param[in] parent The window that should be the parent
///
/// \returns Reference to self
///
/// \throws SDL2pp::Exception
///
/// \see https://wiki.libsdl.org/SDL_SetWindowModalFor
///
////////////////////////////////////////////////////////////
Window &SetModal(Window& parent);
////////////////////////////////////////////////////////////
/// \brief Read only data structure to represent the size borders of a window