Announcement

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

    Drag DrawRect but not out of DrawPane

    Hi,

    I have a DrawPane with some DrawRect objects on it.
    It is possible to drag move the DrawRect objects, however, I do not want to drag the DrawRect objects out of the DrawPane. Is there a way to prevent this?


    this is with v8.3p_2013-02-13/Pro Deployment (built 2013-02-13)


    thanks,

    #2
    There's currently no built-in feature to do this for DrawItem. There is one for Canvas (keepInParentRect).

    You should be able to implement DragMove handlers that detect whether a DrawItem is being dragged out of the DrawPane and move it back.

    Otherwise you could sponsor having the keepInParentRect behavior added for DrawItems. Just a note that it's not trivial given that not all shapes are square.

    Comment


      #3
      OK thanks. We'll keep it in mind :)

      Meanwhile, to do something manually, can you add a DragResizeMoveHandler on DrawItem ?

      Comment


        #4
        No, that handle doesn't exist, you need to use DragMove.

        Comment


          #5
          But the DragMove doesn't seem to fire when you're resizing a DrawItem (using com.smartgwt.client.types.KnobType.RESIZE). This also to prevent the user from resizing a DrawItem outside its parent DrawPane's size.

          Comment


            #6
            Hi,
            so is there an event which fires when a DrawItem is being resized when the user is dragging a knob?


            thanks,

            Comment


              #7
              We have now added dragResizeMove notification events, and while we were in there, an implementation of "keepInParentRect".
              This will show up in nightly builds on the 4.0d branch going forward (dated March 15 and above).

              Regards
              Isomorphic Software

              Comment


                #8
                Hi,

                We will still be on the 3.1 for a while - is there any possibility to have the changes merged there too please?

                thanks

                Comment


                  #9
                  No, sorry, this was not a patch or fix, it will not be backported.

                  Comment

                  Working...
                  X