Class: Yast::UIHelperClass
- Inherits:
-
Module
- Object
- Module
- Yast::UIHelperClass
- Defined in:
- ../../library/general/src/modules/UIHelper.rb
Instance Method Summary (collapse)
-
- (Object) EditTable(table_header, table_contents, above_table, below_table, below_buttons, buttons)
Create an edit table with basic buttons.
- - (Object) main
-
- (Object) SizeAtLeast(content, xsize, ysize)
Encloses the content into VBoxes and HBoxes.
-
- (Object) SpacingAround(content, left, right, top, bottom)
Encloses the content into VBoxes and HBoxes with the appropriate spacings around it.
Instance Method Details
- (Object) EditTable(table_header, table_contents, above_table, below_table, below_buttons, buttons)
Create an edit table with basic buttons.
It contains table and buttons Add, Edit, Delete. User may specify table header and content, content that will be placed above table, between table and buttons, below buttons and rights from buttons (usually another button).
UI elements ids:<table> <tr><td>Table</td><td><code>table</td></tr> <tr><td>Button add</td><td></code>add_button</td></tr> <tr><td>Button edit</td><td><code>edit_button</td></tr> <tr><td>Button delete</td><td></code>delete_button</td></tr> </table>
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File '../../library/general/src/modules/UIHelper.rb', line 64 def EditTable(table_header, table_contents, above_table, below_table, , ) table_header = deep_copy(table_header) table_contents = deep_copy(table_contents) above_table = deep_copy(above_table) below_table = deep_copy(below_table) = deep_copy() = deep_copy() contents = VBox() contents = Builtins.add(contents, above_table) if nil != above_table contents = Builtins.add( contents, Table(Id(:table), Opt(:notify), table_header, table_contents) ) contents = Builtins.add(contents, below_table) if nil != below_table but_box = HBox( Opt(:hstretch), PushButton(Id(:add_button), Opt(:key_F3), _("A&dd")), PushButton(Id(:edit_button), Opt(:key_F4), _("&Edit")), PushButton(Id(:delete_button), Opt(:key_F5), _("De&lete")) ) if nil != but_box = Builtins.add(Builtins.add(but_box, HStretch()), ) end contents = Builtins.add(contents, but_box) contents = Builtins.add(contents, ) if nil != deep_copy(contents) end |
- (Object) main
34 35 36 |
# File '../../library/general/src/modules/UIHelper.rb', line 34 def main textdomain "base" end |
- (Object) SizeAtLeast(content, xsize, ysize)
Encloses the content into VBoxes and HBoxes
Enclose so that its size is at least <emphasis>xsize</emphasis> x <emphasis>ysize</emphasis>.
128 129 130 131 132 133 134 135 136 137 138 |
# File '../../library/general/src/modules/UIHelper.rb', line 128 def SizeAtLeast(content, xsize, ysize) content = deep_copy(content) xsize = deep_copy(xsize) ysize = deep_copy(ysize) VBox( VSpacing(0.4), HSpacing(xsize), HBox(HSpacing(1.6), VSpacing(ysize), content, HSpacing(1.6)), VSpacing(0.4) ) end |
- (Object) SpacingAround(content, left, right, top, bottom)
Encloses the content into VBoxes and HBoxes with the appropriate spacings around it.
106 107 108 109 110 111 112 113 114 115 116 117 |
# File '../../library/general/src/modules/UIHelper.rb', line 106 def SpacingAround(content, left, right, top, bottom) content = deep_copy(content) left = deep_copy(left) right = deep_copy(right) top = deep_copy(top) bottom = deep_copy(bottom) HBox( HSpacing(left), VBox(VSpacing(top), content, VSpacing(bottom)), HSpacing(right) ) end |