public void ShowTools()
        {
            // Remove any open editor, if present.
            if (current_editor != null) {
                active_editor.Hide ();
                widgets.Remove (active_editor);
                active_editor = null;
                current_editor.Restore ();
                current_editor = null;
            }

            // No need to build the widget twice.
            if (buttons != null) {
                buttons.Show ();
                return;
            }

            if (widgets == null) {
                widgets = new VBox (false, 0);
                widgets.NoShowAll = true;
                widgets.Show ();
                Viewport widgets_port = new Viewport ();
                widgets_port.Add (widgets);
                Add (widgets_port);
                widgets_port.ShowAll ();
            }

            // Build the widget (first time we call this method).
            buttons = new VButtonBox ();
            buttons.BorderWidth = 5;
            buttons.Spacing = 5;
            buttons.LayoutStyle = ButtonBoxStyle.Start;

            foreach (Editor editor in editors)
                PackButton (editor);

            buttons.Show ();
            widgets.Add (buttons);
        }
Example #2
0
		// Page 3
		// Extension Preferences
		public Gtk.Widget MakeAddinsPane ()
		{
			Gtk.VBox vbox = new Gtk.VBox (false, 6);
			vbox.BorderWidth = 6;
			Gtk.Label l = new Gtk.Label (Catalog.GetString (
			                                     "The following add-ins are installed"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

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

			// TreeView of Add-ins
			Gtk.TreeView tree = new Gtk.TreeView ();
			addin_tree = new Mono.Addins.Gui.AddinTreeWidget (tree);

			tree.Show ();

			Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
			sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.ShadowType = Gtk.ShadowType.In;
			sw.Add (tree);
			sw.Show ();
			Gtk.LinkButton get_more_link =
				new Gtk.LinkButton ("http://live.gnome.org/Tomboy/PluginList",
				                    Catalog.GetString ("Get More Add-Ins..."));
			get_more_link.Show ();
			Gtk.VBox tree_box = new Gtk.VBox (false, 0);
			tree_box.Add (sw);
			tree_box.PackEnd (get_more_link, false, false, 5);
			tree_box.Show ();
			hbox.PackStart (tree_box, true, true, 0);

			// Action Buttons (right of TreeView)
			Gtk.VButtonBox button_box = new Gtk.VButtonBox ();
			button_box.Spacing = 4;
			button_box.Layout = Gtk.ButtonBoxStyle.Start;

			// TODO: In a future version, add in an "Install Add-ins..." button

			// TODO: In a future version, add in a "Repositories..." button

			enable_addin_button =
			        new Gtk.Button (Catalog.GetString ("_Enable"));
			enable_addin_button.Sensitive = false;
			enable_addin_button.Clicked += OnEnableAddinButton;
			enable_addin_button.Show ();

			disable_addin_button =
			        new Gtk.Button (Catalog.GetString ("_Disable"));
			disable_addin_button.Sensitive = false;
			disable_addin_button.Clicked += OnDisableAddinButton;
			disable_addin_button.Show ();

			addin_prefs_button =
			        new Gtk.Button (Gtk.Stock.Preferences);
			addin_prefs_button.Sensitive = false;
			addin_prefs_button.Clicked += OnAddinPrefsButton;
			addin_prefs_button.Show ();

			addin_info_button =
			        new Gtk.Button (Gtk.Stock.Info);
			addin_info_button.Sensitive = false;
			addin_info_button.Clicked += OnAddinInfoButton;
			addin_info_button.Show ();

			button_box.PackStart (enable_addin_button);
			button_box.PackStart (disable_addin_button);
			button_box.PackStart (addin_prefs_button);
			button_box.PackStart (addin_info_button);

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

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

			tree.Selection.Changed += OnAddinTreeSelectionChanged;
			LoadAddins ();

			return vbox;
		}