Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

canvas.h

00001 /***************************************************************************
00002                           canvas.h  -  description
00003                              -------------------
00004     begin                : Thu Aug 28 2003
00005     copyright            : (C) 2003 by Gabor Torok
00006     email                : cctorok@yahoo.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef CANVAS_H
00019 #define CANVAS_H
00020 
00021 #include "../constants.h"
00022 #include "widget.h"
00023 #include "widgetview.h"
00024 #include "draganddrop.h"
00025 
00030 class Canvas : public Widget {
00031  private:
00032   WidgetView *view;
00033   int x2, y2;
00034   DragAndDropHandler *dragAndDropHandler;
00035   int dragX, dragY;
00036   bool dragging;
00037   bool highlightBorders;
00038   bool highlightOnMouseOver;
00039   bool inside;
00040   bool glowing;
00041 
00042  public: 
00043   Canvas(int x, int y, int x2, int y2, WidgetView *view, 
00044          DragAndDropHandler *dragAndDropHandler = NULL, 
00045          bool highlightOnMouseOver=false);
00046   virtual ~Canvas();
00047   inline WidgetView *getView() { return view; }
00048   void drawWidget(Widget *parent);
00049 
00050   inline void setGlowing( bool b ) { glowing = b; }
00051   inline bool isGlowing() { return glowing; }
00052 
00058   bool handleEvent(Widget *parent, SDL_Event *event, int x, int y);
00059   void removeEffects(Widget *parent);
00060   inline void resize(int w, int h) { Widget::resize(w, h); x2 = getX() + w; y2 = getY() + h; }
00061   inline bool canGetFocus() { return false; }
00062 
00063   // don't play sound when the value changes
00064   virtual inline bool hasSound() { return false; }
00065 };
00066 
00067 #endif
00068 

Generated on Thu Jun 16 21:50:42 2005 for scourge by  doxygen 1.4.0