diff options
author | Merov Linden <merov@lindenlab.com> | 2011-10-05 11:18:17 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-10-05 11:18:17 -0700 |
commit | 3b3a13707309eb4b7d6ed5d309081c99e5f28eca (patch) | |
tree | 3103294452ad16bcd18b79c78db00b5e5a2dea8b /indra/llui/lltoolbar.h | |
parent | daae211fe3e2d1da3623951b1166473c53ce5808 (diff) |
EXP-1286 : DaD is functional though has bugs... Working on it...
Diffstat (limited to 'indra/llui/lltoolbar.h')
-rw-r--r-- | indra/llui/lltoolbar.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 10e5f49c0f..ddf2e048b6 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -35,9 +35,11 @@ #include "llcommandmanager.h" #include "llassettype.h" -typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> startdrag_callback_t; -typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> handledrag_callback_t; -typedef boost::function<BOOL (EDragAndDropType type, void* data, const LLUUID& uuid)> handledrop_callback_t; +class LLToolBar; + +typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> tool_startdrag_callback_t; +typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t; +typedef boost::function<BOOL (void* data, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t; class LLToolBarButton : public LLButton { @@ -63,8 +65,8 @@ public: BOOL handleHover(S32 x, S32 y, MASK mask); void setCommandId(const LLCommandId& id) { mId = id; } - void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } - void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } + void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } + void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } private: LLCommandId mId; S32 mMouseDownX; @@ -72,10 +74,9 @@ private: S32 mMinWidth; S32 mMaxWidth; S32 mDesiredHeight; - bool mIsDragged; - startdrag_callback_t mStartDragItemCallback; - handledrag_callback_t mHandleDragItemCallback; - LLUUID mUUID; + bool mIsDragged; + tool_startdrag_callback_t mStartDragItemCallback; + tool_handledrag_callback_t mHandleDragItemCallback; }; @@ -146,6 +147,7 @@ public: // virtuals void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + int getRankFromPosition(S32 x, S32 y); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, @@ -153,12 +155,13 @@ public: EAcceptance* accept, std::string& tooltip_msg); - bool addCommand(const LLCommandId& commandId); + bool addCommand(const LLCommandId& commandId, int rank = -1); + bool removeCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); - void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } - void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } - void setHandleDropCallback(handledrop_callback_t cb) { mHandleDropCallback = cb; } + void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } + void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } + void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; } LLToolBarButton* createButton(const LLCommandId& id); @@ -168,10 +171,10 @@ protected: ~LLToolBar(); void initFromParams(const Params&); - startdrag_callback_t mStartDragItemCallback; - handledrag_callback_t mHandleDragItemCallback; - handledrop_callback_t mHandleDropCallback; - bool mDragAndDropTarget; + tool_startdrag_callback_t mStartDragItemCallback; + tool_handledrag_callback_t mHandleDragItemCallback; + tool_handledrop_callback_t mHandleDropCallback; + bool mDragAndDropTarget; public: // Methods used in loading and saving toolbar settings @@ -188,7 +191,6 @@ private: BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); - LLUUID mUUID; const bool mReadOnly; std::list<LLToolBarButton*> mButtons; |