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 wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      26 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, Yesterday, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      192 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,235 views
      0 likes
      Last Post xiinteractive  
      Working...
      X