本文整理汇总了C#中Gtk.Toolbar类的典型用法代码示例。如果您正苦于以下问题:C# Toolbar类的具体用法?C# Toolbar怎么用?C# Toolbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Toolbar类属于Gtk命名空间,在下文中一共展示了Toolbar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: build
private void build()
{
this.vbox1 = new VBox();
this.toolbar1 = new Toolbar();
this.aboutbtn1 = new ToolButton(Stock.About);
this.aboutbtn1.Label = "About";
this.aboutbtn1.IsImportant = true;
this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
this.toolbar1.Add(this.aboutbtn1);
this.vbox1.PackStart(this.toolbar1, false, true, 0);
this.treestore1 = this.populateTreeStoreFromSession();
this.scrollw1 = new ScrolledWindow();
this.hpaned1 = new HPaned();
this.treeview1 = new TreeView(this.treestore1);
this.treeview1.HeadersVisible = true;
this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0);
this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1);
this.treeview1.ExpandAll();
this.scrollw1.Add(this.treeview1);
this.iconview1 = new IconView();
this.hpaned1.Add1(this.scrollw1);
this.hpaned1.Add2(this.iconview1);
this.hpaned1.Position = 254;
this.vbox1.PackStart(this.hpaned1, true, true, 0);
this.statusbar1 = new Statusbar();
this.vbox1.PackEnd(this.statusbar1, false, true, 0);
this.Add(this.vbox1);
this.SetSizeRequest(800,600);
this.DeleteEvent += HandleDeleteEvent;
}
示例2: OnBuildToolBar
protected override void OnBuildToolBar (Toolbar tb)
{
base.OnBuildToolBar (tb);
if (brush_width_label == null)
brush_width_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Brush width")));
tb.AppendItem (brush_width_label);
if (brush_width_minus == null) {
brush_width_minus = new ToolBarButton ("Toolbar.MinusButton.png", "", Catalog.GetString ("Decrease brush size"));
brush_width_minus.Clicked += MinusButtonClickedEvent;
}
tb.AppendItem (brush_width_minus);
if (brush_width == null)
brush_width = new ToolBarComboBox (65, 1, true, "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "20", "25", "30", "35",
"40", "45", "50", "55");
tb.AppendItem (brush_width);
if (brush_width_plus == null) {
brush_width_plus = new ToolBarButton ("Toolbar.PlusButton.png", "", Catalog.GetString ("Increase brush size"));
brush_width_plus.Clicked += PlusButtonClickedEvent;
}
tb.AppendItem (brush_width_plus);
}
示例3: ToolBoxWidget
public ToolBoxWidget()
{
// First column
tb1 = new Toolbar () {
Name = "tb1",
Orientation = Orientation.Vertical,
ShowArrow = false,
ToolbarStyle = ToolbarStyle.Icons,
IconSize = IconSize.SmallToolbar
};
PackStart (tb1, false, false, 0);
// second column
tb2 = new Toolbar () {
Name = "tb2",
Orientation = Orientation.Vertical,
ShowArrow = false,
ToolbarStyle = ToolbarStyle.Icons,
IconSize = IconSize.SmallToolbar
};
PackStart (tb2, false, false, 0);
PintaCore.Tools.ToolAdded += HandleToolAdded;
ShowAll ();
}
示例4: build
protected void build()
{
this.SetDefaultSize (1000, 600);
this.Title = "Battle";
this.DeleteEvent += HandleDeleteEvent;
this.vbox = new VBox ();
this.tbar = new Toolbar ();
this.tbar.ToolbarStyle = ToolbarStyle.BothHoriz;
this.about = new ToolButton (Stock.About);
this.about.IsImportant = false;
this.about.Label = "About";
this.about.TooltipText = "About this application";
this.tbar.Add (this.about);
this.hpaned = new HPaned ();
this.frame = new Frame ("Battle Map");
this.map = new MapControl ();
this.frame.Add (this.map);
Label a = new Label ("Welcome");
this.hpaned.Pack1 (a, false, false);
this.hpaned.Pack2 (this.frame, true, true);
this.sbar = new Statusbar ();
this.vbox.PackStart (this.tbar, false, true, 0);
this.vbox.PackStart (this.hpaned, true, true, 0);
this.vbox.PackEnd (this.sbar, false, true, 0);
this.Add (this.vbox);
}
示例5: SetupToolbar
/// <summary>
/// Sets up the DashPatternBox in the Toolbar.
///
/// Note that the dash pattern change event response code must be created manually outside of the DashPatternBox
/// (using the returned Gtk.ComboBox from the SetupToolbar method) so that each tool that uses it
/// can react to the change in pattern according to its usage.
///
/// Returns null if the DashPatternBox has already been setup; otherwise, returns the DashPatternBox itself.
/// </summary>
/// <param name="tb">The Toolbar to add the DashPatternBox to.</param>
/// <returns>null if the DashPatternBox has already been setup; otherwise, returns the DashPatternBox itself.</returns>
public Gtk.ComboBox SetupToolbar(Toolbar tb)
{
if (dashPatternSep == null)
{
dashPatternSep = new SeparatorToolItem();
}
tb.AppendItem(dashPatternSep);
if (dashPatternLabel == null)
{
dashPatternLabel = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Dash")));
}
tb.AppendItem(dashPatternLabel);
if (comboBox == null)
{
comboBox = new ToolBarComboBox(100, 0, true,
"-", " -", " --", " ---", " -", " -", " - --", " - - --------", " - - ---- - ----");
}
tb.AppendItem(comboBox);
if (dashChangeSetup)
{
return null;
}
else
{
dashChangeSetup = true;
return comboBox.ComboBox;
}
}
示例6: OnBuildToolBar
protected override void OnBuildToolBar (Toolbar tb)
{
base.OnBuildToolBar (tb);
// Change the cursor when the BrushWidth is changed.
brush_width.ComboBox.Changed += (sender, e) => SetCursor (DefaultCursor);
tb.AppendItem (new Gtk.SeparatorToolItem ());
if (brush_label == null)
brush_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Type")));
if (brush_combo_box == null) {
brush_combo_box = new ToolBarComboBox (100, 0, false);
brush_combo_box.ComboBox.Changed += (o, e) => {
Gtk.TreeIter iter;
if (brush_combo_box.ComboBox.GetActiveIter (out iter)) {
active_brush = (BasePaintBrush)brush_combo_box.Model.GetValue (iter, 1);
} else {
active_brush = default_brush;
}
};
RebuildBrushComboBox ();
}
tb.AppendItem (brush_label);
tb.AppendItem (brush_combo_box);
}
示例7: SqlQueryView
public SqlQueryView ()
{
stoppedQueries = new List<object> ();
vbox = new VBox (false, 6);
vbox.BorderWidth = 6;
sqlEditor = new SqlEditorWidget ();
sqlEditor.TextChanged += new EventHandler (SqlChanged);
Toolbar toolbar = new Toolbar ();
toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
buttonExecute = new ToolButton (
Services.Resources.GetImage ("md-db-execute", IconSize.SmallToolbar),
GettextCatalog.GetString ("Execute")
);
buttonStop = new ToolButton ("gtk-stop");
buttonClear = new ToolButton (Services.Resources.GetImage ("gtk-clear", IconSize.Button), GettextCatalog.GetString ("Clear Results"));
buttonStop.Sensitive = false;
buttonExecute.Sensitive = false;
buttonExecute.Clicked += new EventHandler (ExecuteClicked);
buttonStop.Clicked += new EventHandler (StopClicked);
buttonClear.Clicked += new EventHandler (ClearClicked);
comboConnections = new DatabaseConnectionContextComboBox ();
selectedConnection = comboConnections.DatabaseConnection;
comboConnections.Changed += new EventHandler (ConnectionChanged);
buttonExecute.IsImportant = true;
ToolItem comboItem = new ToolItem ();
comboItem.Child = comboConnections;
toolbar.Add (buttonExecute);
toolbar.Add (buttonStop);
toolbar.Add (buttonClear);
toolbar.Add (new SeparatorToolItem ());
toolbar.Add (comboItem);
pane = new VPaned ();
ScrolledWindow windowStatus = new ScrolledWindow ();
status = new TextView ();
windowStatus.Add (status);
notebook = new Notebook ();
notebook.AppendPage (windowStatus, new Label (GettextCatalog.GetString ("Status")));
pane.Pack1 (sqlEditor, true, true);
pane.Pack2 (notebook, true, true);
vbox.PackStart (toolbar, false, true, 0);
vbox.PackStart (pane, true, true, 0);
vbox.ShowAll ();
notebook.Hide ();
}
示例8: build
private void build()
{
this.vbox1 = new Gtk.VBox();
this.toolbar1 = new Gtk.Toolbar();
this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
this.new_toolbutton = new ToolButton(Stock.New);
this.new_toolbutton.IsImportant = true;
this.new_toolbutton.Label = "New Character";
this.new_toolbutton.Clicked += HandleNew_toolbuttonhandleClicked;
this.toolbar1.Add(this.new_toolbutton);
this.pref_toolbutton = new ToolButton(Stock.Preferences);
this.pref_toolbutton.IsImportant = true;
this.pref_toolbutton.Label = "Preferences";
this.pref_toolbutton.Clicked += HandlePref_toolbuttonhandleClicked;
this.toolbar1.Add(this.pref_toolbutton);
this.quit_toolbutton = new ToolButton(Stock.Quit);
this.quit_toolbutton.IsImportant = true;
this.quit_toolbutton.Label = "Quit";
this.quit_toolbutton.Clicked += HandleQuit_toolbuttonhandleClicked;
this.toolbar1.Add(this.quit_toolbutton);
this.about_toolbutton = new ToolButton(Stock.About);
this.about_toolbutton.IsImportant = true;
this.about_toolbutton.Label = "About";
this.about_toolbutton.Clicked += HandleAbout_toolbuttonhandleClicked;
SeparatorToolItem sti = new SeparatorToolItem();
sti.Draw = false;
sti.Expand = true;
this.toolbar1.Add(sti);
this.toolbar1.Add(this.about_toolbutton);
this.statusbar1 = new Gtk.Statusbar();
this.image1 = new Image(MediaManager.GetPixbufFromBaseFile("BLLogo.jpg").ScaleSimple(296, 149, Gdk.InterpType.Bilinear));
Gtk.VBox vbox2 = new Gtk.VBox();
Gtk.ScrolledWindow sw1 = new Gtk.ScrolledWindow();
TreeStore ts1 = new TreeStore (typeof (string), typeof (string));
ts1.AppendValues("Player Characters",DateTime.Now.ToString());
ts1.AppendValues("Non-Player Characters",DateTime.Now.ToString());
ts1.AppendValues("Database",DateTime.Now.ToString());
TreeView tv1 = new TreeView ();
tv1.Model = ts1;
tv1.HeadersVisible = true;
tv1.AppendColumn ("Source", new CellRendererText (), "text", 0);
tv1.AppendColumn ("Last Update", new CellRendererText (), "text", 1);
sw1.Add(tv1);
vbox2.PackStart(this.image1, false, true, 0);
vbox2.PackEnd(sw1, true, true, 0);
this.vbox1.PackStart(this.toolbar1, false, true, 0);
this.vbox1.PackStart(vbox2, true, true, 0);
this.vbox1.PackStart(this.statusbar1, false, true, 0);
this.Add(this.vbox1);
//this.SetSizeRequest(640, Screen.Height - 100);
this.SetSizeRequest(480, 640);
this.Icon = Battle.Gui.MediaManager.GetPixbufFromBaseFile("LSIMMS.png");
this.statusbar1.Push(0, string.Format("{0} started @ {1}",
this.session.GetType().ToString(),
this.session.StartTime.ToString()));
this.Maximize();
}
示例9: CreateToolBar
public Toolbar CreateToolBar (string name)
{
main_toolbar = new Toolbar ();
main_toolbar.Name = name;
menu_layout.PackStart (main_toolbar, false, false, 0);
main_toolbar.Show ();
return main_toolbar;
}
示例10: Create
public static Gtk.Window Create()
{
window = new Window ("Toolbar");
window.Resizable = false;
toolbar = new Toolbar ();
toolbar.InsertStock (Stock.New, "Stock icon: New", "Toolbar/New",
new SignalFunc (set_small_icon), IntPtr.Zero, -1);
toolbar.InsertStock (Stock.Open, "Stock icon: Open", "Toolbar/Open",
new SignalFunc (set_large_icon), IntPtr.Zero, -1);
toolbar.AppendSpace ();
toolbar.AppendItem ("Toggle tooltips", "toggle showing of tooltips", "Toolbar/Tooltips",
new Image (Stock.DialogInfo, IconSize.LargeToolbar),
new SignalFunc (toggle_tooltips));
toolbar.AppendSpace ();
toolbar.AppendItem ("Horizontal", "Horizontal layout", "Toolbar/Horizontal",
new Image (Stock.GoForward, IconSize.LargeToolbar),
new SignalFunc (set_horizontal));
toolbar.AppendItem ("Vertical", "Vertical layout", "Toolbar/Vertical",
new Image (Stock.GoUp, IconSize.LargeToolbar),
new SignalFunc (set_vertical));
toolbar.AppendSpace ();
toolbar.AppendItem ("Icons", "Only show icons", "Toolbar/IconsOnly",
new Image (Stock.Home, IconSize.LargeToolbar),
new SignalFunc (set_icon_only));
toolbar.AppendItem ("Text", "Only show Text", "Toolbar/TextOnly",
new Image (Stock.JustifyFill, IconSize.LargeToolbar),
new SignalFunc (set_text_only));
toolbar.AppendItem ("Both", "Show both Icon & Text", "Toolbar/Both",
new Image (Stock.Index, IconSize.LargeToolbar),
new SignalFunc (set_both));
toolbar.AppendItem ("Both (Horizontal)", "Show Icon & Text horizontally", "Toolbar/BothHoriz",
new Image (Stock.Index, IconSize.LargeToolbar),
new SignalFunc (set_both_horiz));
toolbar.AppendSpace ();
toolbar.InsertStock (Stock.Close, "Stock icon: Close", "Toolbar/Close",
new SignalFunc (Close_Button), IntPtr.Zero, -1);
window.Add (toolbar);
window.ShowAll ();
return window;
}
示例11: build
private void build()
{
this.SetDefaultSize (1000, 600);
this.vbox1 = new VBox ();
this.toolbar1 = new Toolbar ();
this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
this.newcharbutton = new ToolButton (Stock.New);
this.newcharbutton.Label = "New";
this.newcharbutton.TooltipText = "New Character";
this.newcharbutton.IsImportant = true;
this.newcharbutton.Clicked += HandleNewcharbuttonClicked;
this.toolbar1.Add (this.newcharbutton);
this.savecharbutton = new ToolButton (Stock.Save);
this.savecharbutton.Label = "Save";
this.savecharbutton.TooltipText = "Save Character";
this.savecharbutton.Clicked += HandleSavecharbuttonClicked;
this.toolbar1.Add(this.savecharbutton);
this.printcharbutton = new ToolButton (Stock.Print);
this.printcharbutton.Label = "Print";
this.printcharbutton.TooltipText = "Print Character";
this.printcharbutton.Clicked += HandlePrintcharbuttonClicked;
this.toolbar1.Add(this.printcharbutton);
this.toolbar1.Add(new SeparatorToolItem());
this.rollbutton = new ToolButton (Stock.Refresh);
this.rollbutton.Label = "Roll";
this.rollbutton.TooltipText = "Roll Characteristics";
this.rollbutton.IsImportant = true;
this.rollbutton.Clicked += HandleRollbuttonClicked;
this.toolbar1.Add(this.rollbutton);
this.aboutbutton = new ToolButton (Stock.About);
this.aboutbutton.Label = "About";
this.aboutbutton.TooltipText = "About Adeptus";
this.aboutbutton.Clicked += HandleAboutbuttonClicked;
SeparatorToolItem sti = new SeparatorToolItem();
sti.Draw = false;
sti.Expand = true;
this.toolbar1.Add(sti);
this.toolbar1.Add (this.aboutbutton);
this.frame1 = new Frame ();
this.frame1.Add(new Image(Gdk.Pixbuf.LoadFromResource("Adeptus.Gui.EmperorVHorus.jpg")));
this.statusbar1 = new Statusbar ();
this.statusbar1.Push (0, "Ready");
this.vbox1.PackStart (this.toolbar1, false, true, 0);
this.vbox1.PackStart (this.frame1, true, true, 0);
this.vbox1.PackEnd (this.statusbar1, false, true, 0);
this.Add (this.vbox1);
}
示例12: CombinedDesignView
public CombinedDesignView (IViewContent content)
{
this.content = content;
if (content is IEditableTextBuffer) {
((IEditableTextBuffer)content).CaretPositionSet += delegate {
ShowPage (0);
};
}
content.ContentChanged += new EventHandler (OnTextContentChanged);
content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
notebook = new Gtk.Notebook ();
// Main notebook
notebook.TabPos = Gtk.PositionType.Bottom;
notebook.ShowTabs = false;
notebook.ShowBorder = false;
notebook.Show ();
box = new VBox ();
// Bottom toolbar
toolbar = new Toolbar ();
toolbar.IconSize = IconSize.SmallToolbar;
toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
toolbar.ShowArrow = false;
CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
crc.Show ();
AddButton (GettextCatalog.GetString ("Source Code"), crc).Active = true;
toolbar.ShowAll ();
box.PackStart (notebook, true, true, 0);
box.PackStart (toolbar, false, false, 0);
box.Show ();
IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged);
content.Control.Realized += delegate {
if (content != null && content.WorkbenchWindow != null)
content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
};
notebook.SwitchPage += delegate {
if (content != null && content.WorkbenchWindow != null)
content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
};
}
示例13: SetupChildren
public void SetupChildren ()
{
VBox l = new VBox (false, 0);
Add (l);
menubar = CreateMenu ();
toolbar = CreateToolbar ();
statusbar = CreateStatusBar ();
friends = CreateFriends ();
l.PackStart (menubar, false, false, 0);
l.PackStart (toolbar);
l.PackStart (statusbar);
}
示例14: CreateToolbar
private Toolbar CreateToolbar()
{
Toolbar tb = new Toolbar();
ToolbarTooltips = new Tooltips();
SaveButton = new ToolButton(Gtk.Stock.Save);
SaveButton.SetTooltip(ToolbarTooltips, Util.GS("Save the synchronization log"), "Toolbar/Save Log");
SaveButton.Clicked += new EventHandler(SaveLogHandler);
tb.Insert(SaveButton, -1);
ClearButton = new ToolButton(Gtk.Stock.Clear);
ClearButton.SetTooltip(ToolbarTooltips, Util.GS("Clear the synchronization log"), "Toolbar/Clear Log");
ClearButton.Clicked += new EventHandler(ClearLogHandler);
tb.Insert(ClearButton, -1);
SaveButton.Sensitive = false;
ClearButton.Sensitive = false;
return tb;
}
示例15: DemoIconView
public DemoIconView () : base ("Gtk.IconView demo")
{
SetDefaultSize (650, 400);
DeleteEvent += new DeleteEventHandler (OnWinDelete);
VBox vbox = new VBox (false, 0);
Add (vbox);
Toolbar toolbar = new Toolbar ();
vbox.PackStart (toolbar, false, false, 0);
upButton = new ToolButton (Stock.GoUp);
upButton.IsImportant = true;
upButton.Sensitive = false;
toolbar.Insert (upButton, -1);
ToolButton homeButton = new ToolButton (Stock.Home);
homeButton.IsImportant = true;
toolbar.Insert (homeButton, -1);
fileIcon = GetIcon (Stock.File);
dirIcon = GetIcon (Stock.Open);
ScrolledWindow sw = new ScrolledWindow ();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vbox.PackStart (sw, true, true, 0);
// Create the store and fill it with the contents of '/'
store = CreateStore ();
FillStore ();
IconView iconView = new IconView (store);
iconView.SelectionMode = SelectionMode.Multiple;
upButton.Clicked += new EventHandler (OnUpClicked);
homeButton.Clicked += new EventHandler (OnHomeClicked);
iconView.TextColumn = COL_DISPLAY_NAME;
iconView.PixbufColumn = COL_PIXBUF;
iconView.ItemActivated += new ItemActivatedHandler (OnItemActivated);
sw.Add (iconView);
iconView.GrabFocus ();
ShowAll ();
}