167 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

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...