コード例 #1
0
        internal void QuickAccessToolbarChangePlacement()
        {
            m_RibbonStrip.ClosePopups();
            if (m_QatPositionedBelow)
            {
                m_QatToolbar.ClosePopups();
                m_QatToolbar.Visible = false;
                ArrayList qatItems = new ArrayList(m_QatToolbar.Items.Count);
                m_QatToolbar.Items.CopyTo(qatItems);
                m_QatToolbar.Items.Clear();

                foreach (BaseItem item in qatItems)
                    m_RibbonStrip.CaptionContainerItem.SubItems.Add(item);
                if (m_QatSubItemsCollection != null)
                {
                    m_QatSubItemsCollection._Clear();
                    m_QatSubItemsCollection = null;
                }
                this.DockPadding.Bottom = DefaultBottomDockPadding;
                m_QatPositionedBelow = false;
                m_RibbonStrip.RecalcLayout();
                if (m_AutoSize)
                    this.AutoSyncSize();
                else
                    this.Height -= (m_QatToolbar.Height + m_QatToolbar.DockPadding.Top);
                m_QatToolbar.Dispose();
                m_QatToolbar = null;
            }
            else
            {
                if (m_QatToolbar == null)
                    CreateQatToolbar();
                this.DockPadding.Bottom = 1;
                m_QatToolbar.BeginUpdate();
                ArrayList qatItems = GetQatItems(true);
                foreach (BaseItem item in qatItems)
                {
                    this.QuickToolbarItems.Remove(item);
                    m_QatToolbar.Items.Add(item);
                }
                m_QatToolbar.EndUpdate();
                m_QatToolbar.Height = m_QatToolbar.GetAutoSizeHeight();
                m_QatPositionedBelow = true;
                if (m_AutoSize)
                    this.AutoSyncSize();
                else
                    this.Height += (m_QatToolbar.Height + m_QatToolbar.DockPadding.Top);
            }
            this.RecalcLayout();
            m_QatLayoutChanged = true;
            OnQatPlacementChanged(EventArgs.Empty);
        }
コード例 #2
0
        private SubItemsCollection GetQatSubItemsCollection()
        {
            if (m_QatPositionedBelow)
            {
                if (m_QatSubItemsCollection == null)
                {
                    m_QatSubItemsCollection = new Ribbon.SubItemsQatCollection(m_QatToolbar);
                    BaseItem startButton = GetApplicationButton();
                    if (startButton != null)
                        m_QatSubItemsCollection._Add(startButton);
                    foreach (BaseItem item in m_QatToolbar.Items)
                        m_QatSubItemsCollection._Add(item);
                }

                return m_QatSubItemsCollection;
            }
            else
                return m_RibbonStrip.QuickToolbarItems;
        }