Beispiel #1
0
        RibbonListItem AppendListItem(RibbonItemCollection ribbonItems, int num, string path)
        {
            var rli = new C1.Win.Ribbon.RibbonListItem();

            var sb = new StringBuilder();

            if (num < 10)
            {
                sb.Append('&').Append(num).Append("  ");
            }
            else
            {
                sb.Append(num).Append(' ');
            }
            sb.Append(Path.GetFileNameWithoutExtension(path));
            rli.Items.Add(new RibbonLabel(sb.ToString()));

            var delButton = new C1.Win.Ribbon.RibbonButton();

            if (num < 10)
            {
                delButton.KeyTip = "Y" + num.ToString();
            }
            delButton.SelectableInListItem = true;
            delButton.SmallImage           = Properties.Resources.Delete16x16;
            delButton.ToolTip = "Remove from list";
            delButton.Click  += new System.EventHandler(this.DelButton_Click);
            rli.Items.Add(delButton);

            ribbonItems.Add(rli);

            rli.ToolTip = path;
            rli.Click  += RibbonListItem_Click;
            return(rli);
        }
Beispiel #2
0
        void BuildAppMenu()
        {
            var appMenu = fv.Ribbon.ApplicationMenu;

            appMenu.Visible       = true;
            appMenu.KeyTip        = "Q";
            appMenu.SmallImage    = Properties.Resources.Menu;
            appMenu.DropDownWidth = 420;
            appMenu.DropDown     += AppMenu_DropDown;

            var btn = new RibbonButton();

            btn.SmallImage = Properties.Resources.Open16x16;
            btn.LargeImage = Properties.Resources.Open32x32;
            btn.Text       = "Open";
            btn.Click     += OpenButton_Click;
            appMenu.LeftPaneItems.Add(btn);

            _exportButton            = new RibbonButton();
            _exportButton.Enabled    = false;
            _exportButton.SmallImage = Properties.Resources.Export16x16;
            _exportButton.LargeImage = Properties.Resources.Export32x32;
            _exportButton.Text       = "Export";
            new ButtonActionElement(fv, _exportButton, FlexViewerAction.Export);
            appMenu.LeftPaneItems.Add(_exportButton);

            appMenu.LeftPaneItems.Add(new RibbonSeparator());

            _printButton            = new RibbonButton();
            _printButton.Enabled    = false;
            _printButton.SmallImage = Properties.Resources.Print16x16;
            _printButton.LargeImage = Properties.Resources.Print32x32;
            _printButton.Text       = "Print";
            new ButtonActionElement(fv, _printButton, FlexViewerAction.Print);
            appMenu.LeftPaneItems.Add(_printButton);

            _pageSetupButton            = new RibbonButton();
            _pageSetupButton.Enabled    = false;
            _pageSetupButton.SmallImage = Properties.Resources.PageSetup16x16;
            _pageSetupButton.LargeImage = Properties.Resources.PageSetup32x32;
            _pageSetupButton.Text       = "Page Setup";
            new ButtonActionElement(fv, _pageSetupButton, FlexViewerAction.PageSetup);
            appMenu.LeftPaneItems.Add(_pageSetupButton);

            appMenu.LeftPaneItems.Add(new RibbonSeparator());

            _closeButton            = new RibbonButton();
            _closeButton.Enabled    = false;
            _closeButton.SmallImage = Properties.Resources.Close16x16;
            _closeButton.LargeImage = Properties.Resources.Close32x32;
            _closeButton.Text       = "Close";
            _closeButton.Click     += CloseButton_Click;
            appMenu.LeftPaneItems.Add(_closeButton);

            appMenu.LeftPaneItems.Add(new RibbonSeparator());

            btn            = new RibbonButton();
            btn.SmallImage = Properties.Resources.Exit16x16;
            btn.LargeImage = Properties.Resources.Exit32x32;
            btn.Text       = "Exit";
            btn.Click     += ExitButton_Click;
            appMenu.LeftPaneItems.Add(btn);

            var rli = new C1.Win.Ribbon.RibbonListItem();

            rli.AllowSelection = false;
            rli.Items.Add(new RibbonLabel("Recent Documents"));
            appMenu.RightPaneItems.Add(rli);

            _registerLabel = new RibbonLabel();
            rli            = new C1.Win.Ribbon.RibbonListItem();
            rli.Items.Add(_registerLabel);
            rli.Click += RegisterButton_Click;
            appMenu.RightPaneItems.Add(rli);

            rli = new C1.Win.Ribbon.RibbonListItem();
            rli.AllowSelection = false;
            rli.Items.Add(new RibbonSeparator());
            appMenu.RightPaneItems.Add(rli);

            _reportsCombo                   = new RibbonComboBox();
            _reportsCombo.Enabled           = false;
            _reportsCombo.GripHandleVisible = true;
            _reportsCombo.KeyTip            = "G";
            _reportsCombo.Label             = " Select report: ";
            _reportsCombo.TextAreaWidth     = 170;
            _reportsCombo.MaxDropDownItems  = 12;
            _reportsCombo.DropDownStyle     = RibbonComboBoxStyle.DropDownList;
            _reportsCombo.ChangeCommitted  += ReportsCombo_SelectedIndexChanged;

            var ti = fv.Ribbon.TopToolBar.Items;

            ti.Insert(ti.Count - 2, _reportsCombo);
            fv.Ribbon.Qat.Visible = false;

            _themeColorMenu      = new RibbonMenu();
            _themeColorMenu.Text = "&Colors";
            fv.StatusBar.RightPaneItems.Insert(0, new RibbonSeparator());
            fv.StatusBar.RightPaneItems.Insert(0, _themeColorMenu);

            var coll = _themeColorMenu.Items;

            AddThemeColor(coll, ThemeColor.Azure);
            AddThemeColor(coll, ThemeColor.Blue);
            AddThemeColor(coll, ThemeColor.Green);
            AddThemeColor(coll, ThemeColor.Orange);
            AddThemeColor(coll, ThemeColor.Orchid);
            AddThemeColor(coll, ThemeColor.Red);
            AddThemeColor(coll, ThemeColor.Teal);
            AddThemeColor(coll, ThemeColor.Violet);
            var tb = (RibbonToggleButton)coll[0];

            tb.Pressed = true;
            tb.PressedButtonChanged += PreviewForm_PressedButtonChanged;

            fv.ZoomMode       = FlexViewerZoomMode.PageWidth;
            fv.ShowParameters = true;
        }