Announcement

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

    Get dragTracker instance during a drag operation

    I have a group of isc.Window instances that I can drag around the browser window. I have figured out how to keep the window from being able to be moved outside of the visible browser window by overriding dragRepositionStop and dragRepositionMove. At the end of a move I can successfully place the window back in the visible area if the user attempted to drag the window out of the visible window.

    What I can't do is keep the dragTracker from leaving the visible browser window during a drag.

    I'm sure I can do it if I can figure out how to get a handle to the instance of the dragTacker canvas while inside dragRepositionMove() for the window.

    So the question: During a drag operation, how can I locate the dragTracker canvas instance so that I can perform operations on it?

    EventHandler has a setDragTracker() method that allows me to create a custom tracker, but it doesn't have a getDragTracker() function to allow me to manipulate the existing tracker (like the default outline).

    Any guidance would be appreciated.

    Thanks,
    -Chris
    Last edited by reaper; 9 Oct 2009, 23:21. Reason: Title was misleading

    #2
    I should also point out that keepInParentRect will not work since I want the user to be able to move the window partially off screen.

    Having said that: All my tests seem to indicate that the rectangle parameters that can be passed to keepInParentRect are static and are set during the window instantiation and that I can't change their values dynamically (like if the user resizes the browser window) after the isc.Window is instantiated.

    If this isn't the case then I'm happy to use keepInParentRect, but I need to know how to set that value either as soon as the browser is resized, or at the start of the drag.

    -Chris

    Comment


      #3
      OK, I've solved my immediate problem. I can constrain the tracker with keepInParentRect by doing:
      Code:
      dragRepositionStart: function(){
        this.keepInParentRect = [newLeft, newTop, newRight, newBottom];
      }
      where newLeft, newTop...., etc are calculated values.

      I would still like to know how to get the dragTracker instance though since I would like to be able to control it's look based on various drop targets.

      Thanks,
      -Chris

      Comment


        #4
        You probably want to consider a custom drag - turn off the builtin dragAppearance and generate your own drag tracker, place it yourself and
        move it yourself (implementing your constraints) and update it's appearance as necessary.

        Comment


          #5
          Thank you for your response.

          I'm still getting familiar with this forum. I didn't realize I didn't automatically get e-mail notifications when I posted, and the 'instant notification' setting was below the fold and I didn't even see it when posting.

          -Chris

          Comment

          Working...
          X