Beispiel #1
0
        private void CreateQatToolbar()
        {
            m_QatToolbar = new Ribbon.QatToolbar();
            m_QatToolbar.FadeEffect = m_RibbonStrip.FadeEffect;
            m_QatToolbar.Style = this.Style;

            //if (this.Style == eDotNetBarStyle.Office2007)
            //{
            //    RibbonPredefinedColorSchemes.ApplyOffice2007ColorScheme(m_QatToolbar);
            //}
            //else
            //{
            //    m_QatToolbar.BackgroundStyle.ApplyStyle(this.BackgroundStyle);
            //}
            m_QatToolbar.Dock = DockStyle.Bottom;
            this.Controls.Add(m_QatToolbar);
            if (!this.Expanded)
                m_QatToolbar.BringToFront();
        }
Beispiel #2
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);
        }