예제 #1
0
        private void RenderAnalysis2Cell(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            MyTreeNode node = (MyTreeNode)model.GetValue(iter, 0);

            (cell as Gtk.CellRendererText).CellBackground = node.color;
            (cell as Gtk.CellRendererText).Text           = node.analysis2;
            (cell as Gtk.CellRendererText).Family         = "DejaVu Sans";
            (cell as Gtk.CellRendererText).Size           = node.analysisSize;
        }
예제 #2
0
        private void RenderInputCell(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            MyTreeNode node = (MyTreeNode)model.GetValue(iter, 0);

            (cell as Gtk.CellRendererText).CellBackground = node.color;
            (cell as Gtk.CellRendererText).Text           = node.input;
            (cell as Gtk.CellRendererText).Weight         = node.inputBold;
            (cell as Gtk.CellRendererText).Family         = "DejaVu Sans";
            (cell as Gtk.CellRendererText).Size           = node.inputSize;
        }
예제 #3
0
        public void AddToTextView(List <String> s, String color)
        {
            MyTreeNode node = new MyTreeNode(s.ElementAt(0), Functions.SpliceText(s.ElementAt(1), 20, @"\s"), s.ElementAt(2),
                                             Functions.SpliceText(s.ElementAt(3), 60, @"\s"));

            node.color = color;
            Gtk.TreeIter iter = treeStore.AppendValues(node);
            TreePath     path = treeStore.GetPath(iter);

            tree.ScrollToCell(path, null, true, 0, 0);

            while (Application.EventsPending())
            {
                Application.RunIteration();
            }
        }
예제 #4
0
        /// <summary>
        /// SoundChangeRule zum TextView hinzufügen.
        /// </summary>
        public void AddToTextView(SoundChangeRule scr, List <Change> lastChanges, int multiPathNum)
        {
            TreePath path;

            Gtk.TreeIter iter;

            /* MultiPath */
            if (multiPathNum != 0)
            {
                MyTreeNode multiPathNode = new MyTreeNode("", "\u2502 (" + Functions.ToRoman(multiPathNum) + ")", "", "");
                multiPathNode.color     = "Honeydew";
                multiPathNode.inputBold = 600;
                multiPathNode.inputSize = Convert.ToInt32(10 * Pango.Scale.PangoScale);
                iter = treeStore.AppendValues(multiPathNode);
                path = treeStore.GetPath(iter);
                tree.ScrollToCell(path, null, true, 0, 0);
            }

            /* Id + Name = IterNode */
            List <String> idName = scr.PrintShort();

            MyTreeNode idNameNode = new MyTreeNode(idName.ElementAt(0), Functions.SpliceText(idName.ElementAt(1), 20, @"\s"),
                                                   Functions.SpliceText(idName.ElementAt(2), 50, @","),
                                                   Functions.SpliceText(idName.ElementAt(3), 60, @"\s"));

            idNameNode.color = "Honeydew";
            iter             = treeStore.AppendValues(idNameNode);
            path             = treeStore.GetPath(iter);
            tree.ScrollToCell(path, null, true, 0, 0);

            /* Attribute */
            bool grey = false;

            List <List <String> > printList = scr.Print(lastChanges);

            foreach (List <string> line in printList)
            {
                MyTreeNode node = new MyTreeNode(line.ElementAt(0), Functions.SpliceText(line.ElementAt(1), 20, @"\s"),
                                                 Functions.SpliceText(line.ElementAt(2), 50, @","),
                                                 Functions.SpliceText(line.ElementAt(3), 60, @"\s"));
                if (grey == false)
                {
                    node.color = "white";
                    grey       = true;
                }
                else
                {
                    node.color = "Gray98";
                    grey       = false;
                }
                treeStore.AppendValues(iter, node);
                path = treeStore.GetPath(iter);
                tree.ScrollToCell(path, null, true, 0, 0);
            }

            /* Pfeilspitze */
            MyTreeNode arrowNode = new MyTreeNode("", "\u25bc", "", "");

            arrowNode.color = "Honeydew";
            iter            = treeStore.AppendValues(arrowNode);
            path            = treeStore.GetPath(iter);
            tree.ScrollToCell(path, null, true, 0, 0);

            while (Application.EventsPending())
            {
                Application.RunIteration();
            }
        }
예제 #5
0
        /// <summary>
        /// Wordform zum TextView hinzufügen.
        /// </summary>
        public void AddToTextView(Wordform wf, bool changed, String comment, String color, String arrowType, String lang)
        {
            TreePath path;

            /* Wortform + IPA  = IterNode */
            List <string> shortLine = new List <string>(wf.PrintShort(comment, ""));
            MyTreeNode    shortNode = new MyTreeNode(arrowType, Functions.SpliceText(shortLine.ElementAt(1), 20, @"\s"), shortLine.ElementAt(2),
                                                     Functions.SpliceText(shortLine.ElementAt(3), 60, @"\s"));

            shortNode.color = color;
            if (changed == false)
            {
                shortNode.inputBold = 600;
                shortNode.inputSize = Convert.ToInt32(10 * Pango.Scale.PangoScale);
            }
            Gtk.TreeIter iter = treeStore.AppendValues(shortNode);
            path = treeStore.GetPath(iter);
            tree.ScrollToCell(path, null, true, 0, 0);

            /* Attribute */
            bool grey = false;

            if (changed == true)
            {
                foreach (List <string> line in wf.PrintChanged())
                {
                    MyTreeNode node = new MyTreeNode(line.ElementAt(0), Functions.SpliceText(line.ElementAt(1), 20, @"\s"), line.ElementAt(2),
                                                     Functions.SpliceText(line.ElementAt(3), 60, @"\s"));
                    if (grey == false)
                    {
                        node.color = "white";
                        grey       = true;
                    }
                    else
                    {
                        node.color = "Gray98";
                        grey       = false;
                    }
                    treeStore.AppendValues(iter, node);
                    path = treeStore.GetPath(iter);
                    tree.ScrollToCell(path, null, true, 0, 0);
                }

                treeStore.AppendValues(iter, new MyTreeNode("", "", "", ""));
                path = treeStore.GetPath(iter);
                tree.ScrollToCell(path, null, true, 0, 0);
            }
            else
            {
                List <List <String> > print = new List <List <string> >();

                if (lang == "lang1")
                {
                    print = wf.Print();
                }
                else
                {
                    print = wf.PrintLang2();
                }

                foreach (List <string> line in print)
                {
                    MyTreeNode node = new MyTreeNode(line.ElementAt(0), Functions.SpliceText(line.ElementAt(1), 20, @"\s"), line.ElementAt(2),
                                                     Functions.SpliceText(line.ElementAt(3), 60, @"\s"));
                    if (grey == false)
                    {
                        node.color = "white";
                        grey       = true;
                    }
                    else
                    {
                        node.color = "Gray98";
                        grey       = false;
                    }
                    treeStore.AppendValues(iter, node);
                    path = treeStore.GetPath(iter);
                    tree.ScrollToCell(path, null, true, 0, 0);
                }

                treeStore.AppendValues(iter, new MyTreeNode("", "", "", ""));
                path = treeStore.GetPath(iter);
                tree.ScrollToCell(path, null, true, 0, 0);
            }

            while (Application.EventsPending())
            {
                Application.RunIteration();
            }
        }