//******************************************************************************** void CButtonAppearanceDlg::OnImageList() { CBCGPToolbarButton* pSelButton = m_wndButtonList.GetSelectedButton (); m_iSelImage = (pSelButton == NULL) ? -1 : pSelButton->GetImage (); m_wndEditImage.EnableWindow (m_iSelImage >= 0 && m_pImages != NULL && !m_pImages->IsReadOnly ()); }
//**************************************************************************************** void CBCGPDropDownToolbarButton::SetDefaultCommand (UINT uiCmd) { ASSERT_VALID (m_pToolBar); m_nID = uiCmd; //------------------ // Find image index: //------------------ int iImage = 0; m_iSelectedImage = -1; for (int i = 0; i < m_pToolBar->GetCount (); i ++) { CBCGPToolbarButton* pButton = m_pToolBar->GetButton (i); ASSERT_VALID (pButton); if (pButton->m_nStyle & TBBS_SEPARATOR) { continue; } if (pButton->m_nID == uiCmd) { m_bLocalUserButton = pButton->m_bUserButton; m_strSelectedText = pButton->m_strText; if (m_bLocalUserButton) { m_iSelectedImage = pButton->GetImage(); } else { m_iSelectedImage = iImage; } break; } iImage ++; } if (m_iSelectedImage == -1) { ASSERT (FALSE); m_iSelectedImage = 0; } }
//*************************************************************************************************************** void CBCGPRibbonItemDlg::OnImageList() { CBCGPToolbarButton* pSelButton = m_wndImageList.GetSelectedButton (); m_iSelImage = (pSelButton == NULL) ? -1 : pSelButton->GetImage (); }