(svn r8931) [cpp_gui] -Add: first OO widget type (TextButton) added only with basic functionality
-Add: new gui events (C++)
-Add: dynamic event handlers introduced (see Widget::AddReflectHandlerT)
-Add: test window using the new features (intro_gui.cpp)
/* $Id$ */
#include "../stdafx.h"
#include <stdarg.h>
#include "../openttd.h"
#include "../debug.h"
#include "../functions.h"
#include "../map.h"
#include "../player.h"
#include "../window.h"
#include "../gfx.h"
#include "../viewport.h"
#include "../console.h"
#include "../variables.h"
#include "../table/sprites.h"
#include "../genworld.h"
#include "../helpers.hpp"
#include "window_events.hpp"
namespace gui {
/*virtual*/ void Button::DrawBackground(EvtPaint &ev)
{
DrawFrameRect(m_color, m_pushed ? FR_LOWERED : FR_NONE);
}
/*virtual*/ void Button::OnLeftClick(EvtClick &ev)
{
m_pushed = !m_pushed;
CallHandlers(ev);
ev.SetHandled();
Invalidate();
}
}; // namespace gui