in GUI Development by
I'm looking for layout meachnisms to arrange the members of UI components, in order to create UI components that can be used for different screen resolutions.

1 Answer

0 votes

The Mosaic framework provides several methods of automatic layout mechanisms - even with some additional lines of Chora code if no other possibility exists - in order to make customer specific arrangements of views, e.g. to implement a GridView. 

From the programmers point of view there are following approaches available:

  1.  The 'Layout' property. With this property you can determine how a view (any view) should react to size changes of its owner (the group or outline box in which the view is visible). This allows you to construct panels which move and stretch embedded views automatically when the size of the panel is changed.
  2. The outline box. The class 'Core::Outline' is able to automatically arrange (similar to grid view) views in rows or columns. However unlike a typical grid view, one outline box can layout the view either vertically (in a single column) or horizontally (in a single row). The combination of both with one outline box is not possible. The outline box automatically reacts when you add new views to the outline, remove views from the outline or even resize a view and performs then automatically the layout calculation for the embedded views. See the property 'Formation' of the outline box. It determines whether and if yes how the views are arranged.
  3. The 'UpdateLayout' method. The very basic class 'Core::Group' of all GUI components implements a method 'UpdateLayout'. In your component you can override this method and implement your own layout algorithm. For example, you can arrange all views automatically in rows and columns in order to fill the entire area of the GUI component. This 'UpdateLayout' method is invoked automatically when the size of the component changes. It is also called if views are added, resized or removed and the affected views are controlled by an outline box existing within the component.

The first and the second approaches provide the programmer a simple but convenient technique to layout the GUI. All he needs to do is to set all properties of the affected views and the layout is calculated automatically. The third approach gives the programmer the full control about the layout calculation - it expects however the layout algorithms to be implemented.

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