private void BuildFileNameGroup(Gtk.HBox hbFileName) { this.btOpen = new Gtk.Button( Gtk.Stock.Open ); this.edFileName = new Gtk.Entry(); this.edFileName.IsEditable = false; this.btOpen.Clicked += (sender, e) => this.OnOpen(); hbFileName.PackStart( this.edFileName, true, true, 5 ); hbFileName.PackStart( this.btOpen, false, false, 5 ); }
public void FillVbox(Gtk.VBox vbox, IList people) { foreach (Person p in people) { vbox.PackStart (new PersonAndJobRow(p, null)); } vbox.ShowAll (); }
private Gtk.Button MakeButton (Gtk.HBox header, string icon, EventHandler handler) { Gtk.Button button = new Gtk.Button (); Gtk.Image img = new Gtk.Image (icon, Gtk.IconSize.Button); button.Add (img); button.Relief = Gtk.ReliefStyle.None; button.Clicked += handler; header.PackStart (button, false, false, 0); button.ShowAll (); return button; }
private void FillTestComboBox(Gtk.ComboBox cb) { cb.Clear(); CellRendererText cell = new CellRendererText(); cb.PackStart(cell, false); cb.AddAttribute(cell, "text", 0); ListStore store = new ListStore(typeof (string)); cb.Model = store; store.AppendValues("BitBlt"); store.AppendValues("Ellipse"); store.AppendValues("Polygon"); store.AppendValues("LineTo"); store.AppendValues("PolylineTo"); }
private void fill_themes_combo(Gtk.ComboBox box) { box.Clear(); CellRendererText cell = new CellRendererText(); box.PackStart(cell, false); box.AddAttribute(cell, "text", 0); ListStore store = new ListStore(typeof(string)); box.Model = store; TreeIter iter; string cur_theme = Conf.Get(Preference.THEME, Defines.DEFAULT_THEME); cur_theme = cur_theme.Substring(cur_theme.LastIndexOf("/") + 1); IList themes = Application.TheApp.ThemeManager.GetThemeList(); foreach(Theme t in themes){ iter = store.AppendValues(t.Name); if(t.Name == cur_theme){ box.SetActiveIter(iter); } } }
/// Add new checkbox to the dialog with label and default value /// <param name="page">An object that represents dialog (a container of items on the dialog)</param> /// <param name="propertyLabel">Label that will be shown before the checkbox</param> /// <param name="propertyValue">Default value that will be preset to the checkbox (should be one of True or False)</param> /// <param name="propertyHint">Hint that will be shown when mouse goes over a checkbox</param> /// <param name="wayInXml">A XPath path to the element, whose checkbox is created</param> protected void AddBoolItem(Gtk.Box page, string propertyLabel, string propertyValue, string propertyHint, string wayInXml) { // create one entry to property dialog HBox hbox = new HBox(false, 3); Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1); CheckButton checkButton = CheckButton.NewWithLabel(propertyLabel); hbox.PackStart(checkButton, false, false, 1); checkButton.Active = (propertyValue.ToUpper() == "TRUE"); // add hints to created items tooltips.SetTip(checkButton, propertyHint, ""); page.PackStart(hbox, false, false, 1); // add checkbox to list of properies (useful during saving) checkButton.Name = "item" + (lastItemNumber++).ToString(); StoreToProperties(checkButton.Name, wayInXml); }
/// Add new spinbutton to the dialog with label and default value /// <param name="page">An object that represents dialog (a container of items on the dialog)</param> /// <param name="propertyLabel">Label that will be shown before the spinbutton</param> /// <param name="propertyValue">Default value that will be preset to the spinbutton (should be one of True or False)</param> /// <param name="propertyHint">Hint that will be shown when mouse goes over a spinbutton</param> /// <param name="wayInXml">A XPath path to the element, whose spinbutton is created</param> protected void AddIntItem(Gtk.Box page, string propertyLabel, string propertyValue, string propertyHint, string minimum, string maximum, string step, string wayInXml) { double dMinimum = Convert.ToDouble(minimum); double dMaximum = Convert.ToDouble(maximum); double dStep = Convert.ToDouble(step); double hodnota = (propertyValue != string.Empty) ? Convert.ToDouble(propertyValue) : 1f; if (hodnota < dMinimum) hodnota=dMinimum; if (hodnota > dMaximum) hodnota=dMaximum; // create spinbutton to represent value HBox hbox = new HBox(false, 3); Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1); SpinButton spinner = new SpinButton(dMinimum, dMaximum, dStep); spinner.Value = hodnota; Label labelInt = new Label(propertyLabel); hbox.PackStart(labelInt, false, false, 1); hbox.PackStart(spinner, false, false, 1); page.PackStart(hbox, false, false, 1); // store the way in Xml to this element spinner.Name = "item" + (lastItemNumber++).ToString(); StoreToProperties(spinner.Name, wayInXml); }
/// Add new editable entry to the dialog with label and default value /// <param name="page">An object that represents dialog (a container of items on the dialog)</param> /// <param name="propertyLabel">Label that will be shown before the entry</param> /// <param name="propertyValue">Default value that will be preset to the entry</param> /// <param name="wayInXml">A XPath path to the element, whose entry is created</param> protected void AddStringItem(Gtk.Box page, string propertyLabel, string propertyValue, string toolTip, string wayInXml) { // create one entry to property dialog HBox hbox = new HBox(false, 3); Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1); Label label = new Label(propertyLabel); Entry entry = new Entry(propertyValue); entry.IsEditable = true; entry.Visible = true; hbox.PackStart(label, false, false, 1); hbox.PackEnd(entry, true, true, 1); page.PackStart(hbox, false, false, 1); // add entry to list of properies (useful during saving) entry.Name = "item" + (lastItemNumber++).ToString(); StoreToProperties(entry.Name, wayInXml); }
internal virtual void AttachMainToolbar (Gtk.VBox parent, IMainToolbarView toolbar) { var toolbarBox = new Gtk.HBox (); parent.PackStart (toolbarBox, false, false, 0); toolbarBox.PackStart ((MainToolbar)toolbar, true, true, 0); }
/// Add new combobox to the dialog with label, filled item and default value /// <param name="page">An object that represents dialog (a container of items on the dialog)</param> /// <param name="propertyLabel">Label that will be shown before the combobox</param> /// <param name="propertySelected">Default value that will be preset to the combobox (should be one of True or False)</param> /// <param name="propertyHint">Hint that will be shown when mouse goes over a combobox</param> /// <param name="options">An array of strings that represents options of combobox</param> /// <param name="wayInXml">A XPath path to the element, whose combobox is created</param> protected void AddComboItem(Gtk.Box page, string propertyLabel, string propertySelected, string propertyHint, ArrayList options, string wayInXml) { int selected = Convert.ToInt32(propertySelected); HBox hbox = new HBox(false, 3); Label vypln = new Label(); vypln.WidthRequest = 18; hbox.PackStart(vypln, false, false, 1); Gtk.Label labelSelect = new Label(propertyLabel); Gtk.ComboBox combo = ComboBox.NewText(); foreach (String option in options) { combo.AppendText(option); } // preselect proper item if (selected < options.Count && selected >= 0) combo.Active = selected; hbox.PackStart(labelSelect, false, false, 1); hbox.PackStart(combo, false, false, 1); page.PackStart(hbox, false, false, 1); // store the way in Xml to this element combo.Name = "item" + (lastItemNumber++).ToString(); StoreToProperties(combo.Name, wayInXml); }
internal override void AttachMainToolbar (Gtk.VBox parent, Components.MainToolbar.IMainToolbarView toolbar) { titleBar = new TitleBar (); var topMenu = new GtkWPFWidget (titleBar) { HeightRequest = System.Windows.Forms.SystemInformation.CaptionHeight, }; //commandManager.IncompleteKeyPressed += (sender, e) => { // if (e.Key == Gdk.Key.Alt_L) { // Keyboard.Focus(titleBar.DockTitle.Children[0]); // } //}; parent.PackStart (topMenu, false, true, 0); SetupMenu (); parent.PackStart ((WPFToolbar)toolbar, false, true, 0); }
/// <summary> /// server gui stuff: /// server path /// server username + password /// check server ssl certificate yes/no /// </summary> /// <param name="insertTo"></param> /// <param name="defaultSpacing"></param> void SetupGuiServerRelated(Gtk.Box insertTo, int defaultSpacing) { Gtk.Table customBox = new Gtk.Table(3, 2, false); // somehow you can't change the default spacing or set it for all rows for (int i = 0; i < 3; i++) customBox.SetRowSpacing((uint)i, (uint)defaultSpacing); // insert the labels customBox.Attach(new Gtk.Label(Catalog.GetString("Server path:")), 0, 1, 0, 1); customBox.Attach(new Gtk.Label(Catalog.GetString("Username:"******"Password:"******"SaveConfiguration" is called //IPropertyEditor serverEditor = Services.Factory.CreatePropertyEditorEntry( // AddinPreferences.SYNC_PRIVATENOTES_SERVERPATH, server_path); //serverEditor.Setup(); server_user = new Gtk.Entry(); customBox.Attach(server_user, 1, 2, 1, 2); string serverUser = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER) as String; server_user.Text = serverUser; // NO EDITOR! because we only save when "SaveConfiguration" is called //IPropertyEditor userEditor = Services.Factory.CreatePropertyEditorEntry( // AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER, server_user); //userEditor.Setup(); server_pass = new Gtk.Entry(); server_pass.InvisibleChar = '*'; server_pass.Visibility = false; customBox.Attach(server_pass, 1, 2, 2, 3); string serverpass = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS) as String; server_pass.Text = serverpass; // NO EDITOR! because we only save when "SaveConfiguration" is called //IPropertyEditor passEditor = Services.Factory.CreatePropertyEditorEntry( // AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS, server_pass); //passEditor.Setup(); check_ssl = new Gtk.CheckButton(Catalog.GetString("Check servers SSL certificate")); insertTo.PackStart(check_ssl); // set up check-ssl certificate stuff object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERCHECKSSLCERT); if (value == null || value.Equals(true)) check_ssl.Active = true; }
private void add_page_link(string text, Gtk.HBox page_navigation, int offset, int current_page) { Gtk.EventBox link_wrapper = new Gtk.EventBox(); Gtk.Label link = new Gtk.Label(); link.Markup = "<u><small>" + text + "</small></u>"; GtkCommon.show_hand_and_tooltip(link_wrapper, text); System.Console.WriteLine("adding a page link: {0} with offset on click {1}", text, offset); link_wrapper.Add(link); link_wrapper.ButtonPressEvent += delegate { if (current_page != -1) { // next sizes_of_last_pages.Push(current_page); this.offset = offset + current_page; } else { int last_page = sizes_of_last_pages.Pop(); this.offset = offset - last_page; } add_elements(); }; GtkCommon.set_background_color(link_wrapper, "white"); page_navigation.PackStart(link_wrapper, false, false, 5); }
public void InitWebKit(Gtk.Box w) { if (!appInited) { MonoMac.AppKit.NSApplication.Init(); appInited = true; } wb = new MonoMac.WebKit.WebView(new System.Drawing.RectangleF(10, 10, 200, 200), "foo", "bar"); scrollWindow.AddWithViewport(NSViewToGtkWidget(wb)); w.PackStart(scrollWindow, true, true, 0); w.ShowAll(); wb.ShouldCloseWithWindow = true; }
private void add_link(string text, CalendarDriver.View view, System.DateTime item_modified_date, Gtk.HBox links) { Gtk.EventBox link_wrapper = new Gtk.EventBox(); Gtk.Label link = new Gtk.Label(); link.Markup = "<u><small>" + text + "</small></u>"; GtkCommon.show_hand_and_tooltip(link_wrapper, text); link_wrapper.Add(link); link_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) { set_view_callback(view, item_modified_date); }; GtkCommon.set_background_color(link_wrapper, "white"); links.PackStart(link_wrapper, false, false, 5); }
// FIXME clicking the spinbutton too fast seems to switch the view to browse public FaceBox (Gtk.Box tb, PhotoImageView vw) : base() { m_list = new ArrayList(); face_store = Core.Database.Faces; View = vw; tag_store = FSpot.Core.Database.Tags; Gtk.Label lab = new Gtk.Label("Face det:"); lab.Show(); tb.PackStart(lab, false, true, 0); face_button = new ToolbarButton (); face_button.Add (new Gtk.Image ("f-spot-sepia", IconSize.Button)); tb.PackStart (face_button, false, true, 0); face_button.Clicked += HandleFaceButtonClicked; tag_entry = new Gtk.Entry ("test"); tag_entry.Show(); tag_entry.Sensitive = false; tb.PackStart(tag_entry, false, true, 0); m_newtag_button = new ToolbarButton (); m_newtag_button.Add (new Gtk.Image ("f-spot-new-tag", IconSize.Button)); m_newtag_button.Show(); m_newtag_button.Sensitive = false; tb.PackStart(m_newtag_button,false,true,0); m_newtag_button.Clicked += HandleNewTagButtonClicked; m_spin = new SpinButton(1,1,1); m_spin.Show(); m_spin.Sensitive = false; tb.PackStart(m_spin, false, true, 0); m_spin.Changed += HandleSpinChanged; //m.spin.ValueChanged += jesli w bazie, to pokaz jego tag //this.Add(tag_widget); }
void AddBox (Gtk.VBox parent, out Gtk.Widget box, out Gtk.VBox vbox) { Gtk.HBox hbox = new Gtk.HBox (); Gtk.Label sep = new Gtk.Label (""); sep.WidthRequest = 24; sep.Show (); hbox.PackStart (sep, false, false, 0); vbox = new Gtk.VBox (); vbox.Spacing = 6; vbox.Show (); hbox.PackStart (vbox, true, true, 0); parent.PackStart (hbox, false, false, 0); box = hbox; }
void AddPackageBuilder (Gtk.VBox parent, PackagingProject project, PackageBuilder pb) { Gtk.CheckButton check = new Gtk.CheckButton (pb.DefaultName); check.Show (); parent.PackStart (check, false, false, 0); Package pkg = new Package (pb); pkg.Name = pb.DefaultName; RegisterCheck (check, project, pkg); }
void AddCreatePackageSection (Gtk.VBox vbox, string label, PackagingProject parentProject, bool showCheck) { Gtk.VBox vboxNewPacks; Gtk.Widget hbox; if (showCheck) { Gtk.CheckButton check = new Gtk.CheckButton (label); check.Show (); vbox.PackStart (check, false, false, 0); AddBox (vbox, out hbox, out vboxNewPacks); check.Toggled += delegate { hbox.Visible = check.Active; if (!check.Active) DisableChecks (hbox); }; } else { Gtk.Label lab = new Gtk.Label (label); lab.Show (); vbox.PackStart (lab, false, false, 0); AddBox (vbox, out hbox, out vboxNewPacks); hbox.Show (); } ICollection builders; if (creatingPackProject) builders = DeployService.GetPackageBuilders (); else builders = DeployService.GetSupportedPackageBuilders (entry); foreach (PackageBuilder pb in builders) { if (creatingPackProject) { pb.SetSolutionItem (parentFolder.ParentSolution.RootFolder); // Add all compatible projects foreach (SolutionItem e in parentFolder.ParentSolution.GetAllSolutionItems ()) { if (pb.CanBuild (e)) pb.AddEntry (e); } } else { pb.SetSolutionItem (parentFolder, new SolutionItem [] { entry }); } PackageBuilder[] defp = pb.CreateDefaultBuilders (); if (defp.Length == 0) continue; if (defp.Length == 1) AddPackageBuilder (vboxNewPacks, parentProject, defp[0]); else { Gtk.CheckButton checkBuilder = new Gtk.CheckButton (pb.Description); checkBuilder.Show (); vboxNewPacks.PackStart (checkBuilder, false, false, 0); Gtk.VBox vboxDefPacks; Gtk.Widget thbox; AddBox (vboxNewPacks, out thbox, out vboxDefPacks); checkBuilder.Toggled += delegate { thbox.Visible = checkBuilder.Active; if (!checkBuilder.Active) DisableChecks (thbox); }; foreach (PackageBuilder dp in defp) AddPackageBuilder (vboxDefPacks, parentProject, dp); } } }
public void InitWebKit(Gtk.Box w) { wb = new WebKit.WebView(); scrollWindow.Add(wb); // Hack to work around webkit bug; webkit will crash the app if a size is not provided // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=466360 for a related bug report wb.SetSizeRequest(2, 2); w.PackStart(scrollWindow, true, true, 0); w.ShowAll(); }
internal override void AttachMainToolbar (Gtk.VBox parent, Components.MainToolbar.IMainToolbarView toolbar) { titleBar = new TitleBar (); var topMenu = new WPFTitlebar (titleBar); //commandManager.IncompleteKeyPressed += (sender, e) => { // if (e.Key == Gdk.Key.Alt_L) { // Keyboard.Focus(titleBar.DockTitle.Children[0]); // } //}; parent.PackStart (topMenu, false, true, 0); SetupMenu (); parent.PackStart ((WPFToolbar)toolbar, false, true, 0); }
public static void ComboPackShowAndSensitive(Gtk.Box box, Gtk.ComboBox combo) { box.PackStart(combo, true, true, 0); box.ShowAll(); combo.Sensitive = true; }
/// <summary> /// setup fields like: store password:yes/no and the actual password entry, /// if it should be stored /// </summary> /// <param name="insertTo"></param> /// <param name="defaultSpacing"></param> void SetupGuiEncryptionRelated(Gtk.Box insertTo, int defaultSpacing) { Gtk.HBox customBox = new Gtk.HBox(false, defaultSpacing); insertTo.PackStart(customBox); rbt_storePw = new Gtk.RadioButton(Catalog.GetString("_Store password")); customBox.PackStart(rbt_storePw); customBox = new Gtk.HBox(false, defaultSpacing); insertTo.PackStart(customBox); // --- Password Boxes --- #if WIN32 && DPAPI String pw = DPAPIUtil.getPassword(); #else String pw = Convert.ToString(Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_PASSWORD)); #endif pw = (pw == null) ? "" : pw; Gtk.VBox pwbox = new Gtk.VBox(false, defaultSpacing); Gtk.HBox superbox = new Gtk.HBox(false, defaultSpacing); superbox.PackStart(new Gtk.Alignment(0, 0, 200, 0)); // spacer superbox.PackStart(pwbox); customBox.PackStart(superbox); stored_pw = new Gtk.Entry(); // set password style: stored_pw.InvisibleChar = '*'; stored_pw.Visibility = false; stored_pw.Text = pw; pwbox.PackStart(stored_pw); stored_pw2 = new Gtk.Entry(); // set password style: stored_pw2.InvisibleChar = '*'; stored_pw2.Visibility = false; stored_pw2.Text = pw; pwbox.PackStart(stored_pw2); match_label = new Gtk.Label(); match_label.Markup = Catalog.GetString(AddinPreferences.MATCH_TEXT); pwbox.PackStart(match_label); customBox = new Gtk.HBox(false, defaultSpacing); insertTo.PackStart(customBox); // give the first rbt here to link the 2 rbt_alwaysAsk = new Gtk.RadioButton(rbt_storePw, Catalog.GetString("_Always ask for password")); customBox.PackStart(rbt_alwaysAsk); // assign event-listener rbt_storePw.Toggled += PasswordMethodChanged; // init with values from preferences object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_ASKEVERYTIME); if (value == null || value.Equals(false)) { rbt_storePw.Active = true; } else { rbt_alwaysAsk.Active = true; } // assign event-listeners stored_pw.Changed += PasswordChanged; stored_pw2.Changed += PasswordChanged; }