Beispiel #1
0
        public void SetModelPanel(ModelPanel p)
        {
            Size sz = new Size(6000, 6000);

            modelPanel      = p;
            panel           = new ImageBox(sz);
            panel.Bounds    = new Rectangle(p.Location.X + 25, p.Location.Y + 2, 140, 14);
            panel.Image     = null;
            panel.BackColor = Color.LightGray;
            panel.Visible   = true;
            this.modelPanel.control.Controls.Add(panel);
            this.panel.MouseMove += ViewList_MouseMove;
            this.panel.MouseUp   += ViewList_MouseUp;
            this.panel.MouseDown += ViewList_MouseDown;
        }
Beispiel #2
0
        public static Connector Connect(ModelPanel p0, ModelPanel p1, int guid)
        {
            Size  s0 = p0.Size;
            Point b0 = p0.Location;

            Size  s1 = p1.Size;
            Point b1 = p1.Location;

            Point a = new Point(b0.X + s0.Width, b0.Y + s0.Height / 2);

            Point b = new Point(b1.X, b1.Y + s1.Height / 2);

            Connector c = Connector.Create(a, b, guid);

            return(c);
        }
Beispiel #3
0
        public void Draw()
        {
            Graphics g = Graphics.FromImage(Image);

            foreach (Control c in Controls)
            {
                ModelPanel p = c as ModelPanel;

                if (p == null)
                {
                    continue;
                }

                p.conrs.Draw(g);
            }
        }
Beispiel #4
0
        public ModelPanel InitModelPanel(DataTable table)
        {
            ModelPanel p = new ModelPanel(new Size(600, 600));

            p.control = imageBox1;

            ViewList v = AddListView(table);

            v.modelPanel = p;
            p.AddControl(v);

            v            = AddListViewAdapter(table);
            v.modelPanel = p;
            p.AddControl(v);

            return(p);
        }
Beispiel #5
0
        public void LoadModel(DataSet dd)
        {
            int ax = 1;
            int bx = 1;

            foreach (DataTable d in dd.Tables)
            {
                ModelPanel pp = InitModelPanel(d);

                pp.Location = new Point(ax * 250, bx * 500);

                //ViewList v = pp.panels[0] as ViewList;

                //if (pc != null)
                //{
                //    Connector c = ModelPanel.Connect(pc, pp, guid++);

                //    pp.AddConnector(c);

                //}

                //pc = pp;

                //pp.AddControl(bb);

                //               ViewList bb = AddListView(d);

                //       bb.modelPanel = pp;

                //      v.SetModelPanel(pp);
                this.imageBox1.Controls.Add(pp);
                pp.Refresh();

                ax += 1;
                if (ax > 6)
                {
                    ax = 1;
                    bx++;
                }
            }
            imageBox1.Draw();
        }
Beispiel #6
0
        public ModelPanel InitModelPanel()
        {
            ModelPanel p = new ModelPanel(new Size(600, 600));

            p.control = imageBox1;

            //ViewList v = new ViewList();
            //v.GridLines = true;
            //v.View = View.Details;
            //v.BackColor = Color.White;
            //v.Columns.Add("name");
            //v.LabelEdit = true;
            //v.FullRowSelect = true;
            //v.context = context;

            //v.HeaderStyle = ColumnHeaderStyle.Clickable;
            //v.Size = new Size(200, 200);
            //v.Columns[0].Width = v.Width - 5;
            //v.Columns[0].ImageKey = "DataTable_256x";
            //v.LargeImageList = img;

            //int i = 0;
            //while (i < 6)
            //{
            //    ListViewItem b = new ListViewItem("Text item");
            //    v.Items.Add(b);
            //    i++;
            //}

            //p.AddControl(v);

            //this.imageBox1.Controls.Add(p);

            ViewList bb = AddTestListView();

            bb.modelPanel = p;

            p.AddControl(bb);

            return(p);
        }
Beispiel #7
0
        public void Init()
        {
            context = contextMenuStrip1;

            models = new ArrayList();

            imageBox1.Image = new Bitmap(6000, 6000);
            using (TextureBrush brush = new TextureBrush(ve_resource.designer, WrapMode.Tile))
            {
                using (Graphics g = Graphics.FromImage(imageBox1.Image))
                {
                    g.FillRectangle(brush, 0, 0, imageBox1.Image.Width, imageBox1.Image.Height);
                }
            }

            img = new ImageList();
            img.Images.Add("TableAdapter_16x", ve_resource.TableAdapter_16x);
            img.Images.Add("DataTable_256x", ve_resource.DataTable_256x);

            v           = new ViewList();
            v.GridLines = true;
            v.View      = View.Details;
            v.BackColor = Color.White;
            v.Columns.Add("name");
            v.LabelEdit     = true;
            v.FullRowSelect = true;
            v.context       = context;

            v.HeaderStyle         = ColumnHeaderStyle.Clickable;
            v.Size                = new Size(200, 200);
            v.Columns[0].Width    = v.Width - 5;
            v.Columns[0].ImageKey = "DataTable_256x";
            v.LargeImageList      = img;

            int i = 0;

            while (i < 6)
            {
                ListViewItem b = new ListViewItem("Text item");
                v.Items.Add(b);
                i++;
            }

            ModelPanel p = new ModelPanel(new Size(6000, 6000));

            p.control = imageBox1;

            p.AddControl(v);

            p.Bounds = new Rectangle(0, 0, 200, 200);

            //v.SetModelPanel( p );

            //this.imageBox1.Controls.Add(p);

            //ViewList bb = AddTestListView();

            //bb.modelPanel = p;

            //p.AddControl(bb);

            //bb.Refresh();

            //ModelPanel pc = null;

            //int guid = 0;

            //for(int ax = 0; ax < 30; ax++)
            //    for(int bx = 0; bx < 15; bx++)
            //    {
            //        ModelPanel pp = InitModelPanel();
            //        pp.Location = new Point(ax * 250, bx * 500);

            //        ViewList v = pp.panels[0] as ViewList;

            //        if (pc != null)
            //        {
            //            Connector c = ModelPanel.Connect(pc, pp, guid++);

            //            pp.AddConnector(c);

            //        }

            //        pc = pp;

            //        v.SetModelPanel(pp);
            //        this.imageBox1.Controls.Add(pp);
            //        pp.Refresh();

            //    }

            this.imageBox1.Draw();
        }