00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef GCN_CHECKBOX_HPP
00056 #define GCN_CHECKBOX_HPP
00057
00058 #include <string>
00059
00060 #include "guichan/keylistener.h"
00061 #include "guichan/mouselistener.h"
00062 #include "guichan/platform.h"
00063 #include "guichan/widget.h"
00064
00065 namespace gcn
00066 {
00070 class GCN_CORE_DECLSPEC CheckBox :
00071 public Widget,
00072 public MouseListener,
00073 public KeyListener
00074 {
00075 public:
00076
00080 CheckBox();
00081
00088 CheckBox(const std::string &caption, bool marked=false);
00089
00093 virtual ~CheckBox() { }
00094
00100 virtual void drawBox(Graphics *graphics);
00101
00107 virtual bool isMarked() const;
00108
00114 virtual void setMarked(bool marked);
00115
00121 virtual const std::string &getCaption() const;
00122
00128 virtual void setCaption(const std::string &caption);
00129
00133 virtual void adjustSize();
00134
00135
00136
00137
00138 virtual void draw(Graphics* graphics);
00139
00140 virtual void drawBorder(Graphics* graphics);
00141
00142
00143
00144
00145 virtual bool keyPress(const Key& key);
00146
00147
00148
00149
00150 virtual void mouseClick(int x, int y, int button, int count);
00151
00152
00153 protected:
00157 virtual void toggle();
00158
00159 bool mMarked;
00160 std::string mCaption;
00161 };
00162 }
00163
00164 #endif // end GCN_CHECKBOX_HPP