本文整理汇总了C++中CXTPToolBar::IsBuiltIn方法的典型用法代码示例。如果您正苦于以下问题:C++ CXTPToolBar::IsBuiltIn方法的具体用法?C++ CXTPToolBar::IsBuiltIn怎么用?C++ CXTPToolBar::IsBuiltIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CXTPToolBar
的用法示例。
在下文中一共展示了CXTPToolBar::IsBuiltIn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnResetToolbar
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();
}
示例2: OnRenameToolbar
void CXTPCustomizeToolbarsPage::OnRenameToolbar()
{
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;
CXTPNewToolbarDlg dlg(m_pSheet, pCommandBars, pToolBar);
if (dlg.DoModal() == IDOK)
{
pToolBar->SetTitle(dlg.m_strToolbar);
m_checkList.DeleteString(nIndex);
nIndex = m_checkList.InsertString(nIndex, pToolBar->GetTitle());
m_checkList.SetCheck(nIndex, pToolBar->IsVisible());
m_checkList.SetItemData(nIndex, i);
m_checkList.SetCurSel(nIndex);
}
}
示例3: OnDeleteToolbar
void CXTPCustomizeToolbarsPage::OnDeleteToolbar()
{
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;
CString strDelete;
CXTPResourceManager::AssertValid(XTPResourceManager()->LoadString(&strDelete, XTP_IDS_CONFIRM_DELETE));
strMessage.Format(strDelete, (LPCTSTR)pToolBar->GetTitle());
if (m_pSheet->MessageBox(strMessage, MB_ICONWARNING | MB_OKCANCEL) == IDOK)
{
pCommandBars->GetSite()->SendMessage(WM_XTP_CUSTOMIZATION_DELETETOOLBAR, 0, (LPARAM)pToolBar);
pCommandBars->Remove(pToolBar);
RefreshToolbarsList();
}
}
示例4: OnSelectionChanged
void CXTPCustomizeToolbarsPage::OnSelectionChanged()
{
int nIndex = m_checkList.GetCurSel();
if (nIndex != LB_ERR)
{
CXTPCommandBars* pCommandBars = m_pSheet->GetCommandBars();
int i = (int)m_checkList.GetItemData(nIndex);
if (i >= 0 && i < pCommandBars->GetCount())
{
CXTPToolBar* pToolBar = pCommandBars->GetAt(i);
BOOL bBuiltIn = pToolBar->IsBuiltIn();
m_btnReset.EnableWindow(bBuiltIn);
m_btnRename.EnableWindow(!bBuiltIn);
m_btnDelete.EnableWindow(!bBuiltIn);
}
}
else
{
m_btnReset.EnableWindow(FALSE);
m_btnRename.EnableWindow(FALSE);
m_btnDelete.EnableWindow(FALSE);
}
}