Many computer-based display systems on desktop displays or mobile devices feature aspect ratios of 3:2, 4:3, or 16:9.
Tablet devices and smartphones can be held either in portrait or landscape orientation.
Even on desktop sytems, windows are used either in full-screen or in a side-by-side configuration, where two "portrait" windows tile a landscape display. Moreover, there are LCD display that can be rotated into 2 orientations.
The objective of this assignment is to implement a new layout manager that supports the
easy specification of rotatable GUI. More specifically, your layout manager has to handle at least one
of the three following pairs of aspect ratios: 3:2 and 2:3, 4:3 and 3:4, or 16:9 and 9:16.
This corresponds to the most common smartphone
aspect ratios.
Your layout manager does not have to be able to handle other aspect ratios. In particular,
aspect ratios not within the range 2:1 and 1:2 are clearly outside of the scope of this assignment.
To facilitate testing, the first widget inside the application window must enable the user to toggle between portrait and landscape orientation for the window, based on the current window size. If your application supports more than one aspect ratio, the second widget must enable the user to select one of the supported aspect ratios. The window should still be resizeable, under the constraint that the current aspect ratio is maintained during resizing.
To demonstrate how the layout changes, you have to specify additional widgets beyond the two mentioned above. You must include at least two widgets that fills the window horizontally, whatever the size. These two "wide" widgets should not be directly adjacent, i.e. there should be other widgets between them. You must also include enough "small" widgets to illustrate how the layout manager redistributes them with changes on window size. Some examples for "small" widgets are buttons, radio buttons, or checkboxes. You also may want to include "tall" widgets, such as a list of items, or a tree-view. The objective of all these widgets is to show how the layout of the GUI changes with changes in the orientation, window size or aspect ratio. In other words, these widgets do not need any real functionality associated with them. You may assume a maximum display size of 1024 pixels in either the horizontal or vertical dimension.
One issue that you will encounter is that with a change of aspect ratio they layout manager may "run out of space", i.e. will not have enough space in the current window to display all widgets. Some possible solutions include resizing widgets (limited to a +50%/-50% change between portrait and landscape view) or support for scrolling of the window pane. You are welcome to come up with your own solution for this issue. Regardless of which solution you chooose, you need to describe your design rationale for this in the documentation.
Last, but not least, you are encouraged to consider support for more advanced layout features, such as widgets that stay adjacent to a label or another widget, centered or right-aligned widget, grid-like arrangements, etc. Ideally, you should support such features with reasonably minimal effort from the side of the programmer.
Notes: