00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __CAUGUI_BUTTON__
00014 #define __CAUGUI_BUTTON__
00015
00016 #include "CAUGuiConfig.h"
00017
00018 #include "CAUGui.h"
00019
00020 typedef enum {
00021
00022 kPushButton = 0,
00023 kIncButton,
00024 kDecButton,
00025 kRadioButton,
00026 kOnOffButton
00028 } CAUGuiBottonMode;
00029
00030 class CAUGuiButton;
00031
00040 typedef void (*buttonUserProcedure)( UInt32 value, CAUGuiButton* from, void* userData );
00041
00055 class CAUGuiButton : public CAUGuiCtrl
00056 {
00057 public:
00058
00069 CAUGuiButton ( CAUGuiMan*, CAAUParameter &, eRect* where, CAUGuiGraphic* fore, CAUGuiGraphic* back, CAUGuiBottonMode );
00070
00072 CAUGuiButton ( CAUGuiMan*, UInt32 theRange, eRect*, CAUGuiGraphic*, CAUGuiGraphic*, CAUGuiBottonMode );
00073
00075 virtual ~CAUGuiButton ();
00076
00078 virtual void draw(CGContextRef context, UInt32 portHeight);
00079
00081 virtual void mouseDown(Point *P, bool, bool);
00082
00084 virtual void mouseTrack(Point *P, bool, bool);
00085
00087 virtual void mouseUp(Point *P, bool, bool);
00088
00090 virtual void setUserProcedure ( buttonUserProcedure theProc, void* theUserData );
00091
00093 virtual void setOnValue ( UInt32 v ) { onValue = v; }
00094
00095 private:
00096
00097 CAUGuiGraphic* ForeGround;
00098 CAUGuiGraphic* BackGround;
00099 CAUGuiBottonMode mode;
00100
00101 buttonUserProcedure userProcedure;
00102 void* userData;
00103
00104 UInt32 onValue;
00105 bool hilite;
00106 float alpha;
00107
00108 };
00109
00110
00111 #endif