コード例 #1
0
    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();
    }
コード例 #2
0
    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;
    }
コード例 #3
0
    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;
    }
コード例 #4
0
    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;
    }
コード例 #5
0
    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");
    }
コード例 #6
0
 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();
 }
コード例 #7
0
    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);
    }
コード例 #8
0
    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)
        {
        }
    }
コード例 #9
0
ファイル: MainWindow.cs プロジェクト: mechatronic/mLedMatrix
    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
    }
コード例 #10
0
    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;
        }
    }
コード例 #11
0
    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);
        }
    }
コード例 #12
0
    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);
        }
    }
コード例 #13
0
ファイル: MainWindow.cs プロジェクト: mechatronic/mLedMatrix
 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();
 }
コード例 #14
0
ファイル: MainWindow.cs プロジェクト: mechatronic/mLedMatrix
    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);
        }
    }