Exemplo n.º 1
0
        public void hover(int xmouse, int ymouse)
        {
            if (current != null)
            {
                current.defaultLabel();
            }
            var lab = this.labels.First(x => (xmouse >= x.x && (xmouse <= x.x + x.width)) && (ymouse >= x.y && (ymouse <= x.y + x.height)));

            if (lab != null)
            {
                lab.hoverLabel();
                current = lab;
            }
        }
Exemplo n.º 2
0
        public void refreshListe()
        {
            this.Clear();
            var allelems = new Label();

            allelems.Content    = $"Nombres éléments(R)({GraphReader.Count(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son)}) : ";
            allelems.FontSize   = 14;
            allelems.FontWeight = FontWeights.Bold;
            labels.Add(new Engine.Liste(allelems, 0, 0));
            Canvas.SetTop(allelems, y);
            Canvas.SetLeft(allelems, x);
            canvas.Children.Add(allelems);

            var all = new List <Information>();

            GraphReader.getPtr(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son, ref all);
            y += 5;
            foreach (var result in all.Where(x => x.type != -1).ToList())
            {
                y += 20;
                var lab = new Label();
                lab.Content  = $"{ Configuration.types[result.type]} : { result.name}";
                lab.FontSize = 14;
                lab.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
                Rect measureRect = new Rect(lab.DesiredSize);
                lab.Arrange(measureRect);
                var liste = new Liste(lab, measureRect.Width, measureRect.Height);
                liste.setPosition((int)x, (int)y);
                liste.id = result.id;

                labels.Add(liste);
                Canvas.SetTop(liste.label, y);
                Canvas.SetLeft(liste.label, x);
                canvas.Children.Add(liste.label);
            }
            y += 20;

            var nelems = new Label();

            nelems.Content    = $"Nombres éléments({GraphReader.CountNext(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son)}) : ";
            nelems.FontSize   = 14;
            nelems.FontWeight = FontWeights.Bold;
            labels.Add(new Engine.Liste(nelems, 0, 0));
            Canvas.SetTop(nelems, y);
            Canvas.SetLeft(nelems, x);
            canvas.Children.Add(nelems);
            all = GraphReader.getElementList(GraphReader.Element(Kernel.getElement(middle.getCurrent())).son);
            foreach (var result in all.Where(x => x.type != -1).ToList())
            {
                y += 20;

                var lab = new Label();
                lab.Content  = $"{ Configuration.types[result.type]} : { result.name}";
                lab.FontSize = 14;
                lab.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
                Rect measureRect = new Rect(lab.DesiredSize);
                lab.Arrange(measureRect);
                var liste = new Liste(lab, measureRect.Width, measureRect.Height);
                liste.setPosition((int)x, (int)y);
                liste.id = result.id;

                labels.Add(liste);
                Canvas.SetTop(liste.label, y);
                Canvas.SetLeft(liste.label, x);
                canvas.Children.Add(liste.label);
            }
        }