private void createTable() { LogB.Debug("Persons count" + persons.Count.ToString()); uint padding = 4; uint cols = 4; //each row has 4 columns uint rows = Convert.ToUInt32(Math.Floor(persons.Count / (1.0 * cols)) + 1); int count = 0; label_selected_person_name.Text = ""; SelectedPerson = null; personButtonsSensitive(false); vbox_button_delete_confirm.Visible = false; for (int row_i = 0; row_i < rows; row_i++) { for (int col_i = 0; col_i < cols; col_i++) { if (count >= persons.Count) { return; } Person p = (Person)persons[count++]; PersonPhotoButton ppb = new PersonPhotoButton(p); Gtk.Button b = ppb.CreateButton(); b.Show(); b.Clicked += new EventHandler(on_button_portrait_clicked); b.CanFocus = true; table1.Attach(b, (uint)col_i, (uint)col_i + 1, (uint)row_i, (uint)row_i + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, padding, padding); } } table1.ShowAll(); }
private void on_button_portrait_clicked(object o, EventArgs args) { LogB.Information("Clicked"); //access the button Button b = (Button)o; int personID = PersonPhotoButton.GetPersonID(b); LogB.Information("UniqueID: " + personID.ToString()); //TODO: now need to process the signal and close foreach (Person p in persons) { if (p.UniqueID == personID) { SelectedPerson = p; label_selected_person_name.Text = p.Name; personButtonsSensitive(true); } } }
private void createTable() { LogB.Debug("Persons count" + persons.Count.ToString()); uint padding = 4; uint cols = 4; //each row has 4 columns uint rows = Convert.ToUInt32(Math.Floor(persons.Count / (1.0 * cols)) + 1); int count = 0; if (SelectedPerson == null) { selectedFirstClickPersonID = -1; label_selected_person_name.Text = ""; } else { selectedFirstClickPersonID = SelectedPerson.UniqueID; label_selected_person_name.Text = "<b>" + SelectedPerson.Name + "</b>"; label_selected_person_name.UseMarkup = true; } personButtonsSensitive(false); vbox_button_delete_confirm.Visible = false; list_ppb = new List <PersonPhotoButton>(); for (int row_i = 0; row_i < rows; row_i++) { for (int col_i = 0; col_i < cols; col_i++) { if (count >= persons.Count) { return; } Person p = (Person)persons[count++]; PersonPhotoButton ppb = new PersonPhotoButton(p.UniqueID, p.Name); //creates the button //select currentPerson if (selectedFirstClickPersonID != -1 && selectedFirstClickPersonID == p.UniqueID) { ppb.Select(true); assignPersonSelectedStuff(p); } list_ppb.Add(ppb); Gtk.Button b = ppb.Button; b.Show(); b.Clicked += new EventHandler(on_button_portrait_clicked); b.CanFocus = true; table1.Attach(b, (uint)col_i, (uint)col_i + 1, (uint)row_i, (uint)row_i + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, padding, padding); } } table1.ShowAll(); }
private void createTable() { LogB.Debug("Persons count" + persons.Count.ToString()); uint padding = 4; uint cols = 4; //each row has 4 columns uint rows = Convert.ToUInt32(Math.Floor(persons.Count / (1.0 * cols) ) +1); int count = 0; label_selected_person_name.Text = ""; SelectedPerson = null; personButtonsSensitive(false); vbox_button_delete_confirm.Visible = false; for (int row_i = 0; row_i < rows; row_i ++) { for (int col_i = 0; col_i < cols; col_i ++) { if(count >= persons.Count) return; Person p = (Person) persons[count ++]; PersonPhotoButton ppb = new PersonPhotoButton(p); Gtk.Button b = ppb.CreateButton(); b.Show(); b.Clicked += new EventHandler(on_button_portrait_clicked); b.CanFocus=true; table1.Attach (b, (uint) col_i, (uint) col_i +1, (uint) row_i, (uint) row_i +1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, padding, padding); } } table1.ShowAll(); }