Fixed MN_STRINGSELECT menu item a bit more and hooked up aspect ration
[supertux.git] / src / gui / button.cpp
index 2e4a336..6b16a13 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
-// 
+//
 //  SuperTux
-//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-//  02111-1307, USA.
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
 #include <config.h>
 
 #include <SDL.h>
@@ -61,13 +61,13 @@ if(state == BT_SHOW_INFO)
     offset = Vector(size.x, - 10);
   else if(pos.x + tanslation.x < 100)
     offset = Vector(size.x, 0);
-  else 
+  else
     offset = Vector(-30, -size.y/2);
-  context.draw_text(info_font, info, pos + offset, LEFT_ALLIGN, LAYER_GUI+2);
+  context.draw_text(info_font, info, pos + offset, ALIGN_LEFT, LAYER_GUI+2);
   if(binding != 0)
     context.draw_text(info_font, "(" + std::string(SDL_GetKeyName(binding)) +
                                  ")", pos + offset + Vector(0,12),
-                                 LEFT_ALLIGN,  LAYER_GUI+2);
+                                 ALIGN_LEFT,  LAYER_GUI+2);
   }
 
 context.draw_surface_part(image, Vector(0,0), size, pos, LAYER_GUI+1);
@@ -162,7 +162,7 @@ for(Buttons::iterator i = buttons.begin(); i != buttons.end(); ++i)
       i->pos.y + i->size.y > (row + buttons_box.y) * buttons_size.y)
     continue;
 
-  i->draw(context, i->id == button_selected ? true : false);
+  i->draw(context, i->id == button_selected);
   }
 context.pop_transform();
 }
@@ -178,7 +178,7 @@ switch(event.type)
 
     if(mouse_left_button)
       {
-      pos.x += int(event.motion.xrel * float(SCREEN_WIDTH)/screen->w); 
+      pos.x += int(event.motion.xrel * float(SCREEN_WIDTH)/screen->w);
       pos.y += int(event.motion.yrel * float(SCREEN_HEIGHT)/screen->h);
       caught_event = true;
       }