Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public static GUIMouseEventArgs Translate(this System.Windows.Forms.MouseEventArgs e)
        {
            var button = (GUIMouseButtons)e.Button;
            var args   = new GUIMouseEventArgs(button, e.Clicks, e.X, e.Y, e.Delta);

            return(args);
        }
Ejemplo n.º 2
0
 void CtrlButton_MouseUp(object sender, GUIMouseEventArgs e)
 {
     if (e.Button == GUIMouseButtons.Left)
     {
         this.Location = this.originalLocation;
         this.Size     = this.originalSize;
     }
 }
Ejemplo n.º 3
0
        void winCanvas_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            GUIMouseEventArgs args = e.Translate();

            foreach (var item in this.Children)
            {
                item.InvokeEvent(EventType.MouseMove, args);
            }
        }
Ejemplo n.º 4
0
        void winCanvas_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            GUIMouseEventArgs args = e.Translate();

            if (this.mouseDownControl != null)
            {
                this.mouseDownControl.InvokeEvent(EventType.MouseUp, args);
                this.mouseDownControl = null;
            }
        }
Ejemplo n.º 5
0
 void CtrlButton_MouseDown(object sender, GUIMouseEventArgs e)
 {
     if (e.Button == GUIMouseButtons.Left)
     {
         this.originalLocation = this.Location;
         this.originalSize     = this.Size;
         this.Size             = new GUISize((int)(this.Width * 0.9f), (int)(this.Height * 0.9f));
         this.Location         = new GUIPoint(
             (int)(this.Location.X + this.Width * 0.05f),
             (int)(this.Location.Y + this.Height * 0.05f));
     }
 }
Ejemplo n.º 6
0
        void winCanvas_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            GUIMouseEventArgs args = e.Translate();

            foreach (var item in this.Children)
            {
                int x = e.X, y = this.BindingCanvas.Height - e.Y;
                if (item.ContainsPoint(x, y))
                {
                    this.mouseDownControl = item;
                    item.InvokeEvent(EventType.MouseDown, args);
                }
            }
        }