Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 chris 1
#ifndef __CHECKBOX_H__
2
#define __CHECKBOX_H__
3
 
4
#include "Widget.h"
5
 
6
namespace Sexy
7
{
8
 
9
class CheckboxListener;
10
class Image;
11
 
12
class Checkbox : public Widget
13
{      
14
protected:
15
        CheckboxListener*               mListener;
16
 
17
public:
18
        int                                             mId;
19
 
20
        bool                                    mChecked;
21
 
22
        Image*                                  mUncheckedImage;
23
        Image*                                  mCheckedImage;
24
 
25
        Rect                                    mCheckedRect;
26
        Rect                                    mUncheckedRect;
27
 
28
        Color                                   mOutlineColor;  // These are only used if no image is specified
29
        Color                                   mBkgColor;
30
        Color                                   mCheckColor;
31
 
32
public:
33
        virtual void                    SetChecked(bool checked, bool tellListener = true);
34
        virtual bool                    IsChecked();
35
 
36
        virtual void                    MouseDown(int x, int y, int theClickCount) { Widget::MouseDown(x, y, theClickCount); }
37
        virtual void                    MouseDown(int x, int y, int theBtnNum, int theClickCount);
38
        virtual void                    Draw(Graphics* g);
39
 
40
public:
41
        Checkbox(Image* theUncheckedImage, Image* theCheckedImage, int theId, CheckboxListener* theCheckboxListener);
42
};
43
 
44
}
45
 
46
#endif //__CHECKBOX_H__