本文整理汇总了C#中Gtk.ScrolledWindow.Activate方法的典型用法代码示例。如果您正苦于以下问题:C# ScrolledWindow.Activate方法的具体用法?C# ScrolledWindow.Activate怎么用?C# ScrolledWindow.Activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.Activate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ModelerCanvasWidget
public ModelerCanvasWidget(ModelerCanvas owner, modelController controller)
{
this.Build ();
_owner = owner;
_controller = controller;
VBox mainVbox = new VBox (false, 6);
mainVbox.BorderWidth = 6;
this.Add(mainVbox);
//Create Toolbar
Toolbar toolbar = new Toolbar ();
toolbar.Name = "toolbar";
toolbar.ShowArrow = true;
toolbar.IconSize = Gtk.IconSize.LargeToolbar;
toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
toolbar.Sensitive=true;
toolbar.Activate();
mainVbox.Add(toolbar);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(mainVbox[toolbar]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = true;
//Create SCrollWindow
mainScrolledWindow = new ScrolledWindow();
mainScrolledWindow.Activate();
mainScrolledWindow.SetPolicy( Gtk.PolicyType.Always,Gtk.PolicyType.Always);
mainScrolledWindow.CanFocus = true;
mainScrolledWindow.Name = "mainScrolledWindow";
mainScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
mainVbox.Add(mainScrolledWindow);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(mainVbox[mainScrolledWindow]));
w2.Position = 1;
w2.Fill=true;
w2.Expand=true;
//Create Toolbar Buttons
//Add New Table
buttonNew = new ToolButton(new Gtk.Image (Gtk.Stock.New, IconSize.Button),"Add Table");
buttonNew.Sensitive = true;
buttonNew.TooltipMarkup = "Add a new empty table";
buttonNew.IsImportant = true;
buttonNew.Clicked += new EventHandler (OnbuttonNewActionActivated);
buttonNew.Activate();
buttonNew.Show();
toolbar.Add (buttonNew);
//Create a Relationship between two tables
buttonRelationship = new ToolButton(new Gtk.Image (Gtk.Stock.New, IconSize.Button),"Relationship");
buttonRelationship.Sensitive = true;
buttonRelationship.TooltipMarkup = "Add a new relationship between tables";
buttonRelationship.IsImportant = true;
buttonRelationship.Clicked += new EventHandler (OnbuttonRelationshipActivated);
buttonRelationship.Activate();
buttonRelationship.Show();
toolbar.Add (buttonRelationship);
//Delete Selected Figure(s)
buttonDelete = new ToolButton(new Gtk.Image (Gtk.Stock.New, IconSize.Button),"Remove");
buttonDelete.Sensitive = true;
buttonDelete.TooltipMarkup = "Remove selected figure(s) from diagram (table or relationship)";
buttonDelete.IsImportant = true;
buttonDelete.Clicked += new EventHandler (buttonDeleteRelationshipActivated);
buttonDelete.Activate();
buttonDelete.Show();
toolbar.Add (buttonDelete);
//Select Active Database
comboConnections = new DatabaseConnectionContextComboBox ();
selectedConnection = comboConnections.DatabaseConnection;
comboConnections.Changed += new EventHandler (ConnectionChanged);
ToolItem comboItem = new ToolItem ();
comboItem.Child = comboConnections;
comboItem.Show();
toolbar.Add (new SeparatorToolItem ());
toolbar.Add (comboItem);
//Show all items
mainVbox.ShowAll ();
}