src/widget/widget_label.cpp
author miham
Sun, 04 Mar 2007 13:13:24 +0000
branchcpp_gui
changeset 6288 f8e3bd806871
parent 6286 6e8eec87fa9d
child 6289 be3d8bd9fb02
permissions -rw-r--r--
(svn r9008) [cpp_gui] -Fix: fixed comparison in Label widget (reported by TrueBrian)
/* $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 Label::DrawBackground(EvtPaint &ev)
{
	if ((m_feature_flags & FF_TRANSPARENT) == FF_NONE) {
		DrawFrameRect(m_color, FR_BG_ONLY);
	}
}

/*virtual*/ void Label::OnPaint(EvtPaint &ev)
{
	DrawBackground(ev);
	Point center = CenterPt();
	DrawStringCentered(center.x, center.y - 5, m_text, 0);
	ev.SetHandled();
}

}; // namespace gui