Gump_button.cc

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2000 The Exult Team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifdef HAVE_CONFIG_H
00020 #  include <config.h>
00021 #endif
00022 
00023 #include "gamewin.h"
00024 #include "Gump_button.h"
00025 #include "Gump.h"
00026 
00027 
00028 /*
00029  *  Redisplay as 'pushed'.
00030  */
00031 
00032 void Gump_button::push
00033   (
00034   )
00035 {
00036   pushed = 1;
00037   paint();
00038   gwin->set_painted();
00039 }
00040 
00041 /*
00042  *  Redisplay as 'unpushed'.
00043  */
00044 
00045 void Gump_button::unpush
00046   (
00047   )
00048 {
00049   pushed = 0;
00050   paint();
00051   gwin->set_painted();
00052 }
00053 
00054 /*
00055  *  Default method for double-click.
00056  */
00057 
00058 void Gump_button::double_clicked
00059   (
00060   int x, int y
00061   )
00062 {
00063 }
00064 
00065 /*
00066  *  Repaint checkmark, etc.
00067  */
00068 
00069 void Gump_button::paint
00070   (
00071   )
00072 {
00073   int px = 0;
00074   int py = 0;
00075 
00076   if (parent)
00077   {
00078     px = parent->get_x();
00079     py = parent->get_y();
00080   }
00081 
00082   int prev_frame = get_framenum();
00083   set_frame(prev_frame + pushed);
00084   paint_shape(x+px, y+py);
00085   set_frame(prev_frame);
00086 
00087 }

Generated on Mon Jul 9 14:42:46 2007 for ExultEngine by  doxygen 1.5.1