Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible to prevent Panel dragging?

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

    Possible to prevent Panel dragging?

    I have an indicator that allows for the ability to drag and re-size objects drawn by it

    In NT8 I'm using OnRender() to draw these objects. In NT7 it was Plot()

    In both versions I use mouse down and move to detect and re-size the objects

    In NT7 when I mouse down on one of the objects the NT icon for letting me know I can drag the indicator to another panel appears. Even when this icon is present the mouse move event is still detected.

    In NT8 it does the same thing with the icon except the mouse move event is no longer detected as the panel selection takes focus.

    Is there a way to either prevent the focus loss OR to prevent the indicator from being able to be dragged from one panel to another.

    #2
    Hello,

    I just wanted to check, what mouse events are you using specifically? Are you using the MouseDown or the PreviewMouseDown handlers?

    If you have not yet, you may try the Preview mouse events to see if this allows you to get the mouse before the focus. If that does not work, could you provide a sample of the event you are currently using and where you are checking for the mouse events?

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

    Comment


      #3
      unfortunately the Preview didn't work, but did lead to some strange results. I'm not able to provide a code sample at this time but I was thinking that in NT8 I might be able to accomplish the same goal by adding an actual draw object to the chart.

      In NT7 I used Plot for the rectangles as drawing objects were very resource intensive. Do you know if there are any issues with using something like Draw.Rectangle in OnRender?

      Ideally to prevent me from having to do a large amount of recoding there would be a way to prevent panel dragging for the indicator since I want it to always be used in panel 1 anyways.

      Comment


        #4
        Hello,

        I would presume that using the Draw from OnRender would not be advisable as you are calling the drawing tool object over and over at a very fast rate.

        In the case of a same tag this would likely not be very resource intensive but many different items could certainly add up as OnRender is called very frequently.

        As for panel dragging, I am not sure of a way to prevent that as it is a default feature of the chart, What specific interface are you trying to achieve regarding not scrolling?

        Generally speaking, OnRender would be the favorable way to draw if you do not need to scroll as the drawings are locked to X and Y coordinates of the panel its self and can be drawn over the bars or the bars can be hidden.

        if you do not need price data at all, it may be advisable to use a custom window or addon as well.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by junkone, Today, 11:37 AM
        2 responses
        14 views
        0 likes
        Last Post junkone
        by junkone
         
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        44 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by proptrade13, Today, 11:06 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        35 views
        0 likes
        Last Post love2code2trade  
        Working...
        X