00001
00002
00003
00004
00005 #include <wx/window.h>
00006 #include <wx/image.h>
00007 #include <wx/dcclient.h>
00008 #include <wx/dcmemory.h>
00009
00010 #ifndef _IMGBUTTON_H_
00011 #define _IMGBUTTON_H_
00012
00013 class ImgButton
00014 {
00015 public:
00016 enum State {ST_NORMAL=0,ST_OVER,ST_DOWN};
00017
00018 ImgButton(wxWindow *parent, const wxString& normal_img, const wxString& over_img = wxEmptyString, const wxString& down_img = wxEmptyString, const wxPoint& position = wxDefaultPosition);
00019 void Draw(wxDC& dc);
00020
00021 void Move(int x, int y);
00022 int GetWidth() const;
00023 int GetHeight() const;
00024
00025 void MouseMove(const wxMouseEvent& e);
00026 void MouseButton(const wxMouseEvent& e);
00027 State get_state(){return state;};
00028
00029 private:
00030 State state;
00031
00032 wxWindow *m_parent;
00033 wxCursor *m_handCursor;
00034
00035 wxImage *img[3];
00036 wxBitmap *bmp[3];
00037 wxPoint pos;
00038 };
00039
00040 #endif // _IMGBUTTON_H_