00001
00032 #ifndef LL_RESIZEBAR_H
00033 #define LL_RESIZEBAR_H
00034
00035 #include "llview.h"
00036 #include "llcoord.h"
00037
00038 class LLResizeBar : public LLView
00039 {
00040 public:
00041 enum Side { LEFT, TOP, RIGHT, BOTTOM };
00042
00043 LLResizeBar(const LLString& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side );
00044
00045
00046 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
00047 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
00048 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
00049 virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
00050
00051 void setResizeLimits( S32 min_size, S32 max_size ) { mMinSize = min_size; mMaxSize = max_size; }
00052 void setEnableSnapping(BOOL enable) { mSnappingEnabled = enable; }
00053 void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; }
00054
00055 private:
00056 S32 mDragLastScreenX;
00057 S32 mDragLastScreenY;
00058 S32 mLastMouseScreenX;
00059 S32 mLastMouseScreenY;
00060 LLCoordGL mLastMouseDir;
00061 S32 mMinSize;
00062 S32 mMaxSize;
00063 const Side mSide;
00064 BOOL mSnappingEnabled;
00065 BOOL mAllowDoubleClickSnapping;
00066 LLView* mResizingView;
00067 };
00068
00069 #endif // LL_RESIZEBAR_H
00070
00071