本文整理汇总了C++中Panel::RequestInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::RequestInfo方法的具体用法?C++ Panel::RequestInfo怎么用?C++ Panel::RequestInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::RequestInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseReleased
//-----------------------------------------------------------------------------
// Purpose:
// Input : code -
//-----------------------------------------------------------------------------
void CBuddyButton::OnMouseReleased(vgui::MouseCode code)
{
if (m_bDragging)
{
// make sure we're over a valid panel
VPanel *imouseOver = input()->GetMouseOver();
if (imouseOver)
{
Panel *mouseOver = ipanel()->Client(imouseOver)->GetPanel();
KeyValues *keyVal = new KeyValues("DragDrop", "type", "TrackerFriend");
keyVal->SetInt("friendID", m_iBuddyID);
if (mouseOver->RequestInfo(keyVal))
{
Panel *acceptPanel = (Panel *)keyVal->GetPtr("AcceptPanel");
if (acceptPanel)
{
PostMessage(acceptPanel, keyVal);
keyVal = NULL;
}
}
if (keyVal)
{
keyVal->deleteThis();
}
}
input()->SetMouseCapture(NULL);
}
m_bDragging = false;
BaseClass::OnMouseReleased(code);
}
示例2: GetControlInt
//-----------------------------------------------------------------------------
// Purpose: Shortcut function to get data in child controls
//-----------------------------------------------------------------------------
int EditablePanel::GetControlInt(const char *controlName, int defaultState)
{
Panel *control = FindChildByName(controlName);
if (control)
{
KeyValues &data = *(new KeyValues("GetState"));
if (control->RequestInfo(&data))
{
return data.GetInt("state", defaultState);
}
}
return defaultState;
}
示例3: GetControlInt
//-----------------------------------------------------------------------------
// Purpose: Shortcut function to get data in child controls
//-----------------------------------------------------------------------------
int EditablePanel::GetControlInt(const char *controlName, int defaultState)
{
Panel *control = FindChildByName(controlName);
if (control)
{
KeyValues *data = new KeyValues("GetState");
if (control->RequestInfo(data))
{
int state = data->GetInt("state", defaultState);
data->deleteThis();
return state;
}
}
return defaultState;
}
示例4: GetControlString
//-----------------------------------------------------------------------------
// Purpose: Shortcut function to get data in child controls
//-----------------------------------------------------------------------------
void EditablePanel::GetControlString(const char *controlName, char *buf, int bufSize, const char *defaultString)
{
Panel *control = FindChildByName(controlName);
KeyValues *data = new KeyValues("GetText");
if (control && control->RequestInfo(data))
{
strncpy(buf, data->GetString("text", defaultString), bufSize - 1);
}
else
{
// no value found, copy in default text
strncpy(buf, defaultString, bufSize - 1);
}
// ensure null termination of string
buf[bufSize - 1] = 0;
// free
data->deleteThis();
}