本文整理汇总了C++中Panel::AddActionSignalTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::AddActionSignalTarget方法的具体用法?C++ Panel::AddActionSignalTarget怎么用?C++ Panel::AddActionSignalTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::AddActionSignalTarget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
//-----------------------------------------------------------------------------
// Purpose: Create a new control in the context panel
// Input: name: class name of control to create
// controlKeys: keyvalues of settings for the panel.
// name OR controlKeys should be set, not both.
// x,y position relative to base panel
// Output: Panel *newPanel, NULL if failed to create new control.
//-----------------------------------------------------------------------------
Panel *BuildGroup::NewControl( const char *name, int x, int y)
{
Assert (name);
Panel *newPanel = NULL;
// returns NULL on failure
newPanel = static_cast<EditablePanel *>(m_pParentPanel)->CreateControlByName(name);
if (newPanel)
{
// panel successfully created
newPanel->SetParent(m_pParentPanel);
newPanel->SetBuildGroup(this);
newPanel->SetPos(x, y);
char newFieldName[255];
GetNewFieldName(newFieldName, sizeof(newFieldName), newPanel);
newPanel->SetName(newFieldName);
newPanel->AddActionSignalTarget(m_pParentPanel);
newPanel->SetBuildModeEditable(true);
newPanel->SetBuildModeDeletable(true);
// make sure it gets freed
newPanel->SetAutoDelete(true);
}
return newPanel;
}
示例2: OnChildAdded
//-----------------------------------------------------------------------------
// Purpose: Called when a child is added to the panel.
//-----------------------------------------------------------------------------
void EditablePanel::OnChildAdded(VPANEL child)
{
BaseClass::OnChildAdded(child);
Panel *panel = ipanel()->GetPanel(child, GetModuleName());
panel->SetBuildGroup(_buildGroup);
panel->AddActionSignalTarget(this);
}
示例3: OnChildAdded
//-----------------------------------------------------------------------------
// Purpose: Called when a child is added to the panel.
//-----------------------------------------------------------------------------
void EditablePanel::OnChildAdded(VPANEL child)
{
BaseClass::OnChildAdded(child);
// add only if we're in the same module
Panel *panel = ipanel()->GetPanel(child, GetModuleName());
if (panel)
{
panel->SetBuildGroup(_buildGroup);
panel->AddActionSignalTarget(this);
}
}
示例4: KeyValues
//-----------------------------------------------------------------------------
// Purpose: Create a new control in the context panel
// Input: controlKeys: keyvalues of settings for the panel only works when applying initial settings.
// Output: Panel *newPanel, NULL if failed to create new control.
//-----------------------------------------------------------------------------
Panel *BuildGroup::NewControl( KeyValues *controlKeys, int x, int y)
{
Assert (controlKeys);
Panel *newPanel = nullptr;
if (controlKeys)
{
// Warning( "Creating new control \"%s\" of type \"%s\"\n", controlKeys->GetString( "fieldName" ), controlKeys->GetString( "ControlName" ) );
KeyValues *keyVal = new KeyValues("ControlFactory", "ControlName", controlKeys->GetString("ControlName"));
m_pBuildContext->RequestInfo(keyVal);
// returns NULL on failure
newPanel = (Panel *)keyVal->GetPtr("PanelPtr");
keyVal->deleteThis();
}
else
{
return nullptr;
}
if (newPanel)
{
// panel successfully created
newPanel->SetParent(m_pParentPanel);
newPanel->SetBuildGroup(this);
newPanel->SetPos(x, y);
newPanel->SetName(controlKeys->GetName()); // name before applysettings :)
newPanel->ApplySettings(controlKeys);
newPanel->AddActionSignalTarget(m_pParentPanel);
newPanel->SetBuildModeEditable(true);
newPanel->SetBuildModeDeletable(true);
// make sure it gets freed
newPanel->SetAutoDelete(true);
}
return newPanel;
}