private static void DisplayGraph(Graph g, Form form)
        {
            var gviewer = new GViewer {
                BuildHitTree = false
            };

            form.SuspendLayout();
            form.Controls.Add(gviewer);
            gviewer.Dock = DockStyle.Fill;


            var b = new Button {
                Text = "Save DebugCurves"
            };

            b.Click    += BClick;
            b.Left      = Screen.PrimaryScreen.WorkingArea.Size.Width * 3 / 8;
            b.AutoSize  = true;
            b.ForeColor = System.Drawing.Color.Blue;
            form.Controls.Add(b);

            var l = new System.Windows.Forms.Label()
            {
                Text = "no object"
            };

            l.Name     = "label";
            l.Dock     = DockStyle.Right;
            l.AutoSize = true;
            form.Controls.Add(l);
            gviewer.SendToBack();



            var statusStrip  = new StatusStrip();
            var toolStribLbl = new ToolStripStatusLabel("test");

            statusStrip.Items.Add(toolStribLbl);
            form.Controls.Add(statusStrip);
            form.ResumeLayout();
            gviewer.ObjectUnderMouseCursorChanged += DisplayGeometryGraph_ObjectUnderMouseCursorChanged;
            gviewer.MouseMove            += Draw.GviewerMouseMove;
            gviewer.NeedToCalculateLayout = false;
            gviewer.MouseClick           += GviewerMouseClick;

            form.Size = new Size(Screen.PrimaryScreen.WorkingArea.Size.Width * 3 / 4,
                                 Screen.PrimaryScreen.WorkingArea.Size.Height * 3 / 4);
            form.StartPosition = FormStartPosition.CenterScreen;
            form.TopLevel      = true;
            gviewer.Graph      = g;

            form.Text = Process.GetCurrentProcess().MainModule.FileName;

            form.ShowDialog();
        }
 public static Form CreateForm(GViewer gviewer) {
     GViewer=gviewer;
     var form = new Form();
     form.SuspendLayout();
     form.Controls.Add(gviewer);
     gviewer.Dock = DockStyle.Fill;
     gviewer.SendToBack();
     form.StartPosition = FormStartPosition.CenterScreen;
     form.Size = new System.Drawing.Size(Screen.PrimaryScreen.WorkingArea.Width,
                       Screen.PrimaryScreen.WorkingArea.Height);
     var statusStrip = new StatusStrip();
     var toolStribLbl = new ToolStripStatusLabel("test");
     statusStrip.Items.Add(toolStribLbl);
     form.Controls.Add(statusStrip);
     form.MainMenuStrip = GetMainMenuStrip();
     form.Controls.Add(form.MainMenuStrip);
     form.ResumeLayout();
     form.Load += form_Load;
     return form;
 }
Esempio n. 3
0
        public void SetGViewer(GViewer gviewer) {

            GViewer=gviewer;
            SuspendLayout();
            Controls.Add(gviewer);
            gviewer.Dock = DockStyle.Fill;
            gviewer.SendToBack();
            StartPosition = FormStartPosition.CenterScreen;
            Size = new Size(Screen.PrimaryScreen.WorkingArea.Width,
                                                Screen.PrimaryScreen.WorkingArea.Height);

            var statusStrip = new StatusStrip();
            var toolStribLbl = new ToolStripStatusLabel("test");
            statusStrip.Items.Add(toolStribLbl);
            Controls.Add(statusStrip);
            MainMenuStrip = GetMainMenuStrip();
            Controls.Add(MainMenuStrip);
            SetMonotonicityCoefficientTrackBar();
            ResumeLayout();
            gviewer.GraphChanged += gviewer_GraphChanged;            
        }
        private static void DisplayGraph(Graph g, Form form){
            var gviewer = new GViewer{BuildHitTree = false};
            form.SuspendLayout();
            form.Controls.Add(gviewer);
            gviewer.Dock = DockStyle.Fill;
            
            
            var b = new Button {Text = "Save DebugCurves"};
            b.Click += BClick;
            b.Left = Screen.PrimaryScreen.WorkingArea.Size.Width*3/8;
            b.AutoSize = true;
            b.ForeColor = System.Drawing.Color.Blue;
            form.Controls.Add(b);

            var l = new System.Windows.Forms.Label() {Text = "no object"};
            l.Name = "label";
            l.Dock = DockStyle.Right;
            l.AutoSize = true;
            form.Controls.Add(l);
            gviewer.SendToBack();


          
            var statusStrip = new StatusStrip();
            var toolStribLbl = new ToolStripStatusLabel("test");
            statusStrip.Items.Add(toolStribLbl);
            form.Controls.Add(statusStrip);
            form.ResumeLayout();
            gviewer.ObjectUnderMouseCursorChanged += DisplayGeometryGraph_ObjectUnderMouseCursorChanged;
            gviewer.MouseMove += Draw.GviewerMouseMove;
            gviewer.NeedToCalculateLayout = false;
            gviewer.MouseClick += GviewerMouseClick;
           
            form.Size = new Size(Screen.PrimaryScreen.WorkingArea.Size.Width*3/4,
                              Screen.PrimaryScreen.WorkingArea.Size.Height*3/4);
            form.StartPosition = FormStartPosition.CenterScreen;
            form.TopLevel = true;            
            gviewer.Graph = g;

            form.Text = Process.GetCurrentProcess().MainModule.FileName;

            form.ShowDialog();
        }