Esempio n. 1
0
        // initialize main menu
        void InitApplicationMenu()
        {
            // initialize menu
            RibbonApplicationMenu menu = this.ApplicationMenu;

            menu.DropDownWidth     = 370;
            menu.AllowImageScaling = false;
            menu.SmallImage        = Resources.AppMenuArrow;
            menu.Appearance        = AppMenuAppearance.WholeForm;
            menu.DropDown         += Menu_DropDown;

            // left menu items
            RibbonItemCollection items = menu.LeftPaneItems;

            items.ClearAndDisposeItems();
            items.Add(CreateButton("New"));
            items.Add(CreateTab("OpenTab"));
            ((AppMenuTabs.OpenTab)((RibbonAppMenuTab)items["OpenTab"]).Control).RibbonApplicationMenu = menu;
            items.Add(CreateButton("Save"));
            items["Save"].SmallImage = null;
            items.Add(CreateTab("SaveAsTab"));
            ((AppMenuTabs.SaveAsTab)((RibbonAppMenuTab)items["SaveAsTab"]).Control).RibbonApplicationMenu = menu;
            items.Add(new RibbonSeparator());
            items.Add(CreateTab("PrintTab"));

            _printTab                 = (AppMenuTabs.PrintTab)((RibbonAppMenuTab)items["PrintTab"]).Control;
            _printTab.Ribbon          = this;
            _printTab.VisibleChanged += _printTab_VisibleChanged;

            //items.Add(CreateSplitButton("Print",
            //    CreateHeaderLabel("PreviewAndPrint"),
            //    CreateButton("Print"),
            //    CreateButton("QuickPrint"),
            //    CreateButton("PrintPreview")));
            items.Add(CreateButton("ExportPdf"));
            items.Add(new RibbonSeparator());
            items.Add(CreateButton("Exit"));

            _mruOpened = new RecentDocumentList(Settings.Default.OpenedFiles);
            _mruSaved  = new RecentDocumentList(Settings.Default.SavedFiles);
        }