public RadioToolButton (RadioToolButton[] group) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (RadioToolButton)) {
				CreateNativeObject (new string [0], new GLib.Value [0]);
				Group = group;
				return;
			}
			IntPtr native_group = IntPtr.Zero;
			if (group != null) {
				GLib.List list = new GLib.List(IntPtr.Zero);
				foreach (RadioToolButton item in group) {
					list.Append (item.Handle);
				}
				native_group = list.Handle;
			}
			Raw = gtk_radio_tool_button_new(native_group);
		}
Example #2
0
        RadioToolButton AddToggle(RadioToolButton group, string icon, 
			      string tooltipText, MouseFunc func)
        {
            var list = (group == null) ? null : group.Group;

              var toggle = new RadioToolButton(list, icon) {TooltipText = tooltipText};
              toggle.Clicked += delegate
            {
              if (toggle.Active)
              {
            _preview.Func = func;
              }
            };

              Insert(toggle, -1);
              return toggle;
        }
		public RadioToolButton (RadioToolButton[] group, string stock_id) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (RadioToolButton)) {
				GLib.Value[] vals = new GLib.Value [1];
				string[] names = { "stock_id" };
				vals [0] = new GLib.Value (stock_id);
				CreateNativeObject (names, vals);
				Group = group;
				return;
			}
			IntPtr stock_id_as_native = GLib.Marshaller.StringToPtrGStrdup (stock_id);
			IntPtr native_group = IntPtr.Zero;
			if (group != null) {
				GLib.List list = new GLib.List(IntPtr.Zero);
				foreach (RadioToolButton item in group) {
					list.Append (item.Handle);
				}
				native_group = list.Handle;
			}
			Raw = gtk_radio_tool_button_new_from_stock(native_group, stock_id_as_native);
			GLib.Marshaller.Free (stock_id_as_native);
		}
Example #4
0
        RadioToolButton CreateEraserToggle(RadioToolButton group, 
				       SliceData sliceData)
        {
            return AddToggle(group, GimpStock.TOOL_ERASER, _("Remove Slice"),
               new RemoveFunc(sliceData, _preview));
        }
Example #5
0
        RadioToolButton CreateTableToggle(RadioToolButton group, 
				      SliceData sliceData)
        {
            return AddToggle(group, GimpStock.GRID, _("Insert Table"),
               new CreateTableFunc(sliceData, _preview));
        }
Example #6
0
        RadioToolButton CreateSliceToggle(RadioToolButton group,
				      SliceData sliceData)
        {
            return AddToggle(group, GimpStock.TOOL_CROP, _("Create a new Slice"),
               new CreateFunc(sliceData, _preview));
        }
Example #7
0
        void FillToolbar()
        {
            Toolbar toolbar = new Toolbar ();
            toolbar.Orientation = Orientation.Vertical;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;

            editimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-edit_active", 22));
            editbutton = new ToggleToolButton ();
            editbutton.IconWidget = editimage;
            editbutton.Toggled += HandleEditToggled;
            editbutton.TooltipText = Catalog.GetString ("Edit dashboard");
            toolbar.Add (editbutton);
            toolbar.Add (new SeparatorToolItem ());

            linksimage = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-link-disabled", 22));
            linksbutton = new ToggleToolButton ();
            linksbutton.IconWidget = linksimage;
            linksbutton.Toggled += HandleLinksToggled;
            linksbutton.TooltipText = Catalog.GetString ("Edit action links");
            toolbar.Add (linksbutton);
            toolbar.Add (new SeparatorToolItem ());

            popupbutton = new ToggleToolButton ();
            popupbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-popup", 22));
            popupbutton.Active = true;
            popupbutton.Toggled += HandlePopupToggled;
            popupbutton.TooltipText = Catalog.GetString ("Disable popup window");
            toolbar.Add (popupbutton);
            toolbar.Add (new SeparatorToolItem ());

            fitbutton = new RadioToolButton ((GLib.SList)null);
            fitbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-fit", 22));
            fitbutton.Toggled += HandleFitModeToggled;
            fitbutton.TooltipText = Catalog.GetString ("Fit dashboard");
            toolbar.Add (fitbutton);
            fillbutton = new RadioToolButton (fitbutton);
            fillbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-fill", 22));
            fillbutton.Toggled += HandleFitModeToggled;
            fillbutton.TooltipText = Catalog.GetString ("Fill dashboard");
            toolbar.Add (fillbutton);
            d11button = new RadioToolButton (fitbutton);
            d11button.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon ("longomatch-dash-11", 22));
            d11button.Toggled += HandleFitModeToggled;
            d11button.TooltipText = Catalog.GetString ("1:1 dashboard");
            toolbar.Add (d11button);
            toolbar.ShowAll ();
            hbox2.PackEnd (toolbar, false, false, 0);

            editbutton.Active = true;
            linksbutton.Active = false;
        }
Example #8
0
 protected Gtk.RadioToolButton CreateRadioToolButton(string pixbuf, string tooltip)
 {
     Gtk.RadioToolButton rtn = new Gtk.RadioToolButton (new GLib.SList (typeof (RadioToolButton)));
     rtn.IconWidget = new Gtk.Image (MonoUML.IconLibrary.PixbufLoader.GetIcon (pixbuf));
     rtn.SetTooltip (_tooltips, tooltip, tooltip);
     return rtn;
 }
Example #9
0
        internal PropertyGrid(EditorManager editorManager)
            : base(false, 0)
        {
            this.editorManager = editorManager;

            tips = new Tooltips ();

            #region Toolbar
            toolbar = new Toolbar ();
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.IconSize = IconSize.SmallToolbar;
            base.PackStart (toolbar, false, false, 0);

            catButton = new RadioToolButton (new GLib.SList (IntPtr.Zero));
            catButton.IconWidget = new Image (new Gdk.Pixbuf (null, "AspNetEdit.UI.PropertyGrid.SortByCat.png"));
            catButton.SetTooltip (tips, "Sort in categories", null);
            catButton.Toggled += new EventHandler (toolbarClick);
            toolbar.Insert (catButton, 0);

            alphButton = new RadioToolButton (catButton, Stock.SortAscending);
            alphButton.SetTooltip (tips, "Sort alphabetically", null);
            alphButton.Clicked += new EventHandler (toolbarClick);
            toolbar.Insert (alphButton, 1);

            catButton.Active = true;

            SeparatorToolItem sep = new SeparatorToolItem();
            toolbar.Insert (sep, 2);

            #endregion

            vpaned = new VPaned ();

            descFrame = new Frame ();
            descFrame.Shadow = ShadowType.In;

            desc = new VBox (false, 0);
            descFrame.Add (desc);

            descTitle = new Label ();
            descTitle.SetAlignment(0, 0);
            descTitle.SetPadding (5, 5);
            descTitle.UseMarkup = true;
            desc.PackStart (descTitle, false, false, 0);

            textScroll = new ScrolledWindow ();
            textScroll.HscrollbarPolicy = PolicyType.Never;
            textScroll.VscrollbarPolicy = PolicyType.Automatic;

            desc.PackEnd (textScroll, true, true, 0);

            //TODO: Use label, but wrapping seems dodgy.
            descText = new TextView ();
            descText.WrapMode = WrapMode.Word;
            descText.WidthRequest = 1;
            descText.HeightRequest = 100;
            descText.Editable = false;
            descText.LeftMargin = 5;
            descText.RightMargin = 5;
            textScroll.Add (descText);

            scrolledWindow = new ScrolledWindow ();
            scrolledWindow.HscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;

            vpaned.Pack1 (scrolledWindow, true, true);
            vpaned.Pack2 (descFrame, false, true);

            AddPropertyTab (new DefaultPropertyTab ());
            AddPropertyTab (new EventPropertyTab ());

            base.PackEnd (vpaned);
            Populate ();
        }
Example #10
0
        private void AddPropertyTab(PropertyTab tab)
        {
            RadioToolButton rtb;
            if (propertyTabs.Count == 0) {
            selectedTab = tab;
            rtb = new RadioToolButton (new GLib.SList (IntPtr.Zero), Stock.MissingImage);
            rtb.Active = true;
            }
            else
            rtb = new RadioToolButton ((RadioToolButton) toolbar.GetNthItem (propertyTabs.Count + FirstTabIndex - 1));

            //load image from PropertyTab's bitmap
            if (tab.Bitmap != null)
            rtb.IconWidget = new Gtk.Image (ImageToPixbuf (tab.Bitmap));
            else
            rtb.IconWidget = new Gtk.Image (Stock.MissingImage, IconSize.SmallToolbar);

            rtb.SetTooltip (tips, tab.TabName, null);
            rtb.Toggled += new EventHandler (toolbarClick);

            toolbar.Insert (rtb, propertyTabs.Count + FirstTabIndex);

            propertyTabs.Add(tab);
        }