00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef HEADER_CONSTRUO_GUI_COMPONENT_HXX
00021 #define HEADER_CONSTRUO_GUI_COMPONENT_HXX
00022
00023 class GraphicContext;
00024 class GUIManager;
00025
00027 class GUIComponent
00028 {
00029 protected:
00030 int x_pos;
00031 int y_pos;
00032 int width;
00033 int height;
00034
00035 public:
00036 GUIComponent (int x_, int y_, int width_, int height_)
00037 : x_pos (x_), y_pos (y_), width (width_), height (height_)
00038 {}
00039
00040 virtual ~GUIComponent () {}
00041
00042 virtual void draw (GraphicContext* gc) =0;
00043
00045 virtual bool is_at (int x, int y);
00046
00047 void set_position (int x, int y) { x_pos = x, y_pos = y; }
00048 void set_width (int w) { width = w; }
00049 void set_height (int h) { height = h; }
00050 int get_x_pos () { return x_pos; }
00051 int get_y_pos () { return y_pos; }
00052 int get_width () { return width; }
00053 int get_height () { return height; }
00054
00055 virtual void on_primary_button_press (int x, int y) {}
00056 virtual void on_primary_button_release (int x, int y) {}
00057
00058 virtual void on_secondary_button_press (int x, int y) {}
00059 virtual void on_secondary_button_release (int x, int y) {}
00060
00061 virtual void on_tertiary_button_press (int x, int y) {}
00062 virtual void on_tertiary_button_release (int x, int y) {}
00063
00064 virtual void on_duplicate_press (int x, int y) {}
00065 virtual void on_delete_press (int x, int y) {}
00066 virtual void on_fix_press (int x, int y) {}
00067
00068 virtual void on_mouse_enter () {}
00069 virtual void on_mouse_leave () {}
00070
00071 virtual void wheel_up (int x, int y) {}
00072 virtual void wheel_down (int x, int y) {}
00073
00074 virtual void on_button_press (int button_id, int x, int y) {}
00075
00076 virtual void scroll_left () {}
00077 virtual void scroll_right () {}
00078 virtual void scroll_up () {}
00079 virtual void scroll_down () {}
00080
00081 virtual void on_mouse_move (int x, int y, int of_x, int of_y) {}
00082 };
00083
00084 #endif
00085
00086