Hello,
I have a problem using Variant and Overriden variables.
I try to Explain:
1) I have a GUI Class called: PROVA with Bounds = 120,120; A rectangle as Background , color RED....and some method like Init(), DrawCircle() and so on, to Draw a circle in the middle of the GUI by using a Chora Variable (point) called CircleSize and containing this Value <20,20>.
2) I have created the Style = [Resized];
3) I have created a Variant of the Class PROVA called PROVA_Resized with VariantCond = [Resized]; In this Vclass I have override only the Bounds size to 320,240, the color of the rectangle Background to YELLOW and the Chora Variable CircleSize to this size = < 50,50>.
If I try to Start the Prototyper with the Styles=[Resized] with Embedded Wizard Studio, it seems to work ok (the size of The Bound is 320,240 and the Background is the one choosed), except when the method DrawCircle(); evalaute the Variable and in this case it draw the circle with 20,20 not 50,50.
Why?
To bypass this problem I have seen that I have to use one of these solution:
1) Override also the method DrawCircle that use thaeVariable, with the same code of the inherited class t(but, to me is not a good solution because I don't want to rewrite the same firmware code...)
2) Create a slot in the original Class that invoke the method DrawCircle(), and call the slot using postsignal... This is the solution that I'm currently using but I don't like it so much.
So the question is: I'm wrong in something? Is there any other (and correct) solution by evaluate the overriden Variable of the VariantClass?
Thank you in advance.