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 r68cervera, Today, 05:29 AM
      0 responses
      3 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      6 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      35 views
      0 likes
      Last Post JonesJoker  
      Started by GussJ, 03-04-2020, 03:11 PM
      12 responses
      3,240 views
      0 likes
      Last Post Leafcutter  
      Started by AveryFlynn, Today, 04:57 AM
      0 responses
      7 views
      0 likes
      Last Post AveryFlynn  
      Working...
      X