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