Example #1
0
        void InitSelectedTabControl(BackstageViewTabItem tab)
        {
            if (tab == null || tab.Tag == null)
            {
                return;
            }
            BackstageViewClientControl panel = tab.ContentControl;

            if (panel.Controls.Count > 0)
            {
                return;
            }

            string tag = tab.Tag.ToString();

            switch (tag)
            {
            case "外观设置":
                ucSkinSettings skinSettings = new ucSkinSettings();
                skinSettings.Dock = DockStyle.Fill;
                panel.Controls.Add(skinSettings);
                skinSettings.InitUI();
                break;
            }
        }
        void AddBackStageViewModule(ModuleType moduleType, BackstageViewTabItem tabItem)
        {
            ViewModel.BeforeReportShown(moduleType);
            tabItem.ContentControl.SuspendLayout();
            tabItem.ContentControl.Controls.Clear();
            var moduleControl = GetReportModule(moduleType);

            ViewModel.AfterReportShown(moduleType);
            moduleControl.Dock   = DockStyle.Fill;
            moduleControl.Parent = tabItem.ContentControl;
            tabItem.ContentControl.ResumeLayout();
        }
Example #3
0
        IOptions GetCurrentOption()
        {
            BackstageViewTabItem       tab   = optionsControl.SelectedTab;
            BackstageViewClientControl panel = tab.ContentControl;
            IOptions uc = null;

            if (panel.Controls.Count > 0)
            {
                uc = (IOptions)panel.Controls[0];
            }
            return(uc);
        }
Example #4
0
 private void CreateRecentItem()
 {
     {
         //// WinForms Controls > DevExpress.XtraBars.Ribbon > BackstageViewTabItem > SelectedChanged
         //// To get a selected tab item or select a tab item, use:
         //BackstageViewTabItem oo = this.backstageViewControl1.SelectedTab;
         //int oo = this.backstageViewControl1.SelectedTabIndex;
         //// BackstageViewTabItem.Selected - Allows you to select a specific tab item by using this Boolean property.
         //this.backstageViewControl1.SelectedTabChanged += this.BackstageViewControl1_SelectedTabChanged;
         {
             BackstageViewButtonItem o = new BackstageViewButtonItem()
             {
                 Caption = "New",
                 Glyph   = ImageResourceCache.Default.GetImage("office2013/actions/new_32x32.png")
             };
             this.backstageViewControl1.Items.Add(o);
         }
         this.backstageViewControl1.Items.Add(new BackstageViewItemSeparator());
         {
             BackstageViewButtonItem o = new BackstageViewButtonItem()
             {
                 Caption = "Open",
                 // Glyph = ImageResourceCache.Default.GetImage("office2013/actions/open_32x32.png"),
             };
             this.backstageViewControl1.Items.Add(o);
         }
         {
             this.rofBackstageViewTabItem = new BackstageViewTabItem()
             {
                 Caption = "Open Recent",
                 Name    = "Open Recent",
                 //Glyph = ImageResourceCache.Default.GetImage( "office2013/actions/open_32x32.png" )
             };
             this.backstageViewControl1.Items.Add(this.rofBackstageViewTabItem);
             OpenRecentXuc xuc = new OpenRecentXuc(this.appCfg, this.backstageViewControl1)
             {
                 Dock = DockStyle.Fill
             };
             this.rofBackstageViewTabItem.ContentControl.Controls.Add(xuc);
             xuc.ReOpenFile += this.OpenRecentXuc_ReOpenFile;
         }
         this.backstageViewControl1.Items.Add(new BackstageViewItemSeparator());
         {
             BackstageViewButtonItem o = new BackstageViewButtonItem()
             {
                 Caption = "Save",
                 //Glyph = ImageResourceCache.Default.GetImage("office2013/save/save_32x32.png")
             };
             this.backstageViewControl1.Items.Add(o);
         }
         {
             BackstageViewTabItem o = new BackstageViewTabItem()
             {
                 Caption = "Save As...",
                 //Glyph = ImageResourceCache.Default.GetImage("office2013/save/saveas_32x32.png")
             };
             this.backstageViewControl1.Items.Add(o);
         }
         this.backstageViewControl1.Items.Add(new BackstageViewItemSeparator());
         {
             BackstageViewButtonItem o = new BackstageViewButtonItem()
             {
                 Caption = nameof(Close),
                 //Glyph = ImageResourceCache.Default.GetImage( "office2013/actions/close_32x32.png" )
             };
             this.backstageViewControl1.Items.Add(o);
         }
         this.backstageViewControl1.Items.Add(new BackstageViewItemSeparator());
         {
             BackstageViewButtonItem o = new BackstageViewButtonItem()
             {
                 Caption = "Exit",
                 //Glyph = ImageResourceCache.Default.GetImage( "office2013/actions/close_32x32.png" )
             };
             this.backstageViewControl1.Items.Add(o);
         }
         this.backstageViewControl1.Items.Add(new BackstageViewItemSeparator());
         {
             BackstageViewTabItem o = new BackstageViewTabItem();
             o.Caption = "Export";
             SimpleButton btn = new SimpleButton();
             btn.Text     = "Export";
             btn.Location = new Point(10, 10);
             o.ContentControl.Controls.Add(btn);
             this.backstageViewControl1.Items.Add(o);
         }
         this.backstageViewControl1.Items.Insert(1, new BackstageViewItemSeparator());
     }
 }
Example #5
0
        private void InitBackstageViewTabItemAndCommand(DisplayMode displayMode)
        {
            backstageViewControl.Items.Clear();

            if (this.BackstageViewTabItems != null)
            {
                var list = BackstageViewTabItems.Where(p => p.Value.DisplayMode.In(displayMode, DisplayMode.All)).OrderBy(p => p.Value.Index);
                foreach (var item in list)
                {
                    item.Value.Init();

                    if (item.Value.BeginGroup)
                    {
                        BackstageViewItemSeparator sp = new BackstageViewItemSeparator();
                        backstageViewControl.Items.Add(sp);
                    }

                    BackstageViewTabItem tab = new BackstageViewTabItem();
                    tab.Caption = item.Value.Caption;
                    tab.ContentControl.Controls.Add(item.Value.View);
                    item.Value.View.Dock = DockStyle.Fill;
                    backstageViewControl.Items.Add(tab);

                    tab.Selected = item.Value.IsSelected;
                    tab.SelectedChanged += (sender, args) =>
                    {
                        item.Value.RefreshUI();
                    };
                }
            }

            if (this.BackstageViewCommands != null)
            {
                var list = BackstageViewCommands.Where(p => p.Value.DisplayMode.In(displayMode, DisplayMode.All)).OrderBy(p => p.Value.Index);
                foreach (var item in list)
                {
                    if (item.Value.BeginGroup)
                    {
                        BackstageViewItemSeparator sp = new BackstageViewItemSeparator();
                        backstageViewControl.Items.Add(sp);
                    }
                    BackstageViewButtonItem btn = new BackstageViewButtonItem();
                    btn.Caption = item.Value.Caption;
                    btn.Glyph = item.Value.m_Glyph;
                    btn.ItemClick += item.Value.ItemClick;
                    backstageViewControl.Items.Add(btn);
                }
            }
        }
Example #6
0
 void AddBackStageViewModule(ModuleType moduleType, BackstageViewTabItem tabItem) {
     ViewModel.BeforeReportShown(moduleType);
     tabItem.ContentControl.Controls.Clear();
     var moduleControl = GetReportModule(moduleType);
     ViewModel.AfterReportShown(moduleType);
     moduleControl.Dock = DockStyle.Fill;
     moduleControl.Parent = tabItem.ContentControl;
 }