diff --git a/indra/newview/piemenu.cpp b/indra/newview/piemenu.cpp index 4dcc8b8887..37ef565c70 100644 --- a/indra/newview/piemenu.cpp +++ b/indra/newview/piemenu.cpp @@ -107,6 +107,18 @@ void PieMenu::removeChild(LLView* child) reshape(PIE_OUTER_SIZE*2,PIE_OUTER_SIZE*2,FALSE); } +void PieMenu::childSetText(const std::string& sliceName,const std::string& newText) +{ + for(slice_list_t::iterator item_iter=mSlices->begin();item_iter!=mSlices->end();item_iter++) + { + if((*item_iter)->getName()==sliceName) + { + static_cast(*item_iter)->setLabel(newText); + return; + } + } +} + BOOL PieMenu::handleHover(S32 x,S32 y,MASK mask) { // do nothing diff --git a/indra/newview/piemenu.h b/indra/newview/piemenu.h index c480c9be9d..e6d36bb292 100644 --- a/indra/newview/piemenu.h +++ b/indra/newview/piemenu.h @@ -60,6 +60,9 @@ class PieMenu : public LLContextMenu /*virtual*/ bool addChild(LLView* child,S32 tab_group=0); /*virtual*/ void removeChild(LLView* child); + // rename pie slice, used for touch and sit text + void childSetText(const std::string& sliceName,const std::string& newText); + /*virtual*/ BOOL handleHover(S32 x,S32 y,MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x,S32 y,MASK mask); /*virtual*/ BOOL handleRightMouseUp(S32 x,S32 y,MASK mask); diff --git a/indra/newview/pieslice.cpp b/indra/newview/pieslice.cpp index a4e7bb9f4b..b960c8dc04 100644 --- a/indra/newview/pieslice.cpp +++ b/indra/newview/pieslice.cpp @@ -113,11 +113,29 @@ void PieSlice::updateVisible() } // accessor -std::string PieSlice::getLabel() +LLSD PieSlice::getValue() const +{ + return getLabel(); +} + +// accessor +void PieSlice::setValue(const LLSD& value) +{ + setLabel(value.asString()); +} + +// accessor +std::string PieSlice::getLabel() const { return mLabel; } +// accessor +void PieSlice::setLabel(const std::string newLabel) +{ + mLabel=newLabel; +} + // accessor BOOL PieSlice::getStartAutohide() { diff --git a/indra/newview/pieslice.h b/indra/newview/pieslice.h index ce012428d0..ea8a236519 100644 --- a/indra/newview/pieslice.h +++ b/indra/newview/pieslice.h @@ -65,8 +65,12 @@ class PieSlice : public LLUICtrl // initialisation, taking care of optional parameters and setting up the callback void initFromParams(const Params& p); - // accessor to expose the label to the outside - std::string getLabel(); + // accessor to expose the label to the outside (value is the same as label) + std::string getLabel() const; + void setLabel(const std::string newLabel); + LLSD getValue() const; + void setValue(const LLSD& value); + // accessor to expose the autohide feature BOOL getStartAutohide(); BOOL getAutohide();