Fixed touch/sit texts on pie menu. Fixes FIRE-1540, FIRE-1372 (partly)

meow-7.2.2
ziree 2011-09-17 16:58:57 +02:00
parent cb0f31aa72
commit 04a84c8d15
4 changed files with 40 additions and 3 deletions

View File

@ -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<PieSlice*>(*item_iter)->setLabel(newText);
return;
}
}
}
BOOL PieMenu::handleHover(S32 x,S32 y,MASK mask)
{
// do nothing

View File

@ -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);

View File

@ -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()
{

View File

@ -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();