private void SelectNode(Node node)
 {
     if (node != null)
     {
         TreeIter topIter;
         TreeIter nodeIter;
         userListStore.GetIterFirst(out topIter);
         if (userListStore.IterIsValid(topIter))
         {
             do
             {
                 if (userListStore.IterChildren(out nodeIter, topIter))
                 {
                     do
                     {
                         Node currentNode = (Node)userListStore.GetValue(nodeIter, 0);
                         if (currentNode == node)
                         {
                             userList.Selection.SelectIter(nodeIter);
                             return;
                         }
                     } while (userListStore.IterNext(ref nodeIter));
                 }
             } while (userListStore.IterNext(ref topIter));
         }
     }
     else
     {
         userList.Selection.UnselectAll();
     }
 }
    void ItemToggled(int columnThis, int columnOther, object o, ToggledArgs args)
    {
        TreeIter iter;

        if (store.GetIter(out iter, new TreePath(args.Path)))
        {
            bool val = (bool)store.GetValue(iter, columnThis);
            LogB.Information(string.Format("toggled {0} with value {1}", args.Path, !val));

            if (args.Path == "0")
            {
                if (store.GetIterFirst(out iter))
                {
                    val = (bool)store.GetValue(iter, columnThis);
                    store.SetValue(iter, columnThis, !val);
                    store.SetValue(iter, columnOther, val);
                    while (store.IterNext(ref iter))
                    {
                        store.SetValue(iter, columnThis, !val);
                        store.SetValue(iter, columnOther, val);
                    }
                }
            }
            else
            {
                store.SetValue(iter, columnThis, !val);
                store.SetValue(iter, columnOther, val);
                //usnelect "all" checkboxes
                store.GetIterFirst(out iter);
                store.SetValue(iter, columnThis, false);
                store.SetValue(iter, columnOther, false);
            }
        }
    }
        bool GetNodeBranch(TreeIter parent, string name, ExtensionNodeSet nset, out TreeIter citer, out ExtensionNodeSet cset)
        {
            TreeIter iter;
            bool     more;

            if (!parent.Equals(TreeIter.Zero))
            {
                more = store.IterChildren(out iter, parent);
            }
            else
            {
                more = store.GetIterFirst(out iter);
            }

            if (more)
            {
                do
                {
                    if (((string)store.GetValue(iter, ColLabel)) == name)
                    {
                        ExtensionNodeDescription node = (ExtensionNodeDescription)store.GetValue(iter, ColObject);
                        ExtensionNodeType        nt   = nset.GetAllowedNodeTypes() [node.NodeName];
                        cset  = nt;
                        citer = iter;
                        return(true);
                    }
                } while (store.IterNext(ref iter));
            }
            citer = iter;
            cset  = null;
            return(false);
        }
Example #4
0
        void Update()
        {
            localDiff.diffRequested = false;
            localDiff.difs          = null;

            filestore.Clear();
            diffRenderer.Reset();

            if (changeSet == null)
            {
                Sensitive = false;
                return;
            }

            Sensitive = true;

            foreach (ChangeSetItem n in changeSet.Items)
            {
                AppendFileInfo(n);
            }

            UpdateControlStatus();
            if (firstLoad)
            {
                TreeIter it;
                if (filestore.GetIterFirst(out it))
                {
                    filelist.Selection.SelectIter(it);
                }
                firstLoad = false;
            }
        }
    private void markSelected(string selected)
    {
        Gtk.TreeIter iter;
        bool         okIter = store.GetIterFirst(out iter);

        if (okIter)
        {
            int i = 0;
            if (selected == Catalog.GetString("All"))
            {
                do
                {
                    if (!Util.FoundInArrayList(nonSensitiveRows, i))
                    {
                        store.SetValue(iter, 1, true);
                    }
                    i++;
                } while (store.IterNext(ref iter));
            }
            else if (selected == Catalog.GetString("Invert"))
            {
                bool val;
                do
                {
                    if (!Util.FoundInArrayList(nonSensitiveRows, i))
                    {
                        val = (bool)store.GetValue(iter, 1);
                        store.SetValue(iter, 1, !val);
                    }
                    i++;
                } while (store.IterNext(ref iter));
            }
            else if (selected == Catalog.GetString("None"))
            {
                do
                {
                    store.SetValue(iter, 1, false);
                } while (store.IterNext(ref iter));
            }
            else                        //encoderExercises
            {
                do
                {
                    if (selected == (string)store.GetValue(iter, 3) &&
                        !Util.FoundInArrayList(nonSensitiveRows, i))
                    {
                        store.SetValue(iter, 1, true);
                    }
                    else
                    {
                        store.SetValue(iter, 1, false);
                    }
                    i++;
                } while (store.IterNext(ref iter));
            }
        }

        //check if there are rows checked for having sensitive or not in recuperate button
        //buttonRecuperateChangeSensitiveness();
    }
        public void Clear()
        {
            TreeIter it;

            while (store.GetIterFirst(out it))
            {
                store.Remove(ref it);
            }
        }
Example #7
0
        void Refilter()
        {
            keyTreeView.Model = null;
            TreeIter iter;
            bool     allVisible = processedFilterTerms == null || processedFilterTerms.Length == 0;

            if (keyStore.GetIterFirst(out iter))
            {
                Refilter(iter, allVisible);
            }
            keyTreeView.Model = filterModel;
            keyTreeView.ExpandAll();
            keyTreeView.ColumnsAutosize();
        }
        void ToggleAll(bool isToggled)
        {
            TreeIter itr;

            if (!store.GetIterFirst(out itr))
            {
                return;
            }

            do
            {
                store.SetValue(itr, 0, isToggled);
            } while (store.IterNext(ref itr));
        }
Example #9
0
        void on_button_imprimir_notas_clicked(object sender, EventArgs args)
        {
            string numeros_seleccionado    = "";
            string almacenes_seleccionados = "";
            string variable_paso_03        = "";
            int    variable_paso_02_1      = 0;
            string query_in_num            = "";

            //poder elegir una fila del treeview
            TreeIter iter;

            if (treeViewEngineListaNotas.GetIterFirst(out iter))
            {
                if ((bool)treeview_listanotas.Model.GetValue(iter, 0) == true)
                {
                    numeros_seleccionado = (string)treeview_listanotas.Model.GetValue(iter, 1);
                    variable_paso_02_1  += 1;
                }
                while (treeViewEngineListaNotas.IterNext(ref iter))
                {
                    if ((bool)treeview_listanotas.Model.GetValue(iter, 0) == true)
                    {
                        if (variable_paso_02_1 == 0)
                        {
                            numeros_seleccionado = (string)treeview_listanotas.Model.GetValue(iter, 1);
                            variable_paso_02_1  += 1;
                        }
                        else
                        {
                            variable_paso_03     = (string)treeview_listanotas.Model.GetValue(iter, 1);
                            numeros_seleccionado = numeros_seleccionado.Trim() + "','" + variable_paso_03.Trim();
                        }
                    }
                }
            }
            if (variable_paso_02_1 > 0)
            {
                query_in_num = " AND id_secuencia IN('" + numeros_seleccionado + "') ";
            }
            if (treeViewEngineListaNotas.GetIterFirst(out iter))
            {
                if (variable_paso_02_1 > 0)
                {
                    Console.WriteLine(query_in_num);
                    new osiris.rpt_notas_medicas(folioservicio, name_field, sql_general + sql_pidpaciente + sql_folioservicio + sql_filtronotasblanco + query_in_num + " ORDER BY to_char(fecha_anotacion,'yyyy-MM-dd'),hora_anotacion DESC;", diagnosticoadmision);
                }
            }
        }
Example #10
0
        void UpdateThreads(ThreadInfo activeThread)
        {
            TreeIter iter;

            if (!store.GetIterFirst(out iter))
            {
                return;
            }

            do
            {
                var thread = store.GetValue(iter, (int)Columns.Object) as ThreadInfo;

                if (thread == null)
                {
                    store.SetValue(iter, (int)Columns.Weight, (int)(((ProcessInfo)store.GetValue(iter, (int)Columns.Object)).GetThreads().Contains(activeThread) ? Pango.Weight.Bold : Pango.Weight.Normal));
                    var sessionActiveThread = ((DebuggerSession)store.GetValue(iter, (int)Columns.Session)).ActiveThread;
                    // this is a process... descend into our children
                    TreeIter child;

                    if (store.IterChildren(out child, iter))
                    {
                        do
                        {
                            thread = store.GetValue(child, (int)Columns.Object) as ThreadInfo;
                            UpdateThread(child, thread, sessionActiveThread);
                        } while (store.IterNext(ref child));
                    }
                }
                else
                {
                    UpdateThread(iter, thread, activeThread);
                }
            } while (store.IterNext(ref iter));
        }
        TreeIter AddAddin(AddinDescription adesc)
        {
            TreeIter it;

            if (store.GetIterFirst(out it))
            {
                do
                {
                    if ((string)store.GetValue(it, ColAddin) == adesc.AddinId)
                    {
                        return(it);
                    }
                }while (store.IterNext(ref it));
            }
            if (adesc != this.adesc)
            {
                string txt = GLib.Markup.EscapeText(adesc.Name);
                return(store.AppendValues(txt, adesc.AddinId, null, null, pixAddin, true, null));
            }
            else
            {
                string txt = AddinManager.CurrentLocalizer.GetString("Local extension points");
                return(store.AppendValues(txt, adesc.AddinId, null, null, pixLocalAddin, true, null));
            }
        }
Example #12
0
        private void RefreshFolderView(TreeIter parent)
        {
            folderStore.Clear();

            TreeIter child;

            if (TreeIter.Zero.Equals(parent))
            {
                packStore.GetIterFirst(out child);
            }
            else
            {
                packStore.IterChildren(out child, parent);

                Packer.Item root = new Packer.Item(true);
                folderStore.AppendValues(root.IsFolder ? folderIcon : fileIcon, root.Name, root);
            }

            if (!TreeIter.Zero.Equals(child))
            {
                do
                {
                    Packer.Item item = packStore.GetValue(child, 0) as Packer.Item;
                    folderStore.AppendValues(item.IsFolder ? folderIcon : fileIcon, item.Name, item);
                }while (packStore.IterNext(ref child));
            }
        }
Example #13
0
        void UpdateThreads(ThreadInfo activeThread)
        {
            TreeIter iter;

            if (!store.GetIterFirst(out iter))
            {
                return;
            }

            do
            {
                var thread = store.GetValue(iter, (int)Columns.Object) as ThreadInfo;

                if (thread == null)
                {
                    // this is a process... descend into our children
                    TreeIter child;

                    if (store.IterChildren(out child))
                    {
                        do
                        {
                            thread = store.GetValue(iter, (int)Columns.Object) as ThreadInfo;
                            UpdateThread(child, thread, activeThread);
                        } while (store.IterNext(ref child));
                    }
                }
                else
                {
                    UpdateThread(iter, thread, activeThread);
                }
            } while (store.IterNext(ref iter));
        }
        void TraverseSubtree(TreeIter iter, Action <TreeIter> action)
        {
            TreeIter newIter;

            if (!iter.Equals(TreeIter.Zero))
            {
                if (!store.IterChildren(out newIter, iter))
                {
                    return;
                }
            }
            else
            {
                if (!store.GetIterFirst(out newIter))
                {
                    return;
                }
            }
            do
            {
                action(newIter);
                if (store.IterHasChild(newIter))
                {
                    TraverseSubtree(newIter, action);
                }
            } while (store.IterNext(ref newIter));
        }
Example #15
0
 void ReparentOrphans()
 {
     Gtk.TreeIter iter;
     Gtk.TreeIter parentIter = Gtk.TreeIter.Zero;
     TreeStore.GetIterFirst(out iter);
     do
     {
         var orphan = (ChatView)TreeStore.GetValue(iter, 0);
         if (orphan is SessionChatView ||
             orphan is ProtocolChatView)
         {
             continue;
         }
         if (TreeStore.IterParent(out parentIter, iter))
         {
             // already has an parent
             continue;
         }
         // no parent, let's find one!
         parentIter = FindProtocolChatIter(orphan);
         if (!TreeStore.IterIsValid(parentIter))
         {
             continue;
         }
         // found a parent \o/
         TreeStore.Remove(ref iter);
         TreeStore.AppendValues(parentIter, orphan);
         var parentPath = TreeStore.GetPath(parentIter);
         ExpandRow(parentPath, true);
         // reset iter to first as we changed the store and thus can't
         // continue the iteration
         TreeStore.GetIterFirst(out iter);
     } while (TreeStore.IterNext(ref iter));
 }
Example #16
0
        void SelectActiveRuntime()
        {
            ignoreRuntimeChangedCount++;

            try {
                TreeIter iter;

                if (runtimeStore.GetIterFirst(out iter))
                {
                    ExecutionTarget defaultTarget = null;
                    TreeIter        defaultIter   = TreeIter.Zero;
                    bool            selected      = false;

                    if (!SelectActiveRuntime(iter, ref selected, ref defaultTarget, ref defaultIter) && !selected)
                    {
                        if (defaultTarget != null)
                        {
                            IdeApp.Workspace.ActiveExecutionTarget = defaultTarget;
                            runtimeCombo.SetActiveIter(defaultIter);
                        }
                        UpdateBuildConfiguration();
                    }
                }
            } finally {
                ignoreRuntimeChangedCount--;
            }
        }
Example #17
0
        public ContentDirectoryInfo(RemoteContentDirectory contentDirectory)
        {
            if (contentDirectory == null)
            {
                throw new ArgumentNullException("contentDirectory");
            }

            this.content_directry = contentDirectory;
            this.store            = new TreeStore(typeof(ObjectRow));
            var objects = new TreeView();
            var column  = new TreeViewColumn();
            var cell    = new CellRendererText();

            column.PackStart(cell, true);
            column.SetCellDataFunc(cell, RenderObject);
            column.Title = "Objects";
            objects.AppendColumn(column);
            objects.Selection.Changed += HandleObjectsSelectionChanged;
            objects.RowExpanded       += HandleObjectsRowExpanded;
            objects.Model              = store;

            var root = contentDirectory.GetRootObject();

            store.AppendValues(new ObjectRow(root));
            TreeIter iter;

            store.GetIterFirst(out iter);
            store.AppendValues(iter, loading);

            Add(objects);
        }
        void SelectActiveRuntime()
        {
            runtimeCombo.Changed -= HandleRuntimeChanged;
            var i = 0;

            Gtk.TreeIter iter;
            if (runtimeStore.GetIterFirst(out iter))
            {
                do
                {
                    var val = (ExecutionTarget)runtimeStore.GetValue(iter, 2);
                    if (val.Id == IdeApp.Workspace.PreferredActiveExecutionTarget)
                    {
                        runtimeCombo.Active = i;
                        break;
                    }
                    i++;
                }while (runtimeStore.IterNext(ref iter));
            }
            if (runtimeCombo.Active == -1)
            {
                runtimeCombo.Active = 0;
            }
            runtimeCombo.Changed += HandleRuntimeChanged;
        }
Example #19
0
        public ObjectWindow(RuntimeThread runtimeThread, object root)
            : base(GetTitle(root))
        {
            SetDefaultSize(250, 300);
            SkipPagerHint   = true;
            SkipTaskbarHint = true;

            scroller             = new ScrolledWindow();
            scroller.BorderWidth = 5;
            scroller.ShadowType  = ShadowType.In;
            Add(scroller);

            store = new TreeStore(typeof(string), typeof(object), typeof(bool));

            //TreeModelSort storeSort = new TreeModelSort(store);
            //storeSort.SetSortColumnId(0, SortType.Ascending);

            view = new TreeView(store);
            view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
            view.HeadersVisible = false;
            view.RowExpanded   += OnTreeRowExpanded;
            view.RowCollapsed  += OnTreeRowCollapsed;
            scroller.Add(view);

            Add(false, new TreeIter(), "", root, false, false);

            TreeIter first;

            store.GetIterFirst(out first);
            view.ExpandRow(store.GetPath(first), false);
        }
Example #20
0
        public virtual void ToggleAll(bool active)
        {
            TreeIter current;

            store.GetIterFirst(out current);
            ToggleAll(current, active);
        }
Example #21
0
    //----- treeeview_load (end)


    private void initializeShowJustOrder(int rowNumber)
    {
        //know if "serie" has to be plotted or not
        ExecuteAuto eaFirst = (ExecuteAuto)orderedData[0];

        createTreeviewResult(eaFirst.serieID != -1);            //BY_SETS != -1
        fillTreeviewResult();

        //set the selected
        TreeIter iter;
        bool     iterOk = store_result.GetIterFirst(out iter);

        if (iterOk)
        {
            int count = 0;
            while (count < rowNumber)
            {
                store_result.IterNext(ref iter);
                count++;
            }
            treeview_result.Selection.SelectIter(iter);
        }


        button_cancel.Label = Catalog.GetString("Close");
        button_next.Visible = false;

        notebook_main.CurrentPage = 2;
    }
Example #22
0
        Gtk.TreePath GetPath(int rowNumber)
        {
            Gtk.TreeIter iter;
            TreeStore.GetIterFirst(out iter);
            var path = TreeStore.GetPath(iter);
            // TODO: clamp upper limit
            int i;

            for (i = 0; rowNumber >= 0 && i < rowNumber; i++)
            {
                TreeStore.GetIter(out iter, path);
                if (TreeStore.IterHasChild(iter))
                {
                    path.Down();
                }
                else
                {
                    path.Next();

                    TreeStore.GetIter(out iter, path);
                    if (!TreeStore.IterIsValid(iter))
                    {
                        // reached last row
                        path.Up();
                        path.Next();
                    }
                }
            }
            return(path);
        }
Example #23
0
 void ReparentOrphans()
 {
     Gtk.TreeIter iter;
     Gtk.TreeIter parentIter = Gtk.TreeIter.Zero;
     TreeStore.GetIterFirst(out iter);
     do
     {
         var orphan = (ChatView)TreeStore.GetValue(iter, 0);
         if (orphan is SessionChatView ||
             orphan is ProtocolChatView)
         {
             continue;
         }
         if (TreeStore.IterParent(out parentIter, iter))
         {
             // already has an parent
             continue;
         }
         // no parent, let's find one!
         parentIter = FindProtocolChatIter(orphan);
         if (!TreeStore.IterIsValid(parentIter))
         {
             continue;
         }
         // found a parent \o/
         TreeStore.Remove(ref iter);
         TreeStore.AppendValues(parentIter, orphan);
     } while (TreeStore.IterNext(ref iter));
 }
        bool RefillOutlineStore()
        {
            DispatchService.AssertGuiThread();
            Gdk.Threads.Enter();
            refreshingOutline = false;
            if (outlineTreeStore == null || !outlineTreeView.IsRealized)
            {
                refillOutlineStoreId = 0;
                return(false);
            }

            outlineReady = false;
            outlineTreeStore.Clear();
            if (lastCU != null)
            {
                BuildTreeChildren(outlineTreeStore, TreeIter.Zero, lastCU);
                TreeIter it;
                if (outlineTreeStore.GetIterFirst(out it))
                {
                    outlineTreeView.Selection.SelectIter(it);
                }
                outlineTreeView.ExpandAll();
            }
            outlineReady = true;

            Gdk.Threads.Leave();

            //stop timeout handler
            refillOutlineStoreId = 0;
            return(false);
        }
Example #25
0
        public void MarkNowPlayingEntry()
        {
            int    itemCount   = _parent.oXbmc.Playlist.GetLength();
            string itemPlaying = _parent.oXbmc.NowPlaying.Get("songno", true);

            if (itemCount > 0 && Convert.ToInt32(itemPlaying) < itemCount)
            {
                Gtk.Image nowPlayingImage = new Gtk.Image();
                Pixbuf    nowPlayingIcon  = nowPlayingImage.RenderIcon(Stock.MediaPlay, IconSize.Menu, "");
                Pixbuf    emptyIcon       = new Pixbuf("images/pixel.gif");

                TreeIter tiNowPLaying   = new TreeIter();
                TreeIter tiPlaylistItem = new TreeIter();

                tsPlaylist.GetIterFirst(out tiPlaylistItem);

                while (tsPlaylist.IterNext(ref tiPlaylistItem))
                {
                    _parent._tvPlaylist.Model.SetValue(tiPlaylistItem, 0, emptyIcon);
                }

                if (tsPlaylist.GetIter(out tiNowPLaying, new TreePath(itemPlaying)) && !_parent.oXbmc.Status.IsNotPlaying())
                {
                    _parent._tvPlaylist.Model.SetValue(tiNowPLaying, 0, nowPlayingIcon);
                }
            }
        }
Example #26
0
    //pass 0 for first row
    public void SelectRow(int rowNumber)
    {
        TreeIter iter;
        bool     iterOk = store.GetIterFirst(out iter);

        if (iterOk)
        {
            int count = 0;
            while (count < rowNumber)
            {
                store.IterNext(ref iter);
                count++;
            }
            treeview.Selection.SelectIter(iter);
        }
    }
 void UpdateSelectionChecks(TreeIter iter, bool expandSelected)
 {
     if (iter.Equals(TreeIter.Zero))
     {
         if (!store.GetIterFirst(out iter))
         {
             return;
         }
     }
     else
     {
         if (!store.IterChildren(out iter, iter))
         {
             return;
         }
     }
     do
     {
         bool sel = selectedEntries.ContainsKey((SolutionItem)store.GetValue(iter, 2));
         store.SetValue(iter, 3, sel);
         if (sel)
         {
             tree.ExpandToPath(store.GetPath(iter));
         }
         UpdateSelectionChecks(iter, expandSelected);
     }while (store.IterNext(ref iter));
 }
Example #28
0
    private double getTotalTime()
    {
        TreeIter myIter;
        double   totalTime = 0;
        bool     iterOk    = store.GetIterFirst(out myIter);

        if (iterOk)
        {
            do
            {
                double myTime = Convert.ToDouble((string)treeview_subevents.Model.GetValue(myIter, 1));
                totalTime += myTime;
            } while (store.IterNext(ref myIter));
        }
        return(totalTime);
    }
        void AddItem(ComponentIndexFile ifile, ItemToolboxNode co)
        {
            Xwt.Drawing.Image img = co.Icon != null?co.Icon.WithSize(16, 16) : null;

            if (showCategories)
            {
                TreeIter it;
                bool     found = false;
                if (store.GetIterFirst(out it))
                {
                    do
                    {
                        if (co.Category == (string)store.GetValue(it, ColName))
                        {
                            found = true;
                            break;
                        }
                    }while (store.IterNext(ref it));
                }
                if (!found)
                {
                    it = store.AppendValues(false, co.Category, string.Empty, string.Empty, string.Empty, null, null, false, (int)Pango.Weight.Bold);
                }
                store.AppendValues(it, currentItems.ContainsKey(co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
            }
            else
            {
                store.AppendValues(currentItems.ContainsKey(co), co.Name, string.Empty, ifile.Name, ifile.Location, img, co, true, (int)Pango.Weight.Normal);
            }
        }
Example #30
0
        private void GenerateTree()
        {
            store = new TreeStore(typeof(SettingPanel), typeof(string), typeof(string), typeof(bool), typeof(bool), typeof(int));

            tvCategory.Model          = store;
            tvCategory.HeadersVisible = false;

            TreeViewColumn     col = new TreeViewColumn();
            CellRendererPixbuf crp = new CellRendererPixbuf();

            crp.StockSize = (uint)IconSize.LargeToolbar;
            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock-id", 1);
            col.AddAttribute(crp, "visible", 3);
            col.AddAttribute(crp, "sensitive", 4);
            CellRendererText crt = new CellRendererText();

            col.PackStart(crt, true);
            col.AddAttribute(crt, "markup", 2);
            col.AddAttribute(crt, "sensitive", 4);

            tvCategory.AppendColumn(col);

            tvCategory.Selection.Changed += OnSelectionChanged;
            FillTree();

            TreeIter it;

            if (store.GetIterFirst(out it))
            {
                tvCategory.Selection.SelectIter(it);
            }
        }