/* ui/window.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #include "ui/paint.h" #include "ui/window.h" namespace ui { Window::Window(Widget *parent) : Widget(parent) { set_label("window"); set_border(true); set_background(true); set_focus(); } Window::~Window() { } void Window::show() { event_resize(); Widget::show(); //raise(); Widget *w = this; while (w && w->visible()) { w->set_focus(); w = w->parent(); } emit(EventWindowShow); } void Window::hide() { Widget::hide(); emit(EventWindowHide); } void Window::set_previous(Window *previous) { window_previous.assign(previous->label()); } void Window::clear_previous() { window_previous.clear(); } void Window::draw_background() { Paint::draw_material(global_location(), size(), "ui/window"); } void Window::draw_border() { Paint::set_color(palette()->foreground()); Paint::draw_border(global_location(), size()); } }