本文整理汇总了C++中LLUICtrl::setFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ LLUICtrl::setFocus方法的具体用法?C++ LLUICtrl::setFocus怎么用?C++ LLUICtrl::setFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLUICtrl
的用法示例。
在下文中一共展示了LLUICtrl::setFocus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: focusLastItem
BOOL LLUICtrl::focusLastItem(BOOL prefer_text_fields)
{
// search for text field first
if(prefer_text_fields)
{
LLCtrlQuery query = getTabOrderQuery();
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
child_list_t result = query(this);
if(result.size() > 0)
{
LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
gFocusMgr.triggerFocusFlash();
}
return TRUE;
}
}
// no text field found, or we don't care about text fields
child_list_t result = getTabOrderQuery().run(this);
if(result.size() > 0)
{
LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
gFocusMgr.triggerFocusFlash();
}
return TRUE;
}
return FALSE;
}
示例2: focusFirstItem
BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash)
{
LLFastTimer _(FTM_FOCUS_FIRST_ITEM);
// try to select default tab group child
LLCtrlQuery query = getTabOrderQuery();
// sort things such that the default tab group is at the front
query.setSorter(DefaultTabGroupFirstSorter::getInstance());
child_list_t result = query(this);
if(result.size() > 0)
{
LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.front());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
if(focus_flash)
{
gFocusMgr.triggerFocusFlash();
}
}
return TRUE;
}
// search for text field first
if(prefer_text_fields)
{
LLCtrlQuery query = getTabOrderQuery();
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
child_list_t result = query(this);
if(result.size() > 0)
{
LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.front());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
gFocusMgr.triggerFocusFlash();
}
return TRUE;
}
}
// no text field found, or we don't care about text fields
result = getTabOrderQuery().run(this);
if(result.size() > 0)
{
LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.front());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
gFocusMgr.triggerFocusFlash();
}
return TRUE;
}
return FALSE;
}
示例3: setFocus
void LLPanel::setFocus(BOOL b)
{
if( b )
{
if (!gFocusMgr.childHasKeyboardFocus(this))
{
//refresh();
if (!focusFirstItem())
{
LLUICtrl::setFocus(TRUE);
}
onFocusReceived();
}
}
else
{
if( this == gFocusMgr.getKeyboardFocus() )
{
gFocusMgr.setKeyboardFocus( NULL );
}
else
{
//RN: why is this here?
LLView::ctrl_list_t ctrls = getCtrlList();
for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
{
LLUICtrl* ctrl = *ctrl_it;
ctrl->setFocus( FALSE );
}
}
}
}
示例4: childSetFocus
void LLPanel::childSetFocus(const std::string& id, BOOL focus)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
{
child->setFocus(focus);
}
}
示例5: clearCtrls
// virtual
void LLPanel::clearCtrls()
{
LLView::ctrl_list_t ctrls = getCtrlList();
for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
{
LLUICtrl* ctrl = *ctrl_it;
ctrl->setFocus( FALSE );
ctrl->setEnabled( FALSE );
ctrl->clear();
}
}
示例6: onAccordionTabRightClick
void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id)
{
LLAccordionCtrlTab* tab = dynamic_cast<LLAccordionCtrlTab*>(ctrl);
if(mOutfitMenu && is_tab_header_clicked(tab, y) && cat_id.notNull())
{
// Focus tab header to trigger tab selection change.
LLUICtrl* header = tab->findChild<LLUICtrl>("dd_header");
if (header)
{
header->setFocus(TRUE);
}
uuid_vec_t selected_uuids;
selected_uuids.push_back(cat_id);
mOutfitMenu->show(ctrl, selected_uuids, x, y);
}
}