Subclassed Controls? Of course!

  1. 3 months ago

    Sascha S

    Feb 19 Pre-Release Testers, Xojo Pro Germany
    Edited 3 months ago

    I would like to give a general advise to Xojo Starters and Parttime Devs like myself.

    We often read in this Forum that as Projects grow bigger, there's sometime the need to change the behaviour and/or design of a Control used throughout the Project. Which means the Devs need to update all instances of the Control within the Project. Not always this can be done via "Replace all". I've experienced it in my own Projects more then once.

    My advice would be to Subclass each new kind of Control used in your Project, even if you do not plan to modify it. And if there's a need at some point to add a Feature to a Control or to change the Design of a Control across the whole Project, you simply do the needed changes to your Subclassed Control. AFAIK: The changes will then automatically be used across all instances of this Control Subclass.

    I did not try this, but i think it is possible to make Subclasses of Controls an external Ressource.

    Xojo Docs: http://docs.xojo.com/UserGuide:Subclassing_Examples

  2. Wayne G

    Feb 19 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    If you do this then you can filter your library to "Project Controls" which will give you a nice little subset of the list to improve productivity and make it less likely to use a non-sub-classed control.

    If you have controls that are only used once add the attribute "HideFromLibrary" to the control to remove it from the list.

  3. Tim H

    Feb 19 Pre-Release Testers Portland, OR USA

    @SaschaSchneppmueller I did not try this, but i think it is possible to make Subclasses of Controls an external Ressource.

    Yes. And you can create you own personal template so they are there automatically when you start a new project.

or Sign Up to reply!