Example #1
0
        private void MouseMessageSend(Message m) {
            MouseMessage mData = (MouseMessage)m;
            MouseMessage em = new MouseMessage(m.ID, mData.Button, mData.Wheel, new System.Drawing.Point(mData.Point.X - base.Left, mData.Point.Y - base.Top));
            //data.X = mData.X - base.Left;
            //data.Y = mData.Y - base.Top;
            //data.Button = mData.Button;

            //Message em = new Message(m.Msg, data);
            //if (m.Msg == Message.MessageTypes.MOUSE_DOWN) base.Form.Text = "X:" + data.X + ",Y:" + data.Y;
            //if (m.Msg != Message.MessageTypes.MOUSE_MOVE) Trace.WriteLine("MouseMessageSend\\>ID:" + this.ID + ",Name:" + this.Name + ",Msg:(" + m.Msg + "),Children:" + gChildren.Count);

            for (int i = gChildren.Count - 1; i >= 0; i--) {
                if (gChildren[i].Visible) {
                    gChildren[i].SendMessage(em);

                    if (em.Suppress) {
                        m.Suppress = true;
                        return;
                    }
                }
            }
        }
Example #2
0
        private void GUIProcMouseWheel(MouseMessage data) {

            //StackFrame stackFrame = new StackFrame();
            //System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            //Trace.WriteLine(this.GetType().Name + "." + methodBase.Name + "\\>Wheel:" + data.Wheel);

            if (base.Focus) {
                if (data.Wheel < 0) {
                    //g.Value += gnLineHeight;
                    gVScroll.Value += 10;

                }
                if (data.Wheel > 0) {
                    //base.VerticalScroll.Value -= gnLineHeight;
                    gVScroll.Value -= 10;
                }
            }
            //this.MouseWheel(this, new EventArgs.MouseEventArgs(new Point(0, 0), System.Windows.Forms.MouseButtons.None, data.Wheel));
        }
Example #3
0
 //处理鼠标经过消息
 private void GUIProcMouseMove(MouseMessage data) {
     Point p = new Point(data.Point.X, data.Point.Y);
     //Point mp = this.AbsoluteLocation();
     if (gbMouseDown) {
         //int py = p.Y - mp.Y;
         int nSite = gnMouseDownSite + p.Y - gMouseDownPoint.Y;
         int nValue = (int)(nSite / gnSliderMaxHeight * gnSliderMaxValue);
         base.Value = nValue + base.MinValue;
     }
 }