private void CreateContextNotebook() { notebook = new Notebook() { ShowBorder = false, ShowTabs = false }; // 'No active track' and 'Loading' widgets no_active = new RoundedFrame(); no_active.Add(new Label() { Markup = String.Format("<b>{0}</b>", Catalog.GetString("Waiting for playback to begin...")) }); no_active.ShowAll(); notebook.Add(no_active); loading = new RoundedFrame(); loading.Add(new Label() { Markup = String.Format("<b>{0}</b>", Catalog.GetString("Loading...")) }); loading.ShowAll(); notebook.Add(loading); PackStart(notebook, true, true, 0); notebook.Show(); }
public MainWindow() : base(WindowType.Toplevel) { this.barChart = new SmartQuant.Controls.BarChart.BarChart(); this.barChart2 = new SmartQuant.Controls.BarChart.BarChart2(); this.chart3 = new SmartQuant.FinChart.Chart(); this.chart3.ActionType = ChartActionType.Cross; var nb = new Notebook(); nb.Add(barChart); nb.SetTabLabelText(barChart, "Chart"); nb.Add(barChart2); nb.SetTabLabelText(barChart2, "Chart(Gapless)"); nb.Add(chart3); nb.SetTabLabelText(chart3, "Performance"); Add(nb); SetDefaultSize(624, 362); DeleteEvent += (sender, e) => { Application.Quit(); e.RetVal = true; }; var f = new Framework("Demo", true); f.IsDisposable = false; f.GroupDispatcher = new GroupDispatcher(f); this.barChart.Init(f, null, null); this.barChart2.Init(f, null, null); this.barChart.ResumeUpdates(); this.barChart2.ResumeUpdates(); GLib.Timeout.Add(500, new TimeoutHandler(delegate { barChart.UpdateGUI(); barChart2.UpdateGUI(); return true; })); // Until the framework is created, We cannot show them ShowAll(); }
/// <summary> /// Tunes the left dock item. /// </summary> private void TuneLeftDockItem() { Gtk.VBox vbox = new Gtk.VBox(); tbLeft.Name = "LeftToolbar"; vbox.PackStart(tbLeft, true, true, 0); tbLeft.Orientation = Gtk.Orientation.Vertical; // Show only text on the buttons tbLeft.ToolbarStyle = Gtk.ToolbarStyle.Text; ScrolledWindow scroll = new ScrolledWindow(); // Attach the treeView to the scroll bar. scroll.AddWithViewport(vbox); nbLeftDock.Add(scroll);; this.propertyGrid = new SolidV.Gtk.InspectorGrid.InspectorGrid(); nbLeftDock.AppendPage(propertyGrid, new Gtk.Label("Properties")); nbLeftDock.ShowAll(); }
private void CheckNoMatch() { MatchType matches = view.MatchState; if (matches == MatchType.Matched) { pages.CurrentPage = pages.PageNum(panes); return; } if (nomatch != null) { nomatch.Destroy(); } nomatch = new Pages.NoMatch(query_text, matches == MatchType.NoneInScope || scope_list.Active != 0); nomatch.Show(); pages.Add(nomatch); pages.CurrentPage = pages.PageNum(nomatch); // Since there is no match, possibly the user wants to modify query; focus the search entry field. GrabEntryFocus(); }
private void Build() { this.Title = "MonoGame Packager"; this.DefaultWidth = this.WidthRequest = 640; this.DefaultHeight = this.HeightRequest = 480; #if WINDOWS this.ModifyBg (StateType.Normal, new Gdk.Color (255, 255, 255)); #endif #if GTK3 var geom = new Gdk.Geometry(); geom.MinWidth = geom.MaxWidth = this.DefaultWidth; geom.MinHeight = geom.MaxHeight = this.DefaultHeight; this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize); #else this.Resizable = false; #endif vbox1 = new VBox(); vbox1.Spacing = 4; notebook1 = new Notebook(); notebook1.ShowBorder = false; notebook1.ShowTabs = false; // Wizard Page 0 vbox2 = new VBox(); vbox2.Spacing = 10; label1 = new Label(); label1.Wrap = true; label1.LineWrapMode = Pango.WrapMode.Word; label1.Text = "Welcome to MonoGame Packager\n" + "\n" + "This tool will help you pack you desktop game for redistribution. It offers 2 options, installer and bundle of binaries. The difference between bundling the game into an archive with this tool and doing it by hand is the fact that this tool will help by adding per platform dependencies."; vbox2.PackStart(label1, true, true, 0); label2 = new Label("Do note that installer generation is usually only supported for the OS this tool is run from.\n"); vbox2.PackStart(label2, false, true, 1); notebook1.Add(vbox2); // Wizaed Page 1 table1 = new Table(5, 3, false); table1.Attach(new Label(), 0, 3, 0, 1); label3 = new Label(" Select game folder: "); label3.SetAlignment(0f, 0.5f); table1.Attach(label3, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4); entryGameDir = new Entry(); entryGameDir.Sensitive = false; table1.Attach(entryGameDir, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 4, 4); btnBrowse = new Button("Browse..."); btnBrowse.Clicked += BtnBrowse_Clicked; table1.Attach(btnBrowse, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4); label4 = new Label(" Select game .exe file:"); label4.SetAlignment(0f, 0.5f); table1.Attach(label4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4); scroll1 = new ScrolledWindow(); scroll1.HeightRequest = 200; treeview1 = new TreeView(); treeview1.HeightRequest = scroll1.HeightRequest; treeview1.HeadersVisible = false; treeview1.Reorderable = false; treeview1.CursorChanged += Treeview1_CursorChanged; scroll1.Add(treeview1); table1.Attach(scroll1, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); table1.Attach(new Label(), 0, 3, 4, 5); notebook1.Add(table1); // Wizard Page 2 table2 = new Table(10, 3, false); table2.Attach(new Label(), 0, 3, 0, 1); imageIcon = new Image(); btnIcon = new Button(imageIcon); btnIcon.WidthRequest = btnIcon.HeightRequest = 64; btnIcon.Clicked += BtnIcon_Clicked; table2.Attach(btnIcon, 0, 1, 1, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4); label5 = new Label("Title:"); label5.SetAlignment(0f, 0.5f); table2.Attach(label5, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 4, 4); entryTitle = new Entry(); table2.Attach(entryTitle, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4); label6 = new Label("Version:"); label6.SetAlignment(0f, 0.5f); table2.Attach(label6, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4); entryVersion = new Entry(); table2.Attach(entryVersion, 2, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4); label7 = new Label("Creator:"); label7.SetAlignment(0f, 0.5f); table2.Attach(label7, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 4, 4); entryCompany = new Entry(); table2.Attach(entryCompany, 2, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4); table2.Attach(new HSeparator(), 0, 3, 4, 5, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4); table3 = new Table(3, 5, false); label8 = new Label("Generate bundle of binaries:"); label8.SetAlignment(0f, 0.5f); table3.Attach(label8, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4); var bundlers = Generators.GetBundlerList(); for (int i = 0; i < bundlers.Count; i++) { var checkButton = new TagCheckButton(bundlers[i].Name); checkButton.SetAlignment(0f, 0.5f); checkButton.Tag = bundlers[i]; checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive(); table3.Attach(checkButton, 0, 1, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2); checkBundlers.Add(checkButton); } label9 = new Label("Generate installer:"); label9.SetAlignment(0f, 0.5f); table3.Attach(label9, 2, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4); var installers = Generators.GetInstallerList(); for (int i = 0; i < installers.Count; i++) { var checkButton = new TagCheckButton(installers[i].Name); checkButton.SetAlignment(0f, 0.5f); checkButton.Tag = installers[i]; checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive(); table3.Attach(checkButton, 2, 3, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2); checkInstallers.Add(checkButton); } table2.Attach(table3, 0, 3, 5, 6, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 40, 4); table2.Attach(new Label(), 0, 3, 6, 7); notebook1.Add(table2); // Wizard Page 3 vbox3 = new VBox(); vbox3.BorderWidth = 4; vbox3.Spacing = 4; label10 = new Label("Select output folder:"); label10.SetAlignment(0f, 1f); vbox3.PackStart(label10, true, true, 0); hbox2 = new HBox(); hbox2.Spacing = 4; entryOutputDir = new Entry(); entryOutputDir.Sensitive = false; hbox2.PackStart(entryOutputDir, true, true, 0); btnBrowse2 = new Button("Browse..."); btnBrowse2.Clicked += BtnBrowse2_Clicked; hbox2.PackStart(btnBrowse2, false, true, 1); vbox3.PackStart(hbox2, false, false, 1); vbox3.PackStart(new Label(), true, true, 2); notebook1.Add(vbox3); // Wizard Page 4 scroll2 = new ScrolledWindow(); textView1 = new TextView(); scroll2.Add(textView1); notebook1.Add(scroll2); // Control Buttons vbox1.PackStart(notebook1, true, true, 0); var eventBox = new EventBox (); #if WINDOWS eventBox.ModifyBg (StateType.Normal, new Gdk.Color (240, 240, 240)); #endif hbox1 = new HBox(); hbox1.BorderWidth = 10; btnCancel = new Button("Cancel"); btnCancel.WidthRequest = 90; btnCancel.Clicked += (sender, e) => Application.Quit(); hbox1.PackStart(btnCancel, false, false, 0); hbox1.PackStart(new Label(), true, true, 1); btnPrev = new Button("Previous"); btnPrev.WidthRequest = btnCancel.WidthRequest; btnPrev.Clicked += BtnPrev_Clicked; btnPrev.Sensitive = false; hbox1.PackStart(btnPrev, false, false, 2); btnNext = new Button("Next"); btnNext.WidthRequest = btnCancel.WidthRequest; btnNext.Clicked += BtnNext_Clicked; hbox1.PackStart(btnNext, false, false, 3); eventBox.Add (hbox1); vbox1.PackStart(eventBox, false, true, 1); this.Add(vbox1); this.ShowAll(); this.DeleteEvent += OnDeleteEvent; }
private void CreateContextNotebook () { notebook = new Notebook () { ShowBorder = false, ShowTabs = false }; // 'No active track' and 'Loading' widgets no_active = new RoundedFrame (); no_active.Add (new Label () { Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Waiting for playback to begin...")) }); no_active.ShowAll (); notebook.Add (no_active); loading = new RoundedFrame (); loading.Add (new Label () { Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Loading...")) }); loading.ShowAll (); notebook.Add (loading); PackStart (notebook, true, true, 0); notebook.Show (); }
public SearchWindow(ISearch search) : base(WindowType.Toplevel) { this.search = search; base.Title = Catalog.GetString("Desktop Search"); base.Icon = WidgetFu.LoadThemeIcon("system-search", 16); base.DefaultWidth = 700; base.DefaultHeight = 550; base.DeleteEvent += OnWindowDelete; VBox vbox = new VBox(); vbox.Spacing = 3; uim = new UIManager(this); uim.DomainChanged += OnDomainChanged; uim.SortChanged += OnSortChanged; uim.ToggleDetails += OnToggleDetails; uim.ShowQuickTips += OnShowQuickTips; uim.ShowIndexInfo += OnShowIndexInfo; uim.StartDaemon += OnStartDaemon; uim.StopDaemon += OnStopDaemon; vbox.PackStart(uim.MenuBar, false, false, 0); HBox hbox = new HBox(false, 6); Label label = new Label(Catalog.GetString("_Find in:")); hbox.PackStart(label, false, false, 0); scope_list = ComboBox.NewText(); foreach (ScopeMapping mapping in scope_mappings) { scope_list.AppendText(mapping.label); } scope_list.Active = 0; scope_list.Changed += new EventHandler(delegate(object o, EventArgs args) { ComboBox combo = o as ComboBox; if (o == null) { return; } int active = combo.Active; Log.Debug("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping); Query(true); }); hbox.PackStart(scope_list, false, false, 0); entry = new Entry(); entry.Activated += OnEntryActivated; hbox.PackStart(entry, true, true, 0); label.MnemonicWidget = entry; uim.FocusSearchEntry += delegate() { entry.GrabFocus(); }; // The auto search after timeout feauture is now optional // and can be disabled. if (Conf.BeagleSearch.GetOption(Conf.Names.BeagleSearchAutoSearch, true)) { entry.Changed += OnEntryResetTimeout; entry.MoveCursor += OnEntryResetTimeout; } button = new Gtk.Button(); Gtk.HBox button_hbox = new Gtk.HBox(false, 2); Gtk.Image icon = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Button); button_hbox.PackStart(icon, false, false, 0); label = new Gtk.Label(Catalog.GetString("Find Now")); button_hbox.PackStart(label, false, false, 0); button.Add(button_hbox); button.Clicked += OnButtonClicked; Gtk.VBox buttonVBox = new Gtk.VBox(false, 0); buttonVBox.PackStart(button, true, false, 0); hbox.PackStart(buttonVBox, false, false, 0); spinner = new Spinner(); hbox.PackStart(spinner, false, false, 0); HBox padding_hbox = new HBox(); padding_hbox.PackStart(hbox, true, true, 9); vbox.PackStart(padding_hbox, false, true, 6); VBox view_box = new VBox(false, 3); vbox.PackStart(view_box, true, true, 0); HBox na_padding = new HBox(); view_box.PackStart(na_padding, false, true, 0); notification_area = new NotificationArea(); na_padding.PackStart(notification_area, true, true, 3); pages = new Gtk.Notebook(); pages.ShowTabs = false; pages.ShowBorder = false; pages.BorderWidth = 3; view_box.PackStart(pages, true, true, 0); quicktips = new Pages.QuickTips(); quicktips.Show(); pages.Add(quicktips); indexinfo = new Pages.IndexInfo(); indexinfo.Show(); pages.Add(indexinfo); rootuser = new Pages.RootUser(); rootuser.Show(); pages.Add(rootuser); startdaemon = new Pages.StartDaemon(); startdaemon.DaemonStarted += OnDaemonStarted; startdaemon.Show(); pages.Add(startdaemon); panes = new Beagle.Search.Panes(); panes.Show(); pages.Add(panes); view = new GroupView(); view.TileSelected += ShowInformation; panes.MainContents = view; this.statusbar = new Gtk.Statusbar(); vbox.PackEnd(this.statusbar, false, false, 0); Add(vbox); tips = new Gtk.Tooltips(); tips.SetTip(entry, Catalog.GetString("Type in search terms"), ""); tips.SetTip(button, Catalog.GetString("Start searching"), ""); tips.Enable(); if (Environment.UserName == "root" && !Conf.Daemon.GetOption(Conf.Names.AllowRoot, false)) { pages.CurrentPage = pages.PageNum(rootuser); entry.Sensitive = button.Sensitive = uim.Sensitive = false; } else { pages.CurrentPage = pages.PageNum(quicktips); } entry.GrabFocus(); StartCheckingIndexingStatus(); }
private void CreateWidgets() { this.Title = APP_NAME; this.SetDefaultSize (800, 600); this.DeleteEvent += new DeleteEventHandler (OnDeleteEvent); CreateActions (); CreateMenubar (); CreateToolbar (); CreateWebView (); CreateFindbar (); CreateStatusBar (); Notebook nb = new Notebook (); Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow (); scroll.Add (nb); //string label =url; //nb.AppendPage (new Button (label), new Label (label)); nb.Add(webview); vbox = new Gtk.VBox (false, 1); vbox.PackStart (menubar, false, false, 0); vbox.PackStart (toolbar, false, false, 0); vbox.PackStart (scroll); vbox.PackStart (findbar, false, false, 0); vbox.PackEnd (statusbar, false, true, 0); this.Add (vbox); this.ShowAll (); }
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; }
public SearchWindow (ISearch search) : base (WindowType.Toplevel) { this.search = search; base.Title = Catalog.GetString ("Desktop Search"); base.Icon = WidgetFu.LoadThemeIcon ("system-search", 16); base.DefaultWidth = 700; base.DefaultHeight = 550; base.DeleteEvent += OnWindowDelete; VBox vbox = new VBox (); vbox.Spacing = 3; uim = new UIManager (this); uim.DomainChanged += OnDomainChanged; uim.SortChanged += OnSortChanged; uim.ToggleDetails += OnToggleDetails; uim.ShowQuickTips += OnShowQuickTips; uim.ShowIndexInfo += OnShowIndexInfo; uim.StartDaemon += OnStartDaemon; uim.StopDaemon += OnStopDaemon; vbox.PackStart (uim.MenuBar, false, false, 0); HBox hbox = new HBox (false, 6); Label label = new Label (Catalog.GetString ("_Find in:")); hbox.PackStart (label, false, false, 0); scope_list = ComboBox.NewText (); foreach (ScopeMapping mapping in scope_mappings) scope_list.AppendText (mapping.label); scope_list.Active = 0; scope_list.Changed += new EventHandler (delegate (object o, EventArgs args) { ComboBox combo = o as ComboBox; if (o == null) return; int active = combo.Active; Log.Debug ("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping); Query (true); }); hbox.PackStart (scope_list, false, false, 0); entry = new Entry (); entry.Activated += OnEntryActivated; hbox.PackStart (entry, true, true, 0); label.MnemonicWidget = entry; uim.FocusSearchEntry += delegate () { entry.GrabFocus (); }; // The auto search after timeout feauture is now optional // and can be disabled. if (Conf.BeagleSearch.GetOption (Conf.Names.BeagleSearchAutoSearch, true)) { entry.Changed += OnEntryResetTimeout; entry.MoveCursor += OnEntryResetTimeout; } button = new Gtk.Button (); Gtk.HBox button_hbox = new Gtk.HBox (false, 2); Gtk.Image icon = new Gtk.Image (Gtk.Stock.Find, Gtk.IconSize.Button); button_hbox.PackStart (icon, false, false, 0); label = new Gtk.Label (Catalog.GetString ("Find Now")); button_hbox.PackStart (label, false, false, 0); button.Add (button_hbox); button.Clicked += OnButtonClicked; Gtk.VBox buttonVBox = new Gtk.VBox (false, 0); buttonVBox.PackStart (button, true, false, 0); hbox.PackStart (buttonVBox, false, false, 0); spinner = new Spinner (); hbox.PackStart (spinner, false, false, 0); HBox padding_hbox = new HBox (); padding_hbox.PackStart (hbox, true, true, 9); vbox.PackStart (padding_hbox, false, true, 6); VBox view_box = new VBox (false, 3); vbox.PackStart (view_box, true, true, 0); HBox na_padding = new HBox (); view_box.PackStart (na_padding, false, true, 0); notification_area = new NotificationArea (); na_padding.PackStart (notification_area, true, true, 3); pages = new Gtk.Notebook (); pages.ShowTabs = false; pages.ShowBorder = false; pages.BorderWidth = 3; view_box.PackStart (pages, true, true, 0); quicktips = new Pages.QuickTips (); quicktips.Show (); pages.Add (quicktips); indexinfo = new Pages.IndexInfo (); indexinfo.Show (); pages.Add (indexinfo); rootuser = new Pages.RootUser (); rootuser.Show (); pages.Add (rootuser); startdaemon = new Pages.StartDaemon (); startdaemon.DaemonStarted += OnDaemonStarted; startdaemon.Show (); pages.Add (startdaemon); panes = new Beagle.Search.Panes (); panes.Show (); pages.Add (panes); view = new GroupView (); view.TileSelected += ShowInformation; panes.MainContents = view; this.statusbar = new Gtk.Statusbar (); vbox.PackEnd (this.statusbar, false, false, 0); Add (vbox); tips = new Gtk.Tooltips (); tips.SetTip (entry, Catalog.GetString ("Type in search terms"), ""); tips.SetTip (button, Catalog.GetString ("Start searching"), ""); tips.Enable (); if (Environment.UserName == "root" && !Conf.Daemon.GetOption (Conf.Names.AllowRoot, false)) { pages.CurrentPage = pages.PageNum (rootuser); entry.Sensitive = button.Sensitive = uim.Sensitive = false; } else { pages.CurrentPage = pages.PageNum (quicktips); } entry.GrabFocus (); StartCheckingIndexingStatus (); }