Exemplo n.º 1
0
        private void panelTabela_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            //      g.TranslateTransform(xMargin, yMargin);
            g.ScaleTransform(zoom / 100, zoom / 100);

            PointF pt = panelTabela.AutoScrollPosition;  // vraca negativne koordinate

            pt    = new PointF(pt.X + xMargin, pt.Y + yMargin);
            pt.X /= zoom / 100;
            pt.Y /= zoom / 100;

            foreach (ElementTableItem item in tabela.getElementItems(selectedSprava(), selectedGrupa()))
            {
                item.draw(g, pt);
            }
            if (clipboard != null && clipboard.Sprava == selectedSprava() &&
                clipboard.Grupa == selectedGrupa())
            {
                clipboard.draw(g, pt);
            }
            foreach (ElementTableItem item in tabela.getElementItems(selectedSprava(), selectedGrupa()))
            {
                if (item.Selected)
                {
                    item.draw(g, pt);
                }
            }
        }
Exemplo n.º 2
0
 private void filterItems(Sprava sprava, List <TezinaElementa> tezine, List <GrupaElementa> grupeElemenata)
 {
     items = new List <ElementTableItem>();
     foreach (GrupaElementa grupa in grupeElemenata)
     {
         foreach (ElementTableItem item in tabela.getElementItems(sprava, grupa))
         {
             if (item.Element == null)
             {
                 continue;
             }
             foreach (TezinaElementa tezina in tezine)
             {
                 if (item.Element.Tezina == tezina)
                 {
                     item.Location = new PointF(0.0f, 0.0f);
                     items.Add(item);
                     break;
                 }
             }
         }
     }
 }