本文整理汇总了C++中LLComboBox::onCommit方法的典型用法代码示例。如果您正苦于以下问题:C++ LLComboBox::onCommit方法的具体用法?C++ LLComboBox::onCommit怎么用?C++ LLComboBox::onCommit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLComboBox
的用法示例。
在下文中一共展示了LLComboBox::onCommit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onItemSelected
// static
void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata)
{
// Note: item is the LLScrollListCtrl
LLComboBox *self = (LLComboBox *) userdata;
const std::string name = self->mList->getSelectedItemLabel();
S32 cur_id = self->getCurrentIndex();
if (cur_id != -1)
{
self->setLabel(name);
if (self->mAllowTextEntry)
{
gFocusMgr.setKeyboardFocus(self->mTextEntry);
self->mTextEntry->selectAll();
}
}
// hiding the list reasserts the old value stored in the text editor/dropdown button
self->hideList();
// commit does the reverse, asserting the value in the list
self->onCommit();
}
示例2: onTextCommit
//static
void LLComboBox::onTextCommit(LLUICtrl* caller, void* user_data)
{
LLComboBox* self = (LLComboBox*)user_data;
std::string text = self->mTextEntry->getText();
self->setSimple(text);
self->onCommit();
self->mTextEntry->selectAll();
}