本文整理汇总了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);
}
示例2: RibbonTabGlyph
public RibbonTabGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
: base(new RibbonTabGlyphBehavior(designer, ribbon))
{
_behaviorService = behaviorService;
_componentDesigner = designer;
_ribbon = ribbon;
}
示例3: RibbonQuickAccessToolbarGlyph
public RibbonQuickAccessToolbarGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
: base(new RibbonQuickAccessGlyphBehavior(designer, ribbon))
{
_behaviorService = behaviorService;
_componentDesigner = designer;
_ribbon = ribbon;
}
示例4: RibbonDropDown
internal RibbonDropDown(
RibbonItem parentItem,
IEnumerable<RibbonItem> items,
Ribbon ownerRibbon)
: this(parentItem, items, ownerRibbon, RibbonElementSizeMode.DropDown)
{
}
示例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);
//}
}
示例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);
}
示例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;
}
示例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;
}
示例9: RibbonCanvasEventArgs
public RibbonCanvasEventArgs(
Ribbon owner, Graphics g, Rectangle bounds, Control canvas, object relatedObject
)
{
Owner = owner;
Graphics = g;
Bounds = bounds;
Canvas = canvas;
RelatedObject = relatedObject;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}