SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Sep 2002
    Location
    ca
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Expand all treeview?

    I am surprised SilkTest doesn't have an ExpandAllTreeView() method that will allow expanding all treeviews.

    Does anyone have already customized function created to do this? I don't want to do reinvent the wheel if it already exists.

    Thanks a lot.


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

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Location
    San Diego,CA,USA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expand all treeview?

    here is an inefficient solution but should work
    ------------------


    [This message has been edited by AUTOMATION_GURU (edited 01-09-2003).]

  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    448
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expand all treeview?

    The strings "Expand" and "TreeView" return a lot of interesting links from an advanced search for the SilkTest forum.

    One is this Multi-Level treeViews check out the others to stop from re-inventing the wheel

    ------------------
    never say die

    [This message has been edited by witchcrop (edited 01-08-2003).]
    Life, that dares send, A challenge to his end,
    And when it comes say, Welcome friend.

  4. #4
    Senior Member
    Join Date
    Dec 1999
    Location
    Sarasota FL USA
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expand all treeview?

    With our application, which has a couple different tree view controls, the way to expand all is different. In one we select the parent and do a key press of the asterisk key which expands all trees at all levels. Where the Plus expands only the current. The other control we use we have to go down the tree item by item pressing the plus key to get everything expanded.

    Check and see if there is a way to expand everything with a key stroke, and then use that in your script.


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

  5. #5
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expand all treeview?

    For most treeviews, try using TypeKeys ("<Shift-#Times>") to expand the entire tree, or just TypeKeys ("<#Times>") to expand only the parent and children.
    Hope this helps,
    Steve

    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  6. #6
    Junior Member
    Join Date
    Dec 2003
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expand all treeview?

    I had the same problem nika. We ended up using the following

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">VOID ExpandAll (WINDOW wTreeToExpand)
    Integer iTotalItems = wTreeToExpand.GetItemCount()
    for (Count = iTotalItems; Count &gt; 0; Count--)
    wTreeToExpand.Expand(Count)
    if (wTreeToExpand.GetItemCount()&lt; wTreeToExpand.GetItemCount(true))
    ExpandAll(wTreeToExpand) </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">The do a: LIST OF STRING lsWhatever = wTreeToExpand.GetSubItems (1)

  7. #7
    Junior Member
    Join Date
    Sep 2004
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Expand all treeview?

    This one really works well
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> ExpAll(window wTree, STRING sItemName)
    {

    oENTERPRISEDESIGNER.SetActive();
    wTree.ExpandItem(sItemName);
    BOOLEAN bTextMatches = True;

    while (bTextMatches == True)
    {
    INTEGER iItems = wTree.GetItemCount();
    wTree.Select(wTree.GetSelText());
    if (!MatchStr (&quot;{sItemName}*&quot;, wTree.GetSelText()) &amp;#0124;&amp;#0124; (wTree.GetSelIndex()&amp;gt;=iItems))
    {
    if (MatchStr (&quot;{sItemName}*&quot;, wTree.GetSelText()))
    {
    if (wTree.IsItemExpandable(wTree.GetSelText()))
    {
    wTree.TypeKeys(&quot;&amp;lt;Right&amp;gt;&quot;
    bTextMatches = True;
    }
    else
    bTextMatches = False;
    }
    else
    bTextMatches = False;
    }
    else
    {

    wTree.TypeKeys(&quot;&amp;lt;Right&amp;gt;&quot;
    bTextMatches = True;
    }

    }

    }</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

    [ 08-08-2006, 07:47 AM: Message edited by: jamesso ]

 

 

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 09:26 PM.

Copyright BetaSoft Inc.