14 private Builder _builder;
16#pragma warning disable 649
18 private Gtk.Button okBut;
20 private Gtk.Button cancelBut;
22 private Gtk.Entry textinputBox;
24 private Gtk.ColorButton colorBut;
26 private Gtk.FontButton fontBut;
27#pragma warning restore 649
31 #region Constructors / Destructors
32 private bool ROItype =
true;
38 Builder builder =
new Builder(
new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) +
"/" +
"Glade/TextInput.glade", FileMode.Open));
39 var ti =
new TextInput(builder, builder.GetObject(
"textInput").Handle);
45 protected TextInput(Builder builder, IntPtr handle) : base(handle)
48 builder.Autoconnect(
this);
49 okBut.ButtonPressEvent += OkBut_ButtonPressEvent;
50 cancelBut.ButtonPressEvent += CancelBut_ButtonPressEvent;
51 textinputBox.Activated += TextinputBox_Activated;
52 App.ApplyStyles(
this);
55 private void TextinputBox_Activated(
object sender, EventArgs e)
60 Respond(ResponseType.Ok);
67 private void CancelBut_ButtonPressEvent(
object o, ButtonPressEventArgs args)
69 Respond(ResponseType.Cancel);
80 private void OkBut_ButtonPressEvent(
object o, ButtonPressEventArgs args)
85 Respond(ResponseType.Ok);
93 foreach (var r
in ImageView.SelectedImage.Annotations)
103 ro.Text = textinputBox.Text;
104 string s = fontBut.Font;
105 s = s.Replace(
",",
"");
106 string[] sts = s.Split(
' ');
107 s = s.Replace(sts[sts.Length-1],
"");
108 ro.family = fontBut.FontFamily.Name;
109 ro.fontSize =
float.Parse(sts[sts.Length - 1]);
120 get {
return textinputBox.Text; }
126 get {
return colorBut.Rgba; }
130 public string FontFamily
134 return fontBut.FontOptions.HintStyle.ToString();