Ejemplo n.º 1
0
        void OnToggled(object s, Gtk.ToggledArgs args)
        {
            Gtk.TreeIter iter;
            if (!store.GetIterFromString(out iter, args.Path))
            {
                return;
            }

            bool  oldValue = (bool)store.GetValue(iter, 0);
            ulong flag     = (ulong)store.GetValue(iter, 2);

            if (oldValue)
            {
                flags &= ~flag;
            }
            else
            {
                if (flag == 0)
                {
                    flags = 0;
                }
                else
                {
                    flags |= flag;
                }
            }

            store.GetIterFirst(out iter);
            foreach (object value in values)
            {
                ulong val = Convert.ToUInt64(value);
                store.SetValue(iter, 0, (flags == 0 && val == 0) || ((flags & val) != 0));
                store.IterNext(ref iter);
            }
        }
Ejemplo n.º 2
0
        private void OnNormalPackageToggled(object sender, Gtk.ToggledArgs args)
        {
            Gtk.TreeIter iter;
            bool         old = true;
            string       name;
            string       version;

            if (normalPackageListStore.GetIter(out iter, new Gtk.TreePath(args.Path)))
            {
                old = (bool)normalPackageListStore.GetValue(iter, 0);
                normalPackageListStore.SetValue(iter, 0, !old);
            }

            name    = (string)normalPackageListStore.GetValue(iter, 1);
            version = (string)normalPackageListStore.GetValue(iter, 2);

            if (old == false)
            {
                selectedPackagesListStore.AppendValues(name, version);
                selectedPackages.Add(new ProjectPackage(name));
            }
            else
            {
                Gtk.TreeIter search_iter;
                bool         has_elem = selectedPackagesListStore.GetIterFirst(out search_iter);

                if (has_elem)
                {
                    while (true)
                    {
                        string current = (string)selectedPackagesListStore.GetValue(search_iter, 0);

                        if (current.Equals(name))
                        {
                            selectedPackagesListStore.Remove(ref search_iter);
                            foreach (ProjectPackage p in selectedPackages)
                            {
                                if (p.Name == name)
                                {
                                    selectedPackages.Remove(p);
                                    break;
                                }
                            }

                            break;
                        }

                        if (!selectedPackagesListStore.IterNext(ref search_iter))
                        {
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 void OnAfterToggled(object o, Gtk.ToggledArgs args)
 {
     Gtk.TreeIter it;
     if (store.GetIterFromString(out it, args.Path))
     {
         Signal signal = GetSignal(it);
         if (signal != null)
         {
             internalChange = true;
             signal.After   = !signal.After;
             internalChange = false;
             store.SetValue(it, ColAfter, signal.After);
         }
     }
 }
        void OnToggled(object s, Gtk.ToggledArgs args)
        {
            Gtk.TreeIter iter;
            if (!store.GetIterFromString(out iter, args.Path))
            {
                return;
            }

            bool oldValue = (bool)store.GetValue(iter, 0);
            uint flag     = (uint)store.GetValue(iter, 2);

            store.SetValue(iter, 0, !oldValue);

            if (oldValue)
            {
                flags &= ~flag;
            }
            else
            {
                flags |= flag;
            }
        }
Ejemplo n.º 5
0
        void HandleToggled(object o, Gtk.ToggledArgs args)
        {
            int column = columns.IndexOf(o);

            Gtk.TreeIter iter;

            if (Tree.Model.GetIterFromString(out iter, args.Path))
            {
                bool val = (bool)Tree.Model.GetValue(iter, column);
                Tree.Model.SetValue(iter, column, !val);

                VirtualGridRow row = getGridRow(iter);
                if (row != null)
                {
                    String colname = row.getColumnName(column);
                    row.setData(colname, !val, true);
                    if (Toggled != null)
                    {
                        Toggled(this, new RowChangedEventArgs(row, colname));
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public void HandleEndCellEditing(object o, Gtk.ToggledArgs args)
 {
     Handler.Source.EndCellEditing(new Gtk.TreePath(args.Path), Handler.ColumnIndex);
 }
Ejemplo n.º 7
0
 public void HandleToggled(object o, Gtk.ToggledArgs args)
 {
     Handler.SetValue(args.Path, !Handler.Control.Active);
 }
Ejemplo n.º 8
0
 protected void OnHideForwadersToggled(object o, Gtk.ToggledArgs args)
 {
     vboxForwarders.Visible = hideForwaders.ArrowDirection == Gtk.ArrowType.Down;
 }