694 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 - 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

...