SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Window dec inside a class? Dynamic

    hello,
    I had a quick question re classes and window declarations. The AUT isn't a windows program, so in previous versions we were using a static window declaration in order to click buttons on a given screen:
    =======================================
    winclass MyButton : AnyWin

    string sID="", sCoordinates=""
    window DialogBox StartScreen
    --->tag sID
    --->MyButton StartButton
    ------>tag sCoordinates

    (---> = indenting)
    ======================================

    then in our scripts, we'd set the tag and coordinates (sID / sCoordinate) variables in order to StartScreen.StartButton.Click ( )

    However, in our new version we need to put the window declaration in a class (as we're using multiple threads and don't want to have shared variables slowing down our testing).

    I'd really like to set up something similar to what's below:
    ============================================
    winclass MyButton : AnyWin

    winclass Test
    string sID
    string sCoordinates
    DialogBox Screen
    --->tag sID
    --->MyButton Button
    ------>tag sCoordinates
    ==========================================
    (please note: ----> used to show indenting)

    .. but silktest doesn't like that (a property cannot be a tag). Is there a way to put a window declaration inside a class that will allow us to change the tag / coordiantes at will?

    I tried :

    window wScreen=DialogBox(sID)

    that works for the Exists( ) method, but
    I don't know how to define buttons underneath wScreen in order to do some clicking...

    So I think so far I'll have to use this:
    =========================================
    //global variables
    list of string sTags={"","","",""}
    list of string sCoord={"","","",""}

    winclass Test
    int iIndexToUse
    DialogBox Screen
    --->tag sTags[iIndexToUse]
    --->MyButton Button
    ------>tag sCoord[iIndexToUse]
    ========================================
    where each list element is reserved for a particular thread, and we'd set the tag values/coordinates there... but that's ugly as hell. There's got to be a better way!

    I hope I've explained myself well enough for you to grasp what I need to do. If not, feel free to let me know and I'll [try to]provide more details. I think I'm missing something trivial...

    Thank you for your time, energy and effort - it's appreciated.
    take care,
    Steve

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


    [This message has been edited by Meanface (edited 03-18-2003).]

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Window dec inside a class? Dynamic

    One way of doing it which is allowed by silktest is to make the tag a function call e.g.
    That way you can happily set tag and co-ordinates at will.
    P.S. To get nicely indented code examples in your post, use UBB code; when you're posting, there is a link on the left of the page which explains everything you need to know.

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

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Window dec inside a class? Dynamic

    hey, that works really well, thanks a lot.
    I knew there was some easy solution.. just couldn't find it!

    thanks again
    Steve

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

  4. #4
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Window dec inside a class? Dynamic

    we used a solution like this for the menus on one of our apps. We define the string for each object like this:

    then we can use it with function calls that are inherited from ACFMenuItem class.

    that might give you some ideas of how you can do this.

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

  5. #5
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Window dec inside a class? Dynamic

    Ryan - I don't quite understand how this saves you effort.
    If you want to be able to get away with not setting a tag for classes inheriting ACFMenuItem, then you will need to redefine every method in terms of your 'position' field instead of the tag - for example the IsChecked method.
    Or if you don't redefine every method, then you will need to set the tag anyway, so I don't see what you gain with the use of the 'position' field in the Check() method?

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

  6. #6
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Window dec inside a class? Dynamic

    its just an example vince, but it allows dynamic window definition since the 'tag' is now the variable 'position' and since its a var you can change it. Thus, dynamic tags.

    It was just and example and maybe a poor one for this instance but it is what I am starting to use for all these menus that I cant seem to get to work($popupstart).

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

 

 

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

Copyright BetaSoft Inc.