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

DrawingTool OnMouseMove is called only when the tool is selected

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

    DrawingTool OnMouseMove is called only when the tool is selected

    I'm trying to add a visual effect to a DrawingTool when it's hovered. My first thought was to use the OnMouseMove method, but it didn't fully cover my needs because the method only gets called if the DrawingTool is selected, and I need my hover effect to hover even if it's not selected. Is there any other good solution for doing this, or a workaround to make OnMouseMove work like I need it?

    #2
    Hello Matheusfx,

    Thank you for the post.

    I tried testing the situation you described and also see that the object only has its events called when selected after being drawn. That would be the general expectation based on how the hit testing works with the chart to know what is selected and what drives the anchor system.

    For what you are asking I am not certain that this would be possible from the drawing tools events directly. You would likely need to subscribe to the ChartControl mouse events or the overall windows mouse events if you wanted to observe events that don't belong to the object. There is not really a good location I could suggest to do that from a DrawingObject, potentially OnRender or OnMouseUp could be used to trigger a one time action of subscribing to the event if it was not previously subscribed to.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    6 views
    0 likes
    Last Post tkaboris  
    Working...
    X