00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CHECKBOX_H
00019 #define CHECKBOX_H
00020
00021
00022 #include <vector>
00023 #include "../constants.h"
00024 #include "widget.h"
00025 #include "label.h"
00026 #include "button.h"
00027
00032 #define CHECKBOX_SIZE 15
00033
00034 class SDLHandler;
00035 class Label;
00036 class Button;
00037
00038 class Checkbox : public Widget {
00039 private:
00040 int x2, y2;
00041 Label *staticLabel;
00042 Button * checkButton;
00043 bool inside;
00044 bool checked;
00045 void toggleCheck();
00046 void applyCheck();
00047
00048 public:
00049
00050 Checkbox(int x1, int y1, int x2, int y2, GLuint highlight, char *staticText);
00051 ~Checkbox();
00052 bool isInside(int x, int y);
00053 inline bool isChecked() { return checked; }
00054 void setCheck(bool val);
00055
00056 bool handleEvent(Widget *parent, SDL_Event *event, int x, int y);
00057 void drawWidget(Widget *parent);
00058 };
00059
00060 #endif
00061