void CXTPCustomizeToolbarsPage::OnResetToolbar() { int nIndex = m_checkList.GetCurSel(); if (nIndex == LB_ERR) return; CXTPCommandBars* pCommandBars = m_pSheet->GetCommandBars(); int i = (int)m_checkList.GetItemData(nIndex); if (i < 0 || i >= pCommandBars->GetCount()) return; CXTPToolBar* pToolBar = pCommandBars->GetAt(i); if (!pToolBar->IsBuiltIn()) return; CString strMessage, strTitle = pToolBar->GetTitle(), strReset; CXTPResourceManager::AssertValid(XTPResourceManager()->LoadString(&strReset, XTP_IDS_CONFIRM_RESET)); strMessage.Format(strReset, (LPCTSTR)strTitle); if (m_pSheet->MessageBox(strMessage, MB_ICONWARNING | MB_OKCANCEL) != IDOK) return; pToolBar->Reset(FALSE); RefreshToolbarsList(); }
void CXTPCustomizeMenusPage::OnButtonResetAppMenu() { CXTPToolBar* pMenuBar = m_pSheet->GetCommandBars()->GetMenuBar(); pMenuBar->Reset(TRUE); }