protected QueryTermBox CreateRow(bool canDelete) { var row = new QueryTermBox(sorted_fields); row.ValueEntry.HeightRequest = 31; row.Buttons.HeightRequest = 31; Resize((uint)terms.Count + 1, NColumns); Attach(row.FieldChooser, 0, 1, NRows - 1, NRows); Attach(row.OpChooser, 1, 2, NRows - 1, NRows); Attach(row.ValueEntry, 2, 3, NRows - 1, NRows); Attach(row.Buttons, 3, 4, NRows - 1, NRows); if (terms.Count > 0) { row.FieldChooser.Active = terms[terms.Count - 1].FieldChooser.Active; row.OpChooser.Active = terms[terms.Count - 1].OpChooser.Active; } row.Show(); row.CanDelete = canDelete; row.AddRequest += OnRowAddRequest; row.RemoveRequest += OnRowRemoveRequest; if (terms.Count == 0) { //row.FieldBox.GrabFocus (); } terms.Add(row); return(row); }
private void RemoveRow(int index) { FreezeChildNotify(); QueryTermBox row = terms [index]; Remove(row.FieldChooser); Remove(row.OpChooser); Remove(row.ValueEntry); Remove(row.Buttons); for (int i = index + 1; i < terms.Count; i++) { Remove(terms[i].FieldChooser); Remove(terms[i].OpChooser); Remove(terms[i].ValueEntry); Remove(terms[i].Buttons); Attach(terms[i].FieldChooser, 0, 1, (uint)i - 1, (uint)i); Attach(terms[i].OpChooser, 1, 2, (uint)i - 1, (uint)i); Attach(terms[i].ValueEntry, 2, 3, (uint)i - 1, (uint)i); Attach(terms[i].Buttons, 3, 4, (uint)i - 1, (uint)i); } ThawChildNotify(); terms.Remove(row); UpdateCanDelete(); }
protected void AddNode(QueryNode node) { if (node is QueryTermNode) { QueryTermBox box = first_add_node ? FirstRow : CreateRow(true); box.QueryNode = node as QueryTermNode; first_add_node = false; } else { throw new ArgumentException("Query is too complex for GUI query editor", "node"); } }
protected QueryTermBox CreateRow (bool canDelete) { QueryTermBox row = new QueryTermBox (sorted_fields); row.ValueEntry.HeightRequest = 31; row.Buttons.HeightRequest = 31; Resize ((uint) terms.Count + 1, NColumns); Attach (row.FieldChooser, 0, 1, NRows - 1, NRows); Attach (row.OpChooser, 1, 2, NRows - 1, NRows); Attach (row.ValueEntry, 2, 3, NRows - 1, NRows); Attach (row.Buttons, 3, 4, NRows - 1, NRows); if (terms.Count > 0) { row.FieldChooser.Active = terms[terms.Count - 1].FieldChooser.Active; row.OpChooser.Active = terms[terms.Count - 1].OpChooser.Active; } row.Show (); row.CanDelete = canDelete; row.AddRequest += OnRowAddRequest; row.RemoveRequest += OnRowRemoveRequest; if (terms.Count == 0) { //row.FieldBox.GrabFocus (); } terms.Add (row); return row; }