本文整理汇总了C#中Gtk.Toolbar类的典型用法代码示例。如果您正苦于以下问题:C# Toolbar类的具体用法?C# Toolbar怎么用?C# Toolbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Toolbar类属于Gtk命名空间,在下文中一共展示了Toolbar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:sgtnasty,项目名称:battle,代码行数:35,代码来源:MainWindow.cs
示例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);
}
开发者ID:msiyer,项目名称:Pinta,代码行数:30,代码来源:BaseBrushTool.cs
示例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 ();
}
开发者ID:robpvn,项目名称:Pinta,代码行数:28,代码来源:ToolBoxWidget.cs
示例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);
}
开发者ID:sgtnasty,项目名称:battle,代码行数:32,代码来源:BattleWindow.cs
示例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;
}
}
开发者ID:msiyer,项目名称:Pinta,代码行数:46,代码来源:DashPatternBox.cs
示例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);
}
开发者ID:msiyer,项目名称:Pinta,代码行数:29,代码来源:PaintBrushTool.cs
示例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 ();
}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:59,代码来源:SqlQueryView.cs
示例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();
}
开发者ID:sgtnasty,项目名称:battle,代码行数:59,代码来源:MainWindow.cs
示例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;
}
开发者ID:msiyer,项目名称:Pinta,代码行数:10,代码来源:WindowShell.cs
示例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;
}
开发者ID:saraa,项目名称:fishtastic,代码行数:55,代码来源:TestToolbar.cs
示例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);
}
开发者ID:sgtnasty,项目名称:battle,代码行数:53,代码来源:AdeptusWindow.cs
示例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;
};
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:49,代码来源:CombinedDesignView.cs
示例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);
}
开发者ID:hekar,项目名称:Vaporized,代码行数:15,代码来源:Friends.cs
示例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;
}
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:16,代码来源:LogWindow.cs
示例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 ();
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:47,代码来源:DemoIconView.cs
示例16: DefaultMonitorPad
public DefaultMonitorPad(string title, string icon)
{
buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
textEditorControl = new Gtk.TextView (buffer);
textEditorControl.Editable = false;
scroller = new Gtk.ScrolledWindow ();
scroller.ShadowType = ShadowType.In;
scroller.Add (textEditorControl);
Toolbar toolbar = new Toolbar ();
toolbar.IconSize = IconSize.SmallToolbar;
toolbar.Orientation = Orientation.Vertical;
toolbar.ToolbarStyle = ToolbarStyle.Icons;
buttonStop = new ToolButton ("gtk-stop");
buttonStop.Clicked += new EventHandler (OnButtonStopClick);
buttonStop.SetTooltip (tips, "Stop", "Stop");
toolbar.Insert (buttonStop, -1);
ToolButton buttonClear = new ToolButton ("gtk-clear");
buttonClear.Clicked += new EventHandler (OnButtonClearClick);
buttonClear.SetTooltip (tips, "Clear console", "Clear console");
toolbar.Insert (buttonClear, -1);
hbox = new HBox (false, 5);
hbox.PackStart (scroller, true, true, 0);
hbox.PackEnd (toolbar, false, false, 0);
bold = new TextTag ("bold");
bold.Weight = Pango.Weight.Bold;
buffer.TagTable.Add (bold);
tag = new TextTag ("0");
tag.Indent = 10;
buffer.TagTable.Add (tag);
tags.Add (tag);
Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
this.title = title;
this.icon = icon;
this.markupTitle = title;
Control.ShowAll ();
}
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:46,代码来源:DefaultMonitorPad.cs
示例17: BuildToolbar
public static void BuildToolbar(Toolbar toolbar, Tooltips tooltips, ActionModelNode node, int depth)
{
if (node.Action != null)
{
// create the tool button
ToolButton button = new ActiveToolbarButton((IClickAction)node.Action, tooltips);
toolbar.Insert(button, toolbar.NItems);
}
else
{
foreach (ActionModelNode child in node.ChildNodes)
{
BuildToolbar(toolbar, tooltips, child, depth + 1);
}
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:17,代码来源:GtkToolbarBuilder.cs
示例18: addToolbars
/// <summary>
/// reads the given config file and creates toolbars and buttons
/// </summary>
/// <param name='frame'>
/// Frame.
/// </param>
public static void addToolbars(Toolbar toolbar, String configfile, bool hookdelegates, Type type = null, object callingObject=null)
{
String xpath = "//toolbar";
if (type != null)
{
xpath += "[@class='" + type.ToString() + "']";
} else
{
xpath += "[not(@class)]";
}
Console.WriteLine ("addToolbars:" + configfile + xpath);
XmlNodeList lst = Sharpend.Configuration.ConfigurationManager.getValues(configfile, xpath);
foreach (XmlNode nd in lst)
{
XmlNodeList btns = nd.SelectNodes(".//button");
foreach (XmlNode bn in btns)
{
String classname = XmlHelper.getAttributeValue(bn,"class");
String assembly = XmlHelper.getAttributeValue(bn,"assembly");
String icon = XmlHelper.getAttributeValue(bn,"icon");
String btn_title = XmlHelper.getAttributeValue(bn,"title");
String stock_id = XmlHelper.getAttributeValue(bn,"stock_id");
String eventargs = XmlHelper.getAttributeValue(bn,"eventargs");
String buttonname = XmlHelper.getAttributeValue(bn,"name");
Widget btn = createButton(classname,assembly,icon,btn_title,stock_id, eventargs);
if (btn != null)
{
btn.Visible = true;
toolbar.Add(btn);
if (hookdelegates)
{
hookDelegates(bn,btn, callingObject);
}
if (!String.IsNullOrEmpty(buttonname))
{
btn.Name = buttonname;
}
}
}
}
}
开发者ID:sharpend,项目名称:Sharpend,代码行数:51,代码来源:ToolbarHelper.cs
示例19: add_toolbar
public void add_toolbar(string name, Toolbar toolbar)
{
Gtk.Label label = new Label(name);
label.SetSizeRequest((int)Sugar.Style.TOOLBOX_TAB_LABEL_WIDTH, -1);
label.SetAlignment(0.0f, 0.5f);
Gtk.HBox toolbar_box = new HBox();
toolbar_box.PackStart(toolbar,true, true, Sugar.Style.TOOLBOX_HORIZONTAL_PADDING);
toolbar_box.ExposeEvent += _toolbar_box_expose_cb;
_notebook.AppendPage(toolbar_box, label);
toolbar_box.Show();
if (_notebook.NPages>1) {
_notebook.ShowTabs=true;
// _separator.Show();
}
}
开发者ID:mauroguardarini,项目名称:sugar-sharp,代码行数:18,代码来源:Toolbox.cs
示例20: MainWindow
public MainWindow()
: base("ClearCanvas")
{
this.SetDefaultSize(Screen.Width, Screen.Height);
_workspaceToolViewManagers = new Dictionary<IWorkspace, ToolViewManager>();
_mainMenu = new MenuBar();
_toolBar = new Toolbar();
_notebook = new Notebook();
_notebook.TabPos = PositionType.Top;
_notebook.SwitchPage += OnNotebookSwitchPage;
// this box holds the main menu
HBox menuBox = new HBox(false, 0);
menuBox.PackStart(_mainMenu, true, true, 0);
// this box holds the toolbar
_toolBarBox = new HBox(false, 0);
_toolBarBox.PackStart(_toolBar, true, true, 0);
// this box holds the overall layout
_outerBox = new VBox(false, 0);
_outerBox.PackStart(menuBox, false, false, 0);
_outerBox.PackStart(_toolBarBox, false, false, 0);
_outerBox.PackStart(_notebook, true, true, 0);
//WorkstationModel.WorkspaceManager.Workspaces.ItemAdded += new EventHandler<WorkspaceEventArgs>(OnWorkspaceAdded);
//WorkstationModel.WorkspaceManager.Workspaces.ItemRemoved += new EventHandler<WorkspaceEventArgs>(OnWorkspaceRemoved);
//WorkstationModel.WorkspaceManager.WorkspaceActivated += new EventHandler<WorkspaceEventArgs>(OnWorkspaceActivated);
DesktopApplication.WorkspaceManager.Workspaces.ItemAdded += new EventHandler<WorkspaceEventArgs>(OnWorkspaceAdded);
DesktopApplication.WorkspaceManager.Workspaces.ItemRemoved += new EventHandler<WorkspaceEventArgs>(OnWorkspaceRemoved);
DesktopApplication.WorkspaceManager.WorkspaceActivated += new EventHandler<WorkspaceEventArgs>(OnWorkspaceActivated);
this.Add(_outerBox);
this.ShowAll();
BuildMenusAndToolBars(null);
UpdateToolViews(null);
}
开发者ID:nhannd,项目名称:Xian,代码行数:42,代码来源:MainWindow.cs
注:本文中的Gtk.Toolbar类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论