//*********************************************************************************************** void CBCGPRibbonGalleryCtrl::RecalcLayout() { if (GetSafeHwnd() == NULL) { return; } ASSERT_VALID(m_pPanel); m_pPanel->m_arElements.RemoveAll (); m_PaletteButton.RemoveAll(); m_PaletteButton.CreateIcons(); CArray<CBCGPBaseRibbonElement*, CBCGPBaseRibbonElement*> arButtons; m_PaletteButton.GetMenuItems (arButtons); for (int i = 0; i < arButtons.GetSize (); i++) { CBCGPBaseRibbonElement* pButton = arButtons [i]; ASSERT_VALID (pButton); m_pPanel->Add (pButton); } AdjustLocations(); }
//********************************************************************************** void CToolPalette::OnSize(UINT nType, int cx, int cy) { CBCGPBaseToolBar::OnSize (nType, cx, cy); if (IsCustomizeMode () && !m_bLocked) { OnCancelMode (); } if (!m_bInUpdateShadow) { AdjustLocations (); } }
//*********************************************************************************************** void CBCGPRibbonGalleryCtrl::RemoveAll(BOOL bRecalcLayout) { ASSERT_VALID(m_pPanel); const int nScrollButtons = m_PaletteButton.m_bIsComboMode ? 0 : 3; for (int i = 0; i < nScrollButtons; i++) { delete m_PaletteButton.m_arIcons[m_PaletteButton.m_arIcons.GetSize() - i - 1]; } m_pPanel->RemoveAll(); m_PaletteButton.m_arIcons.RemoveAll (); if (bRecalcLayout) { AdjustLocations(); } }