##// END OF EJS Templates
Filenames s/container/box
Jonathan Frederic -
Show More
@@ -1,27 +1,27 b''
1 // Copyright (c) IPython Development Team.
1 // Copyright (c) IPython Development Team.
2 // Distributed under the terms of the Modified BSD License.
2 // Distributed under the terms of the Modified BSD License.
3
3
4 define([
4 define([
5 "widgets/js/manager",
5 "widgets/js/manager",
6 "widgets/js/widget_bool",
6 "widgets/js/widget_bool",
7 "widgets/js/widget_button",
7 "widgets/js/widget_button",
8 "widgets/js/widget_container",
8 "widgets/js/widget_box",
9 "widgets/js/widget_float",
9 "widgets/js/widget_float",
10 "widgets/js/widget_image",
10 "widgets/js/widget_image",
11 "widgets/js/widget_int",
11 "widgets/js/widget_int",
12 "widgets/js/widget_selection",
12 "widgets/js/widget_selection",
13 "widgets/js/widget_selectioncontainer",
13 "widgets/js/widget_selectioncontainer",
14 "widgets/js/widget_string",
14 "widgets/js/widget_string",
15 ], function(widgetmanager) {
15 ], function(widgetmanager) {
16
16
17 // Register all of the loaded views with the widget manager.
17 // Register all of the loaded views with the widget manager.
18 for (var i = 1; i < arguments.length; i++) {
18 for (var i = 1; i < arguments.length; i++) {
19 for (var target_name in arguments[i]) {
19 for (var target_name in arguments[i]) {
20 if (arguments[i].hasOwnProperty(target_name)) {
20 if (arguments[i].hasOwnProperty(target_name)) {
21 widgetmanager.WidgetManager.register_widget_view(target_name, arguments[i][target_name]);
21 widgetmanager.WidgetManager.register_widget_view(target_name, arguments[i][target_name]);
22 }
22 }
23 }
23 }
24 }
24 }
25
25
26 return {'WidgetManager': widgetmanager.WidgetManager};
26 return {'WidgetManager': widgetmanager.WidgetManager};
27 });
27 });
1 NO CONTENT: file renamed from IPython/html/static/widgets/js/widget_container.js to IPython/html/static/widgets/js/widget_box.js
NO CONTENT: file renamed from IPython/html/static/widgets/js/widget_container.js to IPython/html/static/widgets/js/widget_box.js
@@ -1,23 +1,23 b''
1 from .widget import Widget, DOMWidget, CallbackDispatcher
1 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 Box, Popup, FlexBox, HBox, VBox
5 from .widget_box 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
9 from .widget_selection import RadioButtons, ToggleButtons, Dropdown, Select
9 from .widget_selection import RadioButtons, ToggleButtons, Dropdown, Select
10 from .widget_selectioncontainer import Tab, Accordion
10 from .widget_selectioncontainer import Tab, Accordion
11 from .widget_string import HTML, Latex, Text, Textarea
11 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 CheckBox, 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_box import ContainerWidget, PopupWidget
18 from .widget_float import FloatTextWidget, BoundedFloatTextWidget, FloatSliderWidget, FloatProgressWidget
18 from .widget_float import FloatTextWidget, BoundedFloatTextWidget, FloatSliderWidget, FloatProgressWidget
19 from .widget_image import ImageWidget
19 from .widget_image import ImageWidget
20 from .widget_int import IntTextWidget, BoundedIntTextWidget, IntSliderWidget, IntProgressWidget
20 from .widget_int import IntTextWidget, BoundedIntTextWidget, IntSliderWidget, IntProgressWidget
21 from .widget_selection import RadioButtonsWidget, ToggleButtonsWidget, DropdownWidget, SelectWidget
21 from .widget_selection import RadioButtonsWidget, ToggleButtonsWidget, DropdownWidget, SelectWidget
22 from .widget_selectioncontainer import TabWidget, AccordionWidget
22 from .widget_selectioncontainer import TabWidget, AccordionWidget
23 from .widget_string import HTMLWidget, LatexWidget, TextWidget, TextareaWidget
23 from .widget_string import HTMLWidget, LatexWidget, TextWidget, TextareaWidget
1 NO CONTENT: file renamed from IPython/html/widgets/widget_container.py to IPython/html/widgets/widget_box.py
NO CONTENT: file renamed from IPython/html/widgets/widget_container.py to IPython/html/widgets/widget_box.py
@@ -1,67 +1,67 b''
1 """SelectionContainer class.
1 """SelectionContainer class.
2
2
3 Represents a multipage container that can be used to group other widgets into
3 Represents a multipage container that can be used to group other widgets into
4 pages.
4 pages.
5 """
5 """
6 #-----------------------------------------------------------------------------
6 #-----------------------------------------------------------------------------
7 # Copyright (c) 2013, the IPython Development Team.
7 # Copyright (c) 2013, the IPython Development Team.
8 #
8 #
9 # Distributed under the terms of the Modified BSD License.
9 # Distributed under the terms of the Modified BSD License.
10 #
10 #
11 # The full license is in the file COPYING.txt, distributed with this software.
11 # The full license is in the file COPYING.txt, distributed with this software.
12 #-----------------------------------------------------------------------------
12 #-----------------------------------------------------------------------------
13
13
14 #-----------------------------------------------------------------------------
14 #-----------------------------------------------------------------------------
15 # Imports
15 # Imports
16 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17 from .widget_container import Box
17 from .widget_box 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(Box):
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)
28
28
29 # Public methods
29 # Public methods
30 def set_title(self, index, title):
30 def set_title(self, index, title):
31 """Sets the title of a container page.
31 """Sets the title of a container page.
32
32
33 Parameters
33 Parameters
34 ----------
34 ----------
35 index : int
35 index : int
36 Index of the container page
36 Index of the container page
37 title : unicode
37 title : unicode
38 New title"""
38 New title"""
39 self._titles[index] = title
39 self._titles[index] = title
40 self.send_state('_titles')
40 self.send_state('_titles')
41
41
42 def get_title(self, index):
42 def get_title(self, index):
43 """Gets the title of a container pages.
43 """Gets the title of a container pages.
44
44
45 Parameters
45 Parameters
46 ----------
46 ----------
47 index : int
47 index : int
48 Index of the container page"""
48 Index of the container page"""
49 if index in self._titles:
49 if index in self._titles:
50 return self._titles[index]
50 return self._titles[index]
51 else:
51 else:
52 return None
52 return None
53
53
54
54
55 class Accordion(_SelectionContainer):
55 class Accordion(_SelectionContainer):
56 """Displays children each on a separate accordion page."""
56 """Displays children each on a separate accordion page."""
57 _view_name = Unicode('AccordionView', sync=True)
57 _view_name = Unicode('AccordionView', sync=True)
58
58
59
59
60 class Tab(_SelectionContainer):
60 class Tab(_SelectionContainer):
61 """Displays children each on a separate accordion tab."""
61 """Displays children each on a separate accordion tab."""
62 _view_name = Unicode('TabView', sync=True)
62 _view_name = Unicode('TabView', sync=True)
63
63
64
64
65 # Remove in IPython 4.0
65 # Remove in IPython 4.0
66 AccordionWidget = DeprecatedClass(Accordion, 'AccordionWidget')
66 AccordionWidget = DeprecatedClass(Accordion, 'AccordionWidget')
67 TabWidget = DeprecatedClass(Tab, 'TabWidget')
67 TabWidget = DeprecatedClass(Tab, 'TabWidget')
General Comments 0
You need to be logged in to leave comments. Login now