00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00064 virtual inline bool hasSound() { return false; }
00065 };
00066
00067 #endif
00068