• 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

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, 11:09 AM.
        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 lavalampmj, Today, 05:25 PM
              0 responses
              1 view
              0 likes
              Last Post lavalampmj  
              Started by Antares66, Today, 05:19 PM
              0 responses
              2 views
              0 likes
              Last Post Antares66  
              Started by jmneto, Today, 05:18 PM
              0 responses
              2 views
              0 likes
              Last Post jmneto
              by jmneto
               
              Started by Bobbyj78, Today, 02:21 PM
              2 responses
              12 views
              0 likes
              Last Post bltdavid  
              Started by EnveousColnago, Today, 02:10 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Ariana  
              Working...
              X