BioGTK  6.7.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
Loading...
Searching...
No Matches
YesNoDialog.cs
1using Gtk;
2using System;
3using System.Collections.Generic;
4using System.IO;
5using System.Linq;
6using System.Text;
7using System.Threading.Tasks;
8
9namespace BioGTK
10{
11 public class YesNoDialog : Dialog
12 {
13 #region Properties
14 private Builder _builder;
15
16#pragma warning disable 649
17 [Builder.Object]
18 private Gtk.Button yesBut;
19 [Builder.Object]
20 private Gtk.Button noBut;
21 [Builder.Object]
22 private Gtk.Label textLabel;
23#pragma warning restore 649
24
25 #endregion
26
27 #region Constructors / Destructors
28 string selection;
32 public static YesNoDialog Create(string text)
33 {
34 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/YesNoDialog.glade", FileMode.Open));
35 return new YesNoDialog(builder, builder.GetObject("yesDialog").Handle, text);
36 }
37 /* The constructor for the ComboPicker class. */
38 protected YesNoDialog(Builder builder, IntPtr handle, string text) : base(handle)
39 {
40 _builder = builder;
41 builder.Autoconnect(this);
42 Text = text;
43 yesBut.ButtonPressEvent += OkBut_ButtonPressEvent;
44 noBut.ButtonPressEvent += CancelBut_ButtonPressEvent;
45 }
46
51 private void CancelBut_ButtonPressEvent(object o, ButtonPressEventArgs args)
52 {
53 Respond(ResponseType.No);
54 Hide();
55 }
56
57 private void OkBut_ButtonPressEvent(object o, ButtonPressEventArgs args)
58 {
59 Respond(ResponseType.Yes);
60 Hide();
61 }
62
63 public string Text
64 {
65 get
66 {
67 return textLabel.Text;
68 }
69 set
70 {
71 textLabel.Text = value;
72 }
73 }
74
75 #endregion
76
77 }
78}
static YesNoDialog Create(string text)
Definition ML.cs:17