SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Guest

    Problems with GetRect

    Help! Many people have said how 'great' the GetRect method is but why can't I get it to work?!?

    Background: Working with Java application using SilkTest 5.5 sp 3. We have recently upgraded to JDK 1.4.0_01

    I am attempting to drag and drop an icon (the drag and drop icon) to a folder in a treeview. Our application will then put that item in the specified treeview folder.

    This works but I was trying to avoid hardcoding since the folders often change positions:

    AC_Desktop.DragMouse (1, 453, 120, 196, 286)

    These are the combinations that I have tried and the corresponding error messages:

    SCENARIO 1
    [ ] AC_Desktop.SetActive ()
    [ ] AC_Desktop.DesktopMain.ADOFinderTab.Select ("ADO Lists")
    [ ] RECT rect
    [ ] AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.ExposeItem("US SHARES/NYSE")
    [ ] rect = AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.GetItemRect("US SHARES/NYSE", TRUE)
    [ ] print (rect)
    [ ] AC_Desktop.BeginDragAt (1, 453, 120)
    [ ] AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.EndDrag ("rect")


    RESULTS 1:
    {40, 160, 56, 17}
    *** Error: Item 'rect' was not found

    SCENARIO 2
    [ ] AC_Desktop.BeginDragAt (1, 453, 120)
    [ ] AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.EndDrag ("NYSE")

    RESULTS 2
    Drags and drops item but puts it in a random place which is NOT the NYSE folder. Have also tried . . . EndDrag ("US SHARES/NYSE") which is the full path

    SCENARIO 3
    rValue = AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.NYSE.GetRect ()
    AC_Desktop.BeginDragAt (1, 453, 120)
    AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.EndDrag ("rValue")

    RESULTS 3
    NYSE not defined in window

    SCENARIO 4

    [ ] AC_Desktop.SetActive ()
    [ ] AC_Desktop.DesktopMain.ADOFinderTab.Select ("ADO Lists")
    [ ] RECT rValue
    [ ] rValue = AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w ("US SHARES/NYSE").GetRect ()
    [ ] AC_Desktop.BeginDragAt (1, 453, 120)
    [ ] AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.EndDrag ("rValue")

    RESULTS 4

    Function ADOListsTreeView is not defined


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

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with GetRect

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by QATester25:

    SCENARIO 1
    [ ] AC_Desktop.SetActive ()
    [ ] AC_Desktop.DesktopMain.ADOFinderTab.Select ("ADO Lists")
    [ ] RECT rect
    [ ] AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.ExposeItem("US SHARES/NYSE")
    [ ] rect = AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.GetItemRect("US SHARES/NYSE", TRUE)
    [ ] print (rect)
    [ ] AC_Desktop.BeginDragAt (1, 453, 120)
    [ ] AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.EndDrag ("rect")

    <HR></BLOCKQUOTE>
    Why are you collecting the rect and then trying to refer to an item in your tree called "rect". You are actually doing nothing with the rect value here...?
    The EndDrag method takes a string or an integer. It would never know what to do with a rect.
    However you could get the correct coordinates from the rect for the EndDragAt method which takes the x and y of the release point.


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


    [This message has been edited by johntest (edited 11-07-2002).]
    Tempus fugit, Carpe Diem, et al

  3. #3
    Senior Member
    Join Date
    Dec 2000
    Location
    Phoenix, AZ
    Posts
    371
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with GetRect

    If you want to drag and drop something you may want to Use BeginDragAt and EndDragAt. EndDrag requires an item to be passed to it while EndDragAt requires coordinates be passed.

    Using the values that were assigned to "rect" you could do something like:

    EndDragAt(rect.xPos, rect.yPos)

    or if you need to move somewhere else from that position:

    EndDragAt(rect.xPos+10, rect.yPos+20)

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

  4. #4
    Guest

    Re: Problems with GetRect

    Thank you for all your help and efforts but I still can't get this to work. I even contacted Tech Support and they verified that it does not work on my Java application. . . So I guess it must be a bug within SilkTest. . . Until it gets fixed I will have to use the DragMouse method.

    AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.EndDrag ("NYSE") //drops in incorrect folder

    [ ] rect AC_Desktop.DesktopMain.ADOListsTab.ADOListsTreeVie w.GetItemRect("US SHARES/NYSE")
    [ ] print (rect.xPos, rect.yPos)//prints 40, 160 when the coordinates using DragMouse are: 87, 261. Consequently, it drops it in the wrong folder


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

 

 

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 07:25 AM.

Copyright BetaSoft Inc.