822 views
in GUI Development by
Hello,

 

Is it possible to have an action button with a gradient color?

 

Thanks again

 

Giorgio

1 Answer

0 votes
by

Actually, the Action Button from the Gallery folder Flat has its predesigned look-and-feel not supporting gradients per-default. You can, of course, open the unit Flat and copy the class ActionButton to one of your own units and then adapt it to your needs. For example, you can remove the background view Frame and add at its place a new view Rectangle you configure to show a gradient. However, please consider the widgets from the folders Flat, XFlat, Steel and Charts as implemented for their particular look/feel. As such they are intended primarily to be used as they are and not to be modified.

You can however implement your own button using another approach. Let me explain it.

In many years of GUI development we understood, that in fact none customer is satisfied with ready-to-use widgets. This will work well with platforms like iOS, Android, Windows, etc. where the OS manufacturer dictates the look/feel. In turn for customer specific devices, the customers exepect the GUI components (the widgets) to look and even behave differently accordingly to their own design expectations. You can imagine, there are endless possibilities to look and behave for a widget. For us it is not possible to implement universal widgets with all possible variations of look/feel making all customers happy. Instead we follow the so-called template approach.

With this approach we provide a set of templates for the typical widgets. These templates are very simple designed. Their look and the behavior are intentionally right primitive. But they provide all the basic features, the particular widget requires. Our intention is, that the customer takes such template, and adapts it to his/her particular needs. If you want a button with gradient, you add a view to draw such gradient. If you want the button to flash, you add a new animation effect to flash the button accordingly. There are no limits regarding the look/feel of the resulting widget. With templates the customer obtains the basic implementation of the widget and he/she can adapt it accordingly.

Take a look into the Gallery folder Components. You will find there several widget templates. With our lates versions 7.X and 8, we spent a lot of time to rework and document these templates. If you are using an older version, it is thus reasonable to update to the newest version. For your action button, you can use the Push Button template, which provides the fundamental functionality for all push buttons. The annotations included in the template help you to understand how to proceed. Also please note the inline comments within the methods implemented in the particular template.

 

 

 

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

...