00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00023 #ifndef INCLUDE_TRACK_BUTTON_H
00024 #define INCLUDE_TRACK_BUTTON_H
00025 
00026 #include "control.h"
00027 
00028 class EventTrackButton
00029 {
00030 public:
00031         signal0<> rotate; 
00032         signal1<double> resize; 
00033         signal1<double> translate; 
00034 };
00035 
00041 class TrackButton : public Control
00042 {
00043 private:
00044         void ApplyMode();
00045         void Config(int (TrackButton::*onClickFace)(StateMouse *,int),Texture *texture,double angleZ);
00046         BOOL canResize;
00047         BOOL canRotate;
00048         BOOL isMoving;
00049 
00050 public:
00051         
00052         DockPos orientation;            
00053         
00054         EventTrackButton onTrackButton;
00055 
00056         TrackButton();
00057         ~TrackButton();
00058 
00059         virtual void Create() { Create(DEFAULT_SIZE_TRACK_BUTTON); } 
00060         BOOL Create(double size);
00061         void ToString(MyString &str);
00062 
00063         void SetMode(DockPos newOrientation);
00064         void SetResizeAndRotate(BOOL resize,BOOL rotate);
00065 
00066 
00067         int OnButtonClick();
00068         int OnMouseMove(StateMouse *mouse,int deltaX,int deltaY,int face);
00069         int OnOverOut(Control *newControl,int face);
00070 
00071         int OnClickLeft(StateMouse *,int);
00072         int OnClickRight(StateMouse *,int);
00073         int OnClickTop(StateMouse *,int);
00074         int OnClickBottom(StateMouse *,int);
00075         int OnClickLeftTop(StateMouse *,int);
00076         int OnClickLeftBottom(StateMouse *,int);
00077         int OnClickRightTop(StateMouse *,int);
00078         int OnClickRightBottom(StateMouse *,int);
00079 };
00080 
00081 #endif