SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jun 2000
    Location
    CA
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Windows declarations with custom objects

    I have an application wherein some of the windows declaration looks something like this. I didn't bother to include my entire testframe coz it's long. I have lots of custom objects. What's the way around this? I was thinking of mapping these custom objects but since I don't know what they are I have no idea which object should I mapped them to.

    My other problem is when I create my script since there is quite a bit of hierarchy from the parent window. I had to type
    Mainwin.Toolbox.Toolbox.AfxOleControl.SoOn.AndSoFo rth.Click ()

    Is there a way I can minimize typing long names? I can rename the names to a shorter tagnames but aside from this, is there any other way I can do something like this

    Toolbox = Toolbox.AfxOleControl.SoOn.AndSoForth

    or something. I don't know what's the proper syntax, if that indeed is possible. Thanks in advance!

    [-] CustomWin Toolbox
    [+] msw multitag "[AfxControlBar42u]Toolbox"
    [ ] "[AfxControlBar42u]$59420"
    [-] CustomWin Toolbox
    [+] msw multitag "[AfxWnd42u]Toolbox"
    [ ] "[AfxWnd42u]$103"
    [-] CustomWin AfxOleControl42u1
    [ ] msw tag "[AfxOleControl42u]$0"
    [-] CustomWin TemplateViewer
    [+] msw multitag "[AfxWnd42u]Display"
    [ ] "[AfxWnd42u]$103"
    [-] CustomWin Afx160000081
    [ ] msw tag "[Afx:1*:8]$59648"
    [-] CustomWin Afx160000081
    [ ] msw tag "[Afx:1*:8]$59952"
    [-] CustomWin Afx1600000010011601
    [ ] msw tag "[Afx:1*:0:10011:6:0]$101"
    [-] ListView ListView1
    [ ] tag "$0"

  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)

    Re: Windows declarations with custom objects

    I'll just respond to your multiple ancestor problem.

    You can declare

    const Tools = Toolbox.AfxOleControl.SoOn.AndSoForth

    You can also remove the child object from the parent declaration and add a parent statement to the child declaration.

    For example

    window MainWin MyParent
    tag "My Parent"

    CustomWin Tools
    tag "[Custom]#1"

    could be made into

    window CustomWin Tools
    tag "[Custom]#1"
    parent MyParent

    This way you can refer to Tools directly instead of MyParent.Tools.

    Hope this helps.


    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  3. #3
    Junior Member
    Join Date
    Aug 2000
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Windows declarations with custom objects

    You can also modify tags to shorten the length of method calls.

    Ex:
    MainWin Main
    tag "maintag"
    CustomWin Win1
    tag "Win1tag"
    CustomWin Win2
    tag "Win2tag"
    Boom() /// some method

    To call the method Boom:
    Main.Win1.Win2.Boom()

    You could reorganize the class structure to:

    MainWin Main
    tag "maintag"
    CustomWin Win1
    tag "Win1tag"

    CustomWin Win2
    multitag "Main.Win1.Win2" // identifiers
    "maintag/Win1tag/Win2tag" // tags
    Boom() /// some method

    Now to exectue Boom:
    Win2.Boom()

    Also, check out the 'with' statement in help.

  4. #4
    Member
    Join Date
    Jun 2000
    Location
    CA
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Windows declarations with custom objects

    Thanks to both of you. This helps. I guess, I still need to figure out how I go about the custom objects declarations.

  5. #5
    Junior Member
    Join Date
    Nov 2000
    Location
    Fremont, CA, USA
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Windows declarations with custom objects

    You can, many times, map the control objects to 'ignore'. Of course, this will not always work. Some objects are containers for more objects (in which case ignoring them will not allow you to access the objects inside them), and others look like containers in a hierarchal (sp?) sense but, even when ignored, will still allow access to the 'lower' objects. Man that was a run-on

    Once you determine which objects can be mapped to 'ignore', save the options file (*.opt) and be sure to keep that with your scripts when you share them. This can also be done programmatically but it's a pain in the neck . The easy way to test if something can be ignored is by mapping it, then recompiling and doing a 'Record|Windows Identifiers' and determining whether or not you can still get to the sub-objects.

    Hope that helped a little ...


    ------------------
    Tad
    =^{D}
    Tad
    =^{D}

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

    Re: Windows declarations with custom objects

    Tad is right on target. Class-mapping to Ignore will sometimes cause child objects to be hidden as well. In that case, you just have to deal with the extra layer.

    You can embed parent tags in the tag for a child, however, so that you can remove a layer from your references.

    Example:

    ListBox MyList
    tag "[ExtraSpecialCustomWin]#1/[ListBox]Names:"

    Hope this helps

    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

 

 

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 02:23 PM.

Copyright BetaSoft Inc.