• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Disable indicator selection by clicking on custom rendered objects.

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

    Disable indicator selection by clicking on custom rendered objects.

    Hello.
    I am creating an indicator with the wide areas filled by colors (sessions) via method only.
    And I found that clicking on the filled area



    initiates indicator selection (and prevents scrolling, for example).
    While clicks inside non-filled area don't select indicator (please, see the video: ​​​​​​ ​https://www.screencast.com/t/1UD3sexJG)

    The question: How to disable indicator selection by clicking on custom rendered objects?
    Is there another way, then uncheck "Allow the selection of drag/drop of chart series
    "
    Last edited by NinjaTrader_Jim; 06-19-2019, 06:29 AM. Reason: Fix Screencast link
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Thank you for your post.

    If you would like to prevent plots from being selectable, you could force the indicator rendering to only happen without hit testing passes.

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
        if(!IsInHitTest)                                                    // Use IsInHitTest to avoid rendering for hit test passes
            base.OnRender(chartControl, chartScale);                        // Call base OnRender() method to paint defined Plots.
    }
    Here are links to our help guide that go into more detail regarding OnRender() and IsInHitTest:

    OnRender() - https://ninjatrader.com/support/help...s/onrender.htm

    IsInHitTest - https://ninjatrader.com/support/help...sinhittest.htm

    Please let me know if I can be of further assistance.
    Last edited by NinjaTrader_Kate; 06-19-2019, 10:16 AM. Reason: code formatting
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Many thanks, Kate
      It works perfect!
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by D Trader, Yesterday, 09:43 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cassiano_sanches, 07-10-2020, 07:37 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by terminatorT1000, 07-10-2020, 06:40 PM
      2 responses
      27 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Giudiver, 07-10-2020, 04:29 PM
      2 responses
      16 views
      0 likes
      Last Post Giudiver  
      Started by rtwave, Today, 04:11 PM
      0 responses
      4 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Working...
      X