BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
BioGTK.ComboPicker Class Reference
Inheritance diagram for BioGTK.ComboPicker:

Static Public Member Functions

static ComboPicker Create (string[] sts)
 
static ComboPicker Create (Type ems)
 

Protected Member Functions

 ComboPicker (Builder builder, IntPtr handle, Type ems)
 
 ComboPicker (Builder builder, IntPtr handle, string[] sts)
 

Properties

int SelectedIndex [get]
 

Constructor & Destructor Documentation

◆ ComboPicker() [1/2]

BioGTK.ComboPicker.ComboPicker ( Builder  builder,
IntPtr  handle,
Type  ems 
)
inlineprotected
47 : base(handle)
48 {
49 _builder = builder;
50 builder.Autoconnect(this);
51 okBut.ButtonPressEvent += OkBut_ButtonPressEvent;
52 cancelBut.ButtonPressEvent += CancelBut_ButtonPressEvent;
53 ens = ems;
54 List<string> sts = new List<string>();
55 Array ar = Enum.GetValues(ems);
56 foreach (Enum s in ar)
57 {
58 sts.Add(s.ToString());
59 }
60 var states = new ListStore(typeof(string));
61 //We add button states to buttonState box.
62 foreach (string val in sts)
63 {
64 states.AppendValues(val);
65 }
66 // Set the model for the ComboBox
67 comboBox.Model = states;
68 // Set the text column to display
69 var renderer2 = new CellRendererText();
70 comboBox.PackStart(renderer2, false);
71 comboBox.AddAttribute(renderer2, "text", 0);
72 comboBox.Active = 0;
73 App.ApplyStyles(this);
74 }

◆ ComboPicker() [2/2]

BioGTK.ComboPicker.ComboPicker ( Builder  builder,
IntPtr  handle,
string[]  sts 
)
inlineprotected
76 : base(handle)
77 {
78 _builder = builder;
79 builder.Autoconnect(this);
80 okBut.ButtonPressEvent += OkBut_ButtonPressEvent;
81 cancelBut.ButtonPressEvent += CancelBut_ButtonPressEvent;
82 var states = new ListStore(typeof(string));
83 //We add button states to buttonState box.
84 foreach (string val in sts)
85 {
86 states.AppendValues(val);
87 }
88 // Set the model for the ComboBox
89 comboBox.Model = states;
90 // Set the text column to display
91 var renderer2 = new CellRendererText();
92 comboBox.PackStart(renderer2, false);
93 comboBox.AddAttribute(renderer2, "text", 0);
94 comboBox.Active = 0;
95 App.ApplyStyles(this);
96 }

Member Function Documentation

◆ Create() [1/2]

static ComboPicker BioGTK.ComboPicker.Create ( string[]  sts)
inlinestatic

It creates a new ComboPicker object, which is a Gtk.Window, and returns it

Returns
A new instance of the ComboPicker class.
34 {
35 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/ComboPicker.glade", FileMode.Open));
36 return new ComboPicker(builder, builder.GetObject("comboPicker").Handle, sts);
37 }
ComboPicker(Builder builder, IntPtr handle, Type ems)
Definition ComboPicker.cs:47

◆ Create() [2/2]

static ComboPicker BioGTK.ComboPicker.Create ( Type  ems)
inlinestatic

It creates a new ComboPicker object, which is a Gtk.Window, and returns it

Returns
A new instance of the ComboPicker class.
42 {
43 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/ComboPicker.glade", FileMode.Open));
44 return new ComboPicker(builder, builder.GetObject("comboPicker").Handle, ems);
45 }

Property Documentation

◆ SelectedIndex

int BioGTK.ComboPicker.SelectedIndex
get
116 {
117 get { return comboBox.Active; }
118 }

The documentation for this class was generated from the following file: