public MainWindow() : base(WindowType.Toplevel) { Name = "MainWindow"; WindowPosition = ((WindowPosition)(4)); DefaultWidth = 1280; DefaultHeight = 800; _north = new Alignment(0, 0, 1, 1); _south = new Alignment(0, 0, 1, 1); _west = new Alignment(0, 0, 1, 1); _east = new Alignment(0, 0, 1, 1); _center = new Alignment(0, 0, 1, 1); _vBox = new VBox(false, 0); _westAndRestHPaned = new HPaned(); _westAndRestHPaned.Pack1(_west, false, false); _centerAndEastHPaned = new HPaned(); _westAndRestHPaned.Pack2(_centerAndEastHPaned, true, true); _centerAndEastHPaned.Pack1(_center, true, true); _centerAndEastHPaned.Pack2(_east, true, true); _centerAndEastHPaned.Position = 1000; _vBox.PackStart(_north, false, false, 0); _vBox.PackStart(_westAndRestHPaned, true, true, 0); _vBox.PackStart(_south, false, false, 0); Add(_vBox); ShowAll(); }
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); }
/// <summary>Default constructor for ExplorerView</summary> public PropertyCategorisedView(ViewBase owner) : base(owner) { Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.PropertyCategoryView.glade"); Gtk.HPaned hpaned = (Gtk.HPaned)builder.GetObject("hpaned1"); treeview1 = (Gtk.TreeView)builder.GetObject("treeview1"); rightHandView = (Viewport)builder.GetObject("RightHandView"); mainWidget = hpaned; rightHandView.BorderWidth = 7; #if NETFRAMEWORK rightHandView.ModifyBg(StateType.Normal, mainWidget.Style.Base(StateType.Normal)); rightHandView.ShadowType = ShadowType.None; #endif treeview1.Model = treemodel; TreeViewColumn column = new TreeViewColumn(); CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf(); column.PackStart(iconRender, false); textRender = new Gtk.CellRendererText(); textRender.Editable = false; column.PackStart(textRender, true); column.SetAttributes(iconRender, "pixbuf", 1); column.SetAttributes(textRender, "text", 0); treeview1.AppendColumn(column); treeview1.TooltipColumn = 2; treeview1.CursorChanged += OnAfterSelect; treeview1.ButtonReleaseEvent += OnButtonUp; treeview1.ButtonPressEvent += OnButtonPress; treeview1.RowActivated += OnRowActivated; mainWidget.Destroyed += _mainWidget_Destroyed; }
public MainWindow (): base (Gtk.WindowType.Toplevel) { // this window this.Title= "Supos"; this.DeleteEvent += OnDeleteEvent; // main vbox mainBox = new VBox(false, 0); this.Add(mainBox); // actiongroup and uimanager stuff (menubar) actgroup = new ActionGroup ("TestActions"); SetUpActionGroup(); uim = new UIManager (); uim.InsertActionGroup (actgroup, 0); this.AddAccelGroup(uim.AccelGroup); SetUpUiManager(); Gtk.Widget menubar = uim.GetWidget("/MenuBar"); mainBox.PackStart(menubar, false, false, 0); actgroup.GetAction("disconnect").Sensitive=false; // main panned view mainPaned = new HPaned(); mainPaned.Sensitive = false; mainPaned.Name = "toucharea"; mainBox.PackStart(mainPaned, true, true, 0); // order editing view orderview = new ViewOrderEdit(); mainPaned.Pack2(orderview, false, false); // categories product paned view HPaned hpan2; hpan2 = new HPaned(); mainPaned.Pack1(hpan2, true, false); // categories view catview = new ViewNameIcon(); catview.DataMember="Categories"; catview.SelectionChanged += this.OnCatSelectionChanged; catview.WidthRequest= 200; hpan2.Pack1(catview, false, false); // products view prodview = new ViewNameIcon(); prodview.DataMember = "Products"; prodview.RowActivated += this.OnProdRowActivated; prodview.WidthRequest= 400; hpan2.Pack2(prodview, true, false); // status bar Statusbar statusbar; statusbar = new Statusbar(); mainBox.PackStart(statusbar, false, false, 0); // clock Clock clock; clock = new Clock(); clock.BorderWidth = 6; statusbar.PackStart(clock, false, false, 0); // END build interface this.ApplyViewPreferences(SettingsHandler.Settings.viewSettings); }
public ResxEditorView() { Controller = new ResourceController (); HPaned container = new HPaned (); container.Add (Controller.ResourceEditorView); AttachListeners (); Container = container; Container.ShowAll (); }
public MainWindow(string title) : base(title) { // when this window is deleted, it'll run delete_event() DeleteEvent += delete_event; Shown += new EventHandler(window_Shown); // Add the button to the window and display everything MenuBar menuBar = new MenuBar(); menuBar.Add(new MenuItem("File")); treeView = new TreeView(); // Create a column for the artist name Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn(); nameColumn.Title = "Name"; // Create the text cell that will display the artist name Gtk.CellRendererText fileNameCell = new Gtk.CellRendererText(); // Add the cell to the column nameColumn.PackStart(fileNameCell, true); // Add the columns to the TreeView treeView.AppendColumn(nameColumn); // Tell the Cell Renderers which items in the model to display nameColumn.AddAttribute(fileNameCell, "text", 0); listView = new TreeView(); SetupListView(); treeMapView = new TreeMapView(); ScrolledWindow scrolledTreeView = new ScrolledWindow(); scrolledTreeView.Add(treeView); ScrolledWindow scrolledListView = new ScrolledWindow(); scrolledListView.Add(listView); HPaned hpaned = new HPaned(); hpaned.Pack1(scrolledTreeView, true, true); hpaned.Pack2(scrolledListView, false, true); VPaned vpaned = new VPaned(); vpaned.Pack1(hpaned, true, true); vpaned.Pack2(treeMapView, false, true); VBox vbox = new VBox(false, 1); vbox.PackStart(menuBar, false, true, 0); vbox.PackStart(vpaned, true, true, 0); Add(vbox); }
public void Build() { this.window = new Window("BattleNames"); this.window.SetDefaultSize(800, 600); this.window.DeleteEvent += HandleWindowDeleteEvent; this.vbox = new VBox(); { this.tbar = new Toolbar(); this.tbar.ToolbarStyle = ToolbarStyle.BothHoriz; { this.generatebutton = new ToolButton(Stock.New); this.generatebutton.TooltipText = "Generate a new battle name"; this.generatebutton.Label = "Generate"; this.generatebutton.IsImportant = true; this.generatebutton.Clicked += HandleGeneratebuttonClicked; this.clearbutton = new ToolButton(Stock.Clear); this.clearbutton.TooltipText = "Clear output"; this.clearbutton.Label = "Clear"; this.clearbutton.Clicked += HandleClearbuttonClicked; } this.tbar.Add(this.generatebutton); this.tbar.Add(this.clearbutton); this.hpaned = new HPaned(); { this.treescrolledwindow = new ScrolledWindow(); this.treeview = new TreeView(); this.treeview.AppendColumn("Name", new CellRendererText(), "text", 0); this.treeview.HeadersVisible = true; this.treeview.Model = this.treestore; this.treescrolledwindow.Add(this.treeview); this.textscrolledwindow = new ScrolledWindow(); this.textview = new TextView(); this.textview.Editable = false; this.textscrolledwindow.Add(this.textview); } this.hpaned.Pack1(this.treescrolledwindow, false, true); this.hpaned.Pack2(this.textscrolledwindow, true, true); this.hpaned.Position = 200; 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.window.Add(this.vbox); }
public ExploreView(ICredentialsProvider credentialsProvider, int stopAfter) : base(false, 1) { this.credentialsProvider = credentialsProvider; HPaned hPaned = new HPaned(); Add(hPaned); { ScrolledWindowBase scrolledWindow1 = new ScrolledWindowBase(); hPaned.Add1(scrolledWindow1); repositoryView = new RepositoryView(this, credentialsProvider); scrolledWindow1.Add(repositoryView); } viewChildren = new VPaned(); { ScrolledWindowBase scrolledWindow2 = new ScrolledWindowBase(); viewChildren.Pack1(scrolledWindow2, true, true); directoryView = new DirectoryView(this); scrolledWindow2.Add(directoryView); ScrolledWindowBase scrolledWindow3 = new ScrolledWindowBase(); viewChildren.Pack2(scrolledWindow3, true, true); changesetView = new ChangesetView(this, stopAfter); scrolledWindow3.Add(changesetView); int x, y, width, height, depth; RootWindow.GetGeometry (out x, out y, out width, out height, out depth); hPaned.Add2(viewChildren); hPaned.Position = (width - 50) / 3; } // add status bar statusbar = new Statusbar (); statusbar.HasResizeGrip = false; PackEnd(statusbar, false, false, 1); Assembly entry = Assembly.GetEntryAssembly(); StatusMessage(String.Format("{0} version {1}", entry.GetName().Name, entry.GetName().Version.ToString())); ShowAll(); repositoryView.Selection.Changed += OnPathSelectionChanged; }
public Browser(string catalog_dir) : base("Documentation Browser Sample") { DefaultSize = new Size (600, 400); Gtk.Paned paned = new Gtk.HPaned (); Gtk.ScrolledWindow sw = new ScrolledWindow (); DocTree tree = new DocTree (catalog_dir); sw.Add (tree); paned.Add1 (sw); sw = new ScrolledWindow (); DocView view = new DocView (tree); sw.AddWithViewport (view); paned.Add2 (sw); paned.Position = 250; paned.ShowAll (); Add (paned); }
/// <summary>Crea el notebook donde están los campos /// de edición de texto del ensamblador.</summary> /// <returns>El notebook.</returns> private Notebook CrearNotebook() { Notebook not = new Notebook(); Gtk.HPaned panel1 = new Gtk.HPaned(); panel1.Add1(CrearEditorEnsamblador()); panel1.Add2(CrearResultadoEnsamblador()); panel1.Position = 340; Gtk.VPaned panel2 = new Gtk.VPaned(); panel2.Add1(panel1); panel2.Add2(CrearErroresEnsamblador()); panel2.Position = 350; not.AppendPage( panel2, new Gtk.Label(GetText("Ventana_Notebook_Codigo")) ); panelMemoria = new PanelMemoria(); panelRegistros = new PanelRegistros(); Gtk.Table memreg = new Gtk.Table(1, 2, true); memreg.Attach(panelMemoria, 0, 1, 0, 1); memreg.Attach(panelRegistros, 1, 2, 0, 1); not.AppendPage( memreg, new Gtk.Label( String.Format( "{0} - {1}", GetText("Ventana_Notebook_Memoria"), GetText("Ventana_Notebook_Registros") ) ) ); dArea = new PanelDibujo(); not.AppendPage( dArea, new Gtk.Label(GetText("Ventana_Notebook_rdd")) ); return(not); }
public DemoPanes () : base ("Panes") { VBox vbox = new VBox (false, 0); Add (vbox); VPaned vpaned = new VPaned (); vbox.PackStart (vpaned, true, true, 0); vpaned.BorderWidth = 5; HPaned hpaned = new HPaned (); vpaned.Add1 (hpaned); Frame frame = new Frame (); frame.ShadowType = ShadowType.In; frame.SetSizeRequest (60, 60); hpaned.Add1 (frame); Gtk.Button button = new Button ("_Hi there"); frame.Add (button); frame = new Frame (); frame.ShadowType = ShadowType.In; frame.SetSizeRequest (80, 60); hpaned.Add2 (frame); frame = new Frame (); frame.ShadowType = ShadowType.In; frame.SetSizeRequest (60, 80); vpaned.Add2 (frame); // Now create toggle buttons to control sizing vbox.PackStart (CreatePaneOptions (hpaned, "Horizontal", "Left", "Right"), false, false, 0); vbox.PackStart (CreatePaneOptions (vpaned, "Vertical", "Top", "Bottom"), false, false, 0); ShowAll (); }
public ExploreView(Driver driver, int stopAfter) : base("Explore") { int x, y, width, height, depth; RootWindow.GetGeometry (out x, out y, out width, out height, out depth); SetDefaultSize (width - 50, height - 40); VBox vBox = new VBox(false, 1); Add(vBox); HPaned hPaned = new HPaned(); vBox.Add(hPaned); ScrolledWindow scrolledWindow = new ScrolledWindow(); //scrolledWindow.SetDefaultSize (Convert.ToInt32((width - 50) * 0.4), height -40); hPaned.Add1(scrolledWindow); repositoryView = new RepositoryView(driver); scrolledWindow.Add(repositoryView); viewChildren = new Notebook (); changesetView = new ChangesetView(driver, stopAfter); viewChildren.AppendPage (changesetView, new Label ("Changeset View")); directoryView = new DirectoryView(driver); viewChildren.AppendPage (directoryView, new Label ("Directory View")); fileView = new FileView(driver); viewChildren.AppendPage (fileView, new Label ("File View")); hPaned.Add2(viewChildren); hPaned.Position = (width - 50) / 3; // add status bar Statusbar sb = new Statusbar (); sb.HasResizeGrip = false; vBox.PackEnd(sb, false, false, 1); ShowAll(); repositoryView.Selection.Changed += OnPathSelectionChanged; viewChildren.SwitchPage += OnSwitchPage; }
public LauncherWidget() { var tb = new Entry(""); tb.SetIconFromIconName(EntryIconPosition.Secondary, "search"); tb.Changed += (s, e) => { ShowSearch(tb.Text); }; tb.KeyReleaseEvent += (s, e) => { if (e.Event.Key == Gdk.Key.Return && appListStore.NColumns != 0) { //TODO: appListStore.NColumns does not work hpaned.Child1.ChildFocus(DirectionType.TabForward); } if (e.Event.Key == Gdk.Key.Escape) { Parent.Hide(); //TODO: detect Window } }; tb.Margin = 5; //tb.BorderWidth = 1; PackStart(tb, false, false, 0); hpaned = new HPaned(); Add(hpaned); /*Add(CreateList()); Add(CreateList());*/ var appList = CreateAppList(); hpaned.Add1(appList); hpaned.Add2(CreateCatList()); ShowAllApps(); ShowAll(); allButton.Active = true; lastActiveButton = allButton; }
public CairoSnippetsGtk () { Window w = new Window ("Cairo snippets"); w.SetDefaultSize (width, height); w.DeleteEvent += delegate { Application.Quit (); }; HPaned hpane = new HPaned (); ScrolledWindow sw = new ScrolledWindow (); TreeView tv = new TreeView (); tv.HeadersVisible = false; tv.AppendColumn ("snippets", new CellRendererText (), "text", 0); tv.Model = GetModel (); tv.Selection.Changed += OnSelectionChanged; sw.Add (tv); hpane.Add1 (sw); da = new DrawingArea (); da.ExposeEvent += OnExposed; hpane.Add2 (da); hpane.Position = width / 2; w.Add (hpane); w.ShowAll (); }
public SearchResultPad() { // Toolbar 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 results", "Clear results"); toolbar.Insert (buttonClear, -1); buttonOutput = new ToggleToolButton (MonoDevelop.Gui.Stock.OutputIcon); buttonOutput.Clicked += new EventHandler (OnButtonOutputClick); buttonOutput.SetTooltip (tips, "Show output", "Show output"); toolbar.Insert (buttonOutput, -1); // Results list store = new Gtk.ListStore ( typeof (Gdk.Pixbuf), // image typeof (int), // line typeof (int), // column typeof (string), // desc typeof (string), // file typeof (string), // path typeof (string), // full path typeof (bool), // read? typeof (int), // read? -- use Pango weight typeof (bool)); // is file view = new Gtk.TreeView (store); view.RulesHint = true; AddColumns (); sw = new Gtk.ScrolledWindow (); sw.ShadowType = ShadowType.In; sw.Add (view); // Log view logBuffer = new Gtk.TextBuffer (new Gtk.TextTagTable ()); logTextView = new Gtk.TextView (logBuffer); logTextView.Editable = false; logScroller = new Gtk.ScrolledWindow (); logScroller.ShadowType = ShadowType.In; logScroller.Add (logTextView); // HPaned Gtk.HPaned paned = new Gtk.HPaned (); paned.Pack1 (sw, true, true); paned.Pack2 (logScroller, true, true); // HBox status = new Label (); status.Xalign = 0.0f; VBox vbox = new VBox (); vbox.PackStart (paned, true, true, 0); vbox.PackStart (status, false, false, 3); HBox hbox = new HBox (); hbox.PackStart (vbox, true, true, 0); hbox.PackStart (toolbar, false, false, 0); control = hbox; Control.ShowAll (); logScroller.Hide (); view.RowActivated += new RowActivatedHandler (OnRowActivated); }
public TestResultsPad() { title = "Test results"; testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); Toolbar toolbar = new Toolbar (); toolbar.IconSize = IconSize.SmallToolbar; panel.PackStart (toolbar, false, false, 0); buttonSuccess = new ToggleToolButton (); buttonSuccess.Label = "Successful Tests"; buttonSuccess.Active = false; buttonSuccess.IconWidget = new Gtk.Image (CircleImage.Success); buttonSuccess.IsImportant = true; buttonSuccess.Toggled += new EventHandler (OnShowSuccessfulToggled); buttonSuccess.SetTooltip (tips, "Show Successful Tests", "Show Successful Tests"); toolbar.Insert (buttonSuccess, -1); buttonFailures = new ToggleToolButton (); buttonFailures.Label = "Failed Tests"; buttonFailures.Active = true; buttonFailures.IconWidget = new Gtk.Image (CircleImage.Failure); buttonFailures.IsImportant = true; buttonFailures.Toggled += new EventHandler (OnShowFailuresToggled); buttonFailures.SetTooltip (tips, "Show Failed Tests", "Show Failed Tests"); toolbar.Insert (buttonFailures, -1); buttonIgnored = new ToggleToolButton (); buttonIgnored.Label = "Ignored Tests"; buttonIgnored.Active = true; buttonIgnored.IconWidget = new Gtk.Image (CircleImage.NotRun); buttonIgnored.Toggled += new EventHandler (OnShowIgnoredToggled); buttonIgnored.IsImportant = true; buttonIgnored.SetTooltip (tips, "Show Ignored Tests", "Show Ignored Tests"); toolbar.Insert (buttonIgnored, -1); buttonOutput = new ToggleToolButton (); buttonOutput.Label = "Output"; buttonOutput.Active = false; buttonOutput.IconWidget = Runtime.Gui.Resources.GetImage (MonoDevelop.Gui.Stock.OutputIcon, IconSize.SmallToolbar); buttonOutput.Toggled += new EventHandler (OnShowOutputToggled); buttonOutput.IsImportant = true; buttonOutput.SetTooltip (tips, "Show Output", "Show Output"); toolbar.Insert (buttonOutput, -1); toolbar.Insert (new SeparatorToolItem (), -1); buttonStop = new ToolButton ("gtk-stop"); toolbar.Insert (buttonStop, -1); toolbar.ToolbarStyle = ToolbarStyle.BothHoriz; toolbar.ShowArrow = false; // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); // Failures tree failuresTreeView = new TreeView (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Pixbuf), typeof (string), typeof(object)); CellRendererPixbuf pr = new CellRendererPixbuf (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow (); sw.Add(failuresTreeView); Frame frame = new Frame (); frame.Add (sw); book.Pack1 (frame, true, true); outputView = new TextView(); outputView.Editable = false; sw = new Gtk.ScrolledWindow (); sw.Add(outputView); frame = new Frame (); frame.Add (sw); book.Pack2 (frame, true, true); outputViewScrolled = frame; // Run panel HBox runPanel = new HBox (); runPanel.BorderWidth = 5; infoSep = new VSeparator (); resultLabel.UseMarkup = true; runPanel.PackStart (resultLabel, false, false, 0); runPanel.PackStart (progressBar, false, false, 0); runPanel.PackStart (infoCurrent, true, true, 10); labels = new HBox (false, 10); infoFailed.UseMarkup = true; infoIgnored.UseMarkup = true; labels.PackStart (infoFailed, true, false, 0); labels.PackStart (infoIgnored, true, false, 0); runPanel.PackEnd (labels, false, false, 0); runPanel.PackEnd (infoSep, false, false, 10); panel.PackStart (runPanel, false, false, 0); progressBar.HeightRequest = infoFailed.SizeRequest().Height; buttonStop.Clicked += new EventHandler (OnStopClicked); failuresTreeView.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnPopupMenu); Control.ShowAll (); outputViewScrolled.Hide (); }
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); this.ShowAll (); var fileNameColumn = new TreeViewColumn { Resizable = true, SortColumnId = 0, Title = GettextCatalog.GetString("File") }; fileNameColumn.FixedWidth = 200; var fileNamePixbufRenderer = new CellRendererPixbuf (); fileNameColumn.PackStart (fileNamePixbufRenderer, false); fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc); fileNameColumn.PackStart (treeviewSearchResults.TextRenderer, true); fileNameColumn.SetCellDataFunc (treeviewSearchResults.TextRenderer, FileNameDataFunc); treeviewSearchResults.AppendColumn (fileNameColumn); // TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc); // lineColumn.SortColumnId = 1; // lineColumn.FixedWidth = 50; // TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), treeviewSearchResults.TextRenderer, ResultTextDataFunc); textColumn.SortColumnId = 2; textColumn.Resizable = true; textColumn.FixedWidth = 300; TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), treeviewSearchResults.TextRenderer, ResultPathDataFunc); pathColumn.SortColumnId = 3; pathColumn.Resizable = true; pathColumn.FixedWidth = 500; store.SetSortFunc (0, CompareFileNames); // store.SetSortFunc (1, CompareLineNumbers); store.SetSortFunc (3, CompareFilePaths); treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated; buttonStop = new ToolButton (Stock.Stop) { Sensitive = false }; buttonStop.Clicked += ButtonStopClicked; buttonStop.TooltipText = GettextCatalog.GetString ("Stop"); toolbar.Insert (buttonStop, -1); var buttonClear = new ToolButton (Gtk.Stock.Clear); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear results"); toolbar.Insert (buttonClear, -1); var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon); buttonOutput.Clicked += ButtonOutputClicked; buttonOutput.TooltipText = GettextCatalog.GetString ("Show output"); toolbar.Insert (buttonOutput, -1); buttonPin = new ToggleToolButton (Gui.Stock.PinUp); buttonPin.Clicked += ButtonPinClicked; buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad"); toolbar.Insert (buttonPin, -1); store.SetSortColumnId (3, SortType.Ascending); ShowAll (); scrolledwindowLogView.Hide (); }
void CreateControl () { control = new HPaned (); store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type typeof (bool), // read? typeof (Task)); // read? -- use Pango weight TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes); filter = new TreeModelFilter (store, null); filter.VisibleFunc = filterFunct; sort = new TreeModelSort (filter); sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort); sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort); sort.SetSortFunc (VisibleColumns.File, FileIterSort); view = new MonoDevelop.Ide.Gui.Components.PadTreeView (sort); view.RulesHint = true; view.PopupMenu += new PopupMenuHandler (OnPopupMenu); view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed); AddColumns (); LoadColumnsVisibility (); view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type; view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project; view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File; sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (view); TaskService.Errors.TasksRemoved += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (ShowResults)); TaskService.Errors.TasksAdded += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (TaskAdded)); TaskService.Errors.TasksChanged += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (TaskChanged)); TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged; IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen; IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed; view.RowActivated += new RowActivatedHandler (OnRowActivated); iconWarning = sw.RenderIcon (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, ""); iconError = sw.RenderIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu, ""); iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, ""); control.Add1 (sw); outputView = new LogView (); control.Add2 (outputView); Control.ShowAll (); sw.SizeAllocated += delegate { if (outputView.Visible) PropertyService.Set (logSeparatorPositionPropertyName, (double) ((double) control.Position / (double) control.Allocation.Width)); }; outputView.Hide (); CreateMenu (); // Load existing tasks foreach (Task t in TaskService.Errors) { AddTask (t); } control.FocusChain = new Gtk.Widget [] { sw }; }
protected NoteRecentChanges (NoteManager manager) : base (Catalog.GetString ("Search All Notes")) { this.manager = manager; this.IconName = "tomboy"; this.DefaultWidth = 450; this.DefaultHeight = 400; this.current_matches = new Dictionary<string, int> (); this.Resizable = true; selected_tags = new Dictionary<Tag, Tag> (); AddAccelGroup (Tomboy.ActionManager.UI.AccelGroup); menu_bar = CreateMenuBar (); Gtk.Label label = new Gtk.Label (Catalog.GetString ("_Search:")); label.Xalign = 0.0f; find_combo = Gtk.ComboBoxEntry.NewText (); label.MnemonicWidget = find_combo; find_combo.Changed += OnEntryChanged; find_combo.Entry.ActivatesDefault = false; find_combo.Entry.Activated += OnEntryActivated; find_combo.Entry.FocusInEvent += OnEntryFocusIn; if (previous_searches != null) { foreach (string prev in previous_searches) { find_combo.AppendText (prev); } } clear_search_button = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu)); clear_search_button.Sensitive = false; clear_search_button.Clicked += ClearSearchClicked; clear_search_button.Show (); Gtk.Table table = new Gtk.Table (1, 3, false); table.Attach (label, 0, 1, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0); table.Attach (find_combo, 1, 2, 0, 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0); table.Attach (clear_search_button, 2, 3, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0); table.ColumnSpacing = 4; table.ShowAll (); Gtk.HBox hbox = new Gtk.HBox (false, 0); hbox.PackStart (table, true, true, 0); hbox.ShowAll (); // Notebooks Pane Gtk.Widget notebooksPane = MakeNotebooksPane (); notebooksPane.Show (); MakeRecentTree (); tree.Show (); status_bar = new Gtk.Statusbar (); status_bar.HasResizeGrip = true; status_bar.Show (); // Update on changes to notes manager.NoteDeleted += OnNotesDeleted; manager.NoteAdded += OnNotesChanged; manager.NoteRenamed += OnNoteRenamed; manager.NoteSaved += OnNoteSaved; // List all the current notes UpdateResults (); matches_window = new Gtk.ScrolledWindow (); matches_window.ShadowType = Gtk.ShadowType.In; matches_window.HscrollbarPolicy = Gtk.PolicyType.Automatic; matches_window.VscrollbarPolicy = Gtk.PolicyType.Automatic; matches_window.Add (tree); matches_window.Show (); hpaned = new Gtk.HPaned (); hpaned.Position = 150; hpaned.Add1 (notebooksPane); hpaned.Add2 (matches_window); hpaned.Show (); RestorePosition (); Gtk.VBox vbox = new Gtk.VBox (false, 8); vbox.BorderWidth = 6; vbox.PackStart (hbox, false, false, 4); vbox.PackStart (hpaned, true, true, 0); vbox.PackStart (status_bar, false, false, 0); vbox.Show (); // Use another VBox to place the MenuBar // right at thetop of the window. content_vbox = new Gtk.VBox (false, 0); #if !MAC content_vbox.PackStart (menu_bar, false, false, 0); #endif content_vbox.PackStart (vbox, true, true, 0); content_vbox.Show (); this.Add (content_vbox); this.DeleteEvent += OnDelete; this.KeyPressEvent += OnKeyPressed; // For Escape // Watch when notes are added to notebooks so the search // results will be updated immediately instead of waiting // until the note's QueueSave () kicks in. Notebooks.NotebookManager.NoteAddedToNotebook += OnNoteAddedToNotebook; Notebooks.NotebookManager.NoteRemovedFromNotebook += OnNoteRemovedFromNotebook; // Set the focus chain for the top-most containers Bug #512175 Gtk.Widget[] vbox_focus = new Gtk.Widget[2]; vbox_focus[0] = hbox; vbox_focus[1] = hpaned; vbox.FocusChain = vbox_focus; // Set focus chain for sub widgits of first top-most container Gtk.Widget[] table_focus = new Gtk.Widget[2]; table_focus[0] = find_combo; table_focus[1] = matches_window; hbox.FocusChain = table_focus; // set focus chain for sub widgits of seconf top-most container Gtk.Widget[] hpaned_focus = new Gtk.Widget[2]; hpaned_focus[0] = matches_window; hpaned_focus[1] = notebooksPane; hpaned.FocusChain = hpaned_focus; // get back to the beginning of the focus chain Gtk.Widget[] scroll_right = new Gtk.Widget[1]; scroll_right[0] = tree; matches_window.FocusChain = scroll_right; Tomboy.ExitingEvent += OnExitingEvent; }
public TestResultsPad () { testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); panel.FocusChain = new Gtk.Widget [] { book }; // Failures tree failuresTreeView = new TreeView (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Pixbuf), typeof (string), typeof(object), typeof(string)); var pr = new CellRendererPixbuf (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "pixbuf", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; var sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add(failuresTreeView); book.Pack1 (sw, true, true); outputView = new TextView(); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; outputView.Buffer.TagTable.Add (bold); sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add(outputView); book.Pack2 (sw, true, true); outputViewScrolled = sw; failuresTreeView.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (OnPopupMenu); failuresTreeView.RowActivated += OnRowActivated; failuresTreeView.Selection.Changed += OnRowSelected; Control.ShowAll (); outputViewScrolled.Hide (); }
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; }
public TestResultsPad () { UnitTestService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceItemClosed; panel = new VBox { Name = "testResultBox" }; // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); panel.FocusChain = new Gtk.Widget [] { book }; // Failures tree failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView { Name = "testResultsTree" }; failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int), typeof(int)); SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Image", "store__Message","store__RootTest", "store__FileName", "store__FileNumber", "store__ErrorOrStackTrace"); TypeDescriptor.AddAttributes (failuresStore, modelAttr); var pr = new CellRendererImage (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "image", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; var sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (failuresTreeView); book.Pack1 (sw, true, true); outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView { Name = "testResultOutput" }; outputView.ModifyFont (FontService.MonospaceFont); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; outputView.Buffer.TagTable.Add (bold); sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (outputView); book.Pack2 (sw, true, true); outputViewScrolled = sw; failuresTreeView.RowActivated += OnRowActivated; failuresTreeView.Selection.Changed += OnRowSelected; failuresTreeView.DoPopupMenu = delegate (EventButton evt) { IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt, "/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad"); }; panel.ShowAll (); outputViewScrolled.Hide (); }
private void Build() { this.Title = "Sqlite browser"; mainVbox = new Gtk.VBox (); mainVbox.Spacing = 4; this.Add (mainVbox); // Main menu mainMenu = new MainMenu (); mainVbox.Add (mainMenu); var mainMenuBox = (Gtk.Box.BoxChild)mainVbox [mainMenu]; // mainMenuBox.Position = 0; mainMenuBox.Expand = false; mainMenuBox.Fill = false; mainMenu.NewSqliteDbActivated += OnNewSqliteDb; mainMenu.OpenSqliteDbActivated += OnOpenSqliteDb; mainMenu.ExitActivated += OnExit; mainMenu.NewSqlEditorWindowActivated += OnNewSqlTab; // toolbar toolbar = new MainToolbar(); mainVbox.Add (toolbar); var toolbarBox = (Gtk.Box.BoxChild)mainVbox [toolbar]; toolbarBox.Expand = false; // left paned leftPaned = new Gtk.HPaned(); leftPaned.CanFocus = true; mainVbox.Add (leftPaned); var objectBrowserScrolledWindow = new Gtk.ScrolledWindow (); objectBrowserScrolledWindow.ShadowType = ShadowType.EtchedIn; objectBrowserScrolledWindow.WidthRequest = 300; leftPaned.Add1 (objectBrowserScrolledWindow); objectBrowserTreeView = new TreeView (); objectBrowserScrolledWindow.Add (objectBrowserTreeView); objectBrowserTreeStore = new TreeStore (typeof(Gdk.Pixbuf), typeof(IFeature)); objectBrowserTreeView.Model = objectBrowserTreeStore; // main tabbed area tabbedArea = new Notebook(); leftPaned.Add2 (tabbedArea); // status bar statusBar = new Statusbar(); mainVbox.Add (statusBar); var statusBarBox = (Gtk.Box.BoxChild)mainVbox [statusBar]; statusBarBox.Expand = false; statusBarBox.Fill = false; global::Gtk.Label currentDbLabel = new Label (); ApplicationState.Instance.CurrentConnectionChanged += (sender, e) => currentDbLabel.Text = e.DbServerConnection.Name; statusBar.Add (currentDbLabel); this.ShowAll ( ); this.DeleteEvent += OnExit; }
public TestResultsPad () { testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged); panel = new VBox (); // Results notebook book = new HPaned (); panel.PackStart (book, true, true, 0); panel.FocusChain = new Gtk.Widget [] { book }; // Failures tree failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (); failuresTreeView.HeadersVisible = false; failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int)); var pr = new CellRendererImage (); CellRendererText tr = new CellRendererText (); TreeViewColumn col = new TreeViewColumn (); col.PackStart (pr, false); col.AddAttribute (pr, "image", 0); col.PackStart (tr, false); col.AddAttribute (tr, "markup", 1); failuresTreeView.AppendColumn (col); failuresTreeView.Model = failuresStore; var sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (failuresTreeView); book.Pack1 (sw, true, true); outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView (); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; outputView.Buffer.TagTable.Add (bold); sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (outputView); book.Pack2 (sw, true, true); outputViewScrolled = sw; failuresTreeView.RowActivated += OnRowActivated; failuresTreeView.Selection.Changed += OnRowSelected; failuresTreeView.DoPopupMenu = delegate (EventButton evt) { IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt, "/MonoDevelop/NUnit/ContextMenu/TestResultsPad"); }; Control.ShowAll (); outputViewScrolled.Hide (); }
void CreateControl () { control = new HPaned (); store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type typeof (bool), // read? typeof (Task)); // read? -- use Pango weight TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes); filter = new TreeModelFilter (store, null); filter.VisibleFunc = filterFunct; sort = new TreeModelSort (filter); sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort); sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort); sort.SetSortFunc (VisibleColumns.File, FileIterSort); view = new PadTreeView (sort); view.RulesHint = true; view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu (view, evnt, CreateMenu ()); AddColumns (); LoadColumnsVisibility (); view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type; view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project; view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File; sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (view); TaskService.Errors.TasksRemoved += DispatchService.GuiDispatch<TaskEventHandler> (ShowResults); TaskService.Errors.TasksAdded += DispatchService.GuiDispatch<TaskEventHandler> (TaskAdded); TaskService.Errors.TasksChanged += DispatchService.GuiDispatch<TaskEventHandler> (TaskChanged); TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged; IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen; IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed; view.RowActivated += new RowActivatedHandler (OnRowActivated); iconWarning = sw.RenderIcon (Stock.Warning, Gtk.IconSize.Menu, ""); iconError = sw.RenderIcon (Stock.Error, Gtk.IconSize.Menu, ""); iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, ""); control.Add1 (sw); outputView = new LogView (); control.Add2 (outputView); Control.ShowAll (); control.SizeAllocated += HandleControlSizeAllocated; bool outputVisible = PropertyService.Get<bool> (outputViewVisiblePropertyName, false); if (outputVisible) { outputView.Visible = true; logBtn.Active = true; } else { outputView.Hide (); } sw.SizeAllocated += HandleSwSizeAllocated; // Load existing tasks foreach (Task t in TaskService.Errors) { AddTask (t); } control.FocusChain = new Gtk.Widget [] { sw }; }
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); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear results"); toolbar.Insert (buttonClear, -1); var buttonOutput = new ToggleToolButton (); buttonOutput.IconWidget = new ImageView (Gui.Stock.OutputIcon, Gtk.IconSize.Menu); buttonOutput.Clicked += ButtonOutputClicked; buttonOutput.TooltipText = GettextCatalog.GetString ("Show output"); toolbar.Insert (buttonOutput, -1); buttonPin = new ToggleToolButton (); buttonPin.IconWidget = new ImageView (Gui.Stock.PinUp, Gtk.IconSize.Menu); buttonPin.Clicked += ButtonPinClicked; buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad"); toolbar.Insert (buttonPin, -1); // store.SetSortColumnId (3, SortType.Ascending); ShowAll (); scrolledwindowLogView.Hide (); treeviewSearchResults.FixedHeightMode = true; UpdateStyles (); IdeApp.Preferences.ColorScheme.Changed += UpdateStyles; }
private void Build() { this.Title = "Sqlite browser"; mainVbox = new Gtk.VBox(); mainVbox.Spacing = 4; this.Add(mainVbox); // Main menu mainMenu = new MainMenu(); mainVbox.Add(mainMenu); var mainMenuBox = (Gtk.Box.BoxChild)mainVbox [mainMenu]; // mainMenuBox.Position = 0; mainMenuBox.Expand = false; mainMenuBox.Fill = false; mainMenu.NewSqliteDbActivated += OnNewSqliteDb; mainMenu.OpenSqliteDbActivated += OnOpenSqliteDb; mainMenu.ExitActivated += OnExit; mainMenu.NewSqlEditorWindowActivated += OnNewSqlTab; // toolbar toolbar = new MainToolbar(); mainVbox.Add(toolbar); var toolbarBox = (Gtk.Box.BoxChild)mainVbox [toolbar]; toolbarBox.Expand = false; // left paned leftPaned = new Gtk.HPaned(); leftPaned.CanFocus = true; mainVbox.Add(leftPaned); var objectBrowserScrolledWindow = new Gtk.ScrolledWindow(); objectBrowserScrolledWindow.ShadowType = ShadowType.EtchedIn; objectBrowserScrolledWindow.WidthRequest = 300; leftPaned.Add1(objectBrowserScrolledWindow); objectBrowserTreeView = new TreeView(); objectBrowserScrolledWindow.Add(objectBrowserTreeView); objectBrowserTreeStore = new TreeStore(typeof(Gdk.Pixbuf), typeof(IFeature)); objectBrowserTreeView.Model = objectBrowserTreeStore; // main tabbed area tabbedArea = new Notebook(); leftPaned.Add2(tabbedArea); // status bar statusBar = new Statusbar(); mainVbox.Add(statusBar); var statusBarBox = (Gtk.Box.BoxChild)mainVbox [statusBar]; statusBarBox.Expand = false; statusBarBox.Fill = false; global::Gtk.Label currentDbLabel = new Label(); ApplicationState.Instance.CurrentConnectionChanged += (sender, e) => currentDbLabel.Text = e.DbServerConnection.Name; statusBar.Add(currentDbLabel); this.ShowAll( ); this.DeleteEvent += OnExit; }
internal Client (bool loadFiles) { app_count++; Window = new Gtk.Window (Gtk.WindowType.Toplevel) { Title = Catalog.GetString ("PDF Mod") }; Window.SetSizeRequest (640, 480); Window.DeleteEvent += delegate (object o, DeleteEventArgs args) { Quit (); args.RetVal = true; }; // PDF Icon View IconView = new DocumentIconView (this); var iconview_sw = new Gtk.ScrolledWindow (); iconview_sw.AddWithViewport (IconView); query_box = new QueryBox (this) { NoShowAll = true }; query_box.Hide (); // ActionManager ActionManager = new Hyena.Gui.ActionManager (); Window.AddAccelGroup (ActionManager.UIManager.AccelGroup); Actions = new Actions (this, ActionManager); // Status bar StatusBar = new Gtk.Statusbar () { HasResizeGrip = true }; status_label = new Label () { Xalign = 0.0f }; StatusBar.PackStart (status_label, true, true, 6); StatusBar.ReorderChild (status_label, 0); var zoom_slider = new ZoomSlider (this); StatusBar.PackEnd (zoom_slider, false, false, 0); StatusBar.ReorderChild (zoom_slider, 1); // Properties editor box EditorBox = new MetadataEditorBox (this) { NoShowAll = true }; EditorBox.Hide (); // Menubar menu_bar = ActionManager.UIManager.GetWidget ("/MainMenu") as MenuBar; // Toolbar HeaderToolbar = ActionManager.UIManager.GetWidget ("/HeaderToolbar") as Gtk.Toolbar; HeaderToolbar.ShowArrow = false; HeaderToolbar.ToolbarStyle = ToolbarStyle.Icons; HeaderToolbar.Tooltips = true; HeaderToolbar.NoShowAll = true; HeaderToolbar.Visible = Configuration.ShowToolbar; // BookmarksView BookmarkView = new BookmarkView (this); BookmarkView.NoShowAll = true; BookmarkView.Visible = false; var vbox = new VBox (); vbox.PackStart (menu_bar, false, false, 0); vbox.PackStart (HeaderToolbar, false, false, 0); vbox.PackStart (EditorBox, false, false, 0); vbox.PackStart (query_box, false, false, 0); var hbox = new HPaned (); hbox.Add1 (BookmarkView); hbox.Add2 (iconview_sw); vbox.PackStart (hbox, true, true, 0); vbox.PackStart (StatusBar, false, true, 0); Window.Add (vbox); Window.ShowAll (); if (loadFiles) { RunIdle (LoadFiles); Application.Run (); } }
void CreateControl () { control = new HPaned (); store = new Gtk.TreeStore (typeof (Xwt.Drawing.Image), // image - type typeof (bool), // read? typeof (TaskListEntry), // read? -- use Pango weight typeof (string)); SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Type", "store__Read", "store__Task", "store__Description"); TypeDescriptor.AddAttributes (store, modelAttr); TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTasks); filter = new TreeModelFilter (store, null); filter.VisibleFunc = filterFunct; sort = new TreeModelSort (filter); sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort); sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort); sort.SetSortFunc (VisibleColumns.File, FileIterSort); view = new PadTreeView (sort); view.ShowExpanders = true; view.RulesHint = true; view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu (view, evnt, CreateMenu ()); AddColumns (); LoadColumnsVisibility (); view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type; view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project; view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File; sw = new MonoDevelop.Components.CompactScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (view); TaskService.Errors.TasksRemoved += ShowResults; TaskService.Errors.TasksAdded += TaskAdded; TaskService.Errors.TasksChanged += TaskChanged; TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged; IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen; IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed; view.RowActivated += new RowActivatedHandler (OnRowActivated); iconWarning = ImageService.GetIcon (Ide.Gui.Stock.Warning, Gtk.IconSize.Menu); iconError = ImageService.GetIcon (Ide.Gui.Stock.Error, Gtk.IconSize.Menu); iconInfo = ImageService.GetIcon (Ide.Gui.Stock.Information, Gtk.IconSize.Menu); iconEmpty = ImageService.GetIcon (Ide.Gui.Stock.Empty, Gtk.IconSize.Menu); control.Add1 (sw); outputView = new LogView { Name = "buildOutput" }; control.Add2 (outputView); control.ShowAll (); control.SizeAllocated += HandleControlSizeAllocated; bool outputVisible = OutputViewVisible; if (outputVisible) { outputView.Visible = true; logBtn.Active = true; } else { outputView.Hide (); } sw.SizeAllocated += HandleSwSizeAllocated; // Load existing tasks foreach (TaskListEntry t in TaskService.Errors) { AddTask (t); } control.FocusChain = new Gtk.Widget [] { sw }; }
/// <summary> /// Initializes the entire widget and lays out the class. /// </summary> private void InitializeWidget() { // The configuration area is split horizontally by a resizable pane. var pane = new HPaned(); // On the left is the selector area. pane.Add1(CreateSelectorArea()); // On the right is the configurator area. pane.Add2(CreateConfiguratorArea()); // Set the default position of the pane to 100 px for the selector. pane.Position = 100; // Pack the widget into ourselves. PackStart(pane, true, true, 0); }
private void BuildViews () { source_box = new VBox (); views_pane = new HPaned (); PersistentPaneController.Control (views_pane, SourceViewWidth); view_container = new ViewContainer (); source_view = new SourceView (); composite_view = new CompositeTrackSourceContents (); Container source_scroll; if (PlatformDetection.IsMeeGo) { source_scroll = new Gtk.ScrolledWindow () { HscrollbarPolicy = PolicyType.Never, VscrollbarPolicy = PolicyType.Automatic, ShadowType = ShadowType.None }; source_scroll.Add (source_view); var color = new Gdk.Color ((byte)0xe6, (byte)0xe6, (byte)0xe6); Gdk.Colormap.System.AllocColor (ref color, true, true); source_view.ModifyBase (StateType.Normal, color); } else { Hyena.Widgets.ScrolledWindow window; if (ApplicationContext.CommandLine.Contains ("smooth-scroll")) { window = new Hyena.Widgets.SmoothScrolledWindow (); } else { window = new Hyena.Widgets.ScrolledWindow (); } window.AddWithFrame (source_view); source_scroll = window; } composite_view.TrackView.HeaderVisible = false; view_container.Content = composite_view; source_box.PackStart (source_scroll, true, true, 0); source_box.PackStart (new UserJobTileHost (), false, false, 0); UpdateCoverArtDisplay (); source_view.SetSizeRequest (125, -1); view_container.SetSizeRequest (425, -1); views_pane.Pack1 (source_box, false, false); views_pane.Pack2 (view_container, true, false); source_box.ShowAll (); view_container.Show (); views_pane.Show (); primary_vbox.PackStart (views_pane, true, true, 0); }
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; }
/// <summary> /// Creates the GUI from code elements. /// </summary> private void CreateGui() { // Hook up the accelerator group. accelerators = new AccelGroup(); AddAccelGroup(accelerators); // The main frame has a VBox to arrange all the components. The VBox // contains the menu, the primary text editor, and a status bar. var vertical = new VBox(false, 0); Add(vertical); // The center part of the area has a horizontal separator with the // bulk of the text editor on the left. var pane = new HPaned { Position = 1024 - 256, BorderWidth = 0, }; // Create the various components and add them to the vertical box. Widget menuBarWidget = CreateGuiMenubar(); Widget panelsWidget = CreatePanelArea(); Widget textEditorWidget = CreateGuiEditor(); Widget statusBarWidget = CreateGuiStatusbar(); pane.Pack1(textEditorWidget, true, true); pane.Pack2(panelsWidget, true, true); vertical.PackStart(menuBarWidget, false, false, 0); vertical.PackStart(pane, true, true, 0); vertical.PackStart(statusBarWidget, false, false, 0); }
public TypeGraphComponent(Profile p) { Profile = p; Title = "Type Graph"; box = new VBox (); box.Spacing = 12; paned = new HPaned (); Add (box); scroller = new HeapScroller (p); scroller.OnScrolled += delegate { t = null; d.UpdateCache (); d.QueueDraw (); }; box.PackStart (scroller, false, false, 0); tl = new TypeList (p); d = new TypeGrpah (tl, this); ScrolledWindow sw = new ScrolledWindow (); sw.Add (new TypeListNodeStore (tl).GetNodeView ()); paned.Pack1 (d, true, true); paned.Pack2 (sw, false, true); box.PackStart (paned, true, true, 0); }