Kexi/Handbook/Building Simple Databases/Designing Forms/Widget layouts: Difference between revisions
Appearance
add translation tags |
No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
FIXME not implemented in KEXI since 2.4 | |||
< | <!-- | ||
====Widget layouts==== | ====Widget layouts==== | ||
Line 7: | Line 7: | ||
Using special tool called widget layouts can help to automatically lay out the form widgets. Widget layout is an action of grouping two or more widgets so these are well positioned and have appropriate sizes. | Using special tool called widget layouts can help to automatically lay out the form widgets. Widget layout is an action of grouping two or more widgets so these are well positioned and have appropriate sizes. | ||
Using layout in a form improves alignment. Moreover, its space is better used. Text fields are closer to each other, spacing is constant. | Using layout in a form improves alignment. Moreover, its space is better used. Text fields are closer to each other, spacing is constant. | ||
There are two methods to create widget layout. | There are two methods to create widget layout. | ||
Line 23: | Line 23: | ||
;vertical | ;vertical | ||
:Vertical widget layout | :Vertical widget layout | ||
;horizontal | ;horizontal | ||
:Horizontal widget layout | :Horizontal widget layout | ||
Line 32: | Line 33: | ||
To use a spring: | To use a spring: | ||
# Select spring icon on the '''Widgets''' toolbar. | # Select spring icon on the '''Widgets''' toolbar. | ||
# Click on a selected point of the form to insert the spring. | # Click on a selected point of the form to insert the spring. | ||
Line 42: | Line 44: | ||
* Click with the right mouse button on the layout's border and select <menuchoice>Break Layout</menuchoice> command from the context menu. | * Click with the right mouse button on the layout's border and select <menuchoice>Break Layout</menuchoice> command from the context menu. | ||
* Click with the left mouse button on the layout's border and select <menuchoice>Format->Break Layout</menuchoice> menu command. | * Click with the left mouse button on the layout's border and select <menuchoice>Format->Break Layout</menuchoice> menu command. | ||
{{Note|Removing widget layout using the Break Layout command will not remove widgets contained in the layout. If you want to remove the widgets as well, just select the layout by clicking on its border and press <keycap>Delete</keycap> key or use <menuchoice>Edit->Delete</menuchoice> menu command or context menu command.}} | {{Note|Removing widget layout using the Break Layout command will not remove widgets contained in the layout. If you want to remove the widgets as well, just select the layout by clicking on its border and press <keycap>Delete</keycap> key or use <menuchoice>Edit->Delete</menuchoice> menu command or context menu command.}} | ||
====Size policies for widgets (FIXME: within a layout) ==== | |||
Instead of setting a fixed size for your widgets, in ''' | Instead of setting a fixed size for your widgets, in '''KEXI''' you can choose between various widget's size policies. A size policy is a flexible strategy for controlling how a widget is stretched (or shrunk) depending on other neighbouring widgets and space available within the form. | ||
After putting widgets into a layout, typically each widget gets a proportional (<menuchoice>Preferred</menuchoice>) size policy. These widgets will be automatically resized with preferred settings, depending on their type and size of the entire layout itself. For example, three buttons put into the horizontal layout will be resized to fit their visible text. | After putting widgets into (FIXME: a layout) the form, typically each widget gets a proportional (<menuchoice>Preferred</menuchoice>) size policy. These widgets will be automatically resized with preferred settings, depending on their type and size of the entire layout itself. For example, three buttons (FIXME: put into the horizontal layout) on a line will be resized to fit their visible text. | ||
For each widget inserted into the form, there are settings for size policy available in the '''Property Editor'''. The settings are presented as a group of properties called | For each widget inserted into the form, there are settings for size policy available in the '''Property Editor'''. The settings are presented as a group of properties called <menuchoice>Size Policy</menuchoice>. | ||
This group of properties contains: | This group of properties contains: | ||
Line 58: | Line 61: | ||
;Horizontal Size Policy | ;Horizontal Size Policy | ||
:defining horizontal size of the widget, | :defining horizontal size of the widget, | ||
;Vertical Size Policy | ;Vertical Size Policy | ||
:defining vertical size of the widget, | :defining vertical size of the widget, | ||
;Horizontal Stretch | ;Horizontal Stretch | ||
:defining strength of activity of the Horizontal Size Policy, | :defining strength of activity of the Horizontal Size Policy, | ||
;Vertical Stretch | ;Vertical Stretch | ||
:defining strength of activity of the Vertical Size Policy | :defining strength of activity of the Vertical Size Policy | ||
Line 67: | Line 73: | ||
===== Values of size policies ===== | ===== Values of size policies ===== | ||
The following values are available in the drop down list for | The following values are available in the drop down list for <menuchoice>Hor. Policy</menuchoice> and <menuchoice>Vert. Policy</menuchoice> visible in the '''Property Editor''': | ||
;Fixed | ;Fixed | ||
:this value means that the widget cannot be automatically resized; it should maintain the constant size defined at design time (width or height), | :this value means that the widget cannot be automatically resized; it should maintain the constant size defined at design time (width or height), | ||
;Minimum | ;Minimum | ||
:this value means that the original size of the widget is set as minimal allowed, it is sufficient and there is no need for expanding the widget, but the widget will be expanded if needed. This type of policy can be used to force the widget to be expanded to the whole width or height, especially if you set a stretch value greater than 0. | :this value means that the original size of the widget is set as minimal allowed, it is sufficient and there is no need for expanding the widget, but the widget will be expanded if needed. This type of policy can be used to force the widget to be expanded to the whole width or height, especially if you set a stretch value greater than 0. | ||
;Maximum | ;Maximum | ||
:this value means that the original size of the widget is set as maximum allowed and can be decreased without breaking the widget's usability and readability if other widgets need more space, | :this value means that the original size of the widget is set as maximum allowed and can be decreased without breaking the widget's usability and readability if other widgets need more space, | ||
;Preferred | ;Preferred | ||
:this value means that the original size of the widget is the best and preferred; the widget can be shrunk or expanded however and it will stay readable, | :this value means that the original size of the widget is the best and preferred; the widget can be shrunk or expanded however and it will stay readable, | ||
;Expanding | ;Expanding | ||
:this value means that the original size of the widget is reasonable but the widget can be also shrunk; it can be expanded as well to take as much space as possible, | :this value means that the original size of the widget is reasonable but the widget can be also shrunk; it can be expanded as well to take as much space as possible, | ||
;Minimum Expanding | ;Minimum Expanding | ||
:this value means that the original size of the widget is allowed; it can be expanded to take as much space as possible, | :this value means that the original size of the widget is allowed; it can be expanded to take as much space as possible, | ||
;Ignored | ;Ignored | ||
:this value means that the original size of the widget is ignored; the widget can be expanded to take as much space as possible but other widgets usually will not allow for that | :this value means that the original size of the widget is ignored; the widget can be expanded to take as much space as possible but other widgets usually will not allow for that | ||
Line 90: | Line 102: | ||
===== Vertical and horizontal stretch ===== | ===== Vertical and horizontal stretch ===== | ||
The | The <menuchoice>Vert. Stretch</menuchoice> and <menuchoice>Hor. Stretch</menuchoice> properties accept integer values greater than or equal to 0. These properties allow to fine-tune the behavior of size policies. The default value for the properties is 0. A higher value of the stretch means that the widget will be expanded more than widgets for which a lower stretch value is set. | ||
{{Prevnext2 | {{Prevnext2 | ||
Line 102: | Line 114: | ||
[[Category:Kexi]] | [[Category:Kexi]] | ||
[[Category:Tutorials]] | [[Category:Tutorials]] | ||
--> |
Latest revision as of 20:33, 25 December 2024
FIXME not implemented in KEXI since 2.4