17 views
in GUI Development by
Hi,

Curious as to why Constants have to be Project members rather than being able to be members of a class. It's not a huge problem but I'm working on localising my project and want to include some language specific tweaks – for example changing text padding. A localised Constant seems perfect for this as I can set the default and then add value for the languages that need it. I've created a Constants Unit to put them in but as they are specific to a Class I'd prefer to have them defined in the Class so I don't have to go hunting for them in the Constants unit (and embedding the class in the name so it's obvious where it's used when looking at the Constant Unit). I can't think of any reason why they couldn't go in a Class so curious as to the reason for the restriction.

Thanks, ...rob

1 Answer

0 votes
by
 
Best answer
Hello Robert,

when creating Embedded Wizard more than 20 years ago we had the resource usage in mind. We decided therefore to manage bitmaps, fonts and constants as project global entities. The limitation should prevent the user from creating local duplicates of similar entities and motivate the user to structure and reuse the bitmaps, fonts and constants meaningfully.

At the same time we feared that users would be overwhelmed with different options where to store a constant or bitmap/font. The idea was to provide a simple environment where GUI project can be created by user even without any object-oriented programming background.

The reasons are thus more historical nature. If we were to develop the system today, we would certainly have made some decisions differently.

I hope it answers your question.

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

...