SPONSORS:






User Tag List

Results 1 to 4 of 4

Thread: Begin Drag( )

  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Begin Drag( )

    I have a couple of TreeView windows in an applet and need to drag an item from one to the other. The EndDragAt(x, y) is working fine, however the BeginDrag(item) is not. It is moving to the extreme upper-left corner of the browser and attempting to drag from there. Here is the code:

    (Since I can't preview it I hope it looks ok.)

    PanelLocale = NavDesigner.RightFrameSplitPane.RightPane.LowerPan el.TaskLayoutArea.TaskLayoutAreaTreeView.GetRect ()
    List of String lsContents = NavDesigner.RightFrameSplitPane.LeftPane.LowerPane .GetContents ()
    String l
    for each l in lsContents
    Integer iLength = Len(l)
    if iLength > 2
    NavDesigner.RightFrameSplitPane.LeftPane.LowerPane .BeginDrag (1, "{l}")
    NavDesigner.RightFrameSplitPane.RightPane.LowerPan el.TaskLayoutArea.TaskLayoutAreaTreeView.EndDragAt ((PanelLocale.xPos + 30), (PanelLocale.yPos + 40))


    [This message has been edited by DJGray (edited 03-30-2001).]

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Begin Drag( )

    Can you try to use

    1)control.GetFocus()//get the focus on the object of interest
    2)mouse.GetPosition()//get the location of the object
    3)mouse.Click() //click on a reference point and add a relative distance
    4)mouse.GetPosition()//get the location of where you want to drag to
    BeginDragAt()//start dragging at location(x,y)
    5)EndDragAt()


    ------------------

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Begin Drag( )

    Is it possible that when you specify:
    it is failing to find the item you are identifying as "{l}"?
    Maybe you could call some other method to confirm that it is correctly finding the item?


    ------------------

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Begin Drag( )

    Vince and GodKnows,

    Thanks both of you for your replies.

    Vince, just above this call, I am calling Select(l) and it is selecting each item in the tree in succession.

    However, using something very similar to what GodKnows has suggested with the mouse, I am calling Cursor.GetPosition() after each Select() in the 'for each' loop. I figured since I can select it, I can call that position relative to the entire window and then pass that to BeginDragAt(x, y) rather than BeginDrag(item).

    IT WORKS!!

    Thanks again for your input.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:21 PM.

Copyright BetaSoft Inc.