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