Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawingTool State not updated after OnMouseUp

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

    DrawingTool State not updated after OnMouseUp

    I was trying to build a drawing tool for a client, and have run into some issues. The drawing tool needs to work a little differently than the normal Ninja model which is a little clicky for my client.

    The tool has two anchors, but they should be set on the first mouse down and the first mouse up events.I am able to get this to work fine, but after the OnMouseUp event, Ninja does not properly update the drawing based on the new state. For example, after the mouse up processing, the Cursor is left with the Pen and the Drawing is left in a selected state until another mouse down happens (the selected state was cleared in the code).

    I have attached a simple drawing that you can use to see the issue. It is a version of the NT Rectangle (Shapes hacked to be Rect only) that has been changed in OnMouseDown and OnMouseUp to implement a single click drawing. When you use this drawing, you will observe the above behavior.
    Attached Files

    #2
    Hello aslane, and thank you for your question. While fully debugging user code is beyond the scope of the support we may provide, I was able to create a class which extends rectangles and allows overriding its behavior, that does not exhibit any of the behaviors you described, which is attached. Would it be possible to modify the script I have attached minimally so that it exhibits Ninja not behaving as expected?
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks, I was trying to post Ninja code vs mine, but your method of inheriting is a nice way to limit the code.

      Attached is a version of your code that shows the issue. The only code I modified was the OnMouseDown and OnMouseUp.
      Attached Files

      Comment


        #4
        Thank you for this additional information aslane.

        I have submitted a feature request to the product management team for the following feature :
        This user would like the ability to programmatically manually advance the drawing state
        I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.


        Please let us know if there are any other ways we can help.
        Attached Files
        Last edited by NinjaTrader_JessicaP; 02-07-2017, 12:09 PM.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Doing manually would be fine, but it seemed like the underlying base Ninja code should maybe be checking the state after processing OnMouseUp.

          Comment


            #6
            Thank you aslane, any feedback we leave in this thread will be made immediately available to the product management team in this thread, including your suggestion that they allow advancing state through the assignment operator, so that

            DrawingState = xxx

            would queue an advance in the DrawingState to xxx .
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Hello aslane ,

              This feature is being reviewed by the product management team and has been assigned the following unique tracking ID


              SFT-1925


              Please let us know if there is any other way we can help.
              Jessica P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sidlercom80, 10-28-2023, 08:49 AM
              167 responses
              2,260 views
              0 likes
              Last Post jeronymite  
              Started by warreng86, 11-10-2020, 02:04 PM
              7 responses
              1,361 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              5 views
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              9 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Working...
              X