本文整理汇总了C++中vgui::DHANDLE::MarkForDeletion方法的典型用法代码示例。如果您正苦于以下问题:C++ DHANDLE::MarkForDeletion方法的具体用法?C++ DHANDLE::MarkForDeletion怎么用?C++ DHANDLE::MarkForDeletion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vgui::DHANDLE
的用法示例。
在下文中一共展示了DHANDLE::MarkForDeletion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Detach
//-----------------------------------------------------------------------------
// main application
//-----------------------------------------------------------------------------
void CVsVGuiWindow::Detach()
{
if ( m_hTimerCallbackId != 0 )
{
MTimerMessage::removeCallback( m_hTimerCallbackId );
m_hTimerCallbackId = 0;
}
if ( m_hMainPanel.Get() )
{
m_hMainPanel->MarkForDeletion();
m_hMainPanel = NULL;
}
if ( m_hVGuiContext != vgui::DEFAULT_VGUI_CONTEXT )
{
vgui::ivgui()->DestroyContext( m_hVGuiContext );
m_hVGuiContext = vgui::DEFAULT_VGUI_CONTEXT;
}
// detach
if ( m_hWnd )
{
// kill the timer if any
g_pMaterialSystem->RemoveView( m_hWnd );
RemoveWindowSubclass( m_hWnd, SubclassCallback, s_subclassId );
m_hWnd = NULL;
}
if ( m_hKeyFocusWnd )
{
RemoveWindowSubclass( m_hKeyFocusWnd, KeyFocusSubclassCallback, s_subclassId );
m_hKeyFocusWnd = NULL;
}
}
示例2:
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
Tooltip::~Tooltip()
{
if (--s_iTooltipWindowCount < 1)
{
if ( s_TooltipWindow.Get() )
{
s_TooltipWindow->MarkForDeletion();
}
s_TooltipWindow = NULL;
}
}
示例3: OnFileSelected
void CBaseActionPlaySoundStartDialog::OnFileSelected( char const *fullpath )
{
if ( !fullpath || !fullpath[ 0 ] )
return;
char relativepath[ 512 ];
g_pFileSystem->FullPathToRelativePath( fullpath, relativepath );
COM_FixSlashes( relativepath );
char *soundname = relativepath;
if ( !Q_strnicmp( relativepath, "sound\\", strlen( "sound\\" ) ) )
{
soundname += strlen( "sound\\" );
}
m_pSoundName->SetText( soundname );
if ( m_hFileOpenDialog )
{
m_hFileOpenDialog->MarkForDeletion();
}
}
示例4: ImageButton
CASW_VGUI_Info_Message::CASW_VGUI_Info_Message( vgui::Panel *pParent, const char *pElementName, C_ASW_Info_Message* pMessage )
: vgui::Panel( pParent, pElementName ),
CASW_VGUI_Ingame_Panel()
{
//input->MouseEvent(0, false); // unclick all our mouse buttons when this panel pops up (so firing doesn't get stuck on)
if (g_hCurrentInfoPanel.Get())
{
g_hCurrentInfoPanel->MarkForDeletion();
g_hCurrentInfoPanel->SetVisible(false);
}
g_hCurrentInfoPanel = this;
m_hMessage = pMessage;
for (int i=0;i<4;i++)
{
m_pLine[i] = new vgui::WrappedLabel(this, "InfoMessageLabel", "");
m_pLine[i]->SetContentAlignment(vgui::Label::a_northwest);
m_pLine[i]->SetMouseInputEnabled(false);
}
m_pOkayButton = new ImageButton(this, "OkayButton", "#asw_close");
m_pOkayButton->AddActionSignalTarget(this);
KeyValues *msg = new KeyValues("Command");
msg->SetString("command", "OkayButton");
m_pOkayButton->SetCommand(msg);
m_pMessageImage = new vgui::ImagePanel(this, "MessageImage");
m_pMessageImage->SetVisible(false);
m_pMessageImage->SetShouldScaleImage(true);
m_szImageName[0] = '\0';
if (ShouldAddLogButton())
{
m_pLogButton = new ImageButton(this, "LogButton", "#asw_message_log");
m_pLogButton->AddActionSignalTarget(this);
KeyValues *msg = new KeyValues("Command");
msg->SetString("command", "MessageLog");
m_pLogButton->SetCommand(msg);
}
else
{
Msg(" so not adding it\n");
m_pLogButton = NULL;
}
// find use key bind
char lkeybuffer[12];
Q_snprintf(lkeybuffer, sizeof(lkeybuffer), "%s", ASW_FindKeyBoundTo("+use"));
Q_strupr(lkeybuffer);
// copy the found key into wchar_t format (localize it if it's a token rather than a normal keyname)
wchar_t keybuffer[24];
if (lkeybuffer[0] == '#')
{
const wchar_t *pLocal = g_pVGuiLocalize->Find(lkeybuffer);
if (pLocal)
wcsncpy(keybuffer, pLocal, 24);
else
g_pVGuiLocalize->ConvertANSIToUnicode(lkeybuffer, keybuffer, sizeof(keybuffer));
}
else
g_pVGuiLocalize->ConvertANSIToUnicode(lkeybuffer, keybuffer, sizeof(keybuffer));
// look up close text localised
const wchar_t *pLocal = g_pVGuiLocalize->Find("#asw_close");
if (pLocal)
{
// join use key and close text together
wchar_t buffer[ 256 ];
g_pVGuiLocalize->ConstructString( buffer, sizeof(buffer), g_pVGuiLocalize->Find("#asw_use_icon_format"), 2, keybuffer, pLocal );
// set label
m_pOkayButton->SetText(buffer);
}
if (GetControllerFocus())
{
GetControllerFocus()->AddToFocusList(m_pOkayButton);
GetControllerFocus()->SetFocusPanel(m_pOkayButton);
if (m_pLogButton)
{
GetControllerFocus()->AddToFocusList(m_pLogButton);
}
}
m_bClosingMessage = false;
CLocalPlayerFilter filter;
// check for a special sound in the info message
const char *pszSound = pMessage ? pMessage->GetSound() : NULL;
if (pszSound && Q_strlen(pszSound) > 0)
{
StopInfoMessageSound();
EmitSound_t ep;
ep.m_pSoundName = pszSound;
ep.m_flVolume = 1.0f;
ep.m_nPitch = PITCH_NORM;
ep.m_SoundLevel = SNDLVL_NONE;
ep.m_nChannel = CHAN_STATIC;
//.........这里部分代码省略.........