Beispiel #1
0
 private void OnLoad()
 {
     WorldCon.ConnectCons(false);
     Scene.WorldCon = WorldCon;
     Scene.AttachShapes();
     CommandCon.Clear();
     WorldCon.ConnectCons(true);
     SceneCon.RecreateSceneControl();
     SignalsCon.Load();
     Reset();
 }
Beispiel #2
0
 private void ConnectEventHandlers(bool connect)
 {
     ConnectMainMenu(connect);
     ConnectToolbar(connect);
     if (connect)
     {
         PropertyEdit           += WorldCon_PropertyEdit;
         ShapeSelection.Changed += Selection_Changed;
         WorldForm.FormClosed   += WorldForm_FormClosed;
         WorldForm.FormClosing  += WorldForm_FormClosing;
     }
     else
     {
         PropertyEdit           -= WorldCon_PropertyEdit;
         ShapeSelection.Changed -= Selection_Changed;
         WorldForm.FormClosed   -= WorldForm_FormClosed;
         WorldForm.FormClosing  -= WorldForm_FormClosing;
     }
     SceneCon.Connect(connect);
 }
Beispiel #3
0
        public void RecreateSceneControl()
        {
            GLControl
                oldControl = GetSceneControl(),
                newControl = new GLControl();
            var parent     = oldControl.Parent;

            newControl.BackColor = Scene.BackgroundColour;
            newControl.Dock      = DockStyle.Fill;
            newControl.Location  = new System.Drawing.Point(0, 0);
            newControl.Name      = "SceneControl";
            newControl.Size      = new System.Drawing.Size(100, 100);
            newControl.TabIndex  = 1;
            newControl.VSync     = Scene.VSync;
            parent.SuspendLayout();
            SceneCon.Connect(false);
            parent.Controls.Remove(oldControl);
            parent.Controls.Add(newControl);
            SceneCon.Connect(true);
            RenderCon.Refresh();
            parent.ResumeLayout();
            oldControl.Dispose();
        }