Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Is there a virtual OnMouseClick() handler?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is there a virtual OnMouseClick() handler?

    I'd like to handle click events in some of the frame anchors of my custom DrawingTool.

    I can override OnMouseDown, OnMouseMove and OnMouseUp but don't see a way to detect click events.

    Do I need to do my own detection, maybe OnMouseDown, followed by a OnMouseUp without much movement?

    #2
    Helo ntdev,

    Thanks for your question.

    There is not a MouseClick event I could suggest. The offered events are OnMouseDown, OnMouseUp and OnMouseMove. If you use intellisense/intelliprompt to check ChartControl for additional events, we can see that a MouseClick event is not offered.

    Yes, I would suggest the same as you are to detect when the mouse is in a down position for the first part of your click and then to store a bool that is checked in the mouse up event to identify a click.

    You could track the mouse position in OnMouseDown and compare that position in OnMouseUp if you want the click to be invalidated if the user clicks and drags from point A to point B and you do not want that registered as a click.

    We look forward to assisting.
    Last edited by NinjaTrader_Jim; 06-04-2020, 08:02 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim. Yes, that's what I thought but it was worth a shot to ask.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jonker, Today, 01:19 PM
      0 responses
      1 view
      0 likes
      Last Post Jonker
      by Jonker
       
      Started by futtrader, Today, 01:16 PM
      0 responses
      5 views
      0 likes
      Last Post futtrader  
      Started by Segwin, 05-07-2018, 02:15 PM
      14 responses
      1,791 views
      0 likes
      Last Post aligator  
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      844 views
      0 likes
      Last Post emuns
      by emuns
       
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      6 responses
      3,296 views
      1 like
      Last Post jgualdronc  
      Working...
      X