Example #1
0
        internal static void Add(WorkItem workItem, XtraTabbedMdiWorkspace mdiManager)
        {
            RibbonPageGroup ribbonGroup = new RibbonPageGroup(ExtensionSiteNames.RibbonWindows);

            workItem.UIExtensionSites[ExtensionSiteNames.MainMenu].Add <RibbonPageGroup>(ribbonGroup);
            workItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonWindows, ribbonGroup);

            windowMenuHelper.MdiWorkSpace = mdiManager;
            //windowMenuHelper.Shell = shell;

            AddAllRibbonItems(workItem);
        }
Example #2
0
        public WindowMenu(Bar bar, XtraTabbedMdiWorkspace mdiManager, WorkItem rootWorkItem)
        {
            this.bar        = bar;
            this.mdiManager = mdiManager;
            //this.shell = shell;
            this.rootWorkItem = rootWorkItem;
            Manager           = bar.Manager;
            menuHelper        = new WindowMenuHelper(mdiManager);

            Caption = "Window";
            AddAllMenuItems();
        }
        // This method is called just after your shell has been created (the root work item
        // also exists). Here, you might want to:
        //   - Attach UIElementManagers
        //   - Register the form with a name.
        //   - Register additional workspaces (e.g. a named WindowWorkspace)
        protected override void AfterShellCreated()
        {
            base.AfterShellCreated();

            XtraTabbedMdiWorkspace ContentWorkspace = new XtraTabbedMdiWorkspace(Shell);

            RootWorkItem.Items.Add(ContentWorkspace, WorkspaceNames.ShellContentWorkspace);

            //RootWorkItem.Items.Add(new MdiWorkspace(Shell), WorkspaceNames.ShellContentWorkspace);
            RootWorkItem.Items.Add(Shell.NavBarWorkspace, WorkspaceNames.ShellNavBarWorkspace);
            RootWorkItem.Items.Add(Shell.DockManagerWorkspace, WorkspaceNames.DockManagerWorkspace);
            RootWorkItem.Items.Add(Shell.DeckWorkspace, WorkspaceNames.DeckWorkspace);
            RootWorkItem.Workspaces[WorkspaceNames.ShellContentWorkspace].SmartPartActivated += BankShellApplication_SmartPartActivated;
            RootWorkItem.Workspaces[WorkspaceNames.ShellContentWorkspace].SmartPartClosing   += BankShellApplication_SmartPartClosing;
#if UseRibbonForm
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.Ribbon, Shell.Ribbon);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.MainMenu, Shell.homePage);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.MainStatus, Shell.mainStatusBar);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonApplicationMenu, new
                                                       RibbonApplicationMenuUIAdapter(Shell.applicationMenu));

            RibbonPageGroup ribbonGroup = new RibbonPageGroup(ExtensionSiteNames.File);
            RootWorkItem.UIExtensionSites[ExtensionSiteNames.MainMenu].Add <RibbonPageGroup>(ribbonGroup);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.File, ribbonGroup);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonPageHeader, new
                                                       RibbonPageHeaderUIAdapter(Shell.Ribbon.PageHeaderItemLinks));
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonQuickAccessToolbar, new
                                                       RibbonQuickAccessToolbarUIAdapter(Shell.Ribbon.Toolbar));
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonAppMenuBottomPane, new
                                                       RibbonAppMenuBottomPaneSimpleButtonUIAdapter(RootWorkItem, Shell.applicationMenu));

            BankTellerRibbonSkins.Add(RootWorkItem);
            //BankTellerRibbonWindows.Add(RootWorkItem, Shell.xtraTabbedMdiManager, Shell);
            BankTellerRibbonWindows.Add(RootWorkItem, ContentWorkspace);
#else
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.MainMenu, Shell.mainMenuBar);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.MainStatus, Shell.mainStatusBar);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.FileDropDown, Shell.barSubItemFile);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.File, new BarItemWrapper(Shell.mainMenuBar.ItemLinks, Shell.barSubItemFile));
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.SkinsToolBar, Shell.skinsBar);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.ToolBar, Shell.mainBar);
            RootWorkItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.WindowToolBar, Shell.windowToolBar);

            // There are two ways to add skins to the BankTeller demo.
            // 1) SkinMenu: Bypasses the CAB framework and directly adds and
            //    manipulates the menu items. The SkinMenu is standard .NET
            //    functionality and is more efficient and easier to understand.
            // 2) BankTellerDynamicSkins: Uses the event broker to handle both the
            //    menu Popup event and the handling of the menu item click. This
            //    allows both dynamic menu item creation as well as more adherence
            //    to the CAB decoupled philosophy. It does not provide any
            //    additional functionality.
            //
            // SkinMenu and BankTellerDynamicSkins are functionally equivalent.
            // The two methods give the developer a choice on how closely to
            // follow the CAB philosophy.
            //
            // To change between the two swap the comments on the following two
            // lines of code. The two lines can also both be uncommented and two
            // working skin menus will appear.
            RootWorkItem.UIExtensionSites[ExtensionSiteNames.MainMenu].Add(new SkinMenu(Shell.mainMenuBar));
            //BankTellerDynamicSkins.Skins.AddSkins(RootWorkItem);
            RootWorkItem.UIExtensionSites[ExtensionSiteNames.MainMenu].Add(new WindowMenu(Shell.mainMenuBar, ContentWorkspace, RootWorkItem));
#endif
            UIElementBuilder.LoadFromConfig(RootWorkItem);
        }
Example #4
0
 internal WindowMenuHelper(XtraTabbedMdiWorkspace mdiManager)
 {
     mdiWorkspace = mdiManager;
     //Shell = shell;
 }