• 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

    #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!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by joemiller, Today, 07:33 AM
      0 responses
      6 views
      0 likes
      Last Post joemiller  
      Started by isnercrypto, Today, 06:42 AM
      0 responses
      4 views
      0 likes
      Last Post isnercrypto  
      Started by Coursocied67, Today, 04:02 AM
      0 responses
      4 views
      0 likes
      Last Post Coursocied67  
      Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
      7 responses
      36 views
      0 likes
      Last Post DaveS
      by DaveS
       
      Started by claxxical, Yesterday, 10:00 PM
      0 responses
      9 views
      0 likes
      Last Post claxxical  
      Working...
      X