266 views
in GUI Development by

I was hoping to create constants for screen width and screen height:

Then use something like this for bounds

Is it possible to use a constant during the assignment of bounds size?

1 Answer

+1 vote
by
 
Best answer

Hello Kane,

yes, the properties can be initialized with expressions also including constants as long as you assign the expression directly to the property (e.g. to Bounds).

In turn, the values subordinated to the property (e.g. x2) don't accept expressions other than literals (e.g. numbers). These subordinated values are exposed for the convenience only and they are mapped automatically to a single literal which is then assigned to the original property.

Try following:

Here you assign an expression to the property Bounds to calculate its complete rect value. Please note the usage of the rect() instant constructor to create the rect value. Also please note, when you assign an expression other than literal to the property, the subordinated values (e.g. x2) disappear later.

Does it help 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

...