public void Create(RadioMenuItem controller) { if (controller != null) { Control = new Gtk.RadioMenuItem((Gtk.RadioMenuItem)controller.ControlObject); this.controller = (RadioMenuItemHandler)controller.Handler; } else { this.controller = this; Control = new Gtk.RadioMenuItem(string.Empty); foreach (Gtk.Widget w in Control.Children) { Control.Remove(w); } } var hbox = new Gtk.HBox(false, 4); label = new Gtk.AccelLabel(string.Empty); label.Xalign = 0; label.UseUnderline = true; label.AccelWidget = Control; hbox.Add(label); accelLabel = new Gtk.Label(); accelLabel.Xalign = 1; accelLabel.Visible = false; hbox.Add(accelLabel); Control.Add(hbox); }
public ButtonHandler() { Control = new Gtk.Button(); label = new Gtk.AccelLabel(string.Empty); Control.Add(label); Control.Clicked += delegate { Widget.OnClick(EventArgs.Empty); }; var defaultSize = Button.DefaultSize; Control.SizeAllocated += delegate(object o, Gtk.SizeAllocatedArgs args) { var size = args.Allocation; if (size.Width > 1 || size.Height > 1) { if (defaultSize.Width > size.Width) { size.Width = defaultSize.Width; } if (defaultSize.Height > size.Height) { size.Height = defaultSize.Height; } if (args.Allocation != size) { Control.SetSizeRequest(size.Width, size.Height); } } }; //Control.SetSizeRequest(Button.DefaultSize.Width, Button.DefaultSize.Height); }
public RadioMenuItemHandler() { label = new Gtk.AccelLabel(string.Empty); label.Xalign = 0; label.UseUnderline = true; accelLabel = new Gtk.Label(); accelLabel.Xalign = 1; accelLabel.Visible = false; }
public CheckMenuItemHandler() { Control = new Gtk.CheckMenuItem(); label = new Gtk.AccelLabel(string.Empty); label.Xalign = 0; label.UseUnderline = true; label.AccelWidget = Control; Control.Add(label); }
public ImageMenuItemHandler() { Control = new Gtk.ImageMenuItem(); Control.Activated += control_Activated; label = new Gtk.AccelLabel(string.Empty); label.Xalign = 0; label.UseUnderline = true; label.AccelWidget = Control; Control.Add(label); }
public ButtonMenuItemHandler() { Control = new Gtk.ImageMenuItem(); label = new Gtk.AccelLabel(string.Empty); label.Xalign = 0; label.UseUnderline = true; label.AccelWidget = Control; Control.Add(label); Control.ShowAll(); }
public ButtonHandler() { // need separate widgets as the theme can (and usually) disables images on buttons // gtk3 can override the theme per button, but gtk2 cannot table = new Gtk.Table(3, 3, false); table.ColumnSpacing = 0; table.RowSpacing = 0; label = new Gtk.AccelLabel(string.Empty); label.NoShowAll = true; table.Attach(label, 1, 2, 1, 2, Gtk.AttachOptions.Expand, Gtk.AttachOptions.Expand, 0, 0); gtkimage = new Gtk.Image(); gtkimage.NoShowAll = true; }
public void Create(RadioButton controller) { if (controller != null) { Control = new Gtk.RadioButton((Gtk.RadioButton)controller.ControlObject); } else { Control = new Gtk.RadioButton((Gtk.RadioButton)null); } label = new Gtk.AccelLabel(""); Control.Add(label); //control.AddMnemonicLabel(label); Control.Toggled += control_Toggled; }
public void Create(RadioButton controller) { if (controller != null) { Control = new Gtk.RadioButton(RadioButtonHandler.GetControl(controller)); } else { Control = new Gtk.RadioButton((Gtk.RadioButton)null); // make gtk work like others in that no radio button is initially selected var inactive = new Gtk.RadioButton(Control); inactive.Active = true; } label = new Gtk.AccelLabel(""); Control.Add(label); //control.AddMnemonicLabel(label); Control.Toggled += Connector.HandleCheckedChanged; }
/// MenuItemType ISolidIDE.GetMenuItem <MenuItemType>(params string[] names) { Gtk.MenuShell menu = (this as ISolidIDE).GetMainMenu(); Gtk.MenuItem item = null; for (int i = 0; i < names.Length; i++) { item = null; foreach (Gtk.Widget w in menu.Children) { if (w.Name == names[i] + "Action") { item = w as Gtk.ImageMenuItem; if (i < names.Length - 1) { if (item.Submenu == null) { item.Submenu = new Gtk.Menu(); } menu = item.Submenu as Gtk.MenuShell; } break; } } if (item == null) { item = new MenuItemType(); Gtk.AccelLabel accelLabel = new Gtk.AccelLabel(""); accelLabel.TextWithMnemonic = names[i]; accelLabel.SetAlignment(0f, 0.5f); item.Add(accelLabel); accelLabel.AccelWidget = item; item.Name = names[i] + "Action"; menu.Append(item); if (i < names.Length - 1) { item.Submenu = new Gtk.Menu(); } menu = item.Submenu as Gtk.MenuShell; } } return(item as MenuItemType); }
public ButtonHandler() { Control = new Gtk.Button(); // need separate widgets as the theme can (and usually) disables images on buttons // gtk3 can override the theme per button, but gtk2 cannot table = new Gtk.Table(3, 3, false); table.ColumnSpacing = 0; table.RowSpacing = 0; label = new Gtk.AccelLabel(string.Empty); label.NoShowAll = true; table.Attach(label, 1, 2, 1, 2, Gtk.AttachOptions.Expand, Gtk.AttachOptions.Expand, 0, 0); gtkimage = new Gtk.Image(); gtkimage.NoShowAll = true; SetImagePosition(false); Control.Add(table); Control.Clicked += delegate { Widget.OnClick(EventArgs.Empty); }; var defaultSize = Button.DefaultSize; Control.SizeAllocated += delegate(object o, Gtk.SizeAllocatedArgs args) { var size = args.Allocation; if (size.Width > 1 || size.Height > 1) { if (defaultSize.Width > size.Width) { size.Width = defaultSize.Width; } if (defaultSize.Height > size.Height) { size.Height = defaultSize.Height; } if (args.Allocation != size) { Control.SetSizeRequest(size.Width, size.Height); } } }; }
public RadioMenuItemHandler() { label = new Gtk.AccelLabel(string.Empty); label.Xalign = 0; label.UseUnderline = true; }
public ButtonHandler() { label = new Gtk.AccelLabel(string.Empty); label.Ellipsize = Pango.EllipsizeMode.End; label.Show(); }