本文整理汇总了C#中RibbonElementSizeMode类的典型用法代码示例。如果您正苦于以下问题:C# RibbonElementSizeMode类的具体用法?C# RibbonElementSizeMode怎么用?C# RibbonElementSizeMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RibbonElementSizeMode类属于命名空间,在下文中一共展示了RibbonElementSizeMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnGetTextBounds
internal override Rectangle OnGetTextBounds(RibbonElementSizeMode sMode, Rectangle bounds)
{
Rectangle r = base.OnGetTextBounds(sMode, bounds);
r.X = Bounds.Left + 3;
return r;
}
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:8,代码来源:RibbonOrbRecentItem.cs
示例2: RibbonPanel
/// <summary>
/// Creates a new RibbonPanel
/// </summary>
public RibbonPanel()
{
_items = new RibbonItemCollection();
_sizeMode = RibbonElementSizeMode.None;
_flowsTo = RibbonPanelFlowDirection.Bottom;
_buttonMoreEnabled = true;
_buttonMoreVisible = true;
_items.SetOwnerPanel(this);
_enabled = true;
}
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:13,代码来源:RibbonPanel.cs
示例3: RibbonButtonList
public RibbonButtonList()
{
_buttons = new RibbonButtonCollection(this);
_dropDownItems = new RibbonItemCollection();
_controlButtonsWidth = 16;
_itemsInLargeMode = 7;
_itemsInMediumMode = 3;
_ItemsInDropwDownMode = new Size(7, 5);
_buttonsSizeMode = RibbonElementSizeMode.Large;
}
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:11,代码来源:RibbonButtonList.cs
示例4: RibbonDropDown
internal RibbonDropDown(RibbonItem parentItem, IEnumerable<RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize)
: this()
{
_items = items;
_ownerRibbon = ownerRibbon;
_sizingGripHeight = 12;
_parentItem = parentItem;
_sensor = new RibbonMouseSensor(this, OwnerRibbon, items);
_MeasuringSize = measuringSize;
if (Items != null)
foreach (RibbonItem item in Items)
{
item.SetSizeMode(RibbonElementSizeMode.DropDown);
item.SetCanvas(this);
}
UpdateSize();
}
开发者ID:daywrite,项目名称:EApp,代码行数:19,代码来源:RibbonDropDown.cs
示例5: RibbonDropDown
internal RibbonDropDown(RibbonItem parentItem, IEnumerable<RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize)
: this()
{
_items = items;
_ownerRibbon = ownerRibbon;
_sizingGripHeight = 12;
_parentItem = parentItem;
_sensor = new RibbonMouseSensor(this, OwnerRibbon, items);
_MeasuringSize = measuringSize;
_scrollBarSize = 16;
if (Items != null)
foreach (RibbonItem item in Items)
{
item.SetSizeMode(RibbonElementSizeMode.DropDown);
item.SetCanvas(this);
//If item is a RibbonHost, the MouseSensor will not detect the mouse move event, so manually hook into the event.
if (item is RibbonHost)
{
((RibbonHost)item).ClientMouseMove += new MouseEventHandler(OnRibbonHostMouseMove);
}
}
UpdateSize();
}
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:26,代码来源:RibbonDropDown.cs
示例6: UpdateRegionsFlowsToRight
/// <summary>
/// Updates the bounds of child elements when flow is to bottom
/// </summary>
private void UpdateRegionsFlowsToRight(Graphics g, RibbonElementSizeMode mode)
{
int curLeft = ContentBounds.Left;
int curTop = ContentBounds.Top;
int padding = mode == RibbonElementSizeMode.Medium ? 7 : 0;
int maxBottom = 0;
#region Sorts from larger to smaller
RibbonItem[] array = Items.ToArray();
for (int i = (array.Length - 1); i >= 0; i--)
{
for (int j = 1; j <= i; j++)
{
if (array[j - 1].LastMeasuredSize.Width < array[j].LastMeasuredSize.Width)
{
RibbonItem temp = array[j - 1];
array[j - 1] = array[j];
array[j] = temp;
}
}
}
#endregion
List<RibbonItem> list = new List<RibbonItem>(array);
///Attend elements, deleting every attended element from the list
while (list.Count > 0)
{
///Extract item and delete it
RibbonItem item = list[0];
list.Remove(item);
///If not enough space left, reset left and advance top
if (curLeft + item.LastMeasuredSize.Width > ContentBounds.Right)
{
curLeft = ContentBounds.Left;
curTop = maxBottom + Owner.ItemPadding.Vertical + 1 + padding;
}
///Set item's bounds
item.SetBounds(new Rectangle(new Point(curLeft, curTop), item.LastMeasuredSize));
///Increment reminders
curLeft += item.Bounds.Width + Owner.ItemPadding.Horizontal;
maxBottom = Math.Max(maxBottom, item.Bounds.Bottom);
///Check available space after placing item
int spaceAvailable = ContentBounds.Right - curLeft;
///Check for elements that fit on available space
for (int i = 0; i < list.Count; i++)
{
///If item fits on the available space
if (list[i].LastMeasuredSize.Width < spaceAvailable)
{
///Place the item there and reset the counter to check for further items
list[i].SetBounds(new Rectangle(new Point(curLeft, curTop), list[i].LastMeasuredSize));
curLeft += list[i].Bounds.Width + Owner.ItemPadding.Horizontal;
maxBottom = Math.Max(maxBottom, list[i].Bounds.Bottom);
spaceAvailable = ContentBounds.Right - curLeft;
list.RemoveAt(i);
i = 0;
}
}
}
}
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:72,代码来源:RibbonPanel.cs
示例7: UpdateItemsRegions
/// <summary>
/// Updates the bounds of child elements
/// </summary>
internal void UpdateItemsRegions(Graphics g, RibbonElementSizeMode mode)
{
switch (FlowsTo)
{
case RibbonPanelFlowDirection.Right:
UpdateRegionsFlowsToRight(g, mode);
break;
case RibbonPanelFlowDirection.Bottom:
UpdateRegionsFlowsToBottom(g, mode);
break;
}
///Center items on the panel
CenterItems();
}
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:18,代码来源:RibbonPanel.cs
示例8: SetSizeMode
internal override void SetSizeMode(RibbonElementSizeMode sizeMode)
{
if (sizeMode == RibbonElementSizeMode.Overflow)
{
base.SetSizeMode(RibbonElementSizeMode.Large);
}
else
{
base.SetSizeMode(sizeMode);
}
}
开发者ID:daywrite,项目名称:EApp,代码行数:11,代码来源:RibbonButton.cs
示例9: OnGetImageBounds
/// <summary>
/// Sets the bounds of the image of the button when SetBounds is called.
/// Override this method to change image bounds
/// </summary>
/// <param name="sMode">Mode which is being measured</param>
/// <param name="bounds">Bounds of the button</param>
/// <remarks>
/// The measuring occours in the following order:
/// <list type="">
/// <item>OnSetImageBounds</item>
/// <item>OnSetTextBounds</item>
/// <item>OnSetDropDownBounds</item>
/// <item>OnSetButtonFaceBounds</item>
/// </list>
/// </remarks>
internal virtual Rectangle OnGetImageBounds(RibbonElementSizeMode sMode, Rectangle bounds)
{
if (sMode == RibbonElementSizeMode.Large)// || this is RibbonOrbMenuItem)
{
if (Image != null)
{
return new Rectangle(
Bounds.Left + ((Bounds.Width - Image.Width) / 2),
Bounds.Top + Owner.ItemMargin.Top,
Image.Width,
Image.Height);
}
else
{
return new Rectangle(ContentBounds.Location, new Size(32, 32));
}
}
else
{
if (SmallImage != null)
{
return new Rectangle(
Bounds.Left + Owner.ItemMargin.Left,
Bounds.Top + ((Bounds.Height - SmallImage.Height) / 2),
SmallImage.Width,
SmallImage.Height);
}
else
{
return new Rectangle(ContentBounds.Location, new Size(0, 0));
}
}
}
开发者ID:daywrite,项目名称:EApp,代码行数:48,代码来源:RibbonButton.cs
示例10: OnGetButtonFaceBounds
/// <summary>
/// Sets the bounds of the button face part of the button when SetBounds is called.
/// Override this method to change image bounds
/// </summary>
/// <param name="sMode">Mode which is being measured</param>
/// <param name="bounds">Bounds of the button</param>
/// <remarks>
/// The measuring occours in the following order:
/// <list type="">
/// <item>OnSetImageBounds</item>
/// <item>OnSetTextBounds</item>
/// <item>OnSetDropDownBounds</item>
/// <item>OnSetButtonFaceBounds</item>
/// </list>
/// </remarks>
internal virtual Rectangle OnGetButtonFaceBounds(RibbonElementSizeMode sMode, Rectangle bounds)
{
Rectangle sideBounds = Rectangle.FromLTRB(
bounds.Right - _dropDownMargin.Horizontal - 2,
bounds.Top, bounds.Right, bounds.Bottom);
switch (SizeMode)
{
case RibbonElementSizeMode.Large:
case RibbonElementSizeMode.Overflow:
return Rectangle.FromLTRB(bounds.Left,
bounds.Top, bounds.Right, _dropDownBounds.Top);
case RibbonElementSizeMode.DropDown:
case RibbonElementSizeMode.Medium:
case RibbonElementSizeMode.Compact:
return Rectangle.FromLTRB(bounds.Left, bounds.Top,
_dropDownBounds.Left, bounds.Bottom);
}
return Rectangle.Empty;
}
开发者ID:daywrite,项目名称:EApp,代码行数:38,代码来源:RibbonButton.cs
示例11: RibbonElementPaintEventArgs
internal RibbonElementPaintEventArgs(Rectangle clip, Graphics graphics, RibbonElementSizeMode mode, Control control)
: this(clip, graphics, mode)
{
_control = control;
}
开发者ID:KeizouToyoda,项目名称:RibbonControl,代码行数:5,代码来源:RibbonElementPaintEventArgs.cs
示例12: OnGetImageBounds
internal override Rectangle OnGetImageBounds(RibbonElementSizeMode sMode, System.Drawing.Rectangle bounds)
{
return Rectangle.Empty;
}
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:4,代码来源:RibbonOrbRecentItem.cs
示例13: AddButton
private RibbonButton AddButton(RibbonItemCollection collection, RibbonButtonStyle style, string label, string msoImageName,
string msoCommandName, RibbonElementSizeMode maxSizeMode = RibbonElementSizeMode.None, Action customAction = null)
{
RibbonButton button = new RibbonButton();
button.Style = style;
button.MaxSizeMode = maxSizeMode;
button.Text = label;
AssignImage(button, msoImageName);
if (customAction == null) {
AssignAction(button, msoCommandName);
} else {
EventHandler handler = new EventHandler(delegate(object sender, EventArgs ea) {
RunCommand(customAction);
});
button.Click += handler;
button.DoubleClick += handler;
}
collection.Add(button);
return button;
}
开发者ID:JoeyScarr,项目名称:word-commandmap,代码行数:20,代码来源:CommandMapForm.cs
示例14: RibbonElementMeasureSizeEventArgs
/// <summary>
/// Creates a new RibbonElementMeasureSizeEventArgs object
/// </summary>
/// <param name="graphics">Device info to draw and measure</param>
/// <param name="sizeMode">Size mode to measure</param>
internal RibbonElementMeasureSizeEventArgs(System.Drawing.Graphics graphics, RibbonElementSizeMode sizeMode)
{
_graphics = graphics;
_sizeMode = sizeMode;
}
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:10,代码来源:RibbonElementMeasureSizeEventArgs.cs
示例15: SetSizeMode
/// <summary>
/// Sets the value of the SizeMode property
/// </summary>
/// <param name="sizeMode"></param>
internal virtual void SetSizeMode(RibbonElementSizeMode sizeMode)
{
_sizeMode = GetNearestSize(sizeMode);
}
开发者ID:amoikevin,项目名称:Office-Ribbon-Project,代码行数:8,代码来源:RibbonItem.cs
示例16: SetSizeMode
internal override void SetSizeMode(RibbonElementSizeMode sizeMode)
{
base.SetSizeMode(sizeMode);
foreach (RibbonItem item in Items)
{
item.SetSizeMode(RibbonElementSizeMode.Compact);
}
}
开发者ID:sduxiaowu,项目名称:NineLineScore,代码行数:9,代码来源:RibbonItemGroup.cs
示例17: GetNearestSize
/// <summary>
/// Gets the size applying the rules of MaxSizeMode and MinSizeMode properties
/// </summary>
/// <param name="sizeMode">Suggested sizeMode</param>
/// <returns>The nearest size to the specified one</returns>
protected RibbonElementSizeMode GetNearestSize(RibbonElementSizeMode sizeMode)
{
int size = (int)sizeMode;
int max = (int)MaxSizeMode;
int min = (int)MinSizeMode;
int result = (int)sizeMode;
if (max > 0 && size > max) //Max is specified and value exceeds max
{
result = max;
}
if (min > 0 && size < min) //Min is specified and value exceeds min
{
result = min;
}
return (RibbonElementSizeMode)result;
}
开发者ID:amoikevin,项目名称:Office-Ribbon-Project,代码行数:24,代码来源:RibbonItem.cs
示例18: OnGetDropDownBounds
/// <summary>
/// Sets the bounds of the dropdown part of the button when SetBounds is called.
/// Override this method to change image bounds
/// </summary>
/// <param name="sMode">Mode which is being measured</param>
/// <param name="bounds">Bounds of the button</param>
/// <remarks>
/// The measuring occours in the following order:
/// <list type="">
/// <item>OnSetImageBounds</item>
/// <item>OnSetTextBounds</item>
/// <item>OnSetDropDownBounds</item>
/// <item>OnSetButtonFaceBounds</item>
/// </list>
/// </remarks>
internal virtual Rectangle OnGetDropDownBounds(RibbonElementSizeMode sMode, Rectangle bounds)
{
Rectangle sideBounds = Rectangle.FromLTRB(
bounds.Right - _dropDownMargin.Horizontal - 2,
bounds.Top, bounds.Right, bounds.Bottom);
switch (SizeMode)
{
case RibbonElementSizeMode.Large:
case RibbonElementSizeMode.Overflow:
return Rectangle.FromLTRB(bounds.Left,
bounds.Top + Image.Height + Owner.ItemMargin.Vertical,
bounds.Right, bounds.Bottom);
case RibbonElementSizeMode.DropDown:
case RibbonElementSizeMode.Medium:
case RibbonElementSizeMode.Compact:
return sideBounds;
}
return Rectangle.Empty;
}
开发者ID:daywrite,项目名称:EApp,代码行数:37,代码来源:RibbonButton.cs
示例19: OnGetTextBounds
/// <summary>
/// Sets the bounds of the text of the button when SetBounds is called.
/// Override this method to change image bounds
/// </summary>
/// <param name="sMode">Mode which is being measured</param>
/// <param name="bounds">Bounds of the button</param>
/// <remarks>
/// The measuring occours in the following order:
/// <list type="">
/// <item>OnSetImageBounds</item>
/// <item>OnSetTextBounds</item>
/// <item>OnSetDropDownBounds</item>
/// <item>OnSetButtonFaceBounds</item>
/// </list>
/// </remarks>
internal virtual Rectangle OnGetTextBounds(RibbonElementSizeMode sMode, Rectangle bounds)
{
int imgw = _imageBounds.Width;
int imgh = _imageBounds.Height;
if (sMode == RibbonElementSizeMode.Large)
{
return Rectangle.FromLTRB(
Bounds.Left + Owner.ItemMargin.Left,
Bounds.Top + Owner.ItemMargin.Top + imgh,
Bounds.Right - Owner.ItemMargin.Right,
Bounds.Bottom - Owner.ItemMargin.Bottom);
}
else
{
int ddw = Style != RibbonButtonStyle.Normal ? _dropDownMargin.Horizontal : 0;
return Rectangle.FromLTRB(
Bounds.Left + imgw + Owner.ItemMargin.Horizontal + Owner.ItemMargin.Left,
Bounds.Top + Owner.ItemMargin.Top,
Bounds.Right - ddw,
Bounds.Bottom - Owner.ItemMargin.Bottom);
}
}
开发者ID:daywrite,项目名称:EApp,代码行数:39,代码来源:RibbonButton.cs
示例20: SetSizeMode
internal override void SetSizeMode(RibbonElementSizeMode sizeMode)
{
base.SetSizeMode(sizeMode);
if (OwnerPanel != null && OwnerPanel.SizeMode == RibbonElementSizeMode.Overflow)
{
ctl.Visible = false;
}
}
开发者ID:taozhengbo,项目名称:sdrsharp_experimental,代码行数:8,代码来源:RibbonHost.cs
注:本文中的RibbonElementSizeMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论