Exemplo n.º 1
0
        protected virtual void AddActionCommands(Wrapper.Action action)
        {
            if (allowBinding)
            {
                Gtk.ToolButton bindButton = new Gtk.ToolButton(null, Catalog.GetString("Bind to Field"));
                bindButton.IsImportant = true;
                bindButton.Show();
                Insert(bindButton, -1);
                if (action == null)
                {
                    bindButton.Sensitive = false;
                }

                bindButton.Clicked += delegate { frontend.NotifyBindField(); };
            }
        }
        Gtk.Widget CreateLabel(NotebookTab tab)
        {
            var vbox = new Gtk.HBox();

            Gtk.Label label = new Gtk.Label();

            /* INTRODUCED BY houen */

            if (tab.Label.Contains("\\_"))
            {
                label.Text = tab.Label.Replace("\\_", "_");
            }
            else
            {
                label.TextWithMnemonic = tab.Label.Replace("\\_", "_");
            }

            /* INTRODUCED BY houen */

            label.Show();
            vbox.PackStart(label);

            if (!label.Text.StartsWith(char.ConvertFromUtf32(0x200B)))
            {
                var closeImage = new Gtk.Image(Assembly.GetExecutingAssembly(), "Xwt.GtkBackend.delete.png");
                var button     = new Gtk.ToolButton(closeImage, "");
                vbox.PackEnd(button, false, false, 0);
                button.Show();
                closeImage.Show();
                var nativeWidget = GetWidget((IWidgetBackend)Toolkit.GetBackend(tab.Child));
                button.Clicked += (object sender, EventArgs e) =>
                {
                    tab.OnClosing();
                    Widget.Remove(nativeWidget);
                };
            }

            return(vbox);
        }
Exemplo n.º 3
0
        Gtk.Widget CreateLabel(NotebookTab tab)
        {
            var vbox = new Gtk.HBox();
            Gtk.Label label = new Gtk.Label ();

            /* INTRODUCED BY houen */

            if (tab.Label.Contains("\\_"))
            {
                label.Text = tab.Label.Replace("\\_", "_");
            }
            else
            {
                label.TextWithMnemonic = tab.Label.Replace("\\_", "_");
            }

            /* INTRODUCED BY houen */

            label.Show ();
            vbox.PackStart(label);

            if(!label.Text.StartsWith(char.ConvertFromUtf32(0x200B)))
            {
                var closeImage = new Gtk.Image(Assembly.GetExecutingAssembly(), "Xwt.GtkBackend.delete.png");
                var button = new Gtk.ToolButton(closeImage, "");
                vbox.PackEnd(button, false, false, 0);
                button.Show();
                closeImage.Show();
                var nativeWidget = GetWidget((IWidgetBackend)Toolkit.GetBackend(tab.Child));
                button.Clicked += (object sender, EventArgs e) =>
                {
                    tab.OnClosing();
                    Widget.Remove(nativeWidget);
                };
            }

            return vbox;
        }
		protected virtual void AddActionCommands (Wrapper.Action action)
		{
			if (allowBinding) {
				Gtk.ToolButton bindButton = new Gtk.ToolButton (null, Catalog.GetString ("Bind to Field"));
				bindButton.IsImportant = true;
				bindButton.Show ();
				Insert (bindButton, -1);
				if (action == null)
					bindButton.Sensitive = false;
					
				bindButton.Clicked += delegate { frontend.NotifyBindField (); };
			}
		}