private void Init() { var hbox = new HBox(false, 0); var hboxYesNo = new HBox(false, 0); var suffix = GLTheme.DialogScaling >= 2.0f ? "@2x" : ""; buttonYes = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.Yes{suffix}.png")); buttonNo = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.No{suffix}.png")); buttonAdvanced = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.PlusSmall{suffix}.png")); buttonYes.Show(); buttonYes.ButtonPressEvent += ButtonYes_ButtonPressEvent; buttonNo.Show(); buttonNo.ButtonPressEvent += ButtonNo_ButtonPressEvent; buttonAdvanced.ButtonPressEvent += ButtonAdvanced_ButtonPressEvent; buttonYes.TooltipText = "Accept"; buttonNo.TooltipText = "Cancel"; buttonAdvanced.TooltipText = "Toggle Advanced Options"; hboxYesNo.PackStart(buttonYes, false, false, 0); hboxYesNo.PackStart(buttonNo, false, false, 0); hboxYesNo.Show(); var alignLeft = new Alignment(0.0f, 0.5f, 0.0f, 0.0f); alignLeft.TopPadding = 5; alignLeft.Add(buttonAdvanced); alignLeft.Show(); var alignRight = new Alignment(1.0f, 0.5f, 0.0f, 0.0f); alignRight.TopPadding = 5; alignRight.Add(hboxYesNo); alignRight.Show(); hbox.Add(alignLeft); hbox.Add(alignRight); hbox.Show(); var vbox = new VBox(); vbox.PackStart(propertyPage, false, false, 0); vbox.PackStart(hbox, false, false, 0); vbox.Show(); Add(vbox); propertyPage.PropertyWantsClose += propertyPage_PropertyWantsClose; propertyPage.Show(); BorderWidth = (uint)GtkUtils.ScaleGtkWidget(5); Resizable = false; Decorated = false; Modal = true; SkipTaskbarHint = true; TransientFor = FamiStudioForm.Instance; }
public PropertyDialog(System.Drawing.Point pt, int width, bool leftAlign = false) : base(WindowType.Toplevel) { var hbox = new HBox(false, 0); var suffix = GLTheme.DialogScaling >= 2.0f ? "@2x" : ""; var buttonYes = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.Yes{suffix}.png")); var buttonNo = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.No{suffix}.png")); buttonYes.Show(); buttonYes.ButtonPressEvent += ButtonYes_ButtonPressEvent; buttonNo.Show(); buttonNo.ButtonPressEvent += ButtonNo_ButtonPressEvent; hbox.PackStart(buttonYes, false, false, 0); hbox.PackStart(buttonNo, false, false, 0); hbox.Show(); var align = new Alignment(1.0f, 0.5f, 0.0f, 0.0f); align.TopPadding = 5; align.Show(); align.Add(hbox); var vbox = new VBox(); vbox.PackStart(propertyPage, false, false, 0); vbox.PackStart(align, false, false, 0); vbox.Show(); Add(vbox); propertyPage.PropertyWantsClose += propertyPage_PropertyWantsClose; propertyPage.Show(); BorderWidth = 5; Resizable = false; Decorated = false; KeepAbove = true; Modal = true; WidthRequest = width; if (leftAlign) { pt.X -= width; } Move(pt.X, pt.Y); }
private void Init() { var hbox = new HBox(false, 0); var suffix = GLTheme.DialogScaling >= 2.0f ? "@2x" : ""; buttonYes = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.Yes{suffix}.png")); buttonNo = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.No{suffix}.png")); buttonYes.Show(); buttonYes.ButtonPressEvent += ButtonYes_ButtonPressEvent; buttonNo.Show(); buttonNo.ButtonPressEvent += ButtonNo_ButtonPressEvent; hbox.PackStart(buttonYes, false, false, 0); hbox.PackStart(buttonNo, false, false, 0); hbox.Show(); var align = new Alignment(1.0f, 0.5f, 0.0f, 0.0f); align.TopPadding = 5; align.Show(); align.Add(hbox); var vbox = new VBox(); vbox.PackStart(propertyPage, false, false, 0); vbox.PackStart(align, false, false, 0); vbox.Show(); Add(vbox); propertyPage.PropertyWantsClose += propertyPage_PropertyWantsClose; propertyPage.Show(); BorderWidth = 5; Resizable = false; Decorated = false; KeepAbove = true; Modal = true; SkipTaskbarHint = true; #if FAMISTUDIO_LINUX TransientFor = FamiStudioForm.Instance; #endif }
public PropertyPage AddPropertyPage(string text, string image) { var pixbuf = Gdk.Pixbuf.LoadFromResource("FamiStudio.Resources." + image + ".png"); var page = new PropertyPage(); page.Show(); if (tabs.Count == 0) { propsVBox.PackStart(page, false, false, 0); } var tab = new PropertyPageTab(); tab.button = AddButton(text, pixbuf); tab.properties = page; tabs.Add(tab); return(page); }
public PropertyPage AddPropertyPage(string text, string image) { var suffix = DpiScaling.Dialog >= 2.0f ? "@2x" : ""; var pixbuf = Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.{image}{suffix}.png"); var page = new PropertyPage(); page.Show(); if (tabs.Count == 0) { propsVBox.PackStart(page, false, false, 0); } var tab = new PropertyPageTab(); tab.button = AddButton(text, pixbuf); tab.properties = page; tabs.Add(tab); return(page); }