Exemple #1
0
        private Gtk.Widget MakeViewPage()
        {
            Gtk.VBox vbox = new Gtk.VBox(false, 0);
            vbox.BorderWidth = 6;

            textLabel              = new Gtk.Label();
            textLabel.Xalign       = 0;
            textLabel.UseUnderline = false;
            textLabel.Justify      = Gtk.Justification.Left;
            textLabel.Wrap         = true;
            textLabel.Text         = text;
            textLabel.Show();
            vbox.PackStart(textLabel, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            deleteButton          = new Gtk.Button(Gtk.Stock.Delete);
            deleteButton.Clicked += OnDeleteButtonClicked;
            deleteButton.Show();
            hButtonBox.PackStart(deleteButton, false, false, 0);

            editButton          = new Gtk.Button(Gtk.Stock.Edit);
            editButton.Clicked += OnEditButtonClicked;
            editButton.Show();
            hButtonBox.PackStart(editButton, false, false, 0);

            hButtonBox.Show();
            vbox.PackStart(hButtonBox, false, false, 0);

            vbox.Show();
            return(vbox);
        }
Exemple #2
0
        void BuildLayout ()
        {
            primary_vbox = new VBox ();
            
            var label = new Label ("Super duper test UI!");
            label.Show ();
            primary_vbox.Add (label);
            
            var button_box = new HButtonBox ();
            button_box.Show ();
            primary_vbox.Add (button_box);
            
            var folder_button = new FileChooserButton ("Select import folder", FileChooserAction.SelectFolder);
            folder_button.FileSet += delegate {
                folder = folder_button.Uri;
                Log.Information ("Selected " + folder);
            };
            folder_button.Show ();
            button_box.Add (folder_button);
            
            var import_button = new Button { Label = "Start Import" };
            import_button.Activated += StartImport;
            import_button.Clicked += StartImport;
            import_button.Show ();
            button_box.Add (import_button);

            primary_vbox.Show ();
            Add (primary_vbox);
        }
Exemple #3
0
        public NewSearchPage()
            : base(0.5f, 0.5f, 0f, 0f)
        {
            base.SetPadding(36, 36, 36, 36);
            base.FocusGrabbed += base_FocusGrabbed;

            mainVBox = new VBox();

            Label label = new Label();
            label.Xalign = 0;
            label.Markup = "<span size=\"x-large\" weight=\"bold\">Search for files...</span>";
            mainVBox.PackStart(label, false, false, 0);
            label.Show();

            searchEntry = new FileSearchEntry();
            searchEntry.WidthRequest = 400;
            mainVBox.PackStart(searchEntry, false, false, 6);
            searchEntry.Show();

            searchButton = new Button("_Search");
            searchButton.Image = new Image(Stock.Find, IconSize.Button);
            searchButton.Clicked += searchButton_Clicked;
            searchButton.Show();

            HButtonBox buttonBox = new HButtonBox();
            buttonBox.Layout = ButtonBoxStyle.End;
            buttonBox.PackStart(searchButton, false, false, 0);
            mainVBox.PackStart(buttonBox, false, false, 0);
            buttonBox.Show();

            base.Add(mainVBox);
            mainVBox.Show();
        }
Exemple #4
0
        public static void Main(string[] args)
        {
            Application.Init();

            var window = new Gtk.Window(Gtk.WindowType.Toplevel)
            {
                Title       = "Treemap Example",
                BorderWidth = 0,                //12,
            };

            window.SetDefaultSize(640, 480);
            window.DeleteEvent += delegate {
                Gtk.Application.Quit();
            };
            window.Show();

            var vbox = new Gtk.VBox(false, 6);

            window.Add(vbox);
            vbox.Show();

            var treemap = new TreeMap.TreeMap()
            {
                Model        = BuildModel(),
                TextColumn   = 0,
                WeightColumn = 1,
                Title        = "Treemap Example",
            };

            vbox.PackStart(treemap, true, true, 0);
            treemap.Show();

            var buttonbox = new Gtk.HButtonBox();

            buttonbox.BorderWidth = 12;
            buttonbox.Layout      = Gtk.ButtonBoxStyle.End;
            vbox.PackStart(buttonbox, false, true, 0);
            buttonbox.Show();

            var close = new Gtk.Button(Gtk.Stock.Close);

            close.CanDefault = true;
            close.Clicked   += delegate { Gtk.Application.Quit(); };
            buttonbox.PackStart(close, false, true, 0);
            window.Default = close;
            close.Show();

            Application.Run();
        }
Exemple #5
0
        public static void Main(string[] args)
        {
            Application.Init ();

            var window = new Gtk.Window (Gtk.WindowType.Toplevel) {
                Title       = "Treemap Example",
                BorderWidth = 0,//12,
            };
            window.SetDefaultSize (640, 480);
            window.DeleteEvent += delegate {
                Gtk.Application.Quit ();
            };
            window.Show ();

            var vbox = new Gtk.VBox (false, 6);
            window.Add (vbox);
            vbox.Show ();

            var treemap = new TreeMap.TreeMap () {
                Model        = BuildModel (),
                TextColumn   = 0,
                WeightColumn = 1,
                Title        = "Treemap Example",
            };
            vbox.PackStart (treemap, true, true, 0);
            treemap.Show ();

            var buttonbox = new Gtk.HButtonBox ();
            buttonbox.BorderWidth = 12;
            buttonbox.Layout = Gtk.ButtonBoxStyle.End;
            vbox.PackStart (buttonbox, false, true, 0);
            buttonbox.Show ();

            var close = new Gtk.Button (Gtk.Stock.Close);
            close.CanDefault = true;
            close.Clicked += delegate { Gtk.Application.Quit (); };
            buttonbox.PackStart (close, false, true, 0);
            window.Default = close;
            close.Show ();

            Application.Run ();
        }
Exemple #6
0
        private Gtk.Widget MakeEditPage()
        {
            Gtk.VBox vbox = new Gtk.VBox(false, 0);
            vbox.BorderWidth = 6;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType       = Gtk.ShadowType.EtchedIn;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;

            textView             = new Gtk.TextView();
            textView.WrapMode    = Gtk.WrapMode.Word;
            textView.Editable    = true;
            textView.Buffer.Text = text;
            textView.CanFocus    = true;
            textView.NoShowAll   = true;
            textView.SetSizeRequest(-1, 60);
            sw.Add(textView);
            sw.Show();
            vbox.PackStart(sw, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            cancelButton           = new Gtk.Button(Gtk.Stock.Cancel);
            cancelButton.Clicked  += OnEditCanceled;
            cancelButton.NoShowAll = true;
            hButtonBox.PackStart(cancelButton, false, false, 0);

            saveButton           = new Gtk.Button(Gtk.Stock.Save);
            saveButton.Clicked  += OnSaveButtonClicked;
            saveButton.NoShowAll = true;
            hButtonBox.PackStart(saveButton, false, false, 0);

            hButtonBox.Show();
            vbox.PackStart(hButtonBox, false, false, 6);

            vbox.Show();
            return(vbox);
        }
		Widget CreateButtonBox ()
		{
			var buttons = new HButtonBox () { Layout = ButtonBoxStyle.End, Spacing = 12 };

			var copy = new Button (Stock.Copy);
			copy.Clicked += CopyClicked;
			copy.Show ();

			buttons.PackStart (copy, false, true, 0);

			var close = new Button (Stock.Close);
			close.Activated += CloseClicked;
			close.Clicked += CloseClicked;
			close.Show ();

			buttons.PackStart (close, false, true, 0);

			buttons.Show ();

			return buttons;
		}
    void showWidgetsPowerful(ArrayList widgetArray)
    {
        Constants.GenericWindowShow stuff = (Constants.GenericWindowShow)widgetArray[0];
        bool   editable = (bool)widgetArray[1];
        string text     = (string)widgetArray[2];

        if (stuff == Constants.GenericWindowShow.ENTRY)
        {
            entry.Show();
            entry.IsEditable = editable;
            entry.Sensitive  = editable;
            entry.Text       = text;
        }
        else if (stuff == Constants.GenericWindowShow.ENTRY2)
        {
            hbox_entry2.Show();
            entry2.IsEditable = editable;
            entry2.Sensitive  = editable;
            entry2.Text       = text;
        }
        else if (stuff == Constants.GenericWindowShow.ENTRY3)
        {
            hbox_entry3.Show();
            entry3.IsEditable = editable;
            entry3.Sensitive  = editable;
            entry3.Text       = text;
        }
        else if (stuff == Constants.GenericWindowShow.SPININT)
        {
            hbox_spin_int.Show();
            spin_int.IsEditable = editable;
            spin_int.Sensitive  = editable;
        }
        else if (stuff == Constants.GenericWindowShow.SPINDOUBLE)
        {
            spin_double.Show();
            spin_double.IsEditable = editable;
        }
        else if (stuff == Constants.GenericWindowShow.HBOXSPINDOUBLE2)
        {
            hbox_spin_double2.Show();
            spin_double2.IsEditable = editable;
            spin_double2.Sensitive  = editable;
        }
        else if (stuff == Constants.GenericWindowShow.SPININT2)
        {
            hbox_spin_int2.Show();
            spin_int2.IsEditable = editable;
        }
        else if (stuff == Constants.GenericWindowShow.SPININT3)
        {
            hbox_spin_int3.Show();
            spin_int3.IsEditable = editable;
        }
        else if (stuff == Constants.GenericWindowShow.HEIGHTMETRIC)
        {
            hbox_height_metric.Show();
        }
        else if (stuff == Constants.GenericWindowShow.COMBO)
        {
            /*
             * hbox_combo.Show();
             * combo.Show();
             */
        }
        else if (stuff == Constants.GenericWindowShow.COMBOALLNONESELECTED)
        {
            //createComboCheckBoxes();
            //combo_all_none_selected.Active =
            //	UtilGtk.ComboMakeActive(comboCheckBoxesOptions, Catalog.GetString("Selected"));
            hbox_combo_all_none_selected.Show();
            hbox_all_none_selected.Show();
        }
        else if (stuff == Constants.GenericWindowShow.BUTTONMIDDLE)
        {
            hbuttonbox_middle.Show();
        }
        else if (stuff == Constants.GenericWindowShow.TEXTVIEW)
        {
            scrolled_window_textview.Show();
        }
        else           //if(stuff == Constants.GenericWindowShow.TREEVIEW)
        {
            scrolled_window_treeview.Show();
        }
    }
Exemple #9
0
        private Gtk.Widget MakeViewPage()
        {
            Gtk.VBox vbox = new Gtk.VBox (false, 0);
            vbox.BorderWidth = 6;

            textLabel = new Gtk.Label ();
            textLabel.Xalign = 0;
            textLabel.UseUnderline = false;
            textLabel.Justify = Gtk.Justification.Left;
            textLabel.Wrap = true;
            textLabel.Text = text;
            textLabel.Show ();
            vbox.PackStart (textLabel, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox ();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            deleteButton = new Gtk.Button (Gtk.Stock.Delete);
            deleteButton.Clicked += OnDeleteButtonClicked;
            deleteButton.Show ();
            hButtonBox.PackStart (deleteButton, false, false, 0);

            editButton = new Gtk.Button (Gtk.Stock.Edit);
            editButton.Clicked += OnEditButtonClicked;
            editButton.Show ();
            hButtonBox.PackStart (editButton, false, false, 0);

            hButtonBox.Show ();
            vbox.PackStart (hButtonBox, false, false, 0);

            vbox.Show ();
            return vbox;
        }
Exemple #10
0
        private Gtk.Widget MakeEditPage()
        {
            Gtk.VBox vbox = new Gtk.VBox (false, 0);
            vbox.BorderWidth = 6;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
            sw.ShadowType = Gtk.ShadowType.EtchedIn;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;

            textView = new Gtk.TextView ();
            textView.WrapMode = Gtk.WrapMode.Word;
            textView.Editable = true;
            textView.Buffer.Text = text;
            textView.CanFocus = true;
            textView.NoShowAll = true;
            textView.SetSizeRequest (-1, 60);
            sw.Add (textView);
            sw.Show ();
            vbox.PackStart (sw, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox ();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            cancelButton = new Gtk.Button (Gtk.Stock.Cancel);
            cancelButton.Clicked += OnEditCanceled;
            cancelButton.NoShowAll = true;
            hButtonBox.PackStart (cancelButton, false, false, 0);

            saveButton = new Gtk.Button (Gtk.Stock.Save);
            saveButton.Clicked += OnSaveButtonClicked;
            saveButton.NoShowAll = true;
            hButtonBox.PackStart (saveButton, false, false, 0);

            hButtonBox.Show ();
            vbox.PackStart (hButtonBox, false, false, 6);

            vbox.Show ();
            return vbox;
        }
		public Gtk.Widget MakeSyncPane ()
		{
			Gtk.VBox vbox = new Gtk.VBox (false, 0);
			vbox.Spacing = 4;
			vbox.BorderWidth = 8;

			Gtk.HBox hbox = new Gtk.HBox (false, 4);

			Gtk.Label label = new Gtk.Label (Catalog.GetString ("Ser_vice:"));
			label.Xalign = 0;
			label.Show ();
			hbox.PackStart (label, false, false, 0);

			// Populate the store with all the available SyncServiceAddins
			syncAddinStore = new Gtk.ListStore (typeof (SyncServiceAddin));
			syncAddinIters = new Dictionary<string,Gtk.TreeIter> ();
			SyncServiceAddin [] addins = Tomboy.DefaultNoteManager.AddinManager.GetSyncServiceAddins ();
			Array.Sort (addins, CompareSyncAddinsByName);
			foreach (SyncServiceAddin addin in addins) {
				Gtk.TreeIter iter = syncAddinStore.Append ();
				syncAddinStore.SetValue (iter, 0, addin);
				syncAddinIters [addin.Id] = iter;
			}

			syncAddinCombo = new Gtk.ComboBox (syncAddinStore);
			label.MnemonicWidget = syncAddinCombo;
			Gtk.CellRendererText crt = new Gtk.CellRendererText ();
			syncAddinCombo.PackStart (crt, true);
			syncAddinCombo.SetCellDataFunc (crt,
			                                new Gtk.CellLayoutDataFunc (ComboBoxTextDataFunc));

			// Read from Preferences which service is configured and select it
			// by default.  Otherwise, just select the first one in the list.
			string addin_id = Preferences.Get (
			                          Preferences.SYNC_SELECTED_SERVICE_ADDIN) as String;

			Gtk.TreeIter active_iter;
			if (addin_id != null && syncAddinIters.ContainsKey (addin_id)) {
				active_iter = syncAddinIters [addin_id];
				syncAddinCombo.SetActiveIter (active_iter);
			} else {
				if (syncAddinStore.GetIterFirst (out active_iter) == true) {
					syncAddinCombo.SetActiveIter (active_iter);
				}
			}

			syncAddinCombo.Changed += OnSyncAddinComboChanged;

			syncAddinCombo.Show ();
			hbox.PackStart (syncAddinCombo, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			// Get the preferences GUI for the Sync Addin
			if (active_iter.Stamp != Gtk.TreeIter.Zero.Stamp)
				selectedSyncAddin = syncAddinStore.GetValue (active_iter, 0) as SyncServiceAddin;

			if (selectedSyncAddin != null)
				syncAddinPrefsWidget = selectedSyncAddin.CreatePreferencesControl (OnSyncAddinPrefsChanged);
			if (syncAddinPrefsWidget == null) {
				Gtk.Label l = new Gtk.Label (Catalog.GetString ("Not configurable"));
				l.Yalign = 0.5f;
				l.Yalign = 0.5f;
				syncAddinPrefsWidget = l;
			}
			if (syncAddinPrefsWidget != null && addin_id != null &&
			                syncAddinIters.ContainsKey (addin_id) && selectedSyncAddin.IsConfigured)
				syncAddinPrefsWidget.Sensitive = false;

			syncAddinPrefsWidget.Show ();
			syncAddinPrefsContainer = new Gtk.VBox (false, 0);
			syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
			syncAddinPrefsContainer.Show ();
			vbox.PackStart (syncAddinPrefsContainer, true, true, 10);

			// Autosync preference
			int timeout = (int) Preferences.Get (Preferences.SYNC_AUTOSYNC_TIMEOUT);
			if (timeout > 0 && timeout < 5) {
				timeout = 5;
				Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT, 5);
			}
			Gtk.HBox autosyncBox = new Gtk.HBox (false, 5);
			// Translators: This is and the next string go together.
			// Together they look like "Automatically Sync in Background Every [_] Minutes",
			// where "[_]" is a GtkSpinButton.
			autosyncCheck =
				new Gtk.CheckButton (Catalog.GetString ("Automaticall_y Sync in Background Every"));
			autosyncSpinner = new Gtk.SpinButton (5, 1000, 1);
			autosyncSpinner.Value = timeout >= 5 ? timeout : 10;
			Gtk.Label autosyncExtraText =
				// Translators: See above comment for details on
				// this string.
				new Gtk.Label (Catalog.GetString ("Minutes"));
			autosyncCheck.Active = autosyncSpinner.Sensitive = timeout >= 5;
			EventHandler updateTimeoutPref = (o, e) => {
				Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT,
				                 autosyncCheck.Active ? (int) autosyncSpinner.Value : -1);
			};
			autosyncCheck.Toggled += (o, e) => {
				autosyncSpinner.Sensitive = autosyncCheck.Active;
				updateTimeoutPref (o, e);
			};
			autosyncSpinner.ValueChanged += updateTimeoutPref;

			autosyncBox.PackStart (autosyncCheck);
			autosyncBox.PackStart (autosyncSpinner);
			autosyncBox.PackStart (autosyncExtraText);
			vbox.PackStart (autosyncBox, false, true, 0);

			Gtk.HButtonBox bbox = new Gtk.HButtonBox ();
			bbox.Spacing = 4;
			bbox.LayoutStyle = Gtk.ButtonBoxStyle.End;

			// "Advanced..." button to bring up extra sync config dialog
			Gtk.Button advancedConfigButton = new Gtk.Button (Catalog.GetString ("_Advanced..."));
			advancedConfigButton.Clicked += OnAdvancedSyncConfigButton;
			advancedConfigButton.Show ();
			bbox.PackStart (advancedConfigButton, false, false, 0);
			bbox.SetChildSecondary (advancedConfigButton, true);

			resetSyncAddinButton = new Gtk.Button (Gtk.Stock.Clear);
			resetSyncAddinButton.Clicked += OnResetSyncAddinButton;
			resetSyncAddinButton.Sensitive =
			        (selectedSyncAddin != null &&
			         addin_id == selectedSyncAddin.Id &&
			         selectedSyncAddin.IsConfigured);
			resetSyncAddinButton.Show ();
			bbox.PackStart (resetSyncAddinButton, false, false, 0);

			// TODO: Tabbing should go directly from sync prefs widget to here
			// TODO: Consider connecting to "Enter" pressed in sync prefs widget
			saveSyncAddinButton = new Gtk.Button (Gtk.Stock.Save);
			saveSyncAddinButton.Clicked += OnSaveSyncAddinButton;
			saveSyncAddinButton.Sensitive =
			        (selectedSyncAddin != null &&
			         (addin_id != selectedSyncAddin.Id || !selectedSyncAddin.IsConfigured));
			saveSyncAddinButton.Show ();
			bbox.PackStart (saveSyncAddinButton, false, false, 0);

			syncAddinCombo.Sensitive =
			        (selectedSyncAddin == null ||
			         addin_id != selectedSyncAddin.Id ||
			         !selectedSyncAddin.IsConfigured);

			bbox.Show ();
			vbox.PackStart (bbox, false, false, 0);

			vbox.ShowAll ();
			return vbox;
		}
Exemple #12
0
        private Widget CreateBottomBar()
        {
            HButtonBox buttonBox = new HButtonBox ();
            buttonBox.Layout = ButtonBoxStyle.Edge;

            toggleSidebarButton = new Button ();
            toggleSidebarButton.Label = Catalog.GetString ("Close Sidebar");
            toggleSidebarButton.Relief = ReliefStyle.None;
            toggleSidebarButton.Clicked += OnToggleSidebarButtonClicked;
            toggleSidebarButton.Show ();
            buttonBox.PackStart (toggleSidebarButton, false, false, 0);

            personHScale = new HScale (1, 3, 1);
            personHScale.DrawValue = false;
            personHScale.ValueChanged += OnPersonHScaledValueChanged;
            personHScale.Show ();
            buttonBox.PackEnd (personHScale, false, false, 0);

            buttonBox.Show ();
            return buttonBox;
        }