SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Mar 2002
    Location
    Lebanon, NH
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Click specific location in HtmlText

    Silk recognizes HtmlText( "Tab 1Tab 2Third TabFourth Tab" )
    The application actually has 4 tabs with names: "Tab 1", "Tab 2", "Third Tab", "Fourth Tab". I need a way to click a specific location within the string. The tabs are dynamic, and I can't know exactly what order they will be in. So, I don't know the names or the order, of the tabs.
    The parent window is only slightly larger than the string. I've gotten the RECT for the parent, and calculated the average number of pixels per character, then figured where the substring should be based on that. The problem with this method is tabs with very small names (e.g. "1"), or long names, skew the average too much and the click becomes inaccurate.
    Any suggestions?

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

  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: Click specific location in HtmlText

    When you said "I need a way to click a specific location within the string" it sounds like you have a single string to work with.

    You might consider using StrPos() to find the integer position of the specific string piece you want to click on. Read your wThen you would be able to loop through the items based on integer and when your loop takes you to the item represented by that integer you can click on it.

    Will this work for you?

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

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Location
    Lebanon, NH
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Click specific location in HtmlText

    I do have a single string to deal with.

    I don't think I quite understand your suggestion.

    I am using StrPos() to get the SubString's position. The difficult part is assigning a graphical position to the SubString to then click on.
    For example:
    STRING sMyStr = "abcdefghijklmnopqrst"
    How do I click specifically on "j" within sMyStr? Is there a way to get the cursor over a specific location in HtmlText, relative to the characters in the string?

    Thanks for the help,
    Joel

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

  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: Click specific location in HtmlText

    Well, your problem is a little tricky, and I'm not certain that I'm even visualizing it clearly, but what I gather is that you have a row of tabs that Silk is recognizing, but they are dynamic so you can't count on them being the same each time you want to access them, however, you are able to pull the string off the tabs and it comes of as one string. I also gather you are able to click on the tab(s) but are not certain where to do so. You also indicated that you were able to click based on estimated pixel space within a RECT, and it seemed that if you were able to use StrPos, you click would not need to be an estimate, but could be exact. It seems from your response that this is not the case, but that even with StrPos you are still estimating. Somehow, the string needs to be bound to a specific tab.

    Can you use keyboard strokes to manipulate this rather than clicks?

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

  5. #5
    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: Click specific location in HtmlText

    Just another thought...

    If you can accurately determine the position of "K" within that string relative to the RECT, can you use MoveMouse to get the mouse to the position you want it to be?

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

  6. #6
    Junior Member
    Join Date
    Mar 2002
    Location
    Lebanon, NH
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Click specific location in HtmlText

    What you've described is an accurate representation of what's going on. No, I cannot use keystrokes
    I can get the exact location of the SubString, but the reason I cannot get an exact location relative to RECT is because the average pixel size of each character is not accurate enough. With very long, and very short tab names the location is skewed just enough so that the MoveMouse will end up just to the left, or just to the right of the correct tab.

    I keep hoping that there is an undocumented method similar to Child.HtmlText("#1/(5:10,1:1)").Click()
    But the control would be relative to the characters in the string, like GetText( iStartCol, iNumCols), instead of the window.
    I'm working with Tech Support, but I'm not holding my breath.

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


    [This message has been edited by jhvincent (edited 04-12-2002).]

 

 

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 03:48 PM.

Copyright BetaSoft Inc.