private void RenderUserLinesTime(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { userLine line = (userLine)model.GetValue(iter, 0); (cell as Gtk.CellRendererText).Text = line.m_time.ToString(); }
private void RenderUserLinesLoop(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { userLine line = (userLine)model.GetValue(iter, 0); (cell as Gtk.CellRendererToggle).Active = line.m_loop; }
private void RenderUserLinesRss(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { userLine line = (userLine)model.GetValue(iter, 0); (cell as Gtk.CellRendererText).Text = line.m_rss_url; }
private void rssCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); line.m_rss_url = args.NewText; }
public int CompareTo(object obj) { if (obj is userLine) { userLine line = (userLine)obj; return(m_number.CompareTo(line.m_number)); } throw new ArgumentException("object is not a userLine"); }
private void set_line_active(userLine line) { led_matrix.led_matrix_string = line.m_code; led_matrix.rss.url = line.m_rss_url; line.m_active = true; if (line.m_time != 0) { loop_timer.Interval = line.m_time * 1000; } treeview2.QueueDraw(); }
private void codeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); line.m_code = args.NewText; set_lines_inactive(); set_line_active(line); }
private void timeCellEdited(object o, Gtk.EditedArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); try { int.TryParse(args.NewText, out line.m_time); } catch (Exception) { } }
private bool treemode_foreach_func(Gtk.TreeModel model, Gtk.TreePath path, Gtk.TreeIter iter) { userLine line = (userLine)model.GetValue(iter, 0); softwareKey = rootKey.CreateSubKey(@"SOFTWARE\Mono.mLedMatrix\lines\" + line.m_name); softwareKey.SetValue("name", line.m_name); softwareKey.SetValue("code", line.m_code); softwareKey.SetValue("active", line.m_active); softwareKey.SetValue("rss", line.m_rss_url); softwareKey.SetValue("loop", line.m_loop); softwareKey.SetValue("time", line.m_time); softwareKey.SetValue("num", line.m_number); return(false); // run loop further }
private void HandleLoopCellToggled(object o, Gtk.ToggledArgs args) { Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); if (line.m_loop) { line.m_loop = false; } else { line.m_loop = true; } }
void HandleTreeview2KeyPressEvent(object o, KeyPressEventArgs args) { Gtk.TreeSelection selection = (o as Gtk.TreeView).Selection; Gtk.TreeIter iter; Gtk.TreeModel model; if (selection.GetSelected(out model, out iter)) { userLine line = (userLine)model.GetValue(iter, 0); if (args.Event.HardwareKeycode == 119) // DEL { Console.WriteLine("Removing " + line.m_name); user_lines.Remove((userLine)model.GetValue(iter, 0)); treeview_lines_store.Remove(ref iter); } } if (args.Event.HardwareKeycode == 57) // n { userLine line = new userLine("", false, "", "", user_lines.Count + 1, false, 0); treeview_lines_store.AppendValues(line); user_lines.Add(line); } }
private void HandleActiveCellToggled(object o, Gtk.ToggledArgs args) { bool state; Gtk.TreeIter iter; treeview_lines_store.GetIter(out iter, new Gtk.TreePath(args.Path)); userLine line = (userLine)treeview_lines_store.GetValue(iter, 0); state = line.m_active; foreach (userLine foo in user_lines) { foo.m_active = false; } if (state) { line.m_active = false; } else { set_line_active(line); } }
private void set_line_active(userLine line) { led_matrix.led_matrix_string = line.m_code; rss.url = line.m_rss_url; line.m_active = true; if(line.m_time != 0) loop_timer.Interval = line.m_time*1000; treeview2.QueueDraw(); }
void HandleTreeview2KeyPressEvent(object o, KeyPressEventArgs args) { Gtk.TreeSelection selection = (o as Gtk.TreeView).Selection; Gtk.TreeIter iter; Gtk.TreeModel model; if(selection.GetSelected(out model, out iter)) { userLine line = (userLine)model.GetValue (iter, 0); if(args.Event.HardwareKeycode == 119) // DEL { Console.WriteLine("Removing "+line.m_name); user_lines.Remove((userLine)model.GetValue (iter, 0)); treeview_lines_store.Remove(ref iter); } } if(args.Event.HardwareKeycode == 57) // n { userLine line = new userLine("",false,"","",user_lines.Count+1,false,0); treeview_lines_store.AppendValues(line); user_lines.Add (line); } }