Show More
@@ -1493,7 +1493,7 b' div.cell.text_cell.rendered {' | |||
|
1493 | 1493 | box-pack: start; |
|
1494 | 1494 | /* Modern browsers */ |
|
1495 | 1495 | justify-content: flex-start; |
|
1496 | /* ContainerWidget */ | |
|
1496 | /* Box */ | |
|
1497 | 1497 | box-sizing: border-box; |
|
1498 | 1498 | -moz-box-sizing: border-box; |
|
1499 | 1499 | -webkit-box-sizing: border-box; |
@@ -1524,7 +1524,7 b' div.cell.text_cell.rendered {' | |||
|
1524 | 1524 | box-pack: start; |
|
1525 | 1525 | /* Modern browsers */ |
|
1526 | 1526 | justify-content: flex-start; |
|
1527 | /* ContainerWidget */ | |
|
1527 | /* Box */ | |
|
1528 | 1528 | box-sizing: border-box; |
|
1529 | 1529 | -moz-box-sizing: border-box; |
|
1530 | 1530 | -webkit-box-sizing: border-box; |
@@ -1576,7 +1576,7 b' div.cell.text_cell.rendered {' | |||
|
1576 | 1576 | box-pack: start; |
|
1577 | 1577 | /* Modern browsers */ |
|
1578 | 1578 | justify-content: flex-start; |
|
1579 | /* ContainerWidget */ | |
|
1579 | /* Box */ | |
|
1580 | 1580 | box-sizing: border-box; |
|
1581 | 1581 | -moz-box-sizing: border-box; |
|
1582 | 1582 | -webkit-box-sizing: border-box; |
@@ -1631,7 +1631,7 b' div.cell.text_cell.rendered {' | |||
|
1631 | 1631 | box-pack: start; |
|
1632 | 1632 | /* Modern browsers */ |
|
1633 | 1633 | justify-content: flex-start; |
|
1634 | /* ContainerWidget */ | |
|
1634 | /* Box */ | |
|
1635 | 1635 | box-sizing: border-box; |
|
1636 | 1636 | -moz-box-sizing: border-box; |
|
1637 | 1637 | -webkit-box-sizing: border-box; |
@@ -1683,7 +1683,7 b' div.cell.text_cell.rendered {' | |||
|
1683 | 1683 | box-pack: start; |
|
1684 | 1684 | /* Modern browsers */ |
|
1685 | 1685 | justify-content: flex-start; |
|
1686 | /* ContainerWidget */ | |
|
1686 | /* Box */ | |
|
1687 | 1687 | box-sizing: border-box; |
|
1688 | 1688 | -moz-box-sizing: border-box; |
|
1689 | 1689 | -webkit-box-sizing: border-box; |
@@ -1716,7 +1716,7 b' div.cell.text_cell.rendered {' | |||
|
1716 | 1716 | width: 30px; |
|
1717 | 1717 | } |
|
1718 | 1718 | .widget-modal { |
|
1719 |
/* |
|
|
1719 | /* Box - ModalView */ | |
|
1720 | 1720 | overflow: hidden; |
|
1721 | 1721 | position: absolute !important; |
|
1722 | 1722 | top: 0px; |
@@ -1724,11 +1724,11 b' div.cell.text_cell.rendered {' | |||
|
1724 | 1724 | margin-left: 0px !important; |
|
1725 | 1725 | } |
|
1726 | 1726 | .widget-modal-body { |
|
1727 |
/* |
|
|
1727 | /* Box - ModalView Body */ | |
|
1728 | 1728 | max-height: none !important; |
|
1729 | 1729 | } |
|
1730 | 1730 | .widget-container { |
|
1731 | /* ContainerWidget */ | |
|
1731 | /* Box */ | |
|
1732 | 1732 | box-sizing: border-box; |
|
1733 | 1733 | -moz-box-sizing: border-box; |
|
1734 | 1734 | -webkit-box-sizing: border-box; |
@@ -9265,7 +9265,7 b' div.cell.text_cell.rendered {' | |||
|
9265 | 9265 | box-pack: start; |
|
9266 | 9266 | /* Modern browsers */ |
|
9267 | 9267 | justify-content: flex-start; |
|
9268 | /* ContainerWidget */ | |
|
9268 | /* Box */ | |
|
9269 | 9269 | box-sizing: border-box; |
|
9270 | 9270 | -moz-box-sizing: border-box; |
|
9271 | 9271 | -webkit-box-sizing: border-box; |
@@ -9296,7 +9296,7 b' div.cell.text_cell.rendered {' | |||
|
9296 | 9296 | box-pack: start; |
|
9297 | 9297 | /* Modern browsers */ |
|
9298 | 9298 | justify-content: flex-start; |
|
9299 | /* ContainerWidget */ | |
|
9299 | /* Box */ | |
|
9300 | 9300 | box-sizing: border-box; |
|
9301 | 9301 | -moz-box-sizing: border-box; |
|
9302 | 9302 | -webkit-box-sizing: border-box; |
@@ -9348,7 +9348,7 b' div.cell.text_cell.rendered {' | |||
|
9348 | 9348 | box-pack: start; |
|
9349 | 9349 | /* Modern browsers */ |
|
9350 | 9350 | justify-content: flex-start; |
|
9351 | /* ContainerWidget */ | |
|
9351 | /* Box */ | |
|
9352 | 9352 | box-sizing: border-box; |
|
9353 | 9353 | -moz-box-sizing: border-box; |
|
9354 | 9354 | -webkit-box-sizing: border-box; |
@@ -9403,7 +9403,7 b' div.cell.text_cell.rendered {' | |||
|
9403 | 9403 | box-pack: start; |
|
9404 | 9404 | /* Modern browsers */ |
|
9405 | 9405 | justify-content: flex-start; |
|
9406 | /* ContainerWidget */ | |
|
9406 | /* Box */ | |
|
9407 | 9407 | box-sizing: border-box; |
|
9408 | 9408 | -moz-box-sizing: border-box; |
|
9409 | 9409 | -webkit-box-sizing: border-box; |
@@ -9455,7 +9455,7 b' div.cell.text_cell.rendered {' | |||
|
9455 | 9455 | box-pack: start; |
|
9456 | 9456 | /* Modern browsers */ |
|
9457 | 9457 | justify-content: flex-start; |
|
9458 | /* ContainerWidget */ | |
|
9458 | /* Box */ | |
|
9459 | 9459 | box-sizing: border-box; |
|
9460 | 9460 | -moz-box-sizing: border-box; |
|
9461 | 9461 | -webkit-box-sizing: border-box; |
@@ -9488,7 +9488,7 b' div.cell.text_cell.rendered {' | |||
|
9488 | 9488 | width: 30px; |
|
9489 | 9489 | } |
|
9490 | 9490 | .widget-modal { |
|
9491 |
/* |
|
|
9491 | /* Box - ModalView */ | |
|
9492 | 9492 | overflow: hidden; |
|
9493 | 9493 | position: absolute !important; |
|
9494 | 9494 | top: 0px; |
@@ -9496,11 +9496,11 b' div.cell.text_cell.rendered {' | |||
|
9496 | 9496 | margin-left: 0px !important; |
|
9497 | 9497 | } |
|
9498 | 9498 | .widget-modal-body { |
|
9499 |
/* |
|
|
9499 | /* Box - ModalView Body */ | |
|
9500 | 9500 | max-height: none !important; |
|
9501 | 9501 | } |
|
9502 | 9502 | .widget-container { |
|
9503 | /* ContainerWidget */ | |
|
9503 | /* Box */ | |
|
9504 | 9504 | box-sizing: border-box; |
|
9505 | 9505 | -moz-box-sizing: border-box; |
|
9506 | 9506 | -webkit-box-sizing: border-box; |
@@ -7,10 +7,10 b' define([' | |||
|
7 | 7 | "bootstrap", |
|
8 | 8 | ], function(widget, $){ |
|
9 | 9 | |
|
10 |
var |
|
|
10 | var BoxView = widget.DOMWidgetView.extend({ | |
|
11 | 11 | initialize: function(){ |
|
12 | 12 | // Public constructor |
|
13 |
|
|
|
13 | BoxView.__super__.initialize.apply(this, arguments); | |
|
14 | 14 | this.update_children([], this.model.get('children')); |
|
15 | 15 | this.model.on('change:children', function(model, value) { |
|
16 | 16 | this.update_children(model.previous('children'), value); |
@@ -47,9 +47,9 b' define([' | |||
|
47 | 47 | }); |
|
48 | 48 | |
|
49 | 49 | |
|
50 |
var Flex |
|
|
50 | var FlexBoxView = BoxView.extend({ | |
|
51 | 51 | render: function(){ |
|
52 |
Flex |
|
|
52 | FlexBoxView.__super__.render.apply(this); | |
|
53 | 53 | this.model.on('change:orientation', this.update_orientation, this); |
|
54 | 54 | this.model.on('change:flex', this._flex_changed, this); |
|
55 | 55 | this.model.on('change:pack', this._pack_changed, this); |
@@ -321,8 +321,8 b' define([' | |||
|
321 | 321 | }); |
|
322 | 322 | |
|
323 | 323 | return { |
|
324 |
' |
|
|
324 | 'BoxView': BoxView, | |
|
325 | 325 | 'PopupView': PopupView, |
|
326 |
'Flex |
|
|
326 | 'FlexBoxView': FlexBoxView, | |
|
327 | 327 | }; |
|
328 | 328 | }); |
@@ -248,7 +248,7 b'' | |||
|
248 | 248 | } |
|
249 | 249 | |
|
250 | 250 | .widget-modal { |
|
251 |
/* |
|
|
251 | /* Box - ModalView */ | |
|
252 | 252 | overflow : hidden; |
|
253 | 253 | position : absolute !important; |
|
254 | 254 | top : 0px; |
@@ -257,12 +257,12 b'' | |||
|
257 | 257 | } |
|
258 | 258 | |
|
259 | 259 | .widget-modal-body { |
|
260 |
/* |
|
|
260 | /* Box - ModalView Body */ | |
|
261 | 261 | max-height: none !important; |
|
262 | 262 | } |
|
263 | 263 | |
|
264 | 264 | .widget-container { |
|
265 | /* ContainerWidget */ | |
|
265 | /* Box */ | |
|
266 | 266 | .border-box-sizing(); |
|
267 | 267 | .align-start(); |
|
268 | 268 | } |
@@ -7,7 +7,7 b' casper.notebook_test(function () {' | |||
|
7 | 7 | this.execute_cell_then(index); |
|
8 | 8 | |
|
9 | 9 | var container_index = this.append_cell( |
|
10 |
'container = widgets. |
|
|
10 | 'container = widgets.Box()\n' + | |
|
11 | 11 | 'button = widgets.Button()\n'+ |
|
12 | 12 | 'container.children = [button]\n'+ |
|
13 | 13 | 'display(container)\n'+ |
@@ -2,7 +2,7 b' from .widget import Widget, DOMWidget, CallbackDispatcher' | |||
|
2 | 2 | |
|
3 | 3 | from .widget_bool import Checkbox, ToggleButton |
|
4 | 4 | from .widget_button import Button |
|
5 |
from .widget_container import |
|
|
5 | from .widget_container import Box, Popup, FlexBox, HBox, VBox | |
|
6 | 6 | from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress |
|
7 | 7 | from .widget_image import Image |
|
8 | 8 | from .widget_int import IntText, BoundedIntText, IntSlider, IntProgress |
@@ -12,7 +12,7 b' from .widget_string import HTML, Latex, Text, Textarea' | |||
|
12 | 12 | from .interaction import interact, interactive, fixed |
|
13 | 13 | |
|
14 | 14 | # Deprecated classes |
|
15 |
from .widget_bool import Check |
|
|
15 | from .widget_bool import CheckBox, ToggleButtonWidget | |
|
16 | 16 | from .widget_button import ButtonWidget |
|
17 | 17 | from .widget_container import ContainerWidget, PopupWidget |
|
18 | 18 | from .widget_float import FloatTextWidget, BoundedFloatTextWidget, FloatSliderWidget, FloatProgressWidget |
@@ -23,7 +23,7 b' from inspect import getcallargs' | |||
|
23 | 23 | from IPython.core.getipython import get_ipython |
|
24 | 24 | from IPython.html.widgets import (Widget, Text, |
|
25 | 25 | FloatSlider, IntSlider, Checkbox, Dropdown, |
|
26 |
|
|
|
26 | Box, DOMWidget) | |
|
27 | 27 | from IPython.display import display, clear_output |
|
28 | 28 | from IPython.utils.py3compat import string_types, unicode_type |
|
29 | 29 | from IPython.utils.traitlets import HasTraits, Any, Unicode |
@@ -176,7 +176,7 b' def interactive(__interact_f, **kwargs):' | |||
|
176 | 176 | f = __interact_f |
|
177 | 177 | co = kwargs.pop('clear_output', True) |
|
178 | 178 | kwargs_widgets = [] |
|
179 |
container = |
|
|
179 | container = Box() | |
|
180 | 180 | container.result = None |
|
181 | 181 | container.args = [] |
|
182 | 182 | container.kwargs = dict() |
@@ -39,5 +39,5 b' class ToggleButton(_Bool):' | |||
|
39 | 39 | |
|
40 | 40 | |
|
41 | 41 | # Remove in IPython 4.0 |
|
42 |
Check |
|
|
42 | CheckBox = DeprecatedClass(Checkbox, 'CheckBox') | |
|
43 | 43 | ToggleButtonWidget = DeprecatedClass(ToggleButton, 'ToggleButtonWidget') |
@@ -1,4 +1,4 b'' | |||
|
1 |
""" |
|
|
1 | """Box class. | |
|
2 | 2 | |
|
3 | 3 | Represents a container that can be used to group other widgets. |
|
4 | 4 | """ |
@@ -10,9 +10,9 b' from .widget import DOMWidget' | |||
|
10 | 10 | from IPython.utils.traitlets import Unicode, Tuple, TraitError, Int, CaselessStrEnum |
|
11 | 11 | from IPython.utils.warn import DeprecatedClass |
|
12 | 12 | |
|
13 |
class |
|
|
13 | class Box(DOMWidget): | |
|
14 | 14 | """Displays multiple widgets in a group.""" |
|
15 |
_view_name = Unicode(' |
|
|
15 | _view_name = Unicode('BoxView', sync=True) | |
|
16 | 16 | |
|
17 | 17 | # Child widgets in the container. |
|
18 | 18 | # Using a tuple here to force reassignment to update the list. |
@@ -21,15 +21,15 b' class Container(DOMWidget):' | |||
|
21 | 21 | |
|
22 | 22 | def __init__(self, children = (), **kwargs): |
|
23 | 23 | kwargs['children'] = children |
|
24 |
super( |
|
|
25 |
self.on_displayed( |
|
|
24 | super(Box, self).__init__(**kwargs) | |
|
25 | self.on_displayed(Box._fire_children_displayed) | |
|
26 | 26 | |
|
27 | 27 | def _fire_children_displayed(self): |
|
28 | 28 | for child in self.children: |
|
29 | 29 | child._handle_displayed() |
|
30 | 30 | |
|
31 | 31 | |
|
32 |
class Popup( |
|
|
32 | class Popup(Box): | |
|
33 | 33 | """Displays multiple widgets in an in page popup div.""" |
|
34 | 34 | _view_name = Unicode('PopupView', sync=True) |
|
35 | 35 | |
@@ -37,9 +37,9 b' class Popup(Container):' | |||
|
37 | 37 | button_text = Unicode(sync=True) |
|
38 | 38 | |
|
39 | 39 | |
|
40 |
class Flex |
|
|
40 | class FlexBox(Box): | |
|
41 | 41 | """Displays multiple widgets using the flexible box model.""" |
|
42 |
_view_name = Unicode('Flex |
|
|
42 | _view_name = Unicode('FlexBoxView', sync=True) | |
|
43 | 43 | orientation = CaselessStrEnum(values=['vertical', 'horizontal'], default_value='vertical', sync=True) |
|
44 | 44 | flex = Int(0, sync=True, help="""Specify the flexible-ness of the model.""") |
|
45 | 45 | def _flex_changed(self, name, old, new): |
@@ -59,15 +59,15 b' class FlexContainer(Container):' | |||
|
59 | 59 | def VBox(*pargs, **kwargs): |
|
60 | 60 | """Displays multiple widgets vertically using the flexible box model.""" |
|
61 | 61 | kwargs['orientation'] = 'vertical' |
|
62 |
return Flex |
|
|
62 | return FlexBox(*pargs, **kwargs) | |
|
63 | 63 | |
|
64 | 64 | def HBox(*pargs, **kwargs): |
|
65 | 65 | """Displays multiple widgets horizontally using the flexible box model.""" |
|
66 | 66 | kwargs['orientation'] = 'horizontal' |
|
67 |
return Flex |
|
|
67 | return FlexBox(*pargs, **kwargs) | |
|
68 | 68 | |
|
69 | 69 | |
|
70 | 70 | # Remove in IPython 4.0 |
|
71 |
ContainerWidget = DeprecatedClass( |
|
|
71 | ContainerWidget = DeprecatedClass(Box, 'ContainerWidget') | |
|
72 | 72 | PopupWidget = DeprecatedClass(Popup, 'PopupWidget') |
|
73 | 73 |
@@ -14,14 +14,14 b' pages.' | |||
|
14 | 14 | #----------------------------------------------------------------------------- |
|
15 | 15 | # Imports |
|
16 | 16 | #----------------------------------------------------------------------------- |
|
17 |
from .widget_container import |
|
|
17 | from .widget_container import Box | |
|
18 | 18 | from IPython.utils.traitlets import Unicode, Dict, CInt |
|
19 | 19 | from IPython.utils.warn import DeprecatedClass |
|
20 | 20 | |
|
21 | 21 | #----------------------------------------------------------------------------- |
|
22 | 22 | # Classes |
|
23 | 23 | #----------------------------------------------------------------------------- |
|
24 |
class _SelectionContainer( |
|
|
24 | class _SelectionContainer(Box): | |
|
25 | 25 | """Base class used to display multiple child widgets.""" |
|
26 | 26 | _titles = Dict(help="Titles of the pages", sync=True) |
|
27 | 27 | selected_index = CInt(0, sync=True) |
General Comments 0
You need to be logged in to leave comments.
Login now