本文整理汇总了C++中LLView::getChildList方法的典型用法代码示例。如果您正苦于以下问题:C++ LLView::getChildList方法的具体用法?C++ LLView::getChildList怎么用?C++ LLView::getChildList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLView
的用法示例。
在下文中一共展示了LLView::getChildList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasDirtyChilds
bool LLPanelPreferenceGraphics::hasDirtyChilds()
{
std::list<LLView*> view_stack;
view_stack.push_back(this);
while(!view_stack.empty())
{
// Process view on top of the stack
LLView* curview = view_stack.front();
view_stack.pop_front();
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
{
if(ctrl->isDirty())
return true;
}
// Push children onto the end of the work stack
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
iter != curview->getChildList()->end(); ++iter)
{
view_stack.push_back(*iter);
}
}
return false;
}
示例2: saveSettings
void LLPanelPreference::saveSettings()
{
// Save the value of all controls in the hierarchy
mSavedValues.clear();
std::list<LLView*> view_stack;
view_stack.push_back(this);
while(!view_stack.empty())
{
// Process view on top of the stack
LLView* curview = view_stack.front();
view_stack.pop_front();
LLColorSwatchCtrl* color_swatch = dynamic_cast<LLColorSwatchCtrl *>(curview);
if (color_swatch)
{
mSavedColors[color_swatch->getName()] = color_swatch->get();
}
else
{
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
{
LLControlVariable* control = ctrl->getControlVariable();
if (control)
{
mSavedValues[control] = control->getValue();
}
}
}
// Push children onto the end of the work stack
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
iter != curview->getChildList()->end(); ++iter)
{
view_stack.push_back(*iter);
}
}
}
示例3:
void LLFloaterEditUI::navigateHierarchyButtonPressed(void* data)
{
LLView* view = LLView::sEditingUIView;
if( !view ) return;
LLView* parent = view->getParent();
if(!parent)
{
return ;
}
const LLView::child_list_t* viewChildren = view->getChildList();
const LLView::child_list_t* parentChildren = parent->getChildList();
//LLView::child_list_t::iterator
std::list<LLView*>::const_iterator itor;
std::list<LLView*>::size_type idx;
std::list<LLView*>::size_type sidx;
for(idx = 0,itor = parentChildren->begin();itor!=parentChildren->end();itor++,idx++){
if((*itor)==view)break;
}
switch((intptr_t)data)
{
case 0 ://up
view = view->getParent();
break;
case 1 ://down
view = viewChildren->begin()!=viewChildren->end() ? (*viewChildren->begin()) : NULL;
break;
case 2 ://left
{
if(idx==0)
idx = parentChildren->size()-1;
else
idx--;
if( (long) idx < 0 || idx >= parentChildren->size())break;
for(sidx = 0,itor = parentChildren->begin();itor!=parentChildren->end();itor++,sidx++){
if(sidx == idx)
{
view = (*itor);
break;
}
}
}
break;
case 3 ://right
{
if(idx==parentChildren->size()-1)
idx = 0;
else
idx++;
if( (long) idx < 0 || idx >= parentChildren->size())break;
for(sidx = 0,itor = parentChildren->begin();itor!=parentChildren->end();itor++,sidx++){
if(sidx == idx)
{
view = (*itor);
break;
}
}
}
break;
}
if (view)
{
sEditingUIView = view;
sInstance->refresh();
}
}