00001
00032 #ifndef LL_RESIZEHANDLE_H
00033 #define LL_RESIZEHANDLE_H
00034
00035 #include "stdtypes.h"
00036 #include "llview.h"
00037 #include "llimagegl.h"
00038 #include "llcoord.h"
00039
00040
00041 class LLResizeHandle : public LLView
00042 {
00043 public:
00044 enum ECorner { LEFT_TOP, LEFT_BOTTOM, RIGHT_TOP, RIGHT_BOTTOM };
00045
00046
00047 LLResizeHandle(const LLString& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM );
00048
00049 virtual EWidgetType getWidgetType() const;
00050 virtual LLString getWidgetTag() const;
00051
00052 virtual void draw();
00053 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
00054 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
00055 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
00056
00057 void setResizeLimits( S32 min_width, S32 min_height ) { mMinWidth = min_width; mMinHeight = min_height; }
00058
00059 protected:
00060 BOOL pointInHandle( S32 x, S32 y );
00061
00062 protected:
00063 S32 mDragLastScreenX;
00064 S32 mDragLastScreenY;
00065 S32 mLastMouseScreenX;
00066 S32 mLastMouseScreenY;
00067 LLCoordGL mLastMouseDir;
00068 LLPointer<LLImageGL> mImage;
00069 S32 mMinWidth;
00070 S32 mMinHeight;
00071 ECorner mCorner;
00072 };
00073
00074 const S32 RESIZE_HANDLE_HEIGHT = 16;
00075 const S32 RESIZE_HANDLE_WIDTH = 16;
00076
00077 #endif // LL_RESIZEHANDLE_H
00078
00079