BURIED: Implement window enabling

This commit is contained in:
Matthew Hoops 2013-08-04 16:39:46 -04:00 committed by Eugene Sandulenko
parent e97c2f47a8
commit 33444e800d
2 changed files with 18 additions and 1 deletions

View File

@ -31,6 +31,7 @@ namespace Buried {
Window::Window(BuriedEngine *vm) : _vm(vm) {
_parent = 0;
_enabled = true;
}
Window::~Window() {
@ -110,4 +111,18 @@ void Window::dispatchAllMessages() {
}
}
void Window::enableWindow(bool enable) {
if (_enabled != enable) {
_enabled = enable;
sendMessage(new EnableMessage(enable));
}
}
bool Window::isWindowEnabled() const {
if (_parent && !_parent->isWindowEnabled())
return false;
return _enabled;
}
} // End of namespace Buried

View File

@ -65,6 +65,8 @@ public:
const Common::Rect &getRect() const { return _rect; }
Common::Rect getClientRect() const;
void updateWindow() { onPaint(); }
void enableWindow(bool enable);
bool isWindowEnabled() const;
// TODO:
// SetTimer
@ -82,9 +84,9 @@ private:
BuriedEngine *_vm;
Common::Queue<Message *> _queue;
// TODO: Something about children?
Window *_parent;
Common::Rect _rect;
bool _enabled;
};
} // End of namespace Buried