SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Oct 2001
    Location
    Beaverton, OR, USA
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Class mapping: Standard to Custom

    We have created several classes that are derived from basic Silk control classes. For example, we created a extPushButton class that derives from PushButton.

    I want to be able to create class mappings so that when I record window declarations, they are recorded using the derived classes instead of the standard ones (extPushButton instead of PushButton). I have created a class map, but this does not seem to do the trick.

    Has anyone made this work? Does Silk support mapping Standard controls to custom?

    Does anyone have any better ideas? (I do not want to override the PushButton class itself--I would strongly prefer to use derived classes.)

    I am using Silk 5.0.3.2, if it makes a difference.



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

  2. #2
    Senior Member
    Join Date
    Dec 1999
    Location
    Sarasota FL USA
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Class mapping: Standard to Custom

    There are two ways that I do this. First, if the added functions you created in the extpushbutton you want to use for all pushbuttons, then you can create the class this way:

    winclass Pushbutton : Pushbutton
    Function()
    Code
    ....

    This will take the function you enter in the class and add them to the standard Pushbutton class.

    Second way, if only a few buttons needs this is to change the type in the window dec by hand or with search and replace.


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

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

    Re: Class mapping: Standard to Custom

    Thanks. As stated above, I really don't want to override the classes themselves, so, it looks like search and replace.

    We contacted Segue and they said there was no way to make the window recorder recognize PushButton as extPushButton.



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

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Westford, MA, USA
    Posts
    160
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Class mapping: Standard to Custom

    You could put the class map in the tag statement of your custom class:

    But then Record - Window Declarations will report back the extPushbutton class for *all* push buttons, not just selected ones. I'm not sure if that's what you want. Still, since your custom class is not called PushButton, you're not really overriding the 4Test class. You can still use the scope resolution operator to hop up the inheritance tree and get to any method of the original PushButton class. Example:

    Don't know if that's what you're going for.
    AG

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


    [This message has been edited by agroves (edited 01-02-2002).]

    [This message has been edited by agroves (edited 01-02-2002).]

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

    Re: Class mapping: Standard to Custom

    Thanks. That may prove to be very helpful.

    Nathan

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

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

    Re: Class mapping: Standard to Custom

    I agree with segue, you can not recognize the standard push button as ExtPushButton. By doing so the whole sence is lost.

    Second you can not use custom functions on standard controls by simply mapping them. U need to write the code for that

    ------------------
    Sree
    Sree

 

 

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

Copyright BetaSoft Inc.