00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BUTTONWIDGET_H_INCLUDED
00020 #define BUTTONWIDGET_H_INCLUDED
00021
00022 #include "Gump.h"
00023 #include "FrameID.h"
00024
00025 class ButtonWidget : public Gump
00026 {
00027 public:
00028
00029 ENABLE_RUNTIME_CLASSTYPE();
00030
00031 ButtonWidget();
00032 ButtonWidget(int X, int Y, std::string txt, bool gamefont, int font,
00033 uint32 mouseOverBlendCol = 0, int width = 0, int height = 0,
00034 sint32 layer = LAYER_NORMAL);
00035 ButtonWidget(int X, int Y, FrameID frame_up, FrameID frame_down,
00036 bool mouseOver = false, sint32 layer = LAYER_NORMAL);
00037 virtual ~ButtonWidget(void);
00038
00039 virtual void InitGump(Gump* newparent, bool take_focus=true);
00040 virtual uint16 TraceObjId(int mx, int my);
00041 virtual bool PointOnGump(int mx, int my);
00042
00043 virtual Gump* OnMouseDown(int button, int mx, int my);
00044 virtual void OnMouseUp(int button, int mx, int my);
00045 virtual void OnMouseClick(int button, int mx, int my);
00046 virtual void OnMouseDouble(int button, int mx, int my);
00047
00048 virtual void OnMouseOver();
00049 virtual void OnMouseLeft();
00050
00052 int getVlead();
00053
00054
00055
00056
00057 enum Message
00058 {
00059 BUTTON_CLICK = 0,
00060 BUTTON_UP = 1,
00061 BUTTON_DOUBLE = 2
00062 };
00063
00064 protected:
00065 Shape *shape_up;
00066 uint32 framenum_up;
00067 Shape *shape_down;
00068 uint32 framenum_down;
00069 uint16 textwidget;
00070 uint32 mouseOverBlendCol;
00071 bool mouseOver;
00072 int origw, origh;
00073
00074 public:
00075 bool loadData(IDataSource* ids, uint32 version);
00076 protected:
00077 virtual void saveData(ODataSource* ods);
00078 };
00079
00080 #endif // BUTTONWIDGET_H_INCLUDED