本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem类的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem类的具体用法?C# ButtonItem怎么用?C# ButtonItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ButtonItem类属于DevComponents.DotNetBar命名空间,在下文中一共展示了ButtonItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PanelExTitle
public PanelExTitle()
{
m_ExpandChangeButton = new ButtonItem("close");
m_ExpandChangeButton.Style = eDotNetBarStyle.Office2003;
m_ExpandChangeButton.Image = BarFunctions.LoadBitmap("SystemImages.CollapseTitle.png");
m_ExpandChangeButton.Displayed = true;
m_ExpandChangeButton.Click += new EventHandler(m_ExpandChangeButton_Click);
m_ItemContainer = new ItemContainer();
m_ItemContainer.ContainerControl = this;
m_ItemContainer.Style = eDotNetBarStyle.Office2003;
m_ItemContainer.SubItems.Add(m_ExpandChangeButton);
base.MarkupUsesStyleAlignment = true;
}
示例2: HomeOperation
//开始操作
public void HomeOperation(ButtonItem button)
{
string action = button.Text;
switch (action)
{
case "openmxd":
OpenMXD();
break;
case "zoomin":
MapNavigation("zoomin");
break;
case "点":
SpatialQuery(action);
break;
case "attributequery":
AttributeQuery();
break;
case "adddata":
AddData();
break;
default:
break;
}
}
示例3: defaultToolMenu
private void defaultToolMenu()
{
//ButtonItem toolbarItem0 = new ButtonItem("redept", "切换科室");
//toolbarItem0.ImageFixedSize = new Size(30, 30);
//toolbarItem0.Image = Image.FromFile(@"images\1.png");
//toolbarItem0.ImagePosition = eImagePosition.Top;
ButtonItem toolbarItem1 = new ButtonItem("relogin", "切换用户");
toolbarItem1.ImageFixedSize = new Size(30, 30);
toolbarItem1.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\2.png");
toolbarItem1.ImagePosition = eImagePosition.Top;
ButtonItem toolbarItem2 = new ButtonItem("changepassword", "修改密码");
toolbarItem2.ImageFixedSize = new Size(30, 30);
toolbarItem2.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\3.png");
toolbarItem2.ImagePosition = eImagePosition.Top;
ButtonItem toolbarItem3 = new ButtonItem("welcome", "系统首页");
toolbarItem3.BeginGroup = true;
toolbarItem3.ImageFixedSize = new Size(30, 30);
toolbarItem3.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\1.png");
toolbarItem3.ImagePosition = eImagePosition.Top;
ButtonItem toolbarItem4 = new ButtonItem("close", "最小化系统");
toolbarItem4.ImageFixedSize = new Size(30, 30);
toolbarItem4.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\4.png");
toolbarItem4.ImagePosition = eImagePosition.Top;
toolbarItem4.BeginGroup = true;
this.barMainToolBar.Items.AddRange(new BaseItem[] { toolbarItem3,
//toolbarItem0,
toolbarItem1, toolbarItem2, toolbarItem4 });
}
示例4: CreateButtonPainter
public static ButtonItemPainter CreateButtonPainter(ButtonItem button)
{
if (button is RibbonTabItem)
{
return CreateRibbonTabItemPainter((RibbonTabItem)button);
}
if (button is RibbonOverflowButtonItem)
{
ButtonItemPainter p = CreateRibbonOverflowButtonPainter((RibbonOverflowButtonItem)button);
if (p != null)
return p;
}
eDotNetBarStyle buttonEffectiveStyle = button.EffectiveStyle;
if (buttonEffectiveStyle == eDotNetBarStyle.Office2010 && button.ContainerState == eContainerState.NavigationPane)
{
return _Office2010NavPaneButtonPainter;
}
if (buttonEffectiveStyle == eDotNetBarStyle.Office2010 && button is ApplicationButton)
return Office2010ApplicationButtonPainter;
else if (button is DevComponents.DotNetBar.Metro.MetroAppButton || button is ApplicationButton && buttonEffectiveStyle == eDotNetBarStyle.Metro)
return MetroAppButtonPainter;
if (BarFunctions.IsOffice2007Style(buttonEffectiveStyle))
{
if (buttonEffectiveStyle == eDotNetBarStyle.Metro)
return m_MetroButtonPainter;
if (button.ContainerControl is RibbonBar)
return m_Office2007Painter;
return m_Office2007Painter;
}
return m_Office2003Painter;
}
示例5: GetTextRectangle
protected override Rectangle GetTextRectangle(ButtonItem button, ItemPaintArgs pa, eTextFormat stringFormat, CompositeImage image)
{
Rectangle r = base.GetTextRectangle(button, pa, stringFormat, image);
if (image == null && string.IsNullOrEmpty(button.Symbol))
r.Inflate(-3, 0);
return r;
}
示例6: CreateChildMenus
private RibbonBar CreateChildMenus(MenuInfo subMenuInfo)
{
ButtonItem buttonItem = new DevComponents.DotNetBar.ButtonItem();
buttonItem.Name = subMenuInfo.MenuID;
buttonItem.Text = subMenuInfo.MenuName;
buttonItem.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
//buttonItem.Image = ((System.Drawing.Image)(resourceManager.GetObject("buttonItem1.Image")));
//buttonItem.Image = ((System.Drawing.Image)(resourceManager.GetObject("OpenExistingPlace")));
buttonItem.Image = imageList.Images["OpenExistingPlace"];
buttonItem.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
buttonItem.RibbonWordWrap = false;
buttonItem.Visible = true;
DevComponents.DotNetBar.RibbonBar ribbonBar = new DevComponents.DotNetBar.RibbonBar();
ribbonBar.AutoOverflowEnabled = true;
ribbonBar.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
ribbonBar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
ribbonBar.ContainerControlProcessDialogKey = true;
ribbonBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
buttonItem});
ribbonBar.Location = new System.Drawing.Point(3, 0);
ribbonBar.Name = System.Guid.NewGuid().ToString();
ribbonBar.Size = new System.Drawing.Size(337, 82);
ribbonBar.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
ribbonBar.TabIndex = 0;
//ribbonBar.Text = subMenuInfo.MenuName;
ribbonBar.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
ribbonBar.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
ribbonBar.Visible = true;
return ribbonBar;
}
示例7: PaintButtonBackground
public override void PaintButtonBackground(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
{
bool isOnMenu = IsOnMenu(button, pa);
if(isOnMenu)
base.PaintButtonBackground(button,pa, image);
else
PaintButtonCheck(button,pa,image,button.DisplayRectangle);
}
示例8: PaintButtonMouseOver
/// <summary>
/// Paints state of the button, either hot, pressed or checked
/// </summary>
/// <param name="button"></param>
/// <param name="pa"></param>
/// <param name="image"></param>
public override void PaintButtonMouseOver(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r)
{
if (IsOffice2003Rendering(button, pa))
{
base.PaintButtonMouseOver(button, pa, image, r);
return;
}
//PaintState(button, pa, image, r, button.IsMouseDown);
}
示例9: GetButtonShape
protected virtual IShapeDescriptor GetButtonShape(ButtonItem button, ItemPaintArgs pa)
{
IShapeDescriptor shape = Office2007ButtonItemPainter.GetButtonShape(button);
if (pa.ContainerControl is ButtonX)
shape = ((ButtonX)pa.ContainerControl).GetButtonShape();
else if (pa.ContainerControl is NavigationBar)
shape = ((NavigationBar)pa.ContainerControl).ButtonShape;
return shape;
}
示例10: MainForm
StartControl _StartControl = null; // Start control displayed on startup
#endregion Fields
#region Constructors
public MainForm()
{
InitializeComponent();
// Prepare commands
_Commands = new MetroBillCommands();
_Commands.ToggleStartControl = new Command(components);
_Commands.ToggleStartControl.Executed += new EventHandler(ToggleStartControlExecuted);
// Initialize Client related commands
_Commands.ClientCommands.New = new Command(components); // We pass in components from Form so the command gets disposed automatically when form is disposed
_Commands.ClientCommands.New.Executed += NewClientExecuted;
_Commands.ClientCommands.Cancel = new Command(components);
_Commands.ClientCommands.Cancel.Executed += CancelClientExecuted;
_Commands.ClientCommands.Save = new Command(components);
_Commands.ClientCommands.Save.Executed += SaveClientExecuted;
// Invoice related commands
_Commands.InvoiceCommands.New = new Command(components); // We pass in components from Form so the command gets disposed automatically when form is disposed
_Commands.InvoiceCommands.New.Executed += NewInvoiceExecuted;
_Commands.InvoiceCommands.Cancel = new Command(components);
_Commands.InvoiceCommands.Cancel.Executed += CancelInvoiceExecuted;
_Commands.InvoiceCommands.Save = new Command(components);
_Commands.InvoiceCommands.Save.Executed += SaveInvoiceExecuted;
// General commands
_Commands.ChangeMetroTheme = new Command(components, new EventHandler(ChangeMetroThemeExecuted));
_Commands.NotImplemented = new Command(components, new EventHandler(NotImplementedExecuted));
_Commands.DevComponents = new Command(components, new EventHandler(DevComponentsExecuted));
_Commands.GettingStartedCommand = new Command(components, new EventHandler(GettingStartedExecuted));
this.SuspendLayout();
_StartControl = new StartControl();
_StartControl.Commands = _Commands;
this.Controls.Add(_StartControl);
_StartControl.BringToFront();
_StartControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
_StartControl.Click += new EventHandler(StartControl_Click);
this.ResumeLayout(false);
// Assign commands to toolbar buttons
newInvoiceButton.Command = _Commands.InvoiceCommands.New;
newClientButton.Command = _Commands.ClientCommands.New;
// Add metro color themes
MetroColorGeneratorParameters[] metroThemes = MetroColorGeneratorParameters.GetAllPredefinedThemes();
foreach (MetroColorGeneratorParameters mt in metroThemes)
{
ButtonItem theme = new ButtonItem(mt.ThemeName, mt.ThemeName);
theme.Command = _Commands.ChangeMetroTheme;
theme.CommandParameter = mt;
colorThemeButton.SubItems.Add(theme);
}
AddSampleData();
}
示例11: AddSubMenu
/// <summary>
/// 加载子菜单
/// </summary>
/// <param name="menuId">父菜单Id</param>
/// <param name="patientItem">父菜单控件</param>
/// <param name="menuData">菜单数据</param>
private void AddSubMenu(int menuId, BaseItem patientItem, List<BaseMenu> allmenus)
{
List<BaseMenu> mainMenu = allmenus.FindAll(x => x.PMenuId == menuId).OrderBy(x => x.SortId).ToList();
foreach (BaseMenu menu in mainMenu)
{
AddToolMenu(menu);
BaseItem bottonItem = new ButtonItem(menu.MenuId.ToString(), menu.Name);
bottonItem.Tag = menu;
AddSubMenu(menu.MenuId, bottonItem, allmenus);
patientItem.SubItems.Add(bottonItem);
}
}
示例12: frmMain
public frmMain()
{
InitializeComponent();
this.Load += new EventHandler(
delegate(object sender, EventArgs e)
{
this.pbSvrUpdate.Visible = false;
this.stripSvrUpdate.Visible = false;
stripSvrUpdate.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold);
__SvrUpdateInterval = new System.Threading.Timer(new System.Threading.TimerCallback(delegate {
this.SvrUpdate();
}),null,15*1000,1000*60*60);
__SvrResetInterval = new System.Threading.Timer(new System.Threading.TimerCallback(delegate {
this.SvrReset();
}),null,1000,1000*60);
notifyIcon1.Visible = false;
//statusServer.ForeColor = Color.Red;
statusServer.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold);
statusServer.ForeColor = System.Drawing.SystemColors.HotTrack;
try
{
string SvrVersionFile = @"Version.Xml";
DirectoryInfo SvrPath = new DirectoryInfo(@".\");
if (new FileInfo(string.Format(@"{0}{1}", SvrPath.FullName, SvrVersionFile)).Exists)
{
XElement root = XElement.Load(new FileInfo(string.Format(@"{0}{1}", SvrPath.FullName, SvrVersionFile)).FullName);
XElement VersionStr = root.Element(@"SvrReset");
__resetHour = VersionStr.Value;
}
}
catch { }
statusInfo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold);
statusInfo.ForeColor = Color.Red ;
notifyIcon1.Text = this.Text;
lstAsync.Groups.AddRange(new ListViewGroup[] { group1, group2 });
foreach (object itemValue in Enum.GetValues(DevComponents.DotNetBar.eStyle.Windows7Blue.GetType())) {
ButtonItem btnItem = new ButtonItem() { ButtonStyle = eButtonStyle.ImageAndText, Text = itemValue.ToString(), Tag=itemValue };
btnItem.Image = global::ASyncSDK.Office.Properties.Resources.Flag2_Green;
btnItem.Click += new EventHandler(
delegate(object btnSender, EventArgs btnEvent) {
this.styleManager1.ManagerStyle = (eStyle)(btnItem as ButtonItem).Tag;
}
);
this.btnSkin.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
btnItem
});
}
this.btnStart_Click(null, EventArgs.Empty);
}
);
}
示例13: PaintButtonCheck
public override void PaintButtonCheck(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r)
{
if (IsOffice2003Rendering(button, pa))
{
base.PaintButtonCheck(button, pa, image, r);
return;
}
bool isOnMenu = IsOnMenu(button, pa);
if (isOnMenu)
base.PaintButtonCheck(button, pa, image, r);
//else
// PaintState(button, pa, image, r, button.IsMouseDown);
}
示例14: Link
public static void Link(
ButtonItem selectorButton,
IEnumerable<Theme> themes,
string selectedThemeName,
IThemeSettingsContainer settingsContainer,
Action<Theme, bool> themeSelected)
{
var themesExisted = themes.Any();
selectorButton.ForeColor = Color.Black;
selectorButton.ImagePosition = eImagePosition.Left;
selectorButton.Text = String.Empty;
selectorButton.AutoExpandOnClick = false;
if (themesExisted)
{
var currentTheme = themes.FirstOrDefault(t => t.Name.Equals(selectedThemeName) || String.IsNullOrEmpty(selectedThemeName)) ?? themes.FirstOrDefault();
if (currentTheme == null) return;
selectorButton.Image = currentTheme.RibbonLogo;
((RibbonBar)selectorButton.ContainerControl).Text = String.Format("{0}", currentTheme.Name);
if (selectorButton.Tag == null)
{
selectorButton.Tag = new ThemeButtonInfo();
selectorButton.Click += (button, e) =>
{
((ThemeButtonInfo)((ButtonItem)button).Tag).ClickHandler?.Invoke();
};
}
((ThemeButtonInfo)selectorButton.Tag).CurrentTheme = currentTheme;
((ThemeButtonInfo) selectorButton.Tag).ClickHandler = () =>
{
using (var form = new FormThemeSelector())
{
form.ApplyThemeForAllSlideTypes = settingsContainer.ApplyThemeForAllSlideTypes;
form.LoadThemes(themes);
form.Shown += (o, args) =>
{
form.SetSelectedTheme(((ThemeButtonInfo)selectorButton.Tag).CurrentTheme.Name);
};
if (form.ShowDialog() != DialogResult.OK) return;
var selectedTheme = form.SelectedTheme;
if (selectedTheme == null) return;
selectorButton.Image = selectedTheme.RibbonLogo;
((RibbonBar)selectorButton.ContainerControl).Text = String.Format("{0}", selectedTheme.Name);
((ThemeButtonInfo)selectorButton.Tag).CurrentTheme = selectedTheme;
themeSelected(selectedTheme, form.ApplyThemeForAllSlideTypes);
}
};
}
else
selectorButton.Image = Resources.OutputDisabled;
}
示例15: LoadDigitalCategories
private void LoadDigitalCategories()
{
foreach (var category in ListManager.Instance.Categories)
{
var categoryButton = new ButtonItem();
categoryButton.Image = category.Logo;
categoryButton.Text = "<b>" + category.TooltipTitle + "</b><p>" + category.TooltipValue + "</p>";
categoryButton.ImagePaddingHorizontal = 8;
categoryButton.SubItemsExpandWidth = 14;
categoryButton.Tag = category;
categoryButton.Click += DigitalProductAdd;
Controller.Instance.HomeDigitalProductAdd.SubItems.Add(categoryButton);
}
}