Eliminated most instances of the legacy setCallbackUserData (and modernized up a bunch of callbacks)
Also cleaned up slfloatermediafilter to act as a proper singleton. Removes childSetUserData entirely.
This commit is contained in:
@@ -3869,16 +3869,14 @@ LLScrollColumnHeader::LLScrollColumnHeader(const std::string& label, const LLRec
|
||||
mHasResizableElement(FALSE)
|
||||
{
|
||||
mListPosition = LLComboBox::ABOVE;
|
||||
setCommitCallback(onSelectSort);
|
||||
setCallbackUserData(this);
|
||||
setCommitCallback(boost::bind(&LLScrollColumnHeader::onSelectSort, this));
|
||||
mButton->setTabStop(FALSE);
|
||||
// require at least two frames between mouse down and mouse up event to capture intentional "hold" not just bad framerate
|
||||
mButton->setHeldDownDelay(LLUI::sConfigGroup->getF32("ColumnHeaderDropDownDelay"), 2);
|
||||
mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::onHeldDown, this));
|
||||
mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::showList, this));
|
||||
mButton->setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this));
|
||||
mButton->setMouseDownCallback(boost::bind(&LLScrollColumnHeader::onMouseDown, this));
|
||||
|
||||
mButton->setCallbackUserData(this);
|
||||
mButton->setToolTip(label);
|
||||
|
||||
mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate
|
||||
@@ -4037,7 +4035,7 @@ BOOL LLScrollColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask)
|
||||
}
|
||||
else
|
||||
{
|
||||
onClick(this);
|
||||
onClick();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -4065,42 +4063,29 @@ void LLScrollColumnHeader::setImageOverlay(const std::string &image_name, LLFont
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onClick(void* user_data)
|
||||
void LLScrollColumnHeader::onClick()
|
||||
{
|
||||
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
|
||||
if (!headerp) return;
|
||||
if (!mColumn) return;
|
||||
|
||||
LLScrollListColumn* column = headerp->mColumn;
|
||||
if (!column) return;
|
||||
|
||||
if (headerp->mList->getVisible())
|
||||
if (mList->getVisible())
|
||||
{
|
||||
headerp->hideList();
|
||||
hideList();
|
||||
}
|
||||
|
||||
LLScrollListCtrl::onClickColumn(column);
|
||||
LLScrollListCtrl::onClickColumn(mColumn);
|
||||
|
||||
// propagate new sort order to sort order list
|
||||
headerp->mList->selectNthItem(column->mParentCtrl->getSortAscending() ? 0 : 1);
|
||||
mList->selectNthItem(mColumn->mParentCtrl->getSortAscending() ? 0 : 1);
|
||||
|
||||
headerp->mList->setFocus(TRUE);
|
||||
mList->setFocus(TRUE);
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onMouseDown(void* user_data)
|
||||
void LLScrollColumnHeader::onMouseDown()
|
||||
{
|
||||
// for now, do nothing but block the normal showList() behavior
|
||||
return;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onHeldDown(void* user_data)
|
||||
{
|
||||
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
|
||||
headerp->showList();
|
||||
}
|
||||
|
||||
void LLScrollColumnHeader::showList()
|
||||
{
|
||||
if (mShowSortOptions)
|
||||
@@ -4183,30 +4168,25 @@ void LLScrollColumnHeader::showList()
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLScrollColumnHeader::onSelectSort(LLUICtrl* ctrl, void* user_data)
|
||||
void LLScrollColumnHeader::onSelectSort()
|
||||
{
|
||||
LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data;
|
||||
if (!headerp) return;
|
||||
|
||||
LLScrollListColumn* column = headerp->mColumn;
|
||||
if (!column) return;
|
||||
LLScrollListCtrl *parent = column->mParentCtrl;
|
||||
if (!mColumn) return;
|
||||
LLScrollListCtrl* parent = mColumn->mParentCtrl;
|
||||
if (!parent) return;
|
||||
|
||||
if (headerp->getCurrentIndex() == 0)
|
||||
if (getCurrentIndex() == 0)
|
||||
{
|
||||
// ascending
|
||||
parent->sortByColumn(column->mSortingColumn, TRUE);
|
||||
parent->sortByColumn(mColumn->mSortingColumn, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// descending
|
||||
parent->sortByColumn(column->mSortingColumn, FALSE);
|
||||
parent->sortByColumn(mColumn->mSortingColumn, FALSE);
|
||||
}
|
||||
|
||||
// restore original column header
|
||||
headerp->setLabel(headerp->mOrigLabel);
|
||||
setLabel(mOrigLabel);
|
||||
}
|
||||
|
||||
LLView* LLScrollColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding)
|
||||
|
||||
Reference in New Issue
Block a user