397 views
in Embedded Wizard Studio by

Hi.

I created a class named "Page" that has a Core::Group class as its superclass.

This class contains the basic implementation of the configuration that is displayed on the screen.

I then created a "PageA" class that has "Page" as its SuperClass.

"Page Text" is a single screen that implements the ability to display text on the screen.

 

At this point, we were done implementing all the features and decided to create additional pages with different "styles" based on user requests.

I created a variant of the "Page" class named "PageStyleA" and set the "VartiantCond" to"StyleA".

I then created a variant for "PageText" called "PageTextStyleA" and set the "VariantCond" to "StyleA".

 

At this point, I want PageTextStyleA to have the functionality of PageText with StyleA applied.

I've attached an example project. Page and PageStyleA have different background colors.

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=10446593427205159796

 

In the image below, the solid lines are inherited from SuperClass and the dotted lines are created from Variant.

 

How can I inherit the functionality of PageText with StyleA applied?

 

 

1 Answer

0 votes
by
Hello eloiz,

your question is not fully clear for me. Are you asking for a possibility to see the implementation added to some variant V inside a class B which descend from the class A being overridden by the variant V?

If yes, this is not possible. The functionality added to a variant is visible in context of this variant or other variants descending from it only. Since variants can be activated and deactivated dynamically, switching the functionality would result in different interface of the original class. Being a static typed language, Chora does not support such dynamic interface alternation.

Maybe knowing your application case (what exact do you expect to achieve) could help me to provide you the right solution.

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...