KUDr@6258: /* $Id$ */ KUDr@6258: KUDr@6258: #include "../stdafx.h" KUDr@6258: #include KUDr@6258: #include "../openttd.h" KUDr@6282: #include "table/strings.h" KUDr@6258: #include "../debug.h" KUDr@6258: #include "../functions.h" KUDr@6258: #include "../map.h" KUDr@6258: #include "../player.h" KUDr@6258: #include "../window.h" KUDr@6258: #include "../gfx.h" KUDr@6258: #include "../viewport.h" KUDr@6258: #include "../console.h" KUDr@6258: #include "../variables.h" KUDr@6258: #include "../table/sprites.h" KUDr@6258: #include "../genworld.h" KUDr@6258: #include "../helpers.hpp" KUDr@6264: #include "window_events.hpp" KUDr@6258: KUDr@6282: namespace gui { KUDr@6258: KUDr@6282: /*virtual*/ void CloseBox::OnCreate(EvtCreate &ev) KUDr@6282: { KUDr@6282: Point16 size(DEFAULT_WIDTH, DEFAULT_HEIGHT); KUDr@6282: // move itself to the left of the parent KUDr@6282: SetTopLeft(m_container->TopLeft()); KUDr@6282: SetBottomRight(TopLeft() + size - Point16(1, 1)); KUDr@6282: KUDr@6282: m_tooltips = STR_018B_CLOSE_WINDOW; KUDr@6282: KUDr@6282: SetAnchors(PIN_LEFT | PIN_TOP); KUDr@6282: super::OnCreate(ev); KUDr@6282: } KUDr@6282: KUDr@6282: /*virtual*/ void CloseBox::OnPaint(EvtPaint &ev) KUDr@6282: { KUDr@6282: assert(Size() == Point16(DEFAULT_WIDTH, DEFAULT_HEIGHT)); KUDr@6282: KUDr@6282: DrawBackground(ev); KUDr@6282: DrawString(Left() + 2, Top() + 2, STR_00C5, 0); KUDr@6282: } KUDr@6282: KUDr@6282: /*virtual*/ void CloseBox::OnLeftClick(EvtLeftClick &ev) KUDr@6282: { KUDr@6282: BaseWindow *w = GetWindow(); KUDr@6282: assert(w != NULL); KUDr@6282: w->Close(); KUDr@6282: } KUDr@6282: KUDr@6282: }; // namespace gui KUDr@6282: