void UpdateButton(DialogButton btn, Gtk.Button b) { if (!string.IsNullOrEmpty(btn.Label) && btn.Image == null) { b.Label = btn.Label; } else if (string.IsNullOrEmpty(btn.Label) && btn.Image != null) { var pix = btn.Image.ToImageDescription(); b.Image = new ImageBox(ApplicationContext, pix); } else if (!string.IsNullOrEmpty(btn.Label)) { Gtk.Box box = new Gtk.HBox(false, 3); var pix = btn.Image.ToImageDescription(); box.PackStart(new ImageBox(ApplicationContext, pix), false, false, 0); box.PackStart(new Gtk.Label(btn.Label), true, true, 0); b.Image = box; } if (btn.Visible) { b.ShowAll(); } else { b.Hide(); } b.Sensitive = btn.Sensitive; UpdateActionAreaVisibility(); }
public Gtk.Button create_button(Gtk.Label label, Gtk.Image image) { Gtk.Button button = new Gtk.Button(); Gtk.VBox vbox = new Gtk.VBox(); label.WidthChars = 24; label.MaxWidthChars = 24; label.LineWrap = true; label.Justify = Gtk.Justification.Center; vbox.Add(image); vbox.Add(label); button.Add(vbox); button.ShowAll(); int h = 46 + label.SizeRequest().Height; if (h < 80) { h = 80; } button.SetSizeRequest(1, h); return(button); }
void UpdateButton(DialogButton btn, Gtk.Button b) { if (!string.IsNullOrEmpty(btn.Label) && btn.Image == null) { b.Label = btn.Label; } else if (string.IsNullOrEmpty(btn.Label) && btn.Image != null) { var pix = (Gdk.Pixbuf)WidgetRegistry.GetBackend(btn.Image); b.Image = new Gtk.Image(pix); } else if (!string.IsNullOrEmpty(btn.Label)) { Gtk.Box box = new Gtk.HBox(false, 3); var pix = (Gdk.Pixbuf)WidgetRegistry.GetBackend(btn.Image); box.PackStart(new Gtk.Image(pix), false, false, 0); box.PackStart(new Gtk.Label(btn.Label), true, true, 0); b.Image = box; } if (btn.Visible) { b.ShowAll(); } else { b.Hide(); } b.Sensitive = btn.Sensitive; }
public static void CreateUICanvasButtonAddTab(Gtk.Window window, Gtk.Notebook parentNotebook, Gtk.ButtonReleaseEventHandler buttonPressEvent) { Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow(); scrolledWindow.Name = "_scrolledWindow" + nextGeneratedTabIndex; scrolledWindow.ShadowType = ((Gtk.ShadowType)(1)); scrolledWindow.ShowAll(); Gtk.Image buttonAddTabImage = new Gtk.Image(); buttonAddTabImage.Pixbuf = global::Stetic.IconLoader.LoadIcon(window, "gtk-add", Gtk.IconSize.Button); buttonAddTabImage.ShowAll(); Gtk.Button buttonAddTab = new Gtk.Button(); buttonAddTab.CanFocus = true; buttonAddTab.Name = "_buttonAddhostEntry"; buttonAddTab.Image = buttonAddTabImage; buttonAddTab.ShowAll(); buttonAddTab.ButtonReleaseEvent += buttonPressEvent; Gtk.Viewport viewportLabel = new Gtk.Viewport(); viewportLabel.ShadowType = ((Gtk.ShadowType)(0)); viewportLabel.Add(buttonAddTab); parentNotebook.Add(scrolledWindow); parentNotebook.SetTabLabel(scrolledWindow, viewportLabel); }
public Header(string text) : base() { base.SetSizeRequest (-1, 30); Gtk.Alignment alignment = new Gtk.Alignment (0, 0, 1, 1); alignment.TopPadding = 1; alignment.LeftPadding = 5; alignment.RightPadding = 0; alignment.BottomPadding = 1; base.Add (alignment); //Select (); Gtk.HBox box = new Gtk.HBox (); alignment.Add (box); label = new Gtk.Label (); label.Ypad = 3; // label.Xpad = 3; //base.Add (label); box.PackStart (label, true, true, 0); label.SetAlignment (0f, 0.5f); label.Justify = Gtk.Justification.Left; label.Markup = "<b>" + text + "</b>"; closeButton = new Gtk.Button (); closeButton.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Menu)); closeButton.Relief = Gtk.ReliefStyle.None; box.PackEnd (closeButton, false, false, 0); closeButton.ShowAll (); label.Show (); box.Show (); alignment.Show (); closeButton.Clicked += closeButton_Clicked; }
public Header(string text) : base() { base.SetSizeRequest(-1, 30); Gtk.Alignment alignment = new Gtk.Alignment(0, 0, 1, 1); alignment.TopPadding = 1; alignment.LeftPadding = 5; alignment.RightPadding = 0; alignment.BottomPadding = 1; base.Add(alignment); //Select (); Gtk.HBox box = new Gtk.HBox(); alignment.Add(box); label = new Gtk.Label(); label.Ypad = 3; // label.Xpad = 3; //base.Add (label); box.PackStart(label, true, true, 0); label.SetAlignment(0f, 0.5f); label.Justify = Gtk.Justification.Left; label.Markup = "<b>" + text + "</b>"; closeButton = new Gtk.Button(); closeButton.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Menu)); closeButton.Relief = Gtk.ReliefStyle.None; box.PackEnd(closeButton, false, false, 0); closeButton.ShowAll(); label.Show(); box.Show(); alignment.Show(); closeButton.Clicked += closeButton_Clicked; }
public frmAbout() : base(Gtk.WindowType.Toplevel) { sUpdatePath = string.Empty; if (RestrictionLibrary.CurrentOS.IsMac) { sUpdatePath = System.IO.Path.Combine(modFunctions.AppData, "Setup.dmg"); } else if (RestrictionLibrary.CurrentOS.IsLinux) { sUpdatePath = System.IO.Path.Combine(modFunctions.AppData, "Setup.bz2.sh"); } this.Build(); this.WindowStateEvent += HandleWindowStateEvent; this.Title = "About " + modFunctions.ProductName; modFunctions.PrepareLink(lblProduct); if (RestrictionLibrary.CurrentOS.IsLinux) { lblProduct.Markup = "<a href=\"http://srt.realityripple.com/For_MONO/linux.php\">" + modFunctions.ProductName + " for Linux</a>"; } else if (RestrictionLibrary.CurrentOS.IsMac) { lblProduct.Markup = "<a href=\"http://srt.realityripple.com/For_MONO/mac.php\">" + modFunctions.ProductName + " for macOS</a>"; } else if (RestrictionLibrary.CurrentOS.IsWindows) { lblProduct.Markup = "<a href=\"http://srt.realityripple.com/For_MONO/\">" + modFunctions.ProductName + " for Windows (on MONO)</a>"; } else { lblProduct.Markup = "<a href=\"http://srt.realityripple.com/For_MONO/\">" + modFunctions.ProductName + " for MONO</a>"; } modFunctions.PrepareLink(lblVersion); lblVersion.Markup = "<a href=\"http://srt.realityripple.com/For_MONO/changes.php\">Version " + modFunctions.DisplayVersion(modFunctions.ProductVersion) + "</a> on " + RestrictionLibrary.srlFunctions.GetCLRCleanVersion(); modFunctions.PrepareLink(lblCompany); lblCompany.Markup = "<a href=\"http://realityripple.com/\">" + modFunctions.CompanyName + "</a>"; txtDescription.Buffer.Text = "The RestrictionTracker utility monitors and logs ViaSat network usage and limits. It includes graphing software to let you monitor your usage history and predict future usage levels. All application coding by Andrew Sachen. This application is not endorsed by ViaSat, WildBlue, Exede, or any affiliate companies."; if (string.IsNullOrEmpty(sUpdatePath)) { pctUpdate.PixbufAnimation = new Gdk.PixbufAnimation(null, "RestrictionTrackerGTK.Resources.error.png"); pctUpdate.Visible = true; lblUpdate.Visible = true; lblUpdate.HeightRequest = 24; lblUpdate.Markup = "Update Check Disabled"; lblUpdate.TooltipText = "Your Operating System is not supported by " + modFunctions.ProductName + " for MONO.\nYou will need to update manually.\n\nIf you believe this to be an error or are interested in adding official support for your Operating System, please contact me."; pctUpdate.TooltipText = lblUpdate.TooltipText; } else { pctUpdate.PixbufAnimation = new Gdk.PixbufAnimation(null, "RestrictionTrackerGTK.Resources.throbber.gif"); pctUpdate.Visible = false; pnlUpdate.Remove(lblUpdate); cmdUpdate = new Gtk.Button(); cmdUpdate.Name = "cmdUpdate"; cmdUpdate.UseUnderline = true; Gtk.Label cuLabel = new Gtk.Label(); cuLabel.LabelProp = "Check for _Updates"; cuLabel.UseUnderline = true; cmdUpdate.Add(cuLabel); pnlUpdate.Add(cmdUpdate); ((Gtk.Box.BoxChild)pnlUpdate[cmdUpdate]).Position = 2; cmdUpdate.ShowAll(); cmdUpdate.Visible = true; cmdUpdate.TooltipText = "Check for a new version of " + modFunctions.ProductName + "."; ((Gtk.Box.BoxChild)pnlUpdate[cmdUpdate]).PackType = Gtk.PackType.Start; ((Gtk.Box.BoxChild)pnlUpdate[cmdUpdate]).Fill = false; ((Gtk.Box.BoxChild)pnlUpdate[cmdUpdate]).Expand = false; cmdUpdate.Clicked += cmdUpdate_Click; } int lHeight = 24; lblProduct.HeightRequest = lHeight; lblVersion.HeightRequest = lHeight; lblCompany.HeightRequest = lHeight; }