SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    inheritance of the winclass class

    In the winclass.inc file, I put this code snippet in and it worked:
    ------------------------
    void LeftClick ()
    Click(1,5,5)
    ------------------------

    I'm essentially trying to override the Click function defaults with this new LeftClick method that can be used by any window declaration (just like click).

    Anyway, I want to *move* this method to an alternative location (myfuncs.inc).

    So I moved this method to myfuncs.inc like this:
    ------------------------------------
    winclass AnyWin : AnyWin
    void LeftClick ()
    Click(1,5,5)
    ------------------------------------

    I get a compile error stating that function LeftClick is not defined for mybrowserchild.mybutton


    Am I not inheriting the Anywin class correctly?

    Is there a way to have this method defined for the AnyWin class without physically placing it in the winclass.inc file?

    thanks for your help!


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

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: inheritance of the winclass class

    I think what you are trying to do is strictly impossible. Silk is probably loading the .inc files into memory hence any additional function will not be allowed. Correct me if I am wrong.

    Your best bet:
    1)Create a class with different name inherited from AnyWin.

    2)Make a backup of original .inc and start changing the winclass.inc.

    It's possible to crash your silk when you change .inc that silk loads at startup.

    [This message has been edited by GodKnows (edited 01-29-2002).]

  3. #3
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: inheritance of the winclass class

    yeah, it looks like I'll have to stick w/ putting it in the AnyWin class....

    It's a simple call with no ambiguity, so I'd be surprised to see it crash silk...

    Out of curiosity, AnyWin : AnyWin essencially accomplishes the same as creating a new class (w/out the new class), correct?

    thanks...

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

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: inheritance of the winclass class

    Anywin : Anywin in my opinion is not possible even in the winclass.inc because it's a redefinition. You can only declare a variable once. Also it makes Anywin's definition infinite. Try to find an end to your definition and you will not

    Strictly speaking of the form the answer is yes.

    LHS is the child
    RHS is the parent

    Child inherites all public properties from parent.

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

 

 

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 03:56 PM.

Copyright BetaSoft Inc.