SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Problems scrolling List Header buttons into view

    I'm running into trouble with a List view test. I need to test that the columns in Detail mode can be sorted by clicking the header button. This works just great, except for cases where the header button is scrolled out of view (horizontally). Trying to click it gives an error message that the button is not exposed, yet ScrollIntoView does nothing to bring the header item into view. Even creating a horizontal scroll bar item and trying to scroll that seems to be causing problems.

    Anyone seen this problem who might be able to suggest a decent workaround?

    Thanks in advance,

    Fraser Gordon
    e-fr@hotbot.com

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problems scrolling List Header buttons into view

    Fraser,

    I would try this in a loop using do..except. You can check for the error and if its the one you expect, (because its not in view), then scroll the scroll bar one page, then try again. If you're successful or the scroll bar is at max, you can exit the loop.

    The example below assumes my TaskManager declarations from Windows NT.

    John


    [-] main ()
    [ ] WINDOW wListView = TaskManager.Processes.ProcessList
    [ ] WINDOW wButton = TaskManager.Processes.ProcessList.ProcessHeader.Th reads
    [ ]
    [ ] PickHeaderButton (wListView, wButton)
    [ ]
    [ ]
    [-] BOOLEAN PickHeaderButton (WINDOW wListView, WINDOW wButton)
    [ ] INT iErrorYouExpect = E_WINDOW_NOT_EXPOSED
    [ ] INT iCurrentPosition
    [ ]
    [ ] // GET THE SCROLL BAR RANGE
    [ ] SBRANGE sb = wListView.HScrollBar.GetRange ()
    [ ]
    [ ] // FIND THE MAX
    [ ] INTEGER iMaxPosition = sb.iMax
    [ ]
    [ ] // LOOP UNTIL WE FAIL OR SUCCEED
    [-] while TRUE
    [ ]
    [ ] // DO THE CLICK, IF WE SUCCEED RETURN TRUE
    [-] do
    [ ] wButton.Click ()
    [ ] return TRUE
    [ ]
    [ ] // WE FAILED
    [-] except
    [ ]
    [ ] // CHECK FOR WHY WE FAILED
    [-] if (ExceptNum () == iErrorYouExpect)
    [ ] iCurrentPosition = wListView.HScrollBar.GetPosition ()
    [ ]
    [ ] // IF THE SCROLL BAR ISN'T ALREADY AT THE MAX, SCROLL
    [-] if (iCurrentPosition < iMaxPosition)
    [ ] wListView.HScrollBar.ScrollByPage (1)
    [ ]
    [ ] // AT THE MAX, RETURN FALSE
    [-] else
    [ ] return FALSE
    [ ]
    [ ] // SOME OTHER ERROR, RETURN FALSE
    [-] else
    [ ] return FALSE





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

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:55 AM.

Copyright BetaSoft Inc.