[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] rev 2345 - trunk/src
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] rev 2345 - trunk/src |
Date: |
Thu, 24 Jun 2004 21:17:13 +0200 |
Author: grumbel
Date: 2004-06-24 21:17:12 +0200 (Thu, 24 Jun 2004)
New Revision: 2345
Modified:
trunk/src/menu_button.cxx
trunk/src/menu_button.hxx
trunk/src/pingus_menu.cxx
Log:
- some naming cleanup
Modified: trunk/src/menu_button.cxx
===================================================================
--- trunk/src/menu_button.cxx 2004-06-24 19:01:01 UTC (rev 2344)
+++ trunk/src/menu_button.cxx 2004-06-24 19:17:12 UTC (rev 2345)
@@ -39,7 +39,7 @@
using EditorNS::Editor;
-SurfaceButton::SurfaceButton(const CL_Point& pos_, const CL_Sprite& sprite_,
+MenuButton::MenuButton(const CL_Point& pos_, const CL_Sprite& sprite_,
const std::string& text_, const std::string&
desc_)
{
text = text_;
@@ -57,7 +57,7 @@
pressed = false;
}
-SurfaceButton::SurfaceButton ()
+MenuButton::MenuButton ()
{
font = Fonts::pingus_small;
font_large = Fonts::pingus_large;
@@ -72,18 +72,18 @@
//std::cout << "done" << std::endl;
}
-SurfaceButton::~SurfaceButton ()
+MenuButton::~MenuButton ()
{
}
void
-SurfaceButton::on_click ()
+MenuButton::on_click ()
{
click();
}
void
-SurfaceButton::draw (GraphicContext& gc)
+MenuButton::draw (GraphicContext& gc)
{
if (mouse_over && !pressed)
{
@@ -126,13 +126,13 @@
}
void
-SurfaceButton::update (float delta)
+MenuButton::update (float delta)
{
UNUSED_ARG(delta);
}
void
-SurfaceButton::on_pointer_enter ()
+MenuButton::on_pointer_enter ()
{
mouse_over = true;
Sound::PingusSound::play_sound ("tick");
@@ -140,26 +140,26 @@
}
void
-SurfaceButton::on_pointer_leave ()
+MenuButton::on_pointer_leave ()
{
//std::cout << "X: " << this << "leave" << std::endl;
mouse_over = false;
}
void
-SurfaceButton::on_pointer_press ()
+MenuButton::on_pointer_press ()
{
pressed = true;
}
void
-SurfaceButton::on_pointer_release ()
+MenuButton::on_pointer_release ()
{
pressed = false;
}
bool
-SurfaceButton::is_at(int x, int y)
+MenuButton::is_at(int x, int y)
{
return (x > x_pos - int(surface_p.get_width()) / 2
&& x < x_pos + int(surface_p.get_width()) / 2
Modified: trunk/src/menu_button.hxx
===================================================================
--- trunk/src/menu_button.hxx 2004-06-24 19:01:01 UTC (rev 2344)
+++ trunk/src/menu_button.hxx 2004-06-24 19:17:12 UTC (rev 2345)
@@ -17,8 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#ifndef HEADER_PINGUS_SURFACE_BUTTON_HXX
-#define HEADER_PINGUS_SURFACE_BUTTON_HXX
+#ifndef HEADER_PINGUS_MENU_BUTTON_HXX
+#define HEADER_PINGUS_MENU_BUTTON_HXX
#include <string>
#include <ClanLib/Display/sprite.h>
@@ -30,7 +30,7 @@
class PingusMenu;
/** Framework for menu buttons */
-class SurfaceButton : public GUI::Component
+class MenuButton : public GUI::Component
{
protected:
CL_Sprite surface_p;
@@ -49,10 +49,10 @@
CL_Signal_v0 click;
public:
- SurfaceButton(const CL_Point& pos, const CL_Sprite& sprite,
- const std::string& text, const std::string& desc);
- SurfaceButton();
- virtual ~SurfaceButton();
+ MenuButton(const CL_Point& pos, const CL_Sprite& sprite,
+ const std::string& text, const std::string& desc);
+ MenuButton();
+ virtual ~MenuButton();
void draw(GraphicContext& gc);
void update (float delta);
@@ -69,8 +69,8 @@
virtual void on_click ();
CL_Signal_v0& sig_click() { return click; }
private:
- SurfaceButton (const SurfaceButton&);
- SurfaceButton& operator= (const SurfaceButton&);
+ MenuButton (const MenuButton&);
+ MenuButton& operator= (const MenuButton&);
};
} // namespace Pingus
Modified: trunk/src/pingus_menu.cxx
===================================================================
--- trunk/src/pingus_menu.cxx 2004-06-24 19:01:01 UTC (rev 2344)
+++ trunk/src/pingus_menu.cxx 2004-06-24 19:17:12 UTC (rev 2345)
@@ -52,19 +52,19 @@
background = Resource::load_sprite("misc/logo", "core");
- SurfaceButton* editor_button = new
SurfaceButton(CL_Point(CL_Display::get_width() * 150 / 800,
+ MenuButton* editor_button = new
MenuButton(CL_Point(CL_Display::get_width() * 150 / 800,
CL_Display::get_height() * 370 / 600),
Resource::load_sprite("menu/create_on", "core"),
_("Create a\nLevel"),
_("..:: Launch the
level editor ::.."));
- SurfaceButton* start_button = new
SurfaceButton(CL_Point(CL_Display::get_width() * 400 / 800,
+ MenuButton* start_button = new
MenuButton(CL_Point(CL_Display::get_width() * 400 / 800,
CL_Display::get_height() * 370 / 600),
Resource::load_sprite("menu/play_on", "core"),
_("Start"),
_("..:: Start the game
::.."));
- SurfaceButton* quit_button = new
SurfaceButton(CL_Point(CL_Display::get_width() * 650 / 800,
+ MenuButton* quit_button = new
MenuButton(CL_Point(CL_Display::get_width() * 650 / 800,
CL_Display::get_height() * 370 / 600),
Resource::load_sprite("menu/exit_on", "core"),
_("Exit"),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] rev 2345 - trunk/src,
Ingo Ruhnke <=