149 views
in GUI Development by
hi ,

 

I have created one  widget (contain rectangle and three text field ) and that can be used in number of screens. So i implemented with two approach

First Approach : Created Empty GUI component and through browser drag that widget but the disadvantage is different text created in widget does not have fixed position

2. Second approach was created Empty GUI component and add that widget as superclass to gui component so the text and rectangle contain in that widget remains constant but keypad handler does not work as per it functionality for example up down key

What is the best approach to use the widget in another screen with fixed position

1 Answer

0 votes
by

Hello Pidea,

First Approach : Created Empty GUI component and through browser drag that widget but the disadvantage is different text created in widget does not have fixed position 

This is the typical workflow. You design a GUI component (some widget) and then you add an instance of this component to another component. We say: you embed the instance within another GUI component. If necessary, you can even create multiple instances of one and the same GUI component. To create an instance of your own GUI component you use the Browser window. This approach is thus more suitable to manage the GUI components like building blocks you use to assemble more complex components.

However, I don't understand what do you mean by: "disadvantage is different text created in widget does not have fixed position"?

2. Second approach was created Empty GUI component and add that widget as superclass to gui component so the text and rectangle contain in that widget remains constant but keypad handler does not work as per it functionality for example up down key 

This is also a correct approach. You create first a base GUI component and then you derive from it several more specialized components. For example, you create a base Menu component and you implement in this component all the functionality common for all menus in your application. Then for each particular menu you derive a new class from the base Menu component. In each derived class you can then add the individual menu items. The derived menus are thus different (each contains other items). All menus, however, inherit the common functionality from the base Menu class. They all are 'menus'. To derive classes from existing classes you use again the Browser window.

What do you mean with: "so the text and rectangle contain in that widget remains constant but keypad handler does not work as per it functionality for example up down key"?

What is the best approach to use the widget in another screen with fixed position

What do you mean with fixed position? In the first case you can arrange and resize the embedded instances similarly to how you arrange embedded views. In the second case when editing the derived class you can access and modify the position of the views inherited from the base class.

I'm not sure whether I understand your question.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...