Show More
@@ -37,7 +37,7 b' class Popup(Container):' | |||||
37 |
|
37 | |||
38 | class FlexContainer(Container): |
|
38 | class FlexContainer(Container): | |
39 | _view_name = Unicode('FlexContainerView', sync=True) |
|
39 | _view_name = Unicode('FlexContainerView', sync=True) | |
40 |
orientation = |
|
40 | orientation = CaselessStrEnum(values=['vertical', 'horizontal'], default_value='vertical', sync=True) | |
41 | flex = Int(0, sync=True, help="""Specify the flexible-ness of the model.""") |
|
41 | flex = Int(0, sync=True, help="""Specify the flexible-ness of the model.""") | |
42 | def _flex_changed(self, name, old, new): |
|
42 | def _flex_changed(self, name, old, new): | |
43 | new = min(max(0, new), 2) |
|
43 | new = min(max(0, new), 2) | |
@@ -53,12 +53,14 b' class FlexContainer(Container):' | |||||
53 | default_value='start', allow_none=False, sync=True) |
|
53 | default_value='start', allow_none=False, sync=True) | |
54 |
|
54 | |||
55 |
|
55 | |||
56 | class VBox(FlexContainer): |
|
56 | def VBox(*pargs, **kwargs): | |
57 | _view_name = Unicode('VBoxContainerView', sync=True) |
|
57 | kwargs['orientation'] = 'vertical' | |
|
58 | return FlexContainer(*pargs, **kwargs) | |||
58 |
|
59 | |||
|
60 | def HBox(*pargs, **kwargs): | |||
|
61 | kwargs['orientation'] = 'horizontal' | |||
|
62 | return FlexContainer(*pargs, **kwargs) | |||
59 |
|
63 | |||
60 | class HBox(FlexContainer): |
|
|||
61 | _view_name = Unicode('HBoxContainerView', sync=True) |
|
|||
62 |
|
64 | |||
63 | ContainerWidget = DeprecatedClass(Container, 'ContainerWidget') |
|
65 | ContainerWidget = DeprecatedClass(Container, 'ContainerWidget') | |
64 | PopupWidget = DeprecatedClass(Popup, 'PopupWidget') |
|
66 | PopupWidget = DeprecatedClass(Popup, 'PopupWidget') |
General Comments 0
You need to be logged in to leave comments.
Login now