本文整理汇总了C++中CDialog::DestroyWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ CDialog::DestroyWindow方法的具体用法?C++ CDialog::DestroyWindow怎么用?C++ CDialog::DestroyWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDialog
的用法示例。
在下文中一共展示了CDialog::DestroyWindow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CSubFormCollection::~CSubFormCollection()
{
// Free all sub forms on destruction
for (int i = 0; i <= m_Forms.GetUpperBound(); i++) {
CDialog* pDlg = m_Forms.GetAt(i);
pDlg->DestroyWindow();
delete pDlg;
}
}
示例2: GetItemCount
LRESULT CLabelListCtrl::OnP4EndSpecEdit( WPARAM wParam, LPARAM lParam )
{
CCmd_EditSpec *pCmd= (CCmd_EditSpec *) wParam;
int index;
if (lParam != IDCANCEL && lParam != IDABORT)
{
if (m_UpdateState == LIST_UPDATED)
{
if(m_NewLabel && FindInList(m_pNewSpec->GetLabelName()) == -1)
{
InsertLabel(m_pNewSpec, GetItemCount());
ReSort();
index= FindInList(m_pNewSpec->GetLabelName());
}
else
{
index= FindInList(m_pNewSpec->GetLabelName());
UpdateLabel(m_pNewSpec, index);
}
EnsureVisible(index, TRUE );
SetItemState(index, LVIS_SELECTED|LVIS_FOCUSED, LVIS_DROPHILITED|LVIS_SELECTED|LVIS_FOCUSED );
}
else
if ( m_pNewSpec ) delete m_pNewSpec;
}
else
if ( m_pNewSpec ) delete m_pNewSpec;
if (lParam != IDABORT)
{
MainFrame()->ClearStatus();
if (pCmd->HaveServerLock())
pCmd->ReleaseServerLock();
CDialog *dlg = (CDialog *)pCmd->GetSpecSheet();
dlg->DestroyWindow();
}
delete pCmd;
m_EditInProgress = FALSE;
return 0;
}
示例3: specOut
LRESULT CUserListCtrl::OnP4EndSpecEdit( WPARAM wParam, LPARAM lParam )
{
CCmd_EditSpec *pCmd= (CCmd_EditSpec *) wParam;
int i, j;
if (lParam != IDCANCEL && lParam != IDABORT)
{
if (m_UpdateState == LIST_UPDATED)
{
// we have to set 'index' again in case user's name got changed
int index = FindInList(m_pNewSpec->GetUserName());
if(index > -1 )
UpdateUser(m_pNewSpec, index);
else
{
InsertUser(m_pNewSpec, GetItemCount());
ReSort();
if( m_Active != m_olduser )
{
if (GET_P4REGPTR()->GetExpandFlag() == 1)
GET_P4REGPTR()->AddMRUPcuPath(MainFrame()->GetCurrentItemPath());
m_Active = m_olduser;
GET_P4REGPTR()->SetP4User( m_olduser, TRUE, FALSE, FALSE );
MainFrame()->UpdateCaption( ) ;
}
}
}
else
if ( m_pNewSpec ) delete m_pNewSpec;
CString specOut(pCmd->GetSpecOut());
if ((i = specOut.Find(_T("\n\nJobView:\t"))) != -1)
{
i += lstrlen(_T("\n\nJobView:\n"));
if ((j = specOut.Find(_T('\n'),i)) != -1)
{
// if JobView has changed, we have to refresh the changelists (and depot)
if (m_oldJobView != specOut.Mid(i, j-i))
MainFrame()->UpdateDepotandChangeViews(TRUE);
}
}
}
else
if ( m_pNewSpec ) delete m_pNewSpec;
if (lParam != IDABORT)
{
MainFrame()->ClearStatus();
if (pCmd->HaveServerLock())
pCmd->ReleaseServerLock();
CDialog *dlg = (CDialog *)pCmd->GetSpecSheet();
dlg->DestroyWindow();
}
if ((lParam == IDCANCEL) && pCmd->GetIsNewUser()) // if canceled, cleanup newly created user
{
m_Active = pCmd->GetItemName();
CString msg;
msg.FormatMessage ( IDS_DELETENEWUSER_s, m_Active );
// ask if they want to delete the newly created user
if( AfxMessageBox( msg, MB_YESNO|MB_ICONQUESTION ) == IDYES)
{
// fire off the delete of the newly created user
CCmd_Delete *pCmdDel = new CCmd_Delete;
pCmdDel->Init( m_hWnd, RUN_ASYNC );
pCmdDel->SetSwitch2User( m_olduser );
if( pCmdDel->Run( P4USER_DEL, m_Active ) )
MainFrame()->UpdateStatus( LoadStringResource(IDS_DELETING) );
else
delete pCmdDel;
}
else
{
OnViewUpdate();
}
}
delete pCmd;
m_EditInProgress = FALSE;
return 0;
}
示例4: if
//.........这里部分代码省略.........
if (MainFrame()->IsClientFilteredOut(m_pNewSpec)) // should it no longer be shown?
{
need2Refresh = TRUE;
delete m_pNewSpec;
}
else
{
UpdateClient(m_pNewSpec, index);
UpdateClientAll(m_pNewSpec, ixAll);
}
}
else // not in visible list; is in list of all
{
if (MainFrame()->IsClientFilteredOut(m_pNewSpec)) // should it now be shown?
need2Refresh = TRUE;
else
UpdateClientAll(m_pNewSpec, ixAll);
if (pCmd->IsAutoUpdateSpec())
m_OldClient = m_pNewSpec->GetClientName();
delete m_pNewSpec;
bDeld = TRUE;
}
ReSort();
if (pCmd->IsAutoUpdateSpec() || pCmd->IsSpecForceSwitch())
{
if (bDeld)
need2Refresh = TRUE;
else
{
int i = FindInList(m_OldClient = m_pNewSpec->GetClientName());
if (i < 0)
i = 0;
SetItemState(i, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
EnsureVisible(i, FALSE);
}
m_Active = _T("@"); // force switch to new client
}
}
else
if ( m_pNewSpec ) delete m_pNewSpec;
int key= pCmd->HaveServerLock() ? pCmd->GetServerKey() : 0;
if( m_Active == m_saveclientnew ) // active-client == saved new client name
m_OldClient = m_saveclientnew; // means they decided to edit the current client
if( m_Active != m_OldClient ) // If current client is not now the client when this
{ // all started, switch to the new current client
if (GET_P4REGPTR()->GetExpandFlag() == 1)
GET_P4REGPTR()->AddMRUPcuPath(MainFrame()->GetCurrentItemPath());
m_Active = m_OldClient;
GET_P4REGPTR()->SetP4Client( m_Active, TRUE, FALSE, FALSE);
MainFrame()->UpdateCaption( );
if (syncAfter)
chainedCommand = SyncAfter(key, syncAfter);
}
else if( syncAfter || GET_P4REGPTR()->GetClearAndReload()
|| AfxMessageBox(IDS_YOU_HAVE_UPDATED_YOUR_CLIENT_WORKSPACE__CLEAR_AND_RELOAD,
MB_YESNO |MB_ICONQUESTION ) == IDYES )
{
if (syncAfter)
chainedCommand = SyncAfter(key, syncAfter);
else
{
int key= pCmd->HaveServerLock() ? pCmd->GetServerKey() : 0;
MainFrame()->UpdateDepotandChangeViews(REDRILL, key);
chainedCommand=TRUE;
}
}
if (GET_SERVERLEVEL() >= 22)
TheApp()->Set_m_ClientSubOpts(TheApp()->GetClientSpecField( _T("SubmitOptions"), pCmd->GetSpecOut()));
}
else
{
if ( m_pNewSpec )
delete m_pNewSpec;
if (lParam == IDCANCEL && pCmd->GetIsRequestingNew())
{
m_Active = pCmd->GetOldClient(); // switch back to the previous client
GET_P4REGPTR()->SetP4Client( m_Active, TRUE, FALSE, FALSE);
MainFrame()->UpdateCaption( );
}
}
if (lParam != IDABORT)
{
MainFrame()->ClearStatus();
if (!chainedCommand && pCmd->HaveServerLock())
pCmd->ReleaseServerLock();
CDialog *dlg = (CDialog *)pCmd->GetSpecSheet();
dlg->DestroyWindow();
}
delete pCmd;
m_EditInProgress = FALSE;
if (need2Refresh && !chainedCommand)
OnViewUpdate();
if (TheApp()->m_RunClientWizOnly && !chainedCommand)
::PostMessage(MainFrame()->m_hWnd, WM_COMMAND, ID_APP_EXIT, 0);
return 0;
}