本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem.Copy方法的具体用法?C# ButtonItem.Copy怎么用?C# ButtonItem.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevComponents.DotNetBar.ButtonItem
的用法示例。
在下文中一共展示了ButtonItem.Copy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TreeMouseDown
private void TreeMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button!=MouseButtons.Right)
return;
TreeNode node=barTree.GetNodeAt(e.X,e.Y);
if(node!=null)
barTree.SelectedNode=node;
// Popup menu
ButtonItem popup=barManager.Items["popup"] as ButtonItem;
// If MoveTo and CopyTo are visible add items to them
if(popup.SubItems["copyto"].Visible)
{
BaseItem itemCopyTo=popup.SubItems["copyto"];
BaseItem itemMoveTo=popup.SubItems["moveto"];
BaseItem itemSel=barTree.SelectedNode.Tag as BaseItem;
itemCopyTo.SubItems.Clear();
itemMoveTo.SubItems.Clear();
bool bBars=true,bCategories=false, bPopups=false;
// Don't show categories for category items...
node=barTree.SelectedNode;
while(node.Parent!=null)
node=node.Parent;
if(m_PopupsNode!=null && node!=m_PopupsNode)
bPopups=true;
if(m_CategoriesNode!=null && node!=m_CategoriesNode)
bCategories=true;
if(bBars && m_BarsNode!=null)
{
foreach(TreeNode barNode in m_BarsNode.Nodes)
{
BaseItem newItem=new ButtonItem();
newItem.Text=barNode.Text;
newItem.Tag=barNode;
newItem.Click+=new System.EventHandler(this.CopyMoveToClick);
itemCopyTo.SubItems.Add(newItem);
itemMoveTo.SubItems.Add(newItem.Copy());
}
}
if(bCategories && m_CategoriesNode!=null)
{
ButtonItem cat=new ButtonItem("tocategories");
cat.Text="Categories";
cat.BeginGroup=true;
cat.Click+=new System.EventHandler(this.CopyMoveToClick);
itemCopyTo.SubItems.Add(cat);
itemMoveTo.SubItems.Add(cat.Copy());
foreach(TreeNode catNode in m_CategoriesNode.Nodes)
{
BaseItem newItem=new ButtonItem();
newItem.Text=catNode.Text;
newItem.Click+=new System.EventHandler(this.CopyMoveToClick);
newItem.Tag="cat";
itemCopyTo.SubItems.Add(newItem);
itemMoveTo.SubItems.Add(newItem.Copy());
}
}
if(bPopups)
{
BaseItem pi=new ButtonItem("topopups");
pi.BeginGroup=true;
pi.Text="Popups";
pi.Click+=new System.EventHandler(this.CopyMoveToClick);
itemCopyTo.SubItems.Add(pi);
itemMoveTo.SubItems.Add(pi.Copy());
foreach(BaseItem objItem in m_DotNetBar.ContextMenus)
{
BaseItem newItem=new ButtonItem();
newItem.Text=(objItem.Text=="")?objItem.Name:objItem.Text;
newItem.Tag=objItem;
newItem.Click+=new System.EventHandler(this.CopyMoveToClick);
itemCopyTo.SubItems.Add(newItem);
itemMoveTo.SubItems.Add(newItem.Copy());
}
}
}
Point pt=new Point(e.X,e.Y);
pt=barTree.PointToScreen(pt);
popup.PopupMenu(pt);
}
示例2: AddDotNetBarControls
private void AddDotNetBarControls()
{
if(m_Menu!=null)
{
m_Menu.RecalcSize();
m_SimpleBar.Size=new Size(groupBox1.ClientRectangle.Width-12,16);
m_SimpleBar.RecalcSize();
m_FloatBar.Size=new Size(groupBox1.ClientRectangle.Width,16);
m_FloatBar.RecalcSize();
m_PopupBar.Size=new Size(groupBox1.ClientRectangle.Width,24);
m_PopupBar.RecalcSize();
return;
}
m_Menu=new MenuPanel();
m_Menu.PopupMenu=false;
m_Menu.Location=new Point(8,135);
// Create Simple Toolbar
m_SimpleBar=new Bar();
m_SimpleBar.PassiveBar=true;
m_SimpleBar.Location=new Point(4,16);
m_SimpleBar.ThemeAware=false;
m_FloatBar=new Bar();
m_FloatBar.PassiveBar=true;
m_FloatBar.Location=new Point(4,46);
m_FloatBar.ThemeAware=false;
m_PopupBar=new Bar();
m_PopupBar.PassiveBar=true;
m_PopupBar.Location=new Point(4,96);
m_PopupBar.ThemeAware=false;
ButtonItem menuItem=new ButtonItem();
ButtonItem item, item2;
Bitmap bmp=null;
item=new ButtonItem("new","&New...");
bmp=BarFunctions.LoadBitmap("BarEditorImages.FileNew.bmp");
bmp.MakeTransparent(Color.Magenta);
item.Image=bmp;
m_SimpleBar.Items.Add(item.Copy());
m_FloatBar.Items.Add(item.Copy());
m_PopupBar.Items.Add(item.Copy());
menuItem.SubItems.Add(item);
item=new ButtonItem("open","&Open");
bmp=BarFunctions.LoadBitmap("BarEditorImages.FileOpen.bmp");
bmp.MakeTransparent(Color.Magenta);
item.Image=bmp;
item2=(ButtonItem)item.Copy();
item2.ButtonStyle=eButtonStyle.ImageAndText;
m_SimpleBar.Items.Add(item2);
m_FloatBar.Items.Add(item2.Copy());
m_PopupBar.Items.Add(item2.Copy());
menuItem.SubItems.Add(item);
item=new ButtonItem("close","&Close");
bmp=BarFunctions.LoadBitmap("BarEditorImages.FileClose.bmp");
bmp.MakeTransparent(Color.Magenta);
item.Image=bmp;
item2=(ButtonItem)item.Copy();
item2.Checked=true;
item2.ButtonStyle=eButtonStyle.ImageAndText;
m_SimpleBar.Items.Add(item2);
m_PopupBar.Items.Add(item2.Copy());
item2=(ButtonItem)item2.Copy();
item2.Enabled=false;
m_FloatBar.Items.Add(item2.Copy());
menuItem.SubItems.Add(item);
item=new ButtonItem("open","Add Ne&w Item...");
menuItem.SubItems.Add(item);
item=new ButtonItem("open","Add Existin&g Item...");
menuItem.SubItems.Add(item);
item=new ButtonItem("opensol","Open Solution...");
item.BeginGroup=true;
bmp=BarFunctions.LoadBitmap("BarEditorImages.FileOpenSol.bmp");
bmp.MakeTransparent(Color.Magenta);
item.Image=bmp;
item2=(ButtonItem)item.Copy();
item2.Enabled=false;
m_SimpleBar.Items.Add(item2);
m_FloatBar.Items.Add(item2.Copy());
m_PopupBar.Items.Add(item2.Copy());
menuItem.SubItems.Add(item);
item=new ButtonItem("open","Close Solution");
bmp=BarFunctions.LoadBitmap("BarEditorImages.FileCloseSol.bmp");
bmp.MakeTransparent(Color.Magenta);
item.Image=bmp;
item.Enabled=false;
menuItem.SubItems.Add(item);
m_Menu.ParentItem=menuItem;
groupBox1.Controls.Add(m_Menu);
m_Menu.RecalcSize();
m_Menu.Show();
//m_SimpleBar.SetBarState(eBarState.Docked);
m_SimpleBar.Size=new Size(groupBox1.ClientRectangle.Width,16);
m_SimpleBar.GrabHandleStyle=eGrabHandleStyle.StripeFlat;
//.........这里部分代码省略.........
示例3: CreateToolbar
private void CreateToolbar()
{
Bar bar, barToolbar;
ButtonItem item, item2, item3, popupmain;
ButtonItem popup=new ButtonItem("popup");
barManager.Items.Add(popup);
bar=new Bar("Main Menu");
barManager.Bars.Add(bar);
bar.MenuBar=true;
bar.Stretch=true;
barToolbar=new Bar("Item Navigation");
barManager.Bars.Add(barToolbar);
// File Menu
item=new ButtonItem("file");
item.Text="&File";
item.PopupType=ePopupType.Menu;
bar.Items.Add(item);
item2=new ButtonItem("open");
item2.Shortcuts.Add(eShortcut.CtrlO);
item.SubItems.Add(item2);
item2.Text="&Open definition...";
item2.ImageIndex=4;
barToolbar.Items.Add(item2.Copy());
item2=new ButtonItem("save");
item2.Shortcuts.Add(eShortcut.CtrlS);
item.SubItems.Add(item2);
item2.Text="&Save definition...";
item2.ImageIndex=5;
barToolbar.Items.Add(item2.Copy());
item2.BeginGroup=true;
item2=new ButtonItem("saveas");
item2.Text="&Save definition as...";
item.SubItems.Add(item2);
item2=new ButtonItem("loadbar");
item2.Shortcuts.Add(eShortcut.CtrlL);
item.SubItems.Add(item2);
item2.Text="Load Bar...";
barManager.Items.Add(item2.Copy());
item2.BeginGroup=true;
item2.Enabled=true;
item2=new ButtonItem("savebaras");
item2.Shortcuts.Add(eShortcut.CtrlD);
item.SubItems.Add(item2);
item2.Text="Save Bar as...";
barManager.Items.Add(item2.Copy());
item2.Enabled=false;
item2=new ButtonItem("close");
item2.Text="&Close Designer";
item2.BeginGroup=true;
item.SubItems.Add(item2);
// Tools
item=new ButtonItem("tools");
item.Text="&Tools";
item.PopupType=ePopupType.Menu;
bar.Items.Add(item);
item2=new ButtonItem("barscreation","Create Bar");
item.SubItems.Add(item2);
popupmain=item2.Copy() as ButtonItem;
popup.SubItems.Add(popupmain);
if(m_Bar!=null)
item2.Visible=false;
else if(m_DotNetBar.LeftDockSite==null && m_DotNetBar.RightDockSite==null && m_DotNetBar.TopDockSite==null && m_DotNetBar.BottomDockSite==null)
item2.Enabled=false;
item3=new ButtonItem("createbar");
item3.Text="&Toolbar";
item2.SubItems.Add(item3);
popupmain.SubItems.Add(item3.Copy());
item3=new ButtonItem("createmenubar");
item3.Text="&Menu Bar";
item2.SubItems.Add(item3);
popupmain.SubItems.Add(item3.Copy());
item3=new ButtonItem("createstatusbar","&Status Bar");
item2.SubItems.Add(item3);
popupmain.SubItems.Add(item3.Copy());
item3=new ButtonItem("createdockwindow","&Dockable Window");
item2.SubItems.Add(item3);
popupmain.SubItems.Add(item3.Copy());
item3=new ButtonItem("createtaskpane","&Task Pane");
item2.SubItems.Add(item3);
popupmain.SubItems.Add(item3.Copy());
item2=new ButtonItem("buttonitem");
item2.Text="Add &ButtonItem";
item2.BeginGroup=true;
item.SubItems.Add(item2);
popup.SubItems.Add(item2.Copy());
item2=new ButtonItem("textboxitem");
item2.Text="Add &TextBoxItem";
item.SubItems.Add(item2);
popup.SubItems.Add(item2.Copy());
item2=new ButtonItem("comboboxitem");
item2.Text="Add &ComboBoxItem";
//.........这里部分代码省略.........