Пример #1
0
        /// <summary>
        /// Setup a panel with the tabbed view
        /// </summary>
        /// <param name="rpc"></param>

        void SetupTabbedPanel(
            DockPanel dp)
        {
            dp.Options.AllowFloating      = false;
            dp.Options.FloatOnDblClick    = false;
            dp.Options.ShowMaximizeButton = false;
            dp.Options.ShowAutoHideButton = false;
            dp.Options.ShowCloseButton    = false;

            dp.Tabbed = true;             // tabbed view

            ButtonCollection chbs = dp.CustomHeaderButtons;

            chbs.Clear();

            CustomHeaderButton chb = new CustomHeaderButton             // add close button
                                         ("", null, 2, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Close", false, -1, true, null, true, false, true, null, null, "Close", -1);

            chbs.Add(chb);

            chb = new CustomHeaderButton             // add restore button
                      ("", null, 1, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Restore", false, -1, true, null, true, false, true, null, null, "Restore", -1);
            chbs.Add(chb);

            dp.CustomButtonClick += new ButtonEventHandler(TabDockPanel_CustomButtonClick);

            return;
        }
Пример #2
0
        /// <summary>
        /// SetupDockPanel
        /// </summary>
        /// <param name="dp"></param>
        /// <param name="view"></param>

        void SetupDockPanel(
            DockPanel dp,
            ResultsViewProps view,
            XtraPanel viewPanel)
        {
            dp.Options.AllowFloating      = false;
            dp.Options.FloatOnDblClick    = false;
            dp.Options.ShowMaximizeButton = false;
            dp.Options.ShowAutoHideButton = false;
            dp.Options.ShowCloseButton    = false;

            ButtonCollection chbs = dp.CustomHeaderButtons;

            chbs.Clear();

            CustomHeaderButton chb = new CustomHeaderButton             // add close button
                                         ("", null, 2, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Close", false, -1, true, null, true, false, true, null, null, "Close", -1);

            chbs.Add(chb);

            chb = new CustomHeaderButton             // add maximize button
                      ("", null, 0, HorizontalImageLocation.Default, ButtonStyle.PushButton, "Maximize", false, -1, true, null, true, false, true, null, null, "Maximize", -1);
            chbs.Add(chb);

            dp.CustomButtonClick += new ButtonEventHandler(ViewDockPanel_CustomButtonClick);
            dp.Enter             += new EventHandler(ViewDockPanel_Enter);                // when dock panel is selected
            dp.Leave             += new EventHandler(ViewDockPanel_Leave);                // when dock panel loses focus
            dp.VisibilityChanged += new VisibilityChangedEventHandler(ViewDockPanel_VisibilityChanged);
            dp.ClosedPanel       += new DockPanelEventHandler(ViewDockPanel_ClosedPanel); // when dock panel is closed
            dp.MouseClick        += new MouseEventHandler(ViewDockPanel_Click);

            dp.Tag = view;             // link the dockpanel to the view

            dp.Text = view.Title;      // set the view title

            int vi = view.GetViewIndex();

            if (dp.Text == "")
            {
                dp.Text = "View " + (vi + 1);
            }
            dp.Name = dp.Text;

            dp.ControlContainer.Controls.Add(viewPanel);             // put the view panel in the dock panel

            return;
        }