104 views
in Embedded Wizard Studio by

Hi Support ,

I want to import "polymorphism" in Embedded Wizard project to implement a single interface to entities of different gui components.

Does EW  implement "polymorphism"?

Could you give me a simple code for "polymorphism", please.

 

The code in picture is a test for polymorphism.

it is in line with Chora?

Thank you.

Charles.

1 Answer

0 votes
by

Hello Charles,

in Embedded Wizard you can define an interface (e.g. diverse methods and properties) in a common base class. All classes descending from this base class inherit this interface implicitly. If it is necessary, in derived classes you can override the methods and provide other implementation. In your concrete case:

1. the common base class is GridComponents::GridVirtualClass.

2. Add to this common class the desired methods InitialF(), getGridValue(), etc. Similarly, if it is necessary, add desired properties to the class.

3. Implement the methods with their default functionality or leave the methods empty.

4. In the descending class (e.g. GridComponents::GridSizeaStylea) override the methods and implement there code particular to the derived class. See also: Override an inherited method.

5. At the runtime when invoking the method, the corect vwersion is determined dynamically depending on the instance of the object in context of which the method is invoked.

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

...