Ejemplo n.º 1
0
        private void button17_Click(object sender, EventArgs e)
        {
            var       ww  = r.Next(400) + 10;
            var       hh  = r.Next(400) + 5;
            QntDialog q   = new QntDialog();
            int       src = 0;

            if (polygons.Any())
            {
                src = polygons.Max(z => z.source.Value) + 1;
            }
            if (q.ShowDialog() == DialogResult.OK)
            {
                for (int i = 0; i < q.Qnt; i++)
                {
                    var xx = r.Next(2000) + 100;
                    var yy = r.Next(2000);

                    NFP pl = new NFP();

                    pl.source = src;
                    polygons.Add(pl);
                    pl.Points = new SvgPoint[] { };
                    pl.x      = xx;
                    pl.y      = yy;
                    pl.AddPoint(new SvgPoint(0, 0));
                    pl.AddPoint(new SvgPoint(0 + ww, 0));
                    pl.AddPoint(new SvgPoint(0 + ww, 0 + hh));
                    pl.AddPoint(new SvgPoint(0, 0 + hh));
                }

                UpdateList();
            }
        }
Ejemplo n.º 2
0
        private void importSelectedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView3.SelectedItems.Count > 0)
            {
                QntDialog q = new QntDialog();
                if (q.ShowDialog() == DialogResult.OK)
                {
                    foreach (var item in listView3.SelectedItems)
                    {
                        var t = (item as ListViewItem).Tag as FileInfo;

                        var svg = SvgParser.LoadSvg(t.FullName);
                        int src = 0;
                        if (polygons.Any())
                        {
                            src = polygons.Max(z => z.source.Value) + 1;
                        }
                        for (int i = 0; i < q.Qnt; i++)
                        {
                            context.ImportFromRawDetail(svg, src);
                        }
                    }
                    UpdateList();
                }
            }
        }
Ejemplo n.º 3
0
        private void listView3_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listView3.SelectedItems.Count > 0)
            {
                var si = listView3.SelectedItems[0].Tag;
                if (si is DirectoryInfo)
                {
                    UpdateFilesList((si as DirectoryInfo).FullName);
                }
                if (si is FileInfo)
                {
                    var       f = (si as FileInfo);
                    QntDialog q = new QntDialog();
                    if (q.ShowDialog() == DialogResult.OK)
                    {
                        var svg = SvgParser.LoadSvg(f.FullName);
                        int src = 0;
                        if (polygons.Any())
                        {
                            src = polygons.Max(z => z.source.Value) + 1;
                        }
                        for (int i = 0; i < q.Qnt; i++)
                        {
                            context.ImportFromRawDetail(svg, src);
                        }

                        UpdateList();
                    }
                }
            }
        }
Ejemplo n.º 4
0
 private void cloneQntToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         QntDialog qd = new QntDialog();
         if (qd.ShowDialog() == DialogResult.OK)
         {
             var nfp = (listView1.SelectedItems[0].Tag as NFP);
             for (int i = 0; i < qd.Qnt; i++)
             {
                 var r = Background.clone(nfp);
                 polygons.Add(r);
             }
             UpdateList();
         }
     }
 }