1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Defines a component container, that can contain two components which are
17 split by divider element."""
18
19 from muntjac.ui.abstract_split_panel import AbstractSplitPanel
20
21
23 """SplitPanel.
24
25 C{SplitPanel} is a component container, that can contain two
26 components (possibly containers) which are split by divider element.
27
28 @author: Vaadin Ltd.
29 @author: Richard Lincoln
30 @version: 1.1.2
31 @deprecated: Use L{HorizontalSplitPanel} or L{VerticalSplitPanel} instead.
32 """
33
34 CLIENT_WIDGET = None
35
36
37 ORIENTATION_VERTICAL = 0
38
39
40 ORIENTATION_HORIZONTAL = 1
41
42
44 """Creates a new split panel. The orientation of the panels is
45 C{ORIENTATION_VERTICAL} by default.
46
47 @param orientation:
48 the orientation of the layout.
49 """
50 super(SplitPanel, self).__init__()
51
52
53 if orientation is None:
54 self._orientation = self.ORIENTATION_VERTICAL
55 else:
56 self.setOrientation(orientation)
57
58 self.setSizeFull()
59
60
61 - def paintContent(self, target):
62 """Paints the content of this component.
63
64 @param target:
65 the Paint Event.
66 @raise PaintException:
67 if the paint operation failed.
68 """
69 super(SplitPanel, self).paintContent(target)
70 if self._orientation == self.ORIENTATION_VERTICAL:
71 target.addAttribute('vertical', True)
72
73
75 """Gets the orientation of the split panel.
76
77 @return: the Value of property orientation.
78 """
79 return self._orientation
80
81
83 """Sets the orientation of the split panel.
84
85 @param orientation:
86 the New value of property orientation.
87 """
88
89 if (orientation < self.ORIENTATION_VERTICAL
90 or orientation > self.ORIENTATION_HORIZONTAL):
91 raise ValueError
92
93 self._orientation = orientation
94 self.requestRepaint()
95