本文整理汇总了C#中Gtk.ToolButton类的典型用法代码示例。如果您正苦于以下问题:C# ToolButton类的具体用法?C# ToolButton怎么用?C# ToolButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolButton类属于Gtk命名空间,在下文中一共展示了ToolButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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
示例2: AddItem
// TODO: This should handle sorting the items
public void AddItem(ToolButton item)
{
if (tb1.NItems <= tb2.NItems)
tb1.Insert (item, tb1.NItems);
else
tb2.Insert (item, tb2.NItems);
}
开发者ID:robpvn,项目名称:Pinta,代码行数:8,代码来源:ToolBoxWidget.cs
示例3: 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
示例4: 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
示例5: 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
示例6: DrawIcons
protected override void DrawIcons()
{
_tbuttonClass = new Gtk.ToolButton ("");
_tbuttonClass.IconWidget = new Gtk.Image (MonoUML.IconLibrary.PixbufLoader.GetIcon ("class_tree.png"));
_tbuttonClass.SetTooltip (_tooltips, GettextCatalog.GetString ("Add a class"), GettextCatalog.GetString ("Add a class"));
Insert (_tbuttonClass, -1);
}
开发者ID:MonoBrasil,项目名称:historico,代码行数:8,代码来源:ToolbarClass.cs
示例7: DrawIcons
protected override void DrawIcons()
{
_tbuttonActor = CreateToolButton ("actor_tree.png", GettextCatalog.GetString ("Add an Actor"));
_tbuttonUseCase = CreateToolButton ("usecase_tree.png", GettextCatalog.GetString ("Add an Use Case"));
Insert (_tbuttonActor, -1);
Insert (_tbuttonUseCase, -1);
_tbuttonActor.Clicked += QueueActor;
_tbuttonUseCase.Clicked += QueueUseCase;
}
开发者ID:MonoBrasil,项目名称:historico,代码行数:9,代码来源:ToolbarUseCase.cs
示例8: ToolbarButton
public ToolbarButton(ICommand cmd)
: base(cmd)
{
button = new ToolButton(cmd.Properties.Icon);
button.Clicked += new EventHandler (OnClicked);
button.Label = cmd.Properties.Text;
this.Add(button);
button.Show();
this.ShowAll();
}
开发者ID:BackupTheBerlios,项目名称:sofia-svn,代码行数:10,代码来源:ToolbarFactories.cs
示例9: 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
示例10: 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
示例11: 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
示例12: 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
示例13: Initialize
public override void Initialize ()
{
separator = new Gtk.SeparatorToolItem ();
separator.Show ();
record_button = new Gtk.ToolButton (Gtk.Stock.MediaRecord);
record_button.Clicked += OnRecordButtonClicked;
record_button.Show ();
play_button = new Gtk.ToolButton (Gtk.Stock.MediaPlay);
play_button.Clicked += OnPlayButtonClicked;
play_button.Show ();
stop_button = new Gtk.ToolButton (Gtk.Stock.MediaStop);
stop_button.Clicked += OnStopButtonClicked;
stop_button.Show ();
delete_item = new Gtk.MenuItem ("Delete Voice Note");
delete_item.Activated += OnDeleteItemActivated;
delete_item.Show ();
initialize ();
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:23,代码来源:VoiceNote.cs
示例14: BuildToolBar
void BuildToolBar()
{
IconFactory icon_factory = new IconFactory ();
AddIcon (icon_factory, "logic-games", "logic-games-32.png");
AddIcon (icon_factory, "math-games", "math-games-32.png");
AddIcon (icon_factory, "memory-games", "memory-games-32.png");
AddIcon (icon_factory, "verbal-games", "verbal-games-32.png");
AddIcon (icon_factory, "pause", "pause-32.png");
AddIcon (icon_factory, "resume", "resume-32.png");
AddIcon (icon_factory, "endgame", "endgame-32.png");
AddIcon (icon_factory, "allgames", "allgames-32.png");
icon_factory.AddDefault ();
IconSize = Gtk.IconSize.Dnd;
AllButton = new ToolButton ("allgames");
AllButton.TooltipText = Catalog.GetString ("Play all the games");
AllButton.Label = Catalog.GetString ("All");
Insert (AllButton, -1);
LogicButton = new ToolButton ("logic-games");
LogicButton.TooltipText = Catalog.GetString ("Play games that challenge your reasoning and thinking");
LogicButton.Label = Catalog.GetString ("Logic");
Insert (LogicButton, -1);
CalculationButton = new ToolButton ("math-games");
CalculationButton.Label = Catalog.GetString ("Calculation");
CalculationButton.TooltipText = Catalog.GetString ("Play games that challenge your mental calculation skills");
Insert (CalculationButton, -1);
MemoryButton = new ToolButton ("memory-games");
MemoryButton.Label = Catalog.GetString ("Memory");
MemoryButton.TooltipText = Catalog.GetString ("Play games that challenge your short term memory");
Insert (MemoryButton, -1);
VerbalButton = new ToolButton ("verbal-games");
VerbalButton.Label = Catalog.GetString ("Verbal");
VerbalButton.TooltipText = Catalog.GetString ("Play games that challenge your verbal aptitude");
Insert (VerbalButton, -1);
PauseButton = new ToolButton ("pause");
PauseButton.Label = Catalog.GetString ("Pause");
PauseButton.TooltipText = Catalog.GetString ("Pause or resume the game");
Insert (PauseButton, -1);
FinishButton = new ToolButton ("endgame");
FinishButton.TooltipText = Catalog.GetString ("End the game and show score");
FinishButton.Label = Catalog.GetString ("End");
Insert (FinishButton, -1);
}
开发者ID:GNOME,项目名称:gbrainy,代码行数:50,代码来源:Toolbar.cs
示例15: Gui
public Gui()
{
dlayer = new DataLayer ();
window_addtag.SetSizeRequest (100, 100);
window.Icon = new Gdk.Pixbuf ("lipsticktower.jpg"); //Kalle, Andreas :: Call for Icon!
Gtk.Entry tagEntry = new Gtk.Entry ();
Gtk.VBox tagbox = new Gtk.VBox (false, 0);
tagbox.PackStart (tagEntry, true, true, 0);
window_addtag.Add (tagbox);
window_addtag.ShowAll ();
window.SetSizeRequest (300, 500);
window.DeleteEvent += DeleteEvent;
window.Icon = new Gdk.Pixbuf ("lipsticktower.jpg"); //Kalle, Andreas :: Call for Icon!
Gtk.VBox box = new Gtk.VBox (false, 0);
Gtk.HBox top = new Gtk.HBox (false, 0);
//Gtk.ComboBox selector = new Gtk.ComboBox ();
Gtk.ComboBox selector = ComboBox.NewText ();
ScrolledWindow scroll = new ScrolledWindow ();
filterEntry = new Gtk.Entry ();
filterEntry.MaxLength = 1;
filterEntry.Changed += OnFilterEntryTextChanged;
//Gtk.TreeView tree = new Gtk.TreeView ();
tree.HeadersVisible = false;
tree.Reorderable = true;
tree.EnableSearch = false;
tree.RowActivated += OnRowActivate;
Gtk.TreeViewColumn iconCol = new Gtk.TreeViewColumn ( );
iconCol.Title = "Icon";
Gtk.CellRendererPixbuf iconCell = new Gtk.CellRendererPixbuf ();
iconCol.PackStart (iconCell, true);
iconCol.SetCellDataFunc (iconCell, new Gtk.TreeCellDataFunc (RenderIcon));
Gtk.TreeViewColumn primCol = new Gtk.TreeViewColumn ( );
primCol.Title = "Primary Info";
Gtk.CellRendererText primInfoCell = new Gtk.CellRendererText ();
primCol.PackStart (primInfoCell, true);
primCol.SetCellDataFunc (primInfoCell, new Gtk.TreeCellDataFunc (RenderPrimary));
Gtk.TreeViewColumn secCol = new Gtk.TreeViewColumn ( );
secCol.Title = "Secondary Info";
Gtk.CellRendererText secInfoCell = new Gtk.CellRendererText ();
secCol.PackStart (secInfoCell, true);
secCol.SetCellDataFunc (secInfoCell, new Gtk.TreeCellDataFunc (RenderSecondary));
projects = DataLayer.GetProjectNames ();
foreach (string project in projects)
{
Console.WriteLine (project);
selector.AppendText (project);
}
selector.Changed += new EventHandler (OnSelectorChanged);
//Store AssetStore = dlayer.GetAssets (projID);
/*filter = new Gtk.TreeModelFilter (AssetStore, null);
filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree);
tree.Model = filter;*/
//tree.Model = dlayer.GetAssets (projID);
tree.AppendColumn (iconCol);
tree.AppendColumn (primCol);
tree.AppendColumn (secCol);
MenuBar menu = new MenuBar ();
Menu fileMenu = new Menu();
MenuItem menuItem = new MenuItem("_File");
menuItem.Submenu = fileMenu;
menu.Append(menuItem);
Statusbar status = new Statusbar ();
Toolbar tool = new Toolbar ();
ToolButton plus = new ToolButton (Gtk.Stock.Add);
plus.Clicked += OnAddClicked;
ToolButton minus = new ToolButton (Gtk.Stock.Remove);
minus.Clicked += OnMinusClicked;
box.PackStart (menu, false, true, 0);
box.PackStart (tool, false, true, 0);
tool.Insert(minus, 0);
tool.Insert(plus, 0);
top.PackStart (filterEntry, true, true, 0);
top.PackStart (selector, true, true, 0);
box.PackStart (top, false, true, 0);
scroll.Add (tree);
box.PackStart (scroll, true, true, 0);
box.PackStart (status, false, true, 0);
window.Add (box);
window.ShowAll ();
}
开发者ID:harokkar,项目名称:gothenburg,代码行数:94,代码来源:Gui.cs
示例16: SearchResultWidget
public SearchResultWidget ()
{
var vbox = new VBox ();
var toolbar = new Toolbar () {
Orientation = Orientation.Vertical,
IconSize = IconSize.Menu,
ToolbarStyle = ToolbarStyle.Icons,
};
this.PackStart (vbox, true, true, 0);
this.PackStart (toolbar, false, false, 0);
labelStatus = new Label () {
Xalign = 0,
Justify = Justification.Left,
};
var hpaned = new HPaned ();
vbox.PackStart (hpaned, true, true, 0);
vbox.PackStart (labelStatus, false, false, 0);
var resultsScroll = new CompactScrolledWindow ();
hpaned.Pack1 (resultsScroll, true, true);
scrolledwindowLogView = new CompactScrolledWindow ();
hpaned.Pack2 (scrolledwindowLogView, true, true);
textviewLog = new TextView () {
Editable = false,
};
scrolledwindowLogView.Add (textviewLog);
store = new ListStore (typeof (SearchResult),
typeof (bool) // didRead
);
treeviewSearchResults = new PadTreeView () {
Model = store,
HeadersClickable = true,
RulesHint = true,
};
treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
resultsScroll.Add (treeviewSearchResults);
var projectColumn = new TreeViewColumn {
Resizable = true,
SortColumnId = 1,
Title = GettextCatalog.GetString ("Project"),
Sizing = TreeViewColumnSizing.Fixed,
FixedWidth = 100
};
var projectPixbufRenderer = new CellRendererImage ();
projectColumn.PackStart (projectPixbufRenderer, false);
projectColumn.SetCellDataFunc (projectPixbufRenderer, ResultProjectIconDataFunc);
var renderer = treeviewSearchResults.TextRenderer;
renderer.Ellipsize = Pango.EllipsizeMode.End;
projectColumn.PackStart (renderer, true);
projectColumn.SetCellDataFunc (renderer, ResultProjectDataFunc);
treeviewSearchResults.AppendColumn (projectColumn);
var fileNameColumn = new TreeViewColumn {
Resizable = true,
SortColumnId = 2,
Title = GettextCatalog.GetString ("File"),
Sizing = TreeViewColumnSizing.Fixed,
FixedWidth = 200
};
var fileNamePixbufRenderer = new CellRendererImage ();
fileNameColumn.PackStart (fileNamePixbufRenderer, false);
fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc);
fileNameColumn.PackStart (renderer, true);
fileNameColumn.SetCellDataFunc (renderer, FileNameDataFunc);
treeviewSearchResults.AppendColumn (fileNameColumn);
TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"),
renderer, ResultTextDataFunc);
textColumn.Resizable = true;
textColumn.Sizing = TreeViewColumnSizing.Fixed;
textColumn.FixedWidth = 300;
pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"),
renderer, ResultPathDataFunc);
pathColumn.SortColumnId = 3;
pathColumn.Resizable = true;
pathColumn.Sizing = TreeViewColumnSizing.Fixed;
pathColumn.FixedWidth = 500;
store.DefaultSortFunc = DefaultSortFunc;
store.SetSortFunc (1, CompareProjectFileNames);
store.SetSortFunc (2, CompareFileNames);
store.SetSortFunc (3, CompareFilePaths);
treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
buttonStop = new ToolButton (new ImageView (Gui.Stock.Stop, Gtk.IconSize.Menu), null) { Sensitive = false };
buttonStop.Clicked += ButtonStopClicked;
buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
toolbar.Insert (buttonStop, -1);
var buttonClear = new ToolButton (new ImageView (Gui.Stock.Clear, Gtk.IconSize.Menu), null);
//.........这里部分代码省略.........
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:101,代码来源:SearchResultWidget.cs
示例17: FrameworkTree
//private Menu popupMenu;
public FrameworkTree()
{
Toolbar toolbar = new Toolbar ();
this.PackStart (toolbar, false, false, 0);
refreshButton = new ToolButton ("refresh.png");//Stock.Home);
refreshButton.IsImportant = true;
refreshButton.Label = "Refresh";
refreshButton.BorderWidth = 1;
refreshButton.Sensitive = false;
refreshButton.Clicked+= delegate {
if(MainClass.Workspace != null && !String.IsNullOrEmpty(MainClass.Workspace.FilePath)){
LoadLibs(MainClass.Workspace.RootDirectory);
}
};
toolbar.Insert (refreshButton, -1);
fileCreateButton = new ToolButton ("file-new.png");//Stock.Home);
fileCreateButton.IsImportant = true;
fileCreateButton.Label = "New File";
fileCreateButton.BorderWidth = 1;
fileCreateButton.Sensitive = false;
fileCreateButton.Clicked += new EventHandler (OnAddFileClicked);
toolbar.Insert (fileCreateButton, -1);
dirCreateButton = new ToolButton ("folder-new.png");//Stock.Home);
dirCreateButton.IsImportant = true;
dirCreateButton.Label = "New Folder";
dirCreateButton.BorderWidth = 1;
dirCreateButton.Sensitive = false;
dirCreateButton.Clicked += new EventHandler (OnAddDirectoryClicked);
toolbar.Insert (dirCreateButton, -1);
treeView = new TreeView();
treeView.ButtonReleaseEvent += new ButtonReleaseEventHandler(OnButtonRelease);
treeView.Model = store;
treeView.HeadersVisible = true;
//this.ExpandAll();
treeView.Selection.Mode = Gtk.SelectionMode.Single;
treeView.RowActivated += OnRowActivate;
treeView.ShowExpanders = true;
// TreeViewColumn display_column.PackStart (text_render, true);
CellRendererPixbuf crp = new CellRendererPixbuf();
crp.Ypad = 0;
crp.Yalign = 0;
Gtk.CellRendererText fileNameRenderer = new Gtk.CellRendererText();
fileNameRenderer.Ypad =0;
TreeViewColumn icon_column = new TreeViewColumn();//("Icon", crp, "pixbuf", ICO_ROW);
icon_column.PackStart (crp, false);
icon_column.AddAttribute(crp,"pixbuf",ICO_ROW);
icon_column.PackStart (fileNameRenderer, true);
icon_column.AddAttribute (fileNameRenderer, "markup", NAME_ROW);
treeView.AppendColumn(icon_column);
//treeView.AppendColumn("Icon", crp, "pixbuf", ICO_ROW);
treeView.AppendColumn("Name", fileNameRenderer, "text", NAME_ROW);
treeView.Columns[NAME_ROW].Visible = false;
CellRendererText textRenderer = new CellRendererText();
textRenderer.Ypad =0;
treeView.AppendColumn("FullPath", textRenderer, "text", PATH_ROW);
treeView.Columns[PATH_ROW].Visible = false;
treeView.HeadersVisible = false;
treeView.EnableTreeLines = true;
treeView.HoverExpand = false;
treeView.HoverSelection = false;
treeView.Columns[NAME_ROW].SetCellDataFunc(fileNameRenderer, new Gtk.TreeCellDataFunc(RenderFileNme));
sw.ShadowType = ShadowType.Out;
sw.Add(treeView);
this.PackEnd(sw, true, true, 0);
}
开发者ID:moscrif,项目名称:ide,代码行数:86,代码来源:FrameworkTree.cs
示例18: LogWidget
public LogWidget (VersionControlDocumentInfo info)
{
this.Build ();
this.info = info;
if (info.Document != null)
this.preselectFile = info.Document.FileName;
revertButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert changes from this revision"));
revertButton.IsImportant = true;
// revertButton.Sensitive = false;
revertButton.Clicked += new EventHandler (RevertRevisionClicked);
CommandBar.Insert (revertButton, -1);
revertToButton = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert to this revision"));
revertToButton.IsImportant = true;
// revertToButton.Sensitive = false;
revertToButton.Clicked += new EventHandler (RevertToRevisionClicked);
CommandBar.Insert (revertToButton, -1);
Gtk.ToolItem item = new Gtk.ToolItem ();
Gtk.HBox a = new Gtk.HBox ();
item.Add (a);
searchEntry = new SearchEntry ();
searchEntry.WidthRequest = 200;
searchEntry.ForceFilterButtonVisible = true;
searchEntry.EmptyMessage = GettextCatalog.GetString ("Search");
searchEntry.Changed += HandleSearchEntryFilterChanged;
searchEntry.Ready = true;
searchEntry.Show ();
a.PackEnd (searchEntry, false, false, 0);
CommandBar.Insert (item, -1);
((Gtk.Toolbar.ToolbarChild)CommandBar[item]).Expand = true;
CommandBar.ShowAll ();
messageRenderer.Ellipsize = Pango.EllipsizeMode.End;
TreeViewColumn colRevMessage = new TreeViewColumn ();
colRevMessage.Title = GettextCatalog.GetString ("Message");
var graphRenderer = new RevisionGraphCellRenderer ();
colRevMessage.PackStart (graphRenderer, false);
colRevMessage.SetCellDataFunc (graphRenderer, GraphFunc);
colRevMessage.PackStart (messageRenderer, true);
colRevMessage.SetCellDataFunc (messageRenderer, MessageFunc);
colRevMessage.Sizing = TreeViewColumnSizing.Autosize;
treeviewLog.AppendColumn (colRevMessage);
colRevMessage.MinWidth = 350;
colRevMessage.Resizable = true;
TreeViewColumn colRevDate = new TreeViewColumn (GettextCatalog.GetString ("Date"), textRenderer);
colRevDate.SetCellDataFunc (textRenderer, DateFunc);
colRevDate.Resizable = true;
treeviewLog.AppendColumn (colRevDate);
TreeViewColumn colRevAuthor = new TreeViewColumn ();
colRevAuthor.Title = GettextCatalog.GetString ("Author");
colRevAuthor.PackStart (pixRenderer, false);
colRevAuthor.PackStart (textRenderer, true);
colRevAuthor.SetCellDataFunc (textRenderer, AuthorFunc);
colRevAuthor.SetCellDataFunc (pixRenderer, AuthorIconFunc);
colRevAuthor.Resizable = true;
treeviewLog.AppendColumn (colRevAuthor);
TreeViewColumn colRevNum = new TreeViewColumn (GettextCatalog.GetString ("Revision"), textRenderer);
colRevNum.SetCellDataFunc (textRenderer, RevisionFunc);
colRevNum.Resizable = true;
treeviewLog.AppendColumn (colRevNum);
treeviewLog.Model = logstore;
treeviewLog.Selection.Changed += TreeSelectionChanged;
treeviewFiles = new FileTreeView ();
treeviewFiles.DiffLineActivated += HandleTreeviewFilesDiffLineActivated;
scrolledwindowFiles.Child = treeviewFiles;
scrolledwindowFiles.ShowAll ();
changedpathstore = new TreeStore (typeof(Gdk.Pixbuf), typeof (string), // icon/file name
typeof(Gdk.Pixbuf), typeof (string), // icon/operation
typeof (string), // path
typeof (string), // revision path (invisible)
typeof (string[]) // diff
);
TreeViewColumn colChangedFile = new TreeViewColumn ();
var crp = new CellRendererPixbuf ();
var crt = new CellRendererText ();
colChangedFile.Title = GettextCatalog.GetString ("File");
colChangedFile.PackStart (crp, false);
colChangedFile.PackStart (crt, true);
colChangedFile.AddAttribute (crp, "pixbuf", 2);
colChangedFile.AddAttribute (crt, "text", 3);
treeviewFiles.AppendColumn (colChangedFile);
TreeViewColumn colOperation = new TreeViewColumn ();
colOperation.Title = GettextCatalog.GetString ("Operation");
colOperation.PackStart (crp, false);
colOperation.PackStart (crt, true);
colOperation.AddAttribute (crp, "pixbuf", 0);
//.........这里部分代码省略.........
开发者ID:okrmartin,项目名称:monodevelop,代码行数:101,代码来源:LogWidget.cs
示例19: StatusView
public StatusView (string filepath, Repository vc)
: base(Path.GetFileName(filepath) + " Status")
{
this.vc = vc;
this.filepath = filepath;
changeSet = vc.CreateChangeSet (filepath);
main = new VBox(false, 6);
widget = main;
commandbar = new Toolbar ();
commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
commandbar.IconSize = Gtk.IconSize.Menu;
main.PackStart (commandbar, false, false, 0);
buttonCommit = new Gtk.ToolButton (new Gtk.Image ("vc-commit", Gtk.IconSize.Menu), GettextCatalog.GetString ("Commit..."));
buttonCommit.IsImportant = true;
buttonCommit.Clicked += new EventHandler (OnCommitClicked);
commandbar.Insert (buttonCommit, -1);
Gtk.ToolButton btnRefresh = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Refresh, IconSize.Menu), GettextCatalog.GetString ("Refresh"));
btnRefresh.IsImportant = true;
btnRefresh.Clicked += new EventHandler (OnRefresh);
commandbar.Insert (btnRefresh, -1);
buttonRevert = new Gtk.ToolButton (new Gtk.Image ("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString ("Revert"));
buttonRevert.IsImportant = true;
buttonRevert.Clicked += new EventHandler (OnRevert);
commandbar.Insert (buttonRevert, -1);
showRemoteStatus = new Gtk.ToolButton (new Gtk.Image ("vc-remote-status", Gtk.IconSize.Menu), GettextCatalog.GetString ("Show Remote Status"));
showRemoteStatus.IsImportant = true;
showRemoteStatus.Clicked += new EventHandler(OnShowRemoteStatusClicked);
commandbar.Insert (showRemoteStatus, -1);
Gtk.ToolButton btnCreatePatch = new Gtk.ToolButton (new Gtk.Image ("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString ("Create Patch"));
btnCreatePatch.IsImportant = true;
btnCreatePatch.Clicked += new EventHandler (OnCreatePatch);
commandbar.Insert (btnCreatePatch, -1);
commandbar.Insert (new Gtk.SeparatorToolItem (), -1);
Gtk.ToolButton btnOpen = new Gtk.ToolButton (new Gtk.Image (Gtk.Stock.Open, IconSize.Menu), GettextCatalog.GetString ("Open"));
btnOpen.IsImportant = true;
btnOpen.Clicked += new EventHandler (OnOpen);
commandbar.Insert (btnOpen, -1);
commandbar.Insert (new Gtk.SeparatorTo
|
请发表评论