本文整理汇总了C++中GuiControl::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiControl::getId方法的具体用法?C++ GuiControl::getId怎么用?C++ GuiControl::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiControl
的用法示例。
在下文中一共展示了GuiControl::getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: constructEditControl
GuiControl* GuiInspectorDatablockField::constructEditControl()
{
GuiControl* retCtrl = new GuiPopUpMenuCtrl();
// If we couldn't construct the control, bail!
if( retCtrl == NULL )
return retCtrl;
GuiPopUpMenuCtrl *menu = dynamic_cast<GuiPopUpMenuCtrl*>(retCtrl);
// Let's make it look pretty.
retCtrl->setDataField( StringTable->insert("profile"), NULL, "InspectorTypeEnumProfile" );
menu->setField("text", getData());
_registerEditControl( retCtrl );
// Configure it to update our value when the popup is closed
char szBuffer[512];
dSprintf( szBuffer, 512, "%d.apply(%d.getText());%d.inspect(%d);",getId(), retCtrl->getId(),mParent->mParent->getId(), mTarget->getId() );
//dSprintf( szBuffer, 512, "%d.%s = %d.getText();%d.inspect(%d);",mTarget->getId(), getFieldName(), menu->getId(), mParent->mParent->getId(), mTarget->getId() );
menu->setField("Command", szBuffer );
Vector<StringTableEntry> entries;
SimDataBlockGroup * grp = Sim::getDataBlockGroup();
for(SimDataBlockGroup::iterator i = grp->begin(); i != grp->end(); i++)
{
SimDataBlock * datablock = dynamic_cast<SimDataBlock*>(*i);
// Skip non-datablocks if we somehow encounter them.
if(!datablock)
continue;
// Ok, now we have to figure inheritance info.
if( datablock && datablock->getClassRep()->isClass(mDesiredClass) )
entries.push_back(datablock->getName());
}
// sort the entries
dQsort(entries.address(), entries.size(), sizeof(StringTableEntry), stringCompare);
// add them to our enum
for(U32 j = 0; j < entries.size(); j++)
menu->addEntry(entries[j], 0);
return retCtrl;
}
示例2: constructEditControl
GuiControl* GuiInspectorField::constructEditControl()
{
GuiControl* retCtrl = new GuiTextEditCtrl();
static StringTableEntry sProfile = StringTable->insert( "profile" );
retCtrl->setDataField( sProfile, NULL, "GuiInspectorTextEditProfile" );
_registerEditControl( retCtrl );
char szBuffer[512];
dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() );
// Suffices to hook on to "validate" as regardless of whether we lose
// focus through the user pressing enter or clicking away on another
// keyboard control, we will see a validate call.
retCtrl->setField("validate", szBuffer );
return retCtrl;
}