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 #ifndef TEDDY__PHYSICAL_COMPONENTS__ACTION_BUTTON__H
00026 #define TEDDY__PHYSICAL_COMPONENTS__ACTION_BUTTON__H
00027 
00028 
00029 #include "Teddy/TeddyConfig.h"
00030 #include "Teddy/PhysicalComponents/Area.h"
00031 #include "Teddy/PhysicalComponents/EventListener.h"
00032 #include "Teddy/PhysicalComponents/WindowManager.h"
00033 #include "Teddy/Graphics/Color.h"
00034 #include "Teddy/SysSupport/Types.h"
00035 using namespace Teddy::Graphics;
00036 
00037 
00038 namespace Teddy              {
00039 namespace PhysicalComponents {
00040 
00041 
00043 class ActionButton : public EventListener, public Area {
00044 public:
00045     ActionButton( std::string name, Teddy::Signals::Functor0<bool> *f, const int type = Teddy::PhysicalComponents::Event::MouseButtonUpEvent_ID );
00046     ActionButton( std::string name, Teddy::Signals::Functor1<bool,const Event &> *f, const int type = Teddy::PhysicalComponents::Event::MouseButtonUpEvent_ID );
00047     ActionButton( std::string name, Teddy::Signals::Functor1<bool,void *> *f, void *data, const int type = Teddy::PhysicalComponents::Event::MouseButtonUpEvent_ID );
00048     virtual ~ActionButton();
00049 
00050     
00051     virtual void  event    ( const Event &e );
00052     virtual bool  doesEvent( int type );
00053 
00054     
00055     virtual void  drawSelf ();
00056 
00057 protected:
00058     std::string                                  label;
00059     int                                          v_type;
00060     int                                          e_type;
00061     int                                          d_type;
00062     Teddy::Signals::Holder0<bool>                v_holder;
00063     Teddy::Signals::Holder1<bool,const Event &>  e_holder;
00064     Teddy::Signals::Holder1<bool,void *>         d_holder;
00065     void                                        *d_data;
00066 };
00067 
00068 
00069 };  
00070 };  
00071 
00072 
00073 #endif  //  TEDDY__PHYSICAL_COMPONENTS__ACTION_BUTTON__H
00074