public GtkSharpChoice(Widget shellobject, params object[] entries) : base(shellobject) { //note: this function is somewhat hacky to get stupid gtk combos to behave like we want //the question is if we can guarantee default width of combos are same evrywhere? int xborder; combobox = new Gtk.ComboBox(); //TODO: support adding objects GtkSharpDriver.InitWidget(combobox, shellobject); var c = combobox.Child; Gtk.Requisition req_r = c.SizeRequest(); Gtk.Requisition req_c = combobox.SizeRequest(); int btnwidth = req_c.Width - req_r.Width; xborder = req_c.Height - req_r.Height; c.SetSizeRequest(Guppy.DefaultEditWidth - xborder, -1); FitWidth(); combobox.Show(); }
public GtkSharpLabel(Widget shellobject, string caption) : base(shellobject) { label = new Gtk.Label(caption); GtkSharpDriver.InitWidget(label, shellobject); label.Show(); label.SetAlignment(0.0f, 0.5f); }
public override Size2i GetNaturalSize() { if (image.Pixbuf == null) { return(new Size2i(16, 16)); } return(GtkSharpDriver.DefaultGetNaturalSize(image)); }
public GtkSharpEdit(Widget shellobject) : base(shellobject) { entry = new Gtk.Entry(); GtkSharpDriver.InitWidget(entry, shellobject); entry.Show(); shellobject.Size = new Size2i(Guppy.DefaultEditWidth, shellobject.Size.Height); }
public GtkSharpMemo(Widget shellobject) : base(shellobject) { textview = new Gtk.TextView(); GtkSharpDriver.InitWidget(textview, shellobject); textview.Show(); textview.Buffer.Changed += delegate { ((Memo)ShellObject).OnChanged(); }; textview.AcceptsTab = false; //dafault is to tab to next control }
public GtkSharpImageLabel(Widget shellobject, Image img) : base(shellobject) { // this.image = GtkSharpDriver.ImageToGtkImage(img); Gdk.Pixbuf pb = GtkSharpDriver.ImageToGtkPixbuf(img); this.image = new Gtk.Image(pb); GtkSharpDriver.InitWidget(this.image, shellobject); this.image.Show(); }
public GtkSharpFrame(Widget shellobject, string caption) : base(shellobject) { frame = new Gtk.Frame(caption); GtkSharpDriver.InitWidget(frame, shellobject); frame.Show(); fixchild = new Gtk.Fixed(); frame.Add(fixchild); fixchild.Show(); }
public override void Show() { Response = null; Gtk.Window parent = GtkSharpDriver.GetForegroundWindow(); //Size = ShellObject.LayoutInfo.Size; window.TransientFor = null; window.Modal = false; SolveWindowPosition(parent); window.Show(); }
public GtkSharpSeparator(Widget shellobject, bool vertical) : base(shellobject) { if (vertical) { sep = new Gtk.VSeparator(); } else { sep = new Gtk.HSeparator(); } GtkSharpDriver.InitWidget(sep, shellobject); sep.Show(); }
//Gtk.Image image; public GtkSharpButton(Widget shellobject, string caption) : base(shellobject) { button = new Gtk.Button(); GtkSharpDriver.InitWidget(button, shellobject); button.Show(); label = new Gtk.Label(caption); label.Show(); CreateContent(null); button.Show(); button.Clicked += delegate { ((Button)ShellObject).OnClicked(); }; }
public GtkSharpWindow(Widget shellobject, string caption) : base(shellobject) { window = new Gtk.Window(caption); GtkSharpDriver.InitWidget(window, shellobject); window.ResizeChecked += new EventHandler(EventResizeChecked); window.Hidden += new EventHandler(EventClosed); //window.WindowPosition = Gtk.WindowPosition.Mouse; fixchild = new Gtk.Fixed(); fixchild.Show(); window.Add(fixchild); window.DeleteEvent += new Gtk.DeleteEventHandler(window_DeleteEvent); window.KeyPressEvent += new Gtk.KeyPressEventHandler(window_KeyPressEvent); }
public override object ShowModal() { Response = null; Gtk.Window parent = GtkSharpDriver.GetForegroundWindow(); window.TransientFor = parent; window.Modal = true; SolveWindowPosition(parent); window.Show(); while (window.Visible) { Gtk.Application.RunIteration(true); } return(Response); }
private bool sendclickevent = true; //used to get rid of click event when setting checked in code public GtkSharpToggle(Widget shellobject, string caption, bool isbutton) : base(shellobject) { if (isbutton) { togglebtn = new Gtk.ToggleButton(caption); } else //checkbox { togglebtn = new Gtk.CheckButton(caption); } GtkSharpDriver.InitWidget(togglebtn, shellobject); togglebtn.Show(); togglebtn.Clicked += delegate { if (sendclickevent) { ((Toggle)shellobject).OnChanged(); } }; }
/* private Gtk.Widget TheWidget * { * get { return NativeObject as Gtk.Widget; } * }*/ public override Size2i GetNaturalSize() { return(GtkSharpDriver.DefaultGetNaturalSize(entry)); }
public override Size2i GetNaturalSize() { return(GtkSharpDriver.DefaultGetNaturalSize(togglebtn)); }
public override Size2i GetNaturalSize() { var res = GtkSharpDriver.DefaultGetNaturalSize(sep); return(res); }
public override Size2i GetNaturalSize() { return(GtkSharpDriver.DefaultGetNaturalSize(combobox)); }