public SimpleGuiCanvasPanel(SplitterPanel splitterPanel)
            : base(splitterPanel)
        {
            // set thisForm's properties and event handlers
            thisForm            = this.Parent.ParentForm as SimpleGuiForm;
            thisForm.KeyPreview = true;

            thisForm.KeyDown     += thisForm_KeyDown;
            thisForm.KeyUp       += thisForm_KeyUp;
            thisForm.Deactivate  += thisForm_Deactivate;
            thisForm.Activated   += thisForm_Activated;
            thisForm.FormClosing += (o, e) => this.Stop();

            // set panel properties and event handlers
            Panel.BackColor = Color.White;
            Panel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic)
            .SetValue(Panel, true, null);                   // make panel double buffered to remove flicker

            Panel.MouseClick += splitterPanel_MouseClick;
            Panel.MouseMove  += splitterPanel_MouseMove;
            Panel.Paint      += Panel_Paint;

            // set the canvas and frame rate
            canvas = new Canvas()
            {
                BackgroundColor = Color.Black,
                Owner           = splitterPanel,
                Size            = new Size(480, 360),
            };

            this.TargetFrameRate = 30;

            downKeys = new System.Collections.Generic.HashSet <Keys>();
        }
        public SimpleGuiCanvasPanel(SplitterPanel splitterPanel)
            : base(splitterPanel)
        {
            // set thisForm's properties and event handlers
            thisForm = this.Parent.ParentForm as SimpleGuiForm;
            thisForm.KeyPreview = true;

            thisForm.KeyDown += thisForm_KeyDown;
            thisForm.KeyUp += thisForm_KeyUp;
            thisForm.Deactivate += thisForm_Deactivate;
            thisForm.Activated += thisForm_Activated;
            thisForm.FormClosing += (o, e) => this.Stop();

            // set panel properties and event handlers
            Panel.BackColor = Color.White;
            Panel.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic)
                           .SetValue(Panel, true, null);    // make panel double buffered to remove flicker

            Panel.MouseClick += splitterPanel_MouseClick;
            Panel.MouseMove += splitterPanel_MouseMove;
            Panel.Paint += Panel_Paint;

            // set the canvas and frame rate
            canvas = new Canvas() {
                BackgroundColor = Color.Black,
                Owner = splitterPanel,
                Size = new Size(480, 360),
            };

            this.TargetFrameRate = 30;

            downKeys = new System.Collections.Generic.HashSet<Keys>();
        }
 public SimpleGuiControlsPanel(SplitterPanel splitterPanel)
     : base(splitterPanel)
 {
     this.Form = this.Parent.ParentForm as SimpleGuiForm;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleGuiOutputPanel"/> class.
 /// </summary>
 /// <param name="splitterPanel">The splitter panel.</param>
 public SimpleGuiOutputPanel(System.Windows.Forms.SplitterPanel splitterPanel)
     : base(splitterPanel)
 {
     this.Form = this.Parent.ParentForm as SimpleGuiForm;
 }
Esempio n. 5
0
 public SimpleGuiControlsPanel(SplitterPanel splitterPanel)
     : base(splitterPanel)
 {
     this.Form = this.Parent.ParentForm as SimpleGuiForm;
 }