當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.Ribbon類代碼示例

本文整理匯總了C#中System.Windows.Forms.Ribbon的典型用法代碼示例。如果您正苦於以下問題:C# Ribbon類的具體用法?C# Ribbon怎麽用?C# Ribbon使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Ribbon類屬於System.Windows.Forms命名空間,在下文中一共展示了Ribbon類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Init

        public void Init(HashTableSettings gSettings, Ribbon mainRibbon)
        {
            ribbon = mainRibbon;

            devSettings = (bool)gSettings["DeveloperMode"];

            appDir = Application.StartupPath + "\\";
            globalSettings = gSettings;

            // load recent files
            if (File.Exists(appDir + "recentFiles.xml"))
            {
                recentFiles = RecentFiles.LoadFromFile(appDir + "recentFiles.xml");
                recentFiles.ClearDeadEntires();
            }
            else
                recentFiles = new RecentFiles();

            RebuildRecentFilesMenu();

            baseDir = /*(string)gSettings["Base.Path"];*/Path.GetFullPath(ConfigurationManager.AppSettings[(devSettings ? "[email protected]" : "") + "Base.Path.Relative"].Replace("%STARTUP%", Application.StartupPath));
            if (!Directory.Exists(baseDir))
                throw new ApplicationException("Base directory does not exist! : " + baseDir);

            cdi = ICommonDeviceInterface.NewInterface((byte)globalSettings["CDI.Adapter"], baseDir);
            cdi.ResourceLoader.RegisterContentLoader(new LayerContentLoader());
            cdi.ResourceLoader.RegisterContentLoader(new BooScriptContentLoader());

            ShowHideGroups(false);
        }
開發者ID:xuchuansheng,項目名稱:GenXSource,代碼行數:30,代碼來源:MdiWindow.cs

示例2: RibbonTabGlyph

 public RibbonTabGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
    : base(new RibbonTabGlyphBehavior(designer, ribbon))
 {
    _behaviorService = behaviorService;
    _componentDesigner = designer;
    _ribbon = ribbon;
 }
開發者ID:shintadono,項目名稱:System.Windows.Forms.Ribbon,代碼行數:7,代碼來源:RibbonTabGlyph.cs

示例3: RibbonQuickAccessToolbarGlyph

 public RibbonQuickAccessToolbarGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
     : base(new RibbonQuickAccessGlyphBehavior(designer, ribbon))
 {
     _behaviorService = behaviorService;
     _componentDesigner = designer;
     _ribbon = ribbon;
 }
開發者ID:daywrite,項目名稱:EApp,代碼行數:7,代碼來源:RibbonQuickAccessToolbarGlyph.cs

示例4: RibbonDropDown

 internal RibbonDropDown(
     RibbonItem parentItem,
     IEnumerable<RibbonItem> items,
     Ribbon ownerRibbon)
     : this(parentItem, items, ownerRibbon, RibbonElementSizeMode.DropDown)
 {
 }
開發者ID:okyereadugyamfi,項目名稱:softlogik,代碼行數:7,代碼來源:RibbonDropDown.cs

示例5: RibbonOrbDropDown

		internal RibbonOrbDropDown(Ribbon ribbon)
			: base()
		{
			DoubleBuffered = true;
			_ribbon = ribbon;
			_menuItems = new RibbonItemCollection();
			_recentItems = new RibbonItemCollection();
			_optionItems = new RibbonItemCollection();

			_menuItems.SetOwner(Ribbon);
			_recentItems.SetOwner(Ribbon);
			_optionItems.SetOwner(Ribbon);

			_optionsPadding = 6;
			Size = new System.Drawing.Size(527, 447);
			BorderRoundness = 8;

         AutoSizeContentButtons = DefaultAutoSizeContentButtons;
         ContentButtonsMinWidth = DefaultContentButtonsMinWidth;
         ContentRecentItemsMinWidth = DefaultContentRecentItemsMinWidth;

			//if (!(Site != null && Site.DesignMode))
			//{
			//   _keyboardHook = new GlobalHook(GlobalHook.HookTypes.Keyboard);
			//   _keyboardHook.KeyUp += new KeyEventHandler(_keyboardHook_KeyUp);
			//}
		}
開發者ID:samuraitruong,項目名稱:comitdownloader,代碼行數:27,代碼來源:RibbonOrbDropDown.cs

示例6: RibbonMouseSensor

 /// <summary>
 /// Creates a new Sensor for specified objects
 /// </summary>
 /// <param name="control">Control to listen mouse events</param>
 /// <param name="ribbon">Ribbon that will be affected</param>
 /// <param name="tabs">Tabs that will be sensed</param>
 /// <param name="panels">Panels that will be sensed</param>
 /// <param name="items">Items that will be sensed</param>
 public RibbonMouseSensor(Control control, Ribbon ribbon, IEnumerable<RibbonTab> tabs, IEnumerable<RibbonPanel> panels, IEnumerable<RibbonItem> items)
     : this(control, ribbon)
 {
     if (tabs != null) Tabs.AddRange(tabs);
     if (panels != null) Panels.AddRange(panels);
     if (items != null) Items.AddRange(items);
 }
開發者ID:KeizouToyoda,項目名稱:RibbonControl,代碼行數:15,代碼來源:RibbonMouseSensor.cs

示例7: FindRibbonItem

        /// <summary>
        /// Find Ribbon Item
        /// </summary>
        /// <param name="ribbon">express Ribbon</param>
        /// <param name="ribbonTabText">express Ribbon Tab Text</param>
        /// <param name="ribbonItemName">express Ribbon Item Name</param>
        /// <returns>RibbonItem</returns>
        public static RibbonItem FindRibbonItem(Ribbon ribbon, string ribbonTabText, string ribbonItemName)
        {
            if (ribbon == null ||
                ribbon.Tabs == null ||
                ribbon.Tabs.Count.Equals(0) ||
                string.IsNullOrEmpty(ribbonTabText) ||
                string.IsNullOrEmpty(ribbonItemName))
            {
                return null;
            }

            foreach (RibbonTab tab in ribbon.Tabs)
            {
                if (ribbonTabText.Trim().Equals(tab.Text.Trim()))
                {
                    foreach (RibbonPanel panel in tab.Panels)
                    {
                        foreach (RibbonItem item in panel.Items)
                        {
                            if (ribbonItemName.Equals(item.Name))
                            {
                                return item;
                            }
                        }
                    }
                }
            }

            return null;
        }
開發者ID:daywrite,項目名稱:EApp,代碼行數:37,代碼來源:RibbonHelper.cs

示例8: RibbonTextEventArgs

 public RibbonTextEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item, Rectangle bounds, string text, StringFormat format)
     : base(owner, g, clip, item, bounds)
 {
     Text = text;
     Style = FontStyle.Regular;
     Format = format;
     Color = Color.Empty;
 }
開發者ID:iraychen,項目名稱:OfficeRibbon,代碼行數:8,代碼來源:RibbonTextEventArgs.cs

示例9: RibbonCanvasEventArgs

 public RibbonCanvasEventArgs(
     Ribbon owner, Graphics g, Rectangle bounds, Control canvas, object relatedObject
     )
 {
     Owner = owner;
     Graphics = g;
     Bounds = bounds;
     Canvas = canvas;
     RelatedObject = relatedObject;
 }
開發者ID:taozhengbo,項目名稱:sdrsharp_experimental,代碼行數:10,代碼來源:RibbonCanvasEventArgs.cs

示例10: RibbonToolTipRenderEventArgs

		public RibbonToolTipRenderEventArgs(Ribbon owner, Graphics g, Rectangle clip, string Text, Image tipImage, Color color, FontStyle style, StringFormat format, Font font)
			: base(owner, g, clip)
		{
			_text = Text;
			_color = Color;
			_style = style;
			_format = format;
			_image = tipImage;
			_font = font;
		}
開發者ID:iraychen,項目名稱:OfficeRibbon,代碼行數:10,代碼來源:RibbonToolTipRenderEventArgs.cs

示例11: RibbonMouseSensor

        /// <summary>
        /// Creates a new Sensor for the specified RibbonTab
        /// </summary>
        /// <param name="control">Control to listen to mouse events</param>
        /// <param name="ribbon">Ribbon that will be affected</param>
        /// <param name="tab">Tab that will be sensed, from which all panels and items will be extracted to sensing also.</param>
        public RibbonMouseSensor(Control control, Ribbon ribbon, RibbonTab tab)
            : this(control, ribbon)
        {
            Tabs.Add(tab);
            Panels.AddRange(tab.Panels);

            foreach (RibbonPanel panel in tab.Panels)
            {
                Items.AddRange(panel.Items);
            }
        }
開發者ID:taozhengbo,項目名稱:sdrsharp_experimental,代碼行數:17,代碼來源:RibbonMouseSensor.cs

示例12: RibbonSensor

        public RibbonSensor(Control control, Ribbon ribbon, RibbonTab tabToSense)
        {
            _ribbon = ribbon;
            _control = control;
            _tab = tabToSense;

            _control.MouseMove += new MouseEventHandler(_control_MouseMove);
            _control.MouseDown += new MouseEventHandler(_control_MouseDown);
            _control.MouseUp += new MouseEventHandler(_control_MouseUp);
            _control.MouseLeave += new EventHandler(_control_MouseLeave);
        }
開發者ID:okyereadugyamfi,項目名稱:softlogik,代碼行數:11,代碼來源:RibbonSensor.cs

示例13: RibbonQuickAccessToolbar

        internal RibbonQuickAccessToolbar(Ribbon ownerRibbon)
        {
            if (ownerRibbon == null) throw new ArgumentNullException("ownerRibbon");

             SetOwner(ownerRibbon);

             _dropDownButton = new RibbonButton();
             _dropDownButton.SetOwner(ownerRibbon);
             _dropDownButton.SmallImage = CreateDropDownButtonImage();

             _margin = new Padding(9);
             _padding = new Padding(3, 0, 0, 0);
             _items = new RibbonQuickAccessToolbarItemCollection(this);
             _sensor = new RibbonMouseSensor(ownerRibbon, ownerRibbon, Items);
             _DropDownButtonVisible = true;
        }
開發者ID:JamesMasterman,項目名稱:SeaScan,代碼行數:16,代碼來源:RibbonQuickAccessToolbar.cs

示例14: RibbonOrbDropDown

        internal RibbonOrbDropDown(Ribbon ribbon)
            : base()
        {
            DoubleBuffered = true;
            _ribbon = ribbon;
            _menuItems = new RibbonItemCollection();
            _recentItems = new RibbonItemCollection();
            _optionItems = new RibbonItemCollection();

            _menuItems.SetOwner(Ribbon);
            _recentItems.SetOwner(Ribbon);
            _optionItems.SetOwner(Ribbon);

            _optionsPadding = 6;
            Size = new System.Drawing.Size(527, 447);
            BorderRoundness = 8;
        }
開發者ID:daywrite,項目名稱:EApp,代碼行數:17,代碼來源:RibbonOrbDropDown.cs

示例15: AddRibbonButton

        public static void AddRibbonButton(Ribbon ribbon, 
                                           string tabText, 
                                           string buttonName,
                                           string text, 
                                           Image image, 
                                           string tooltip, 
                                           bool enable, 
                                           bool isChecked,
                                           RibbonButtonAlignment alignment,
                                           EventHandler clickHandler)
        {
            if (ribbon == null)
            {
                return;
            }

            RibbonItem ribbonItem = null;

            if (RibbonModulePluginProvider.Ribbon_Separator.Equals(buttonName))
            {
                ribbonItem = new RibbonSeparator();
            }
            else
            {
                ribbonItem = new RibbonButton();
                ribbonItem.Text = text;
                ribbonItem.Image = image;
                ribbonItem.ToolTip = tooltip;
                ribbonItem.Enabled = enable;
                ribbonItem.Checked = isChecked;
                ribbonItem.Click += new EventHandler(clickHandler);
            }

            ribbonItem.Name = buttonName;

            RibbonTab ribbonTab = RibbonHelper.FindRibbonTab(ribbon, tabText);

            if (ribbonTab == null)
            {
                return;
            }

            int panelIndex = alignment == RibbonButtonAlignment.Right ? 1 : 0;

            ribbonTab.Panels[panelIndex].Items.Add(ribbonItem);
        }
開發者ID:daywrite,項目名稱:EApp,代碼行數:46,代碼來源:RibbonExtensionHelper.cs


注:本文中的System.Windows.Forms.Ribbon類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。