SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Nov 2001
    Location
    Mainz - Germany
    Posts
    92
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problems in winclass declaration / Error: Expecting a WINDOW

    Hi all,

    I have a problem while declarating a winclass:

    In the winclass functions, sometimes I wish to set the ParentWindow active. And sometimes
    I want to call a function of a "sister control", a function of another Child of the parent.

    Heres my code:

    [-] public winclass DyalogGrid : Table
    ...
    ARRAY [][] of STRING GetContents()
    ...
    [ ] WINDOW wParent
    [ ] WINDOW w = this


    When I continue with statements like
    [ ]wParent = w.GetParent ()
    or
    [ ]this.wParent.Menu1.MenuSelect(x, y, "Copy")

    I allways get the error
    [ ] *** Error: Type mismatch -- Expecting a WINDOW

    Please give me a hint so that I can stop
    taxing my brain...
    or ask for details...

    Thanks in advance

    Martin

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


    [This message has been edited by MKlein (edited 05-23-2003).]

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: problems in winclass declaration / Error: Expecting a WINDOW

    1. How are you creating an instance of DyalogGrid ? How do you set it's parent ?

    2. The "WINDOW wParent" and "this.wParent.Menu1.MenuS..." statements imply an attempt to variable-ize the usual static parent statement.

    "this" in the second statement automatically includes its entire parental hierarchy so the addition of "wParent" will not work.

    3. Going to a parent level for a control isn't usually necessary. Parents are only typically relevant with containers such as windows or dialog boxes.


    John


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

  3. #3
    Member
    Join Date
    Nov 2001
    Location
    Mainz - Germany
    Posts
    92
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: problems in winclass declaration / Error: Expecting a WINDOW

    Hi John,

    thank you for your reply, I just had a long weekend :-)

    1. How are you creating an instance of DyalogGrid ? How do you set it's parent ?
    <font size="2" face="Verdana, Arial, Helvetica">The declaration of the DyalogGrid class is
    included in my GUI declaration:

    [-] window DialogBox Currencies
    [ ] tag "Currencies"
    [ ] parent HomeSimCorpDimension33G
    ...
    [-] DyalogGrid Table1
    [-] tag "[DyalogForm*]#1/[DyalogForm*]#1/#1"
    [+] TextField TextField1
    ...

    I think it's O.K.?! I can use Currencies.Table1...
    without problems.


    2. The "WINDOW wParent" and "this.wParent.Menu1.MenuS..." statements imply an attempt to variable-ize the usual static parent statement.

    "this" in the second statement automatically includes its entire parental hierarchy so the addition of "wParent" will not work.
    <font size="2" face="Verdana, Arial, Helvetica">"this.wParent.Menu1.MenuS..." is rubbish, O.K.
    but "wParent = w.GetParent ()" should work
    without error, doesn't it?


    3. Going to a parent level for a control isn't usually necessary. Parents are only typically relevant with containers such as windows or dialog boxes.
    <font size="2" face="Verdana, Arial, Helvetica">SilkTest is not able to idetify the row names
    of Dyalog-Grids. So I have to open a 'cusomize
    dialog' witch will opened by an menuitem. In this
    dialog, I can read the row names. The rows can be
    customized, so that I have to read the names
    dynamically at runtime.

    So what can I do to get a handle for the parent?

    regards, Martin.

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: problems in winclass declaration / Error: Expecting a WINDOW

    Ultimately then, if I followed the fragments correctly, you want to to pick a MainWin HomeSimCorpDimension33G menuitem from inside the DyalogClass class:

    From the table control:
    Currencies.Table1.GetParent().GetParent() will return HomeSimCorpDimension33G

    From the DialogBox:
    Currencies.GetParent() will return HomeSimCorpDimension33G

    However, from inside class DyalogGrid you should use a loop to handle any possible dialogbox nesting:

    window wThisParent = this.GetParent()

    while (ClassOf(wThisParent) != MainWin) // find the mainwin
    {
    wThisParent = wThisParent.GetParent()
    }
    // now you can use:

    wThisParent.Menu1.MenuSelect(x, y, "Copy")


    John

 

 

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

Copyright BetaSoft Inc.