SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    May 2001
    Location
    Australia
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Drag and Drop in JavaJFCTable

    I have written a script that Drags an item from one JavaJFCTable to another and it works fine on my computer.

    I have used a Combination of table.GetRect() and table.GetCellRect() to determine start and end drag locations relative to the main dialog as the values realtive to the tables does not work.

    Two questions.
    1. When I use BeginDragAt and EndDragAt relative to the JavaJFCTable it is way off. Can anyone suggest why? ie fromTable.BeginDragAt( button, xStart, yStart) toTable.EndDragAt( xEnd, yEnd )
    2. The script that works(I got to work) on my computer does not work on my co-workers pc. It is 50-55 units off. Can anyone suggest why?
    MainDialog.BeginDragAt( button, xStart, yStart, MASK) MainDialog.EndDragAt( xEnd, yEnd ) NOTE : no hard coded values

    code: Does not work at all - it should though
    =============
    [ ]
    [ ] const Integer LEFT_BUTTON = 1
    [ ] const Integer NO_MASK = 0
    [ ]
    [ ] RECT fromRect = fromTable.GetCellRect( fromCell )
    [ ] RECT toRect = toTable.GetCellRect( toCell )
    [ ]
    [ ] // Start position
    [ ] Integer xStart = fromRect.xPos
    [ ] Integer yStart = fromRect.yPos
    [ ]
    [ ] // End position
    [ ] Integer xEnd = toRect.xPos
    [ ] Integer yEnd = toRect.yPos
    [ ]
    [ ] fromtable.Click( LEFT_BUTTON, xStart - 100, yStart ) // this is just to highlight the row
    [ ]
    [ ] fromtable.BeginDragAt( LEFT_BUTTON, xStart, yStart, NO_MASK ) // Should start the drag
    [ ] totable.EndDragAt( xEnd, yEnd ) // should end the drag
    [ ]
    [ ]



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

  2. #2
    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: Drag and Drop in JavaJFCTable

    Try adding a few pixels to the x and y of the EndDragAt() positon. It's a shot in the dark but I've had better luck with this approach.

  3. #3
    Junior Member
    Join Date
    May 2001
    Location
    Australia
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag and Drop in JavaJFCTable

    This is our only option at the moment.
    However the amount to add or subtract differs on our machines.
    Probably have to add a "fudge factor" setting in an ini file.

    dw


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

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

    Re: Drag and Drop in JavaJFCTable

    Yo:

    When you say: "differ in our machines" Is it because of different screen resolution and monitor size?

    If so, you can use user32.dll api provided by Silk. There are some useful functions like for example GetClientRect(), ScreenToClient() and ClientToScreen(). So you can make a conversion function to handle different machines.

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

 

 

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 10:38 AM.

Copyright BetaSoft Inc.