1
// $Id: menu_button.hpp 3345 2007-10-27 16:02:10Z grumbel $
3
// Pingus - A free Lemmings clone
4
// Copyright (C) 1999 Ingo Ruhnke <grumbel@gmx.de>
6
// This program is free software; you can redistribute it and/or
7
// modify it under the terms of the GNU General Public License
8
// as published by the Free Software Foundation; either version 2
9
// of the License, or (at your option) any later version.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with this program; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#ifndef HEADER_PINGUS_MENU_BUTTON_HXX
21
#define HEADER_PINGUS_MENU_BUTTON_HXX
26
#include "math/vector2i.hpp"
27
#include "../gui/component.hpp"
32
/** Framework for menu buttons */
33
class MenuButton : public GUI::Component
52
MenuButton(PingusMenu* menu, const Vector2i& pos,
53
const std::string& text, const std::string& desc);
55
virtual ~MenuButton();
57
void draw(DrawingContext& gc);
58
void update (float delta);
60
bool is_at (int x, int y);
62
void on_pointer_enter ();
63
void on_pointer_leave ();
64
void on_pointer_press ();
65
void on_pointer_release ();
67
void on_primary_button_click (int x, int y) { on_click (); UNUSED_ARG(x); UNUSED_ARG(y); }
69
virtual void on_click ();
72
MenuButton (const MenuButton&);
73
MenuButton& operator= (const MenuButton&);