src/widget/widget_button_img.cpp
author KUDr
Tue, 06 Mar 2007 13:06:38 +0000
branchcpp_gui
changeset 6290 8078f7a3c8a0
parent 6289 be3d8bd9fb02
permissions -rw-r--r--
(svn r9023) [cpp_gui] -Add: ImageButton and ImageButton2
-Add: Widget::DrawSprite() method that accepts sprite coordinates in the widget space instead of window space
/* $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"
#include "widget_types.h"

namespace gui {

/*virtual*/ void ImageButton::OnPaint(EvtPaint &e)
{
	DrawBackground(e);
	Point16 pos = m_sprite_offset + (m_pushed ? Point16(3, 3) : Point16(2, 2));
	DrawSprite(m_sprite, PAL_NONE, pos);
}

} // namespace gui