SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Junior Member
    Join Date
    Jul 1999
    Location
    Ottawa
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Identical windows with different parents

    Hopefully someone can help out with this one.

    I am testing two different (related) applications, both of which bring up a Color dialog. These dialogs are identical. The only difference is that each have a different parent window.

    I have a generic method that I would like to use in both instances to verify that the window is invoked when a colour box is clicked.

    4Test won't detect the Color dialog unless it has a parent statement in the frame file. Since the parent differs, I don't want to have to specify a parent window. The dialog doesn't register as a MessageBox, so I can't use that option.

    Does anyone know of a way to define the window in the frame file in such a way that it can be detected, regardless of its parent window?

    Right now, I have:

    DialogBox Color_1
    tag "Color"
    parent Parent1
    ...

    DialogBox Color_2
    tag "Color"
    parent Parent2

    What I would prefer to have is something similar to the following:

    DialogBox Color
    tag "Color"
    ...

    Any ideas/suggestions?

    Fraser Gordon
    e-fr@hotbot.com

  2. #2
    Junior Member
    Join Date
    Oct 1999
    Location
    Austin, TX
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identical windows with different parents

    We ran into this, too. We solved it by creating a class called MultiParentDialogBox.
    It looks like this:

    ------------------------------------
    winclass MultiParentDialogBox : DialogBox
    tag DetermineTag()

    STRING DetermineTag()
    STRING sParent
    WINDOW wParent

    for each sParent in this.lsParents
    do
    wParent = @(sParent)
    if ( wParent.DialogBox(this.sTag).Exists() )
    return "{WindowTag(wParent)}/{this.sTag}"
    except
    if ( ExceptNum() != E_UNDEFINED )
    reraise

    raise E_WINDOW_NOT_FOUND, "*** ERROR: Window ""{this}"" does not exist"
    ------------------------------------

    Then, the window declaration looks like this:

    ------------------------------------
    winclass ColorClass : MultiParentDialogBox
    STRING sTag = "[DialogBox]Color"
    LIST OF STRING lsParents = {...}
    "Parent1"
    "Parent2"
    ------------------------------------

    Sorry about the indention, the input field is kinda small. Hope this helps!

  3. #3
    Junior Member
    Join Date
    Oct 1999
    Location
    Austin, TX
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identical windows with different parents

    Oops, I forgot the custom Exists method for MultiParentDialogBox. You'll need it, too.

    BOOLEAN Exists(NUMBER nTimeout optional)
    do
    return derived ::Exists(nTimeout)
    except
    if ( ExceptNum() == E_WINDOW_NOT_FOUND )
    return false
    else
    reraise

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

    Re: Identical windows with different parents

    There are several ways to do this. You can use Dena's method, except that I do it a little differently. I often create the class, place methods in the class, then make two or more instances of the class which have the parent statements in the instance.

    [-] winclass MyColorClass : DialogBox
    [ ] tag "Color"
    [ ]
    [-] Method ()
    [ ] //
    [ ] //
    [ ] //
    [-] window MyColorClass Color1
    [ ] parent FirstPrnt
    [ ]
    [-] window MyColorClass Color2
    [ ] parent SecondPrnt

    This is a lot easier than figuring out the right tag. Sometimes you need to do that when you can't figure out how many objects there or, but I don't think that applies here.

    You can also use multitag and just put the parent statement in with the rest of the tag.

    [-] window DialogBox Colors
    [-] multitag "[Dialogbox]FirstPrnt/Colors"
    [ ] "[DialogBox]SecondPrnt/Colors"

    Let me know if you have questions.

    John Green
    Moderator


    [This message has been edited by John Green (edited 07-19-1999).]

    [This message has been edited by John Green (edited 07-19-1999).]

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

    Re: Identical windows with different parents

    I have a similar problem. I have different parents with different specifiers. One parent is a dialog box while the other one is a main window. how do i go about this? i tried the multitag statement but i get an error that multitag prefix differs from first item .

    thanks in advance for your ideas!

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

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

    Re: Identical windows with different parents

    i found out a way in the other thread by using "~ActiveApp\window"

    this worked.

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

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

    Re: Identical windows with different parents

    i guess, i spoke too fast. "~ActiveApp/Window" works but not completely. It works if my parent is a window but if it is a dialog, it returns an error.

    Any ideas. Thanks!

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

  8. #8
    Junior Member
    Join Date
    Feb 2001
    Location
    Portland, OR, USA
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identical windows with different parents

    Try this


    [-] window DialogBox Colors
    [-] tag "../Colors"
    [ ]

    No parent statement.

    Works for me.

    ------------------
    Bill Hull
    QA Engineer
    Timberline Software
    www.timberline.com
    Bill Hull
    QA Engineer
    Timberline Software
    www.timberline.com

  9. #9
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Identical windows with different parents

    I do the following to just get whatever the current parent is:

    create the following in an inc file that gets compiled via frame file.

    window AnyWin wAnyParent
    {
    tag GetCurrentParent ();
    }

    and then assign wAnyParent as the parent.

    This seems to work better than the ~ActiveApp

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

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

    Re: Identical windows with different parents

    TonyM,
    is GetCurrentParent() a user defined method?

    thanks.

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

 

 
Page 1 of 2 12 LastLast

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:02 AM.

Copyright BetaSoft Inc.