GUI2/Window: added getters for dispatcher and display mode, and flag for modeless windows

Previously they were using the modal flag.
This commit is contained in:
Charles Dang 2017-07-29 23:10:31 +11:00 committed by Celtic Minstrel
parent d2cec5eda7
commit 9801a92b36
2 changed files with 20 additions and 7 deletions

View file

@ -538,7 +538,7 @@ void window::show_non_modal(/*const unsigned auto_close_timeout*/)
set_mouse_behavior(event::dispatcher::hit);
show_mode_ = modal;
show_mode_ = modeless;
/*
* Before show has been called, some functions might have done some testing

View file

@ -502,6 +502,13 @@ public:
callback_next_draw_ = func;
}
enum show_mode {
none,
modal,
modeless,
tooltip
};
private:
/** Needed so we can change what's drawn on the screen. */
CVideo& video_;
@ -509,12 +516,6 @@ private:
/** The status of the window. */
status status_;
enum show_mode {
none,
modal,
tooltip
};
/**
* The mode in which the window is shown.
*
@ -740,6 +741,18 @@ private:
std::unique_ptr<event::distributor> event_distributor_;
public:
/** Gets a reference to the window's distributor to allow some state peeking. */
const event::distributor& get_distributor() const
{
return *event_distributor_;
}
/** Returns the dialog mode for this window. */
show_mode mode() const
{
return show_mode_;
}
// mouse and keyboard_capture should be renamed and stored in the
// dispatcher. Chaining probably should remain exclusive to windows.
void mouse_capture(const bool capture = true);