public Navbar (Gtk.IconSize size) { address = new Entry ("address"); // FIXME: this doesnt't seem to work yet // address.Completion = new EntryCompletion (); address.WidthChars = 50; address.Activated += new EventHandler (OnGoUrl); ActionEntry[] actions = new ActionEntry[] { new ActionEntry ("back", Gtk.Stock.GoBack, null, null, GettextCatalog.GetString ("Go back"), new EventHandler (OnBackClicked)), new ActionEntry ("forward", Gtk.Stock.GoForward, null, null, GettextCatalog.GetString ("Go forward"), new EventHandler (OnForwardClicked)), new ActionEntry ("stop", Gtk.Stock.Stop, null, null, GettextCatalog.GetString ("Stop loading"), new EventHandler (OnStopClicked)), new ActionEntry ("reload", Gtk.Stock.Refresh, null, null, GettextCatalog.GetString ("Address"), new EventHandler (OnReloadClicked)), new ActionEntry ("go", Gtk.Stock.Ok, null, null, GettextCatalog.GetString ("Load address"), new EventHandler (OnGoUrl)) }; ActionGroup ag = new ActionGroup ("navbarGroup"); ag.Add (actions); UIManager uim = new UIManager (); uim.InsertActionGroup (ag, 0); uim.AddWidget += new AddWidgetHandler (OnAddWidget); uim.AddUiFromString (uiInfo); ToolItem item = new ToolItem (); item.Add (address); Toolbar tb = uim.GetWidget ("/ui/toolbar") as Toolbar; tb.IconSize = size; tb.Add (item); this.ShowAll (); }
public static void AddWidgetItem(this Toolbar tb, Widget w) { w.Show (); ToolItem ti = new ToolItem (); ti.Add (w); ti.Show (); tb.Insert (ti, tb.NItems); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); radioButtons.Add(this.radTest1); radioButtons.Add(this.radTest2); radioButtons.Add(this.radiobutton1); radioButtons.Add(this.radiobutton2); string uiaQaPath = UiaAtkBridgeTest.Misc.LookForParentDir("*.gif"); Gtk.Image img1 = new Gtk.Image(); img1.File = System.IO.Path.Combine(uiaQaPath, "opensuse60x38.gif"); img1.Show(); this.btnWithImg.Image = img1; Gtk.Image img2 = new Gtk.Image(); img2.File = System.IO.Path.Combine(uiaQaPath, "soccerball.gif"); img2.Show(); this.checkbutton1.Image = img2; Gtk.Image img3 = new Gtk.Image(); img3.File = System.IO.Path.Combine(uiaQaPath, "apple-red.png"); img3.Show(); this.radTest2.Image = img3; this.imgTest1.File = System.IO.Path.Combine(uiaQaPath, "goalie.gif"); this.imgTest2.File = System.IO.Path.Combine(uiaQaPath, "apple-red.png"); this.maskedEntry.Visibility = false; this.hscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue this.hscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue this.hscrollbar1.Adjustment.PageSize = 1; this.hscrollbar1.Adjustment.StepIncrement = 1; this.vscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue this.vscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue this.vscrollbar1.Adjustment.PageSize = 1; this.vscrollbar1.Adjustment.StepIncrement = 1; //Used when testing Atk.Action.GetKeybinding this.btnWithImg.UseUnderline = true; this.btnTest1.UseUnderline = true; this.WindowPosition = WindowPosition.CenterAlways; Gtk.ToolItem item = new Gtk.ToolItem(); item.Add(new Gtk.Entry("TEST TEXT")); this.toolbar1.Insert(item, 3); this.toolbar1.ShowAll(); }
public MainWindow (): base (Gtk.WindowType.Toplevel) { Build (); radioButtons.Add (this.radTest1); radioButtons.Add (this.radTest2); radioButtons.Add (this.radiobutton1); radioButtons.Add (this.radiobutton2); string uiaQaPath = UiaAtkBridgeTest.Misc.LookForParentDir ("*.gif"); Gtk.Image img1 = new Gtk.Image (); img1.File = System.IO.Path.Combine (uiaQaPath, "opensuse60x38.gif"); img1.Show (); this.btnWithImg.Image = img1; Gtk.Image img2 = new Gtk.Image (); img2.File = System.IO.Path.Combine (uiaQaPath, "soccerball.gif"); img2.Show (); this.checkbutton1.Image = img2; Gtk.Image img3 = new Gtk.Image (); img3.File = System.IO.Path.Combine (uiaQaPath, "apple-red.png"); img3.Show (); this.radTest2.Image = img3; this.imgTest1.File = System.IO.Path.Combine (uiaQaPath, "goalie.gif"); this.imgTest2.File = System.IO.Path.Combine (uiaQaPath, "apple-red.png"); this.maskedEntry.Visibility = false; this.hscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue this.hscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue this.hscrollbar1.Adjustment.PageSize = 1; this.hscrollbar1.Adjustment.StepIncrement = 1; this.vscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue this.vscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue this.vscrollbar1.Adjustment.PageSize = 1; this.vscrollbar1.Adjustment.StepIncrement = 1; //Used when testing Atk.Action.GetKeybinding this.btnWithImg.UseUnderline = true; this.btnTest1.UseUnderline = true; this.WindowPosition = WindowPosition.CenterAlways; Gtk.ToolItem item = new Gtk.ToolItem (); item.Add (new Gtk.Entry ("TEST TEXT")); this.toolbar1.Insert (item, 3); this.toolbar1.ShowAll (); }
private void CreateExprBar() { // UrlEntry expr_entry = new Gtk.Entry(); expr_entry.Activated += new EventHandler(on_expr_activate); Gtk.ToolItem expr_item = new Gtk.ToolItem(); expr_item.Expand = true; expr_item.Add(expr_entry); // Toolbar exprbar = new Toolbar(); exprbar.ToolbarStyle = ToolbarStyle.Icons; exprbar.Orientation = Orientation.Horizontal; exprbar.ShowArrow = true; // Toolbar Itens exprbar.Add(expr_item); exprbar.Add(action_expr.CreateToolItem()); }
private void CreateFindbar() { // FindEntry find_entry = new Gtk.Entry(); //find_entry.Activated += new EventHandler(on_uri_activate); Gtk.ToolItem find_item = new Gtk.ToolItem(); //find_item.Expand = true; find_item.Add(find_entry); // Toolbar findbar = new Toolbar(); findbar.ToolbarStyle = ToolbarStyle.Icons; findbar.Orientation = Orientation.Horizontal; findbar.ShowArrow = true; // Toolbar Itens findbar.Add(action_stop.CreateToolItem()); findbar.Add(find_item); findbar.Add(action_back.CreateToolItem()); findbar.Add(action_forward.CreateToolItem()); }
public WidgetActionBar (WidgetDesignerFrontend frontend, Stetic.Wrapper.Widget rootWidget) { this.frontend = frontend; editors = new Hashtable (); wrappers = new Hashtable (); sensitives = new Hashtable (); invisibles = new Hashtable (); toggles = new ArrayList (); IconSize = IconSize.Menu; Orientation = Orientation.Horizontal; ToolbarStyle = ToolbarStyle.BothHoriz; combo = new WidgetTreeCombo (); comboItem = new ToolItem (); comboItem.Add (combo); comboItem.ShowAll (); Insert (comboItem, -1); ShowAll (); RootWidget = rootWidget; }
private void CreateToolbar() { // UrlEntry uri_entry = new Gtk.Entry(); uri_entry.Activated += new EventHandler(on_uri_activate); Gtk.ToolItem uri_item = new Gtk.ToolItem(); uri_item.Expand = true; uri_item.Add(uri_entry); // Toolbar toolbar = new Toolbar(); toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.Orientation = Orientation.Horizontal; toolbar.ShowArrow = true; // Toolbar Itens toolbar.Add(action_back.CreateToolItem()); toolbar.Add(action_forward.CreateToolItem()); toolbar.Add(action_reload.CreateToolItem()); toolbar.Add(action_stop.CreateToolItem()); toolbar.Add(uri_item); toolbar.Add(action_jump.CreateToolItem()); }
/// <summary> /// Populate the main menu tool strip. /// We rebuild the contents from scratch /// </summary> /// <param name="menuDescriptions">Menu descriptions for each menu item.</param> public void PopulateMainToolStrip(List<MenuDescriptionArgs> menuDescriptions) { foreach (Widget child in toolStrip.Children) toolStrip.Remove(child); foreach (MenuDescriptionArgs description in menuDescriptions) { if (!hasResource(description.ResourceNameForImage)) { MessageDialog md = new MessageDialog(MainWidget.Toplevel as Window, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "Program error. Could not locate the resource named " + description.ResourceNameForImage); md.Run(); md.Destroy(); } else { Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(null, description.ResourceNameForImage, 20, 20); ToolButton button = new ToolButton(new Gtk.Image(pixbuf), description.Name); button.Homogeneous = false; button.LabelWidget = new Label(description.Name); Pango.FontDescription font = new Pango.FontDescription(); font.Size = (int)(8 * Pango.Scale.PangoScale); button.LabelWidget.ModifyFont(font); if (description.OnClick != null) button.Clicked += description.OnClick; toolStrip.Add(button); } } ToolItem item = new ToolItem(); item.Expand = true; toolbarlabel = new Label(); toolbarlabel.Xalign = 1.0F; toolbarlabel.Xpad = 10; toolbarlabel.ModifyFg(StateType.Normal, new Gdk.Color(0x99, 0x99, 0x99)); item.Add(toolbarlabel); toolbarlabel.Visible = false; toolStrip.Add(item); toolStrip.ShowAll(); }
public SearchResultsPage(FileSearch search) { VPaned paned; TreeViewColumn column; ToolItem spacerItem; ToolItem filterItem; Alignment filterAlignment; ToolButton searchAgainToolButton; this.search = search; downloadToolButton = new ToolButton(new Image("gtk-save", IconSize.LargeToolbar), "Download"); downloadToolButton.IsImportant = true; downloadToolButton.Sensitive = false; downloadToolButton.Clicked += DownloadToolButtonClicked; searchAgainToolButton = new ToolButton(new Image("gtk-refresh", IconSize.LargeToolbar), "Search Again"); searchAgainToolButton.IsImportant = true; searchAgainToolButton.Clicked += SearchAgainToolButtonClicked; spacerItem = new ToolItem(); spacerItem.Expand = true; filterButton = new ToggleButton("Filter Results"); filterButton.Image = new Image(Gui.LoadIcon(16, "application-x-executable")); filterButton.Toggled += delegate (object o, EventArgs args) { this.ShowFilter = filterButton.Active; }; filterAlignment = new Alignment(0.5f, 0.5f, 0, 0); filterAlignment.Add(filterButton); filterItem = new ToolItem(); filterItem.Add(filterAlignment); browseToolButton = new ToolButton(new Image("gtk-open", IconSize.LargeToolbar), "Browse"); browseToolButton.IsImportant = true; browseToolButton.Sensitive = false; browseToolButton.Clicked += BrowseToolButtonClicked; toolbar = new Toolbar(); toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar.Insert(downloadToolButton, -1); toolbar.Insert(browseToolButton, -1); toolbar.Insert(spacerItem, -1); toolbar.Insert(filterItem, -1); toolbar.Insert(new SeparatorToolItem(), -1); toolbar.Insert(searchAgainToolButton, -1); toolbar.ShowAll(); this.PackStart(toolbar, false, false, 0); resultCountByTypeCache = new Dictionary<FilterType, int>(); Gdk.Pixbuf audioPixbuf = Gui.LoadIcon(16, "audio-x-generic"); Gdk.Pixbuf videoPixbuf = Gui.LoadIcon(16, "video-x-generic"); Gdk.Pixbuf imagePixbuf = Gui.LoadIcon(16, "image-x-generic"); Gdk.Pixbuf docPixbuf = Gui.LoadIcon(16, "x-office-document"); unknownPixbuf = Gui.LoadIcon(16, "text-x-generic"); folderPixbuf = Gui.LoadIcon(16, "folder"); typeStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(FilterType)); typeStore.AppendValues(null, "All Results", FilterType.All); typeStore.AppendValues(null, "-"); typeStore.AppendValues(audioPixbuf, "Audio", FilterType.Audio); typeStore.AppendValues(videoPixbuf, "Video", FilterType.Video); typeStore.AppendValues(imagePixbuf, "Images", FilterType.Image); typeStore.AppendValues(docPixbuf, "Documents", FilterType.Document); typeStore.AppendValues(folderPixbuf, "Folders", FilterType.Folder); typeStore.AppendValues(unknownPixbuf, "Other", FilterType.Other); typeTree = new TreeView(); typeTree.HeadersVisible = false; typeTree.RowSeparatorFunc = delegate (TreeModel m, TreeIter i) { string text = (string)m.GetValue(i, 1); return (text == "-"); }; typeTree.Selection.Changed += TypeSelectionChanged; typeTree.Model = typeStore; CellRendererPixbuf pixbufCell = new CellRendererPixbuf(); CellRendererText textCell = new CellRendererText(); CellRendererText countTextCell = new CellRendererText(); countTextCell.Sensitive = false; countTextCell.Alignment = Pango.Alignment.Right; countTextCell.Xalign = 1; column = new TreeViewColumn(); column.PackStart(pixbufCell, false); column.PackStart(textCell, true); column.PackStart(countTextCell, false); column.AddAttribute(pixbufCell, "pixbuf", 0); column.AddAttribute(textCell, "text", 1); column.SetCellDataFunc(countTextCell, new TreeCellDataFunc(TypeCountCellFunc)); typeTree.AppendColumn(column); TreeView artistTree = new TreeView(); artistTree.HeadersVisible = false; TreeView albumTree = new TreeView(); albumTree.HeadersVisible = false; HBox topBox = new HBox(); topBox.PackStart(Gui.AddScrolledWindow(typeTree), true, true, 0); topBox.PackStart(Gui.AddScrolledWindow(artistTree), true, true, 1); topBox.PackStart(Gui.AddScrolledWindow(albumTree), true, true, 0); topBox.Homogeneous = true; resultsStore = new ListStore(typeof(SearchResult)); resultsStore.RowInserted += delegate { Refilter(); }; resultsStore.RowDeleted += delegate { Refilter(); }; resultsTree = new TreeView(); resultsTree.RowActivated += resultsTree_RowActivated; resultsTree.ButtonPressEvent += resultsTree_ButtonPressEvent; resultsTree.Selection.Changed += ResultsTreeSelectionChanged; imageColumns = new List<TreeViewColumn>(); audioColumns = new List<TreeViewColumn>(); videoColumns = new List<TreeViewColumn>(); fileOnlyColumns = new List<TreeViewColumn>(); folderOnlyColumns = new List<TreeViewColumn>(); column = new TreeViewColumn(); column.Title = "File Name"; column.Clickable = true; column.Sizing = TreeViewColumnSizing.Autosize; column.Resizable = true; column.SortColumnId = 0; //resultsTree.ExpanderColumn = column; CellRenderer cell = new CellRendererPixbuf(); column.PackStart(cell, false); column.SetCellDataFunc(cell, new TreeCellDataFunc(IconFunc)); cell = new CellRendererText(); column.PackStart(cell, true); column.SetCellDataFunc(cell, new TreeCellDataFunc(FileNameFunc)); resultsTree.AppendColumn(column); column = resultsTree.AppendColumn("Codec", new CellRendererText(), new TreeCellDataFunc(CodecFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 120; column.Resizable = true; column.SortColumnId = 1; videoColumns.Add(column); column = resultsTree.AppendColumn("Format", new CellRendererText(), new TreeCellDataFunc(FormatFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 90; column.Resizable = true; column.SortColumnId = 2; imageColumns.Add(column); column = resultsTree.AppendColumn("Resolution", new CellRendererText(), new TreeCellDataFunc(ResolutionFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 90; column.Resizable = true; column.SortColumnId = 3; videoColumns.Add(column); imageColumns.Add(column); column = resultsTree.AppendColumn("Artist", new CellRendererText(), new TreeCellDataFunc(ArtistFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 110; column.Resizable = true; column.SortColumnId = 4; audioColumns.Add(column); column = resultsTree.AppendColumn("Album", new CellRendererText(), new TreeCellDataFunc(AlbumFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 110; column.Resizable = true; column.SortColumnId = 5; audioColumns.Add(column); column = resultsTree.AppendColumn("Bitrate", new CellRendererText(), new TreeCellDataFunc(BitrateFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 70; column.Resizable = true; column.SortColumnId = 6; audioColumns.Add(column); column = resultsTree.AppendColumn("Size", new CellRendererText(), new TreeCellDataFunc(SizeFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 70; column.SortColumnId = 7; column.Resizable = true; fileOnlyColumns.Add(column); column = resultsTree.AppendColumn("Sources", new CellRendererText(), new TreeCellDataFunc(SourcesFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 85; column.SortColumnId = 8; column.Resizable = true; fileOnlyColumns.Add(column); column = resultsTree.AppendColumn("User", new CellRendererText(), new TreeCellDataFunc(UserFunc)); column.Clickable = true; column.Sizing = TreeViewColumnSizing.Fixed; column.FixedWidth = 85; column.SortColumnId = 8; column.Resizable = true; folderOnlyColumns.Add(column); column = resultsTree.AppendColumn("Full Path", new CellRendererText(), new TreeCellDataFunc(FullPathFunc)); column.Clickable = true; column.Resizable = true; column.SortColumnId = 9; column = resultsTree.AppendColumn("Info Hash", new CellRendererText(), new TreeCellDataFunc(InfoHashFunc)); column.Clickable = true; column.Resizable = true; column.SortColumnId = 10; fileOnlyColumns.Add(column); resultsFilter = new TreeModelFilter(resultsStore, null); resultsFilter.VisibleFunc = resultsFilterFunc; resultsSort = new TreeModelSort(resultsFilter); for (int x = 0; x < resultsTree.Columns.Length; x++) { resultsSort.SetSortFunc(x, resultsSortFunc); } resultsTree.Model = resultsSort; ScrolledWindow resultsTreeSW = new ScrolledWindow(); resultsTreeSW.Add(resultsTree); paned = new VPaned(); paned.Add1(topBox); paned.Add2(resultsTreeSW); paned.Position = 160; paned.ShowAll(); filterWidget = new FilterWidget(search); filterWidget.FiltersChanged += filterWidget_FiltersChanged; filterWidget.Hidden += filterWidget_Hidden; this.PackStart(filterWidget, false, false, 0); this.PackStart(paned, true, true, 0); TypeSelectionChanged(typeTree, EventArgs.Empty); search.NewResults += (NewResultsEventHandler)DispatchService.GuiDispatch(new NewResultsEventHandler(search_NewResults)); search.ClearedResults += (EventHandler)DispatchService.GuiDispatch(new EventHandler(search_ClearedResults)); resultPopupMenu = new Menu(); browseResultMenuItem = new ImageMenuItem("Browse"); browseResultMenuItem.Image = new Image(Gui.LoadIcon(16, "document-open")); browseResultMenuItem.Activated += BrowseToolButtonClicked; resultPopupMenu.Append(browseResultMenuItem); downloadResultMenuItem = new ImageMenuItem("Download"); downloadResultMenuItem.Image = new Image(Gui.LoadIcon(16, "go-down")); downloadResultMenuItem.Activated += DownloadToolButtonClicked; resultPopupMenu.Append(downloadResultMenuItem); resultPropertiesMenuItem = new ImageMenuItem(Gtk.Stock.Properties, null); resultPropertiesMenuItem.Activated += FilePropertiesButtonClicked; resultPopupMenu.Append(resultPropertiesMenuItem); }
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); colOperation.AddAttribute (crt, "text", 1); treeviewFiles.AppendColumn (colOperation); TreeViewColumn colChangedPath = new TreeViewColumn (); colChangedPath.Title = GettextCatalog.GetString ("Path"); diffRenderer.DrawLeft = true; colChangedPath.PackStart (diffRenderer, true); colChangedPath.SetCellDataFunc (diffRenderer, SetDiffCellData); treeviewFiles.AppendColumn (colChangedPath); treeviewFiles.Model = changedpathstore; treeviewFiles.TestExpandRow += HandleTreeviewFilesTestExpandRow; treeviewFiles.Events |= Gdk.EventMask.PointerMotionMask; textviewDetails.WrapMode = Gtk.WrapMode.Word; labelAuthor.Text = ""; labelDate.Text = ""; labelRevision.Text = ""; }
public LogWidget(VersionControlDocumentInfo info) { this.Build(); this.info = info; if (info.Document != null) { this.preselectFile = info.Item.Path; } 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); colOperation.AddAttribute(crt, "text", 1); treeviewFiles.AppendColumn(colOperation); TreeViewColumn colChangedPath = new TreeViewColumn(); colChangedPath.Title = GettextCatalog.GetString("Path"); diffRenderer.DrawLeft = true; colChangedPath.PackStart(diffRenderer, true); colChangedPath.SetCellDataFunc(diffRenderer, SetDiffCellData); treeviewFiles.AppendColumn(colChangedPath); treeviewFiles.Model = changedpathstore; treeviewFiles.TestExpandRow += HandleTreeviewFilesTestExpandRow; treeviewFiles.Events |= Gdk.EventMask.PointerMotionMask; textviewDetails.WrapMode = Gtk.WrapMode.Word; labelAuthor.Text = ""; labelDate.Text = ""; labelRevision.Text = ""; }
private void CreateToolbar() { // UrlEntry uri_entry = new Gtk.Entry (); uri_entry.Activated += new EventHandler(on_uri_activate); Gtk.ToolItem uri_item = new Gtk.ToolItem (); uri_item.Expand = true; uri_item.Add (uri_entry); // Toolbar toolbar = new Toolbar (); toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.Orientation = Orientation.Horizontal; toolbar.ShowArrow = true; // Toolbar Itens toolbar.Add (action_back.CreateToolItem()); toolbar.Add (action_forward.CreateToolItem()); toolbar.Add (action_reload.CreateToolItem()); toolbar.Add (action_stop.CreateToolItem()); toolbar.Add (uri_item); toolbar.Add (action_jump.CreateToolItem()); }
private void CreateFindbar() { // FindEntry find_entry = new Gtk.Entry (); //find_entry.Activated += new EventHandler(on_uri_activate); Gtk.ToolItem find_item = new Gtk.ToolItem (); //find_item.Expand = true; find_item.Add (find_entry); // Toolbar findbar = new Toolbar (); findbar.ToolbarStyle = ToolbarStyle.Icons; findbar.Orientation = Orientation.Horizontal; findbar.ShowArrow = true; // Toolbar Itens findbar.Add (action_stop.CreateToolItem()); findbar.Add (find_item); findbar.Add (action_back.CreateToolItem()); findbar.Add (action_forward.CreateToolItem()); }
public MainWindow() { ToolItem spacerItem; FileSearchEntry searchEntry; ToolItem searchEntryItem; Alignment searchEntryBox; object[] attrs= Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), true); AssemblyTitleAttribute attr = (AssemblyTitleAttribute)attrs[0]; AssemblyName asmName = Assembly.GetExecutingAssembly().GetName(); string title = String.Format ("{0} (BETA) {1} (Protocol Version: {2})", attr.Title, asmName.Version, Core.ProtocolVersion); // Create the interface window = new Window (title); window.SetDefaultSize (850, 550); window.DeleteEvent += on_win_delete; window.ConfigureEvent += on_MainWindow_configure_event; window.FocusInEvent += window_FocusInEvent; ((ToggleAction)Runtime.BuiltinActions["ToggleMainToolbar"]).Active = Gui.Settings.ShowToolbar; Runtime.BuiltinActions["ToggleMainToolbar"].Activated += ToggleMainToolbar_Activated; ((ToggleAction)Runtime.BuiltinActions["ToggleMainStatusbar"]).Active = Gui.Settings.ShowStatusBar; Runtime.BuiltinActions["ToggleMainStatusbar"].Activated += ToggleMainStatusbar_Activated; window.AddAccelGroup (Runtime.UIManager.AccelGroup); mainVBox = new VBox (); window.Add (mainVBox); mainVBox.Show (); if (Common.OSName == "Darwin") { MenuBar menubar = (MenuBar) Runtime.UIManager.GetWidget ("/OSXAppMenu"); Imendio.MacIntegration.Menu.SetMenuBar(menubar); MenuItem preferencesItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/Preferences"); MenuItem aboutItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/About"); IntPtr group = Imendio.MacIntegration.Menu.AddAppMenuGroup(); Imendio.MacIntegration.Menu.AddAppMenuItem(group, aboutItem, "About Meshwork"); group = Imendio.MacIntegration.Menu.AddAppMenuGroup(); Imendio.MacIntegration.Menu.AddAppMenuItem(group, preferencesItem, "Preferences"); MenuItem quitItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/Quit"); Imendio.MacIntegration.Menu.SetQuitMenuItem(quitItem); } else { MenuBar menubar = (MenuBar) Runtime.UIManager.GetWidget ("/MainWindowMenuBar"); mainVBox.PackStart (menubar, false, false, 0); menubar.Show (); } toolbar = (Toolbar) Runtime.UIManager.GetWidget ("/MainWindowToolbar"); toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar.IconSize = IconSize.LargeToolbar; spacerItem = new ToolItem(); spacerItem.Expand = true; toolbar.Insert(spacerItem, -1); spacerItem.Show(); searchEntry = new FileSearchEntry(); searchEntryBox = new Alignment(0.5f, 0.5f, 0, 0); searchEntryBox.LeftPadding = 4; searchEntryBox.RightPadding = 1; searchEntryBox.Add(searchEntry); searchEntryItem = new ToolItem(); searchEntryItem.Add(searchEntryBox); toolbar.Insert(searchEntryItem, -1); searchEntryItem.ShowAll(); mainVBox.PackStart (toolbar, false, false, 0); mainPaned = new HPaned(); mainPaned.Mapped += delegate (object sender, EventArgs args) { // XXX: Remember the user's last setting instead mainPaned.Position = 190; // Set some colors //infoBoxSeparator.ModifyBg(StateType.Normal, GtkHelper.DarkenColor (mainbar.Style.Background(StateType.Normal), 2)); //infoSwitcherTree.ModifyBase(StateType.Normal, infoSwitcherTree.Style.Base(StateType.Active)); //infoSwitcherTree.ModifyBase(StateType.Active, infoBoxSeparator.Style.Base(StateType.Selected)); }; mainPaned.Show(); mainVBox.PackStart (mainPaned, true, true, 0); // Create page notebook pageNotebook = new Notebook(); pageNotebook.ShowTabs = false; pageNotebook.ShowBorder = false; mainPaned.Pack2(pageNotebook, true, true); pageNotebook.ShowAll(); // Create sidebar sidebar = new MainSidebar(); sidebar.ItemAdded += sidebar_ItemAdded; sidebar.SelectedItemChanged += sidebar_SelectedItemChanged; sidebar.AddBuiltinItems(); mainPaned.Pack1(sidebar, false, false); sidebar.ShowAll(); CreateStatusbar (); // Apply "view" settings toolbar.Visible = Gui.Settings.ShowToolbar; statusBar.Visible = Gui.Settings.ShowStatusBar; // Hook up Core events Core.ShareBuilder.StartedIndexing += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_StartedIndexing)); Core.ShareBuilder.FinishedIndexing += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_FinishedIndexing)); Core.ShareBuilder.StoppedIndexing += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_StoppedIndexing)); Core.ShareBuilder.ErrorIndexing += (ErrorEventHandler)DispatchService.GuiDispatch(new ErrorEventHandler(sb_ErrorIndexing)); Core.ShareHasher.StartedHashingFile += (ShareHasherTaskEventHandler)DispatchService.GuiDispatch(new ShareHasherTaskEventHandler(sh_StartedFinished)); Core.ShareHasher.FinishedHashingFile += (ShareHasherTaskEventHandler)DispatchService.GuiDispatch(new ShareHasherTaskEventHandler(sh_StartedFinished)); Core.ShareHasher.QueueChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sh_QueueChanged)); Core.FileSearchManager.SearchAdded += (FileSearchEventHandler)DispatchService.GuiDispatch(new FileSearchEventHandler(FileSearchManager_SearchAdded)); Core.FileSearchManager.SearchRemoved += (FileSearchEventHandler)DispatchService.GuiDispatch(new FileSearchEventHandler(FileSearchManager_SearchRemoved)); window.Resize (Gui.Settings.WindowSize.Width, Gui.Settings.WindowSize.Height); window.Move (Gui.Settings.WindowPosition.X, Gui.Settings.WindowPosition.Y); SelectedPage = NetworkOverviewPage.Instance; }
public ForumView(Forum site, String forum) { this.site = site; this.forum = forum; this.Destroyed += delegate(object sender, EventArgs e) { if (iconThread != null) if (iconThread.IsAlive) iconThread.Abort (); }; topicWindow = new ScrolledWindow (); topicWindow.ShadowType = ShadowType.EtchedIn; topicWindow.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); treeviewTopics = new TreeView (); treeviewTopics.BorderWidth = 0; treeviewTopics.AppendColumn ("", new CellRendererPixbuf (), "pixbuf", 5); CellRendererText cellTopic = new CellRendererText (); TreeViewColumn topicCol = treeviewTopics.AppendColumn ("Topic", cellTopic, "text", 1); topicCol.SetCellDataFunc (cellTopic, new Gtk.TreeCellDataFunc (renderTopic)); topicCol.Resizable = true; treeviewTopics.AppendColumn ("Author", new CellRendererText (), "text", 2).Resizable = true; ; treeviewTopics.AppendColumn ("Replies", new CellRendererText (), "text", 3).Resizable = true; ; treeviewTopics.AppendColumn ("Last Reply", new CellRendererText (), "text", 4).Resizable = true; ; // Use treeView.Selection.Changed? treeviewTopics.RowActivated += treeviewTopics_RowActivated; treeviewTopics.ButtonPressEvent += treeviewTopics_ButtonPress; topicWindow.Add (treeviewTopics); this.Add1 (topicWindow); contentBox = new VBox (false, 0); Toolbar toolbar = new Toolbar (); toolbar.HeightRequest = 38; toolbar.ToolbarStyle = ToolbarStyle.Icons; toolbar.BorderWidth = 0; firstbtn = new ToolButton (Stock.GotoFirst); firstbtn.TooltipText = "First page"; firstbtn.Sensitive = false; firstbtn.Clicked += firstbtn_Clicked; prevbtn = new ToolButton (Stock.GoBack); prevbtn.TooltipText = "Previous page"; prevbtn.Sensitive = false; prevbtn.Clicked += prevbtn_Clicked; nextbtn = new ToolButton (Stock.GoForward); nextbtn.TooltipText = "Next page"; nextbtn.Sensitive = false; nextbtn.Clicked += nextbtn_Clicked; lastbtn = new ToolButton (Stock.GotoLast); lastbtn.TooltipText = "Last page"; lastbtn.Sensitive = false; lastbtn.Clicked += lastbtn_Clicked; Image tmpimage = new Image (); tmpimage.Pixbuf = new Gdk.Pixbuf (".images/icon_up.png"); upbtn = new ToolButton (tmpimage, ""); upbtn.TooltipText = "Expand view to top"; upbtn.Clicked += upbtn_Clicked; Image tmpimage2 = new Image (); tmpimage2.Pixbuf = new Gdk.Pixbuf (".images/icon_down.png"); downbtn = new ToolButton (tmpimage2, ""); downbtn.TooltipText = "Split view"; downbtn.Clicked += downbtn_Clicked; closebtn = new ToolButton (Stock.Close); closebtn.TooltipText = "Close image view"; closebtn.Clicked += closebtn_Clicked; Image tmpimage3 = new Image (); tmpimage3.Pixbuf = new Gdk.Pixbuf (".images/rotate_16.png"); rotatebtn = new ToolButton (tmpimage3, ""); rotatebtn.TooltipText = "Rotate image clockwise"; rotatebtn.Clicked += rotatebtn_Clicked; Image tmpimage4 = new Image (); tmpimage4.Pixbuf = new Gdk.Pixbuf (".images/icon_save.png"); savebtn = new ToolButton (tmpimage4, ""); savebtn.TooltipText = "Download image"; savebtn.Clicked += savebtn_Clicked; pageLabel = new Label (""); ToolItem textItem = new ToolItem (); textItem.Expand = false; textItem.Add (pageLabel); imageviewbtn = new ToggleToolButton (Stock.ZoomFit); imageviewbtn.TooltipText = "Image view"; imageviewbtn.Toggled += imageviewbtn_Toggled; textviewbtn = new ToggleToolButton (Stock.Properties); textviewbtn.TooltipText = "Thread view"; textviewbtn.Active = true; textviewbtn.Toggled += textviewbtn_Toggled; SeparatorToolItem sepSpacer = new SeparatorToolItem (); sepSpacer.Expand = true; sepSpacer.Draw = false; sepFullsize = new SeparatorToolItem (); imageSortAscending = new ToggleToolButton (Stock.SortAscending); imageSortAscending.TooltipText = "Show earliest images first"; imageSortAscending.Active = true; imageSortAscending.Toggled += imageSortAscending_Toggled; imageSortDescending = new ToggleToolButton (Stock.SortDescending); imageSortDescending.TooltipText = "Show latest images first"; imageSortDescending.Toggled += imageSortDescending_Toggled; imageLoadingProgress = new ProgressBar (); ToolItem progressItem = new ToolItem (); progressItem.Expand = false; progressItem.Add (imageLoadingProgress); imageLoadingProgress.Fraction = 0; toolbar.Add (imageSortAscending); toolbar.Add (imageSortDescending); toolbar.Add (progressItem); toolbar.Add (firstbtn); toolbar.Add (prevbtn); toolbar.Add (textItem); toolbar.Add (nextbtn); toolbar.Add (lastbtn); toolbar.Add (sepFullsize); toolbar.Add (savebtn); toolbar.Add (rotatebtn); toolbar.Add (sepSpacer); toolbar.Add (imageviewbtn); toolbar.Add (textviewbtn); toolbar.Add (closebtn); toolbar.Add (upbtn); toolbar.Add (downbtn); threadwindow = new ScrolledWindow (); threadbrowser = new WebView (); threadbrowser.Editable = false; threadbrowser.NavigationRequested += threadbrowser_NavigationRequested; threadwindow.Add (threadbrowser); iconStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(int), typeof(int)); iconview = new IconView (iconStore); iconview.Margin = 1; iconview.Spacing = 1; iconview.BorderWidth = 0; iconview.ColumnSpacing = 1; iconview.RowSpacing = 1; iconview.PixbufColumn = 1; iconview.TooltipColumn = 2; iconview.SelectionMode = SelectionMode.Multiple; iconview.ItemActivated += iconview_ItemActivated; iconview.ButtonPressEvent += iconView_ButtonPress; iconview.Model = iconStore; iconview.ModifyBase (StateType.Normal, new Gdk.Color (0x66, 0x66, 0x66)); iconwindow = new ScrolledWindow (); iconwindow.ShadowType = ShadowType.EtchedIn; iconwindow.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); iconwindow.Add (iconview); imagewindow = new EventBox (); fullSizeImage = new Image (); // JICE TEST fullsizeLayout = new Layout (null, null); fullsizeLayout.Add (fullSizeImage); fullsizeLayout.SizeRequested += fullsizeLayout_SizeRequested; imagewindow.ModifyBase (StateType.Normal, new Gdk.Color (0x66, 0x66, 0x66)); imagewindow.Add (fullsizeLayout); imagewindow.CanFocus = true; imagewindow.KeyPressEvent += imagewindow_keyPressEvent; imagewindow.SizeRequested += imagewindow_sizeAllocated; // imagewindow.Add(fullSizeImage); contentBox.PackStart (toolbar, false, false, 0); contentBox.PackStart (iconwindow); contentBox.PackStart (imagewindow); contentBox.PackStart (threadwindow); this.Add2 (contentBox); this.ShowAll (); imageSortAscending.Hide (); imageSortDescending.Hide (); iconwindow.Hide (); imagewindow.Hide (); closebtn.Hide (); rotatebtn.Hide (); savebtn.Hide (); sepFullsize.Hide (); downbtn.Hide (); imageLoadingProgress.Hide (); String favouriteThreads = UserSettings.getValue ("Site" + site.forumName + ".Forum" + forum + ".Favourites"); favThreads = favouriteThreads.Split (';'); treestoreTopics = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Gdk.Pixbuf)); topicsLoaded = 0; loadTopics (); treeviewTopics.Model = treestoreTopics; }
/// <summary> /// Builds the toolbar. /// </summary> private void BuildToolBar () { PortBox = new ComboBox (); PortBox.WidthRequest = 200; PortBox.Visible = true; EventBox eb = new EventBox (); PortBox.Changed += (sender, e) => { ArduinoController.SerialPortName = PortBox.ActiveText; ArduinoController.Setup (); // UpdatePortBox (); }; PortBox.ButtonPressEvent += (o, args) => UpdatePortBox (); eb.ButtonPressEvent += (o, args) => UpdatePortBox (); var label = new Label ("Connect to:"); label.Xalign = 0; var vbox = new VBox (); vbox.PackStart (label, true, true, 0); vbox.PackStart (PortBox, false, false, 0); eb.Add (vbox); var item = new ToolItem (); item.Expand = false; item.Add (eb); this.toolbarMain.Remove (this.toolbarMain.GetNthItem (4)); this.toolbarMain.Insert (item, 4); this.toolbarMain.ShowAll (); UpdatePortBox (); }
private void Build() { // toolbar toolbar = new Toolbar(); // toolbar.MarginLeft = 10; this.Add (toolbar); var toolbarBox = (Gtk.Box.BoxChild)this [toolbar]; toolbarBox.Fill = false; toolbarBox.Expand = false; toolbarBox.Position = 0; // toolbar choose database dropdown Gtk.Label l = new Gtk.Label(string.Format("Current database: {0}", this.ServerConnection.Name)); ToolItem lTi = new ToolItem (); lTi.Add (l); toolbar.Insert (lTi, 0); // toolbar exec button ToolButton execBtn = new ToolButton (Gtk.Stock.MediaPlay); execBtn.Clicked += (sender, e) => this.ExecuteCommand(); toolbar.Insert (execBtn, 1); // vpaned vpaned = new VPaned(); this.Add (vpaned); // Sql area textbox wrapped in a scrolled window ScrolledWindow sqlAreaScroll = new ScrolledWindow(); vpaned.Add1 (sqlAreaScroll); sqlArea = new Mono.TextEditor.TextEditor(); sqlArea.Text = string.Format ("{0}{0}", System.Environment.NewLine); sqlArea.SetCaretTo (1, 1); sqlArea.CanFocus = true; sqlArea.IsFocus = true; var syntaxMode = loadSyntaxMode (); sqlArea.Document.SyntaxMode = syntaxMode; sqlAreaScroll.Add (sqlArea); // result tabs resultNoteBook = new Notebook (); sqlResultContainer = new Gtk.ScrolledWindow (); resultNoteBook.Add (sqlResultContainer); resultNoteBook.SetTabLabel (sqlResultContainer, new Label ("Results")); outputView = new TextView (); outputView.Editable = false; resultNoteBook.Add (outputView); resultNoteBook.SetTabLabel (outputView, new Label ("Output")); vpaned.Add2 (resultNoteBook); vpaned.Position = 180; }
private void CreateExprBar() { // UrlEntry expr_entry = new Gtk.Entry (); expr_entry.Activated += new EventHandler(on_expr_activate); Gtk.ToolItem expr_item = new Gtk.ToolItem (); expr_item.Expand = true; expr_item.Add (expr_entry); // Toolbar exprbar = new Toolbar (); exprbar.ToolbarStyle = ToolbarStyle.Icons; exprbar.Orientation = Orientation.Horizontal; exprbar.ShowArrow = true; // Toolbar Itens exprbar.Add (expr_item); exprbar.Add (action_expr.CreateToolItem()); }
public ImageToolBarControl(ImageCanvas ic) { this.ic = ic; btnShowHideBarier = new ToggleToolButton("barier-show.png");//RadioToolButton(group1);//,"barier-show.png"); btnShowHideBarier.Label = MainClass.Languages.Translate("show_barier_layer"); btnShowHideBarier.Name = "btnShowHideBarier"; //btnShowHideBarier.Relief = ReliefStyle.None; btnShowHideBarier.CanFocus = false; btnShowHideBarier.BorderWidth = 1; //btnShowHideBarier.WidthRequest = 75; btnShowHideBarier.TooltipText = MainClass.Languages.Translate("show_barier_layer_tt"); btnShowHideBarier.Events = Gdk.EventMask.AllEventsMask;// | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask btnShowHideBarier.Toggled+= delegate(object sender, EventArgs e) { this.ic.ShowBarierLayer = btnShowHideBarier.Active; SetSensitive(btnShowHideBarier.Active); //Console.WriteLine("btnShowHideBarier.Toggled"); }; btnEditBarierPoint = new ToggleToolButton("barier-add.png");//new RadioToolButton(group2,"barier-add.png"); btnEditBarierPoint.Name = "btnEditBarierPoint"; btnEditBarierPoint.Label = MainClass.Languages.Translate("edit_barier_point"); //btnEditBarierPoint.Relief = ReliefStyle.None; btnEditBarierPoint.CanFocus = false; btnEditBarierPoint.BorderWidth = 1; btnEditBarierPoint.TooltipText = MainClass.Languages.Translate("edit_barier_point_tt"); btnEditBarierPoint.Toggled+= delegate(object sender, EventArgs e) { if(btnEditBarierPoint.Active){ btnDeleteBarierPoint.Active = false; //btnMovieBarierPoint.Active = false; } }; btnDeleteBarierPoint = new ToggleToolButton("barier-delete.png");//new RadioToolButton(group2,"barier-delete.png"); btnDeleteBarierPoint.Name = "btnDeleteBarierPoint"; btnDeleteBarierPoint.Label = MainClass.Languages.Translate("delete_barier_point"); //btnDeleteBarierPoint.Relief = ReliefStyle.None; btnDeleteBarierPoint.CanFocus = false; btnDeleteBarierPoint.BorderWidth = 1; btnDeleteBarierPoint.TooltipText = MainClass.Languages.Translate("delete_barier_point_tt"); btnDeleteBarierPoint.Toggled+= delegate(object sender, EventArgs e) { if(btnDeleteBarierPoint.Active){ btnEditBarierPoint.Active = false; //btnAddBarierPoint.Active = false; //btnMovieBarierPoint.Active = false; } }; btnDeleteBarier = new ToolButton("barier-delete-all.png"); btnDeleteBarier.Name = "btnDeleteBarier"; btnDeleteBarier.Label =MainClass.Languages.Translate("delete_barier"); btnDeleteBarier.CanFocus = false; btnDeleteBarier.BorderWidth = 1; btnDeleteBarier.TooltipText = MainClass.Languages.Translate("delete_barier_tt"); btnDeleteBarier.Clicked += delegate(object sender, EventArgs e) { MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, "", MainClass.Languages.Translate("delete_barier_question"), Gtk.MessageType.Question); int result = md.ShowDialog(); if (result != (int)Gtk.ResponseType.Yes){ return; } if(DeleteBarierLayerEvent!= null) DeleteBarierLayerEvent(null,null); }; SetSensitive(false); this.Insert (btnShowHideBarier, 0); this.Insert (btnEditBarierPoint, 1); this.Insert (btnDeleteBarierPoint, 2); this.Insert (btnDeleteBarier, 3); Gtk.ToolButton btnZoomIn = new Gtk.ToolButton("zoom-in.png"); btnZoomIn.Label = MainClass.Languages.Translate("zoom_in"); btnZoomIn.TooltipText = MainClass.Languages.Translate("zoom_in"); //btnZoomIn.Relief = Gtk.ReliefStyle.None; btnZoomIn.CanFocus = false; btnZoomIn.Clicked+= delegate { ZoomIn(); }; Gtk.ToolButton btnZoomOriginal = new Gtk.ToolButton("zoom-original.png"); btnZoomOriginal.Label = MainClass.Languages.Translate("zoom_original"); btnZoomOriginal.TooltipText = MainClass.Languages.Translate("zoom_original"); //btnZoomOriginal.Relief = Gtk.ReliefStyle.None; btnZoomOriginal.CanFocus = false; btnZoomOriginal.Clicked+= delegate { cbeZoom.Active = 11; }; //btnZoomOriginal.WidthRequest = btnZoomOriginal.HeightRequest = 19; Gtk.ToolButton btnZoomOut = new Gtk.ToolButton("zoom-out.png"); btnZoomOut.TooltipText = MainClass.Languages.Translate("zoom_out"); btnZoomOut.Label = MainClass.Languages.Translate("zoom_out"); //btnZoomOut.Relief = Gtk.ReliefStyle.None; btnZoomOut.CanFocus = false; btnZoomOut.Clicked+= delegate { ZoomOut(); }; string[] zoomCollection = new string[] { "3600%", "2400%", "1600%", "1200%", "800%", "700%", "600%", "500%", "400%", "300%", "200%", "100%", "66%", "50%", "33%", "25%", "16%", "12%", "8%", "5%" }; cbeZoom = new ComboBoxEntry(zoomCollection); cbeZoom.Active = 11; cbeZoom.WidthRequest = 70; cbeZoom.Changed+= delegate(object sender, EventArgs e) { UpdateScale(); }; cbeZoom.Entry.FocusOutEvent+= delegate(object o, FocusOutEventArgs args) { //Console.WriteLine("FocusOutEvent"); UpdateScale(); }; cbeZoom.Entry.FocusInEvent+= delegate(object o, FocusInEventArgs args) { }; cbeZoom.Entry.Changed+= delegate(object sender, EventArgs e) { //UpdateScale(); }; ToolItem tic = new ToolItem(); tic.Add(cbeZoom); this.Insert(new SeparatorToolItem(),4); this.Insert(btnZoomIn,5); this.Insert(btnZoomOut,6); this.Insert(tic,7); this.Insert(btnZoomOriginal,8); }
private void CreateStatusbar() { statusBar = new Toolbar(); statusBar.ShowArrow = false; statusBar.ToolbarStyle = ToolbarStyle.BothHoriz; statusBar.ExposeEvent += StatusBarExposeEvent; statusLabel = new Label(); statusLabel.Xalign = 0; statusLabel.Xpad = 6; ToolItem statusLabelItem = new ToolItem(); Alignment statusAlign = new Alignment(0.5f, 0.5f, 1.0f, 1.0f); statusLabelItem.Add(statusLabel); statusLabelItem.Expand = true; statusBar.Insert(statusLabelItem, -1); statusLabelItem.ShowAll(); taskStatusIcon = new Hyena.Widgets.AnimatedImage(); taskStatusIcon.Pixbuf = Gui.LoadIcon(22, "process-working"); taskStatusIcon.FrameHeight = 22; taskStatusIcon.FrameWidth = 22; taskStatusIcon.Load(); EventBox taskStatusIconBox = new EventBox(); taskStatusIconBox.MotionNotifyEvent += delegate { UpdateTaskStatusIcon(); }; taskStatusIconBox.ButtonReleaseEvent += delegate { IndexingStatusWindow.Instance.Show(); }; taskStatusIconBox.SizeAllocated += delegate (object o, SizeAllocatedArgs args) { statusAlign.LeftPadding = (uint)args.Allocation.Width; }; taskStatusIconBox.SetSizeRequest(22, 22); taskStatusIconBox.Add(taskStatusIcon); taskStatusIconBox.Show(); ToolItem taskStatusIconItem = new ToolItem(); taskStatusIconItem.Add(taskStatusIconBox); statusBar.Insert(taskStatusIconItem, -1); taskStatusIconItem.Show(); mainVBox.PackStart(statusBar, false, false, 0); UpdateTaskStatusIcon(); UpdateStatusText(); }
private void CreateToolBars() { mainToolbar.ToolbarStyle = ToolbarStyle.Icons; toolsPaneBar.ToolbarStyle = ToolbarStyle.Icons; toolsPaneBar.Orientation = Orientation.Vertical; toolsToolbar.ToolbarStyle = ToolbarStyle.Icons; toolsToolbar.IconSize = IconSize.Menu; ToolButton T = new ToolButton(Stock.New); T.Clicked += (s, e) => TheVM.CreateNewFile(); mainToolbar.Add(T); T = new ToolButton(Stock.Open); T.ButtonPressEvent += (s, e) => TheVM.Open(); mainToolbar.Add(T); T = new ToolButton(Stock.Save); T.ButtonPressEvent += (s, e) => TheVM.Save(); mainToolbar.Add(T); mainToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Stock.Copy); mainToolbar.Add(T); T = new ToolButton(Stock.Cut); mainToolbar.Add(T); T = new ToolButton(Stock.Paste); mainToolbar.Add(T); T = new ToolButton(Stock.Undo); mainToolbar.Add(T); T = new ToolButton(Stock.Redo); mainToolbar.Add(T); mainToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Stock.Execute); mainToolbar.Add(T); T.Clicked += (s, e) => TheVM.TheDocument.Recompile(); T = cmdAbortCompile = new ToolButton(Stock.Cancel); T.Clicked += (s, e) => TheCompiler.Instance.AbortCompilation(); mainToolbar.Add(T); mainToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Stock.Quit); T.Clicked += (s, e) => Application.Quit(); mainToolbar.Add(T); T = new ToolButton(Stock.Home); toolsPaneBar.Add(T); T = new ToolButton(Stock.Index); toolsPaneBar.Add(T); T = new ToolButton(Stock.Execute); toolsPaneBar.Add(T); // tools toolbar /*RadioToolButton RT0 = null; RadioToolButton RT; RT0 = RT = new RadioToolButton(RT0); RT.IconWidget = Properties.Resources.base_cursor.ToImage(); toolsToolbar.Add(RT); RT = new RadioToolButton(RT0); RT.IconWidget = Properties.Resources.bmpvert.ToImage(); toolsToolbar.Add(RT); RT = new RadioToolButton(null, Stock.Add); //RT.IconWidget = Properties.Resources.bmpvert.ToImage(); RT.Label = "jhgjhgJH"; toolsToolbar.Add(RT);*/ T = new ToolButton(Properties.Resources.base_cursor.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.bmpvert.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.edge.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.path.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Bezier.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Smooth.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.arc.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.arcedit.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Rectangle.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.Ellipse.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); T = new ToolButton(Properties.Resources.grid.ToImage(), ""); toolsToolbar.Add(T); ToolButtons.Add(T); ToolButtons.Each((b, i) => { OverlayToolType t = (OverlayToolType)i; b.Clicked += (s,e)=> TheVM.CurrentTool = t; }); ToolItem it = new ToolItem(); it.Add(new Label("Node style:")); toolsToolbar.Add(it); it = new ToolItem() { WidthRequest = 100 }; it.Add( cmbNodeStyle = ComboBoxEntry.NewText()); toolsToolbar.Add(it); it = new ToolItem(); it.Add(new Label("Edge style:")); toolsToolbar.Add(it); it = new ToolItem() { WidthRequest = 100 }; it.Add(cmbEdgeStyle = ComboBoxEntry.NewText()); toolsToolbar.Add(it); toolsToolbar.Add(new SeparatorToolItem()); T = new ToolButton(Properties.Resources.radial.ToImage(), ""); toolsToolbar.Add(T); }