Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DrawLine not getting individual clicks even though setNoDoubleClicks is true

    I am using SmartGWT LGPL version 2025-01-14

    I would like to disable double-clicks in my application so I set setNoDoubleClicks to true in my DrawPane.
    I don't see a similar method on DrawLine.

    But, the setNoDoubleClicks does not seem to be working. I am still only getting one onClick call when I double click on the line. It should be called twice.

    See the attached test case.
    Attached Files

    #2
    Sorry, the noDoubleClicks feature is for Canvases only - it isn't available on DrawItems, and doesn't "cascade" downward from the parent Canvas (DrawPane).

    Comment


      #3
      It would be OK if I can process the double-click, but I don't see a double click handler on the DrawItem class. Is there a way to do that?

      Comment


        #4
        I think I found a reasonable solution - I can change to using a MouseDownHandler instead of a ClickHandler.
        Thanks for your help!

        Comment


          #5
          Unfortunately, using mouse down does not work well. It is getting called when the user presses the mouse to drag the window so I can't tell the difference between a drag and a click.
          So, I need DrawItem to either:
          1. Give me a way to process double-clicks instead of ignoring them, or
          2. Call onClick for every click, even if they are part of a double-click.

          Comment


            #6
            The event cycle of a click is mouseDown, mouseUp, click. So it seems like mouseUp is what you want, although you may need to set up to ignore the mouseUp at the end of a drag, if you don't want to treat that as a click.

            Comment


              #7
              I guess I can do this in my code. Seems like an oversight that the toolkit's Click Handler is absorbing double-clicks without any way to see that it did.

              Comment

              Working...
              X