MouseEvent.cs :  » GUI » wx-NET » wx » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » GUI » wx NET 
wx NET » wx » MouseEvent.cs
//-----------------------------------------------------------------------------
// wx.NET - MouseEvent.cs
//
// The wxMouseEvent wrapper class.
//
// Written by Bryan Bulten (bryan@bulten.ca)
// (C) 2003 Bryan Bulten
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: MouseEvent.cs,v 1.8 2004/10/17 10:39:12 olkalex Exp $
//-----------------------------------------------------------------------------

using System;
using System.Drawing;
using System.Runtime.InteropServices;

namespace wx{
    public class MouseEvent : Event
    {
        [DllImport("wx-c")] static extern IntPtr wxMouseEvent_ctor(int mouseType);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_IsButton(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_ButtonDown(IntPtr self);
  [DllImport("wx-c")] static extern bool   wxMouseEvent_ButtonDown2(IntPtr self, int button);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_ButtonDClick(IntPtr self, int but);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_ButtonUp(IntPtr self, int but);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_Button(IntPtr self, int but);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_ButtonIsDown(IntPtr self, int but);
        [DllImport("wx-c")] static extern int    wxMouseEvent_GetButton(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_ControlDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_MetaDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_AltDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_ShiftDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_LeftDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_MiddleDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_RightDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_LeftUp(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_MiddleUp(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_RightUp(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_LeftDClick(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_MiddleDClick(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_RightDClick(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_LeftIsDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_MiddleIsDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_RightIsDown(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_Dragging(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_Moving(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_Entering(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_Leaving(IntPtr self);
        [DllImport("wx-c")] static extern void   wxMouseEvent_GetPosition(IntPtr self, ref Point pos);
        [DllImport("wx-c")] static extern void   wxMouseEvent_LogicalPosition(IntPtr self, IntPtr dc, ref Point pos);
        [DllImport("wx-c")] static extern int    wxMouseEvent_GetWheelRotation(IntPtr self);
        [DllImport("wx-c")] static extern int    wxMouseEvent_GetWheelDelta(IntPtr self);
        [DllImport("wx-c")] static extern int    wxMouseEvent_GetLinesPerAction(IntPtr self);
        [DllImport("wx-c")] static extern bool   wxMouseEvent_IsPageScroll(IntPtr self);

    //----------------------------------------------------------------------------

    public MouseEvent(IntPtr wxObject) 
            : base(wxObject) { }

        public MouseEvent(int mouseType)
            : base(wxMouseEvent_ctor(mouseType)) { }

    //----------------------------------------------------------------------------

        public bool IsButton
        {
            get { return wxMouseEvent_IsButton(wxObject); }
        }
  
  //----------------------------------------------------------------------------

        public bool ButtonDown()
        {
            //get { return wxMouseEvent_ButtonDown(wxObject); }
      return ButtonDown(MouseButton.wxMOUSE_BTN_ANY);
        }
  
  public bool ButtonDown(MouseButton but)
  {
    return wxMouseEvent_ButtonDown2(wxObject, (int)but);
  }
  
  //----------------------------------------------------------------------------
  
  public bool ButtonDClick()
  {
    return ButtonDClick(MouseButton.wxMOUSE_BTN_ANY);
  }

        public bool ButtonDClick(MouseButton but)
        {
            return wxMouseEvent_ButtonDClick(wxObject, (int)but);
        }
  
  //----------------------------------------------------------------------------
  
  public bool ButtonUp()
  {
    return ButtonUp(MouseButton.wxMOUSE_BTN_ANY);
  }

        public bool ButtonUp(MouseButton but)
        {
            return wxMouseEvent_ButtonUp(wxObject, (int)but);
        }
  
  //----------------------------------------------------------------------------

        public bool Button(int but)
        {
            return wxMouseEvent_Button(wxObject, but);
        }

        public bool ButtonIsDown(int but)
        {
            return wxMouseEvent_ButtonIsDown(wxObject, but);
        }

        public int Button()
        {
            return wxMouseEvent_GetButton(wxObject);
        }

    //----------------------------------------------------------------------------

        public bool ControlDown
        {
            get { return wxMouseEvent_ControlDown(wxObject); }
        }

        public bool MetaDown
        {
            get { return wxMouseEvent_MetaDown(wxObject); }
        }

        public bool AltDown
        {
            get { return wxMouseEvent_AltDown(wxObject); }
        }

        public bool ShiftDown
        {
            get { return wxMouseEvent_ShiftDown(wxObject); }
        }

    //----------------------------------------------------------------------------

        public bool LeftDown
        {
            get { return wxMouseEvent_LeftDown(wxObject); }
        }

        public bool MiddleDown
        {
            get { return wxMouseEvent_MiddleDown(wxObject); }
        }

        public bool RightDown
        {
            get { return wxMouseEvent_RightDown(wxObject); }
        }

    //----------------------------------------------------------------------------

        public bool LeftUp
        {
            get { return wxMouseEvent_LeftUp(wxObject); }
        }

        public bool MiddleUp
        {
            get { return wxMouseEvent_MiddleUp(wxObject); }
        }

        public bool RightUp
        {
            get { return wxMouseEvent_RightUp(wxObject); }
        }

    //----------------------------------------------------------------------------

        public bool LeftDClick
        {
            get { return wxMouseEvent_LeftDClick(wxObject); }
        }

        public bool MiddleDClick
        {
            get { return wxMouseEvent_MiddleDClick(wxObject); }
        }

        public bool RightDClick
        {
            get { return wxMouseEvent_RightDClick(wxObject); }
        }

    //----------------------------------------------------------------------------

        public bool LeftIsDown
        {
            get { return wxMouseEvent_LeftIsDown(wxObject); }
        }

        public bool MiddleIsDown
        {
            get { return wxMouseEvent_MiddleIsDown(wxObject); }
        }

        public bool RightIsDown
        {
            get { return wxMouseEvent_RightIsDown(wxObject); }
        }

    //----------------------------------------------------------------------------

        public bool Dragging
        {
            get { return wxMouseEvent_Dragging(wxObject); }
        }

        public bool Moving
        {
            get { return wxMouseEvent_Moving(wxObject); }
        }

        public bool Entering
        {
            get { return wxMouseEvent_Entering(wxObject); }
        }

        public bool Leaving
        {
            get { return wxMouseEvent_Leaving(wxObject); }
        }

    //----------------------------------------------------------------------------

        public Point Position
        {
            get { 
                Point pos = new Point();
                wxMouseEvent_GetPosition(wxObject, ref pos);
                return pos;
            }
        }

        public Point LogicalPosition(DC dc)
        {
      Point pos = new Point();
            wxMouseEvent_LogicalPosition(wxObject, Object.SafePtr(dc), ref pos);
      return pos;
        }

    //----------------------------------------------------------------------------

        public int WheelRotation
        {
            get { return wxMouseEvent_GetWheelRotation(wxObject); }
        }

        public int WheelDelta
        {
            get { return wxMouseEvent_GetWheelDelta(wxObject); }
        }

        public int LinesPerAction
        {
            get { return wxMouseEvent_GetLinesPerAction(wxObject); }
        }

        public bool IsPageScroll
        {
            get { return wxMouseEvent_IsPageScroll(wxObject); }
        }

    //----------------------------------------------------------------------------
    }
}

www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.