40 """ |
40 """ |
41 Overwritten method to add a new widget. |
41 Overwritten method to add a new widget. |
42 |
42 |
43 @param editor the editor object to be added (QScintilla.Editor.Editor) |
43 @param editor the editor object to be added (QScintilla.Editor.Editor) |
44 """ |
44 """ |
45 super().addWidget(editor) |
45 super().addWidget(editor.parent()) |
46 if not editor in self.editors: |
46 if not editor in self.editors: |
47 self.editors.append(editor) |
47 self.editors.append(editor) |
48 |
48 |
49 def removeWidget(self, widget): |
49 def removeWidget(self, widget): |
50 """ |
50 """ |
51 Overwritten method to remove a widget. |
51 Overwritten method to remove a widget. |
52 |
52 |
53 @param widget widget to be removed (QWidget) |
53 @param widget widget to be removed (QWidget) |
54 """ |
54 """ |
55 super().removeWidget(widget) |
|
56 if isinstance(widget, QScintilla.Editor.Editor): |
55 if isinstance(widget, QScintilla.Editor.Editor): |
57 self.editors.remove(widget) |
56 self.editors.remove(widget) |
|
57 widget = widget.parent() |
|
58 super().removeWidget(widget) |
|
59 |
|
60 def currentWidget(self): |
|
61 """ |
|
62 Public method to get a reference to the current editor. |
|
63 |
|
64 @return reference to the current editor (Editor) |
|
65 """ |
|
66 widget = super().currentWidget() |
|
67 if widget is not None: |
|
68 widget = widget.getEditor() |
|
69 return widget |
58 |
70 |
59 def setCurrentWidget(self, widget): |
71 def setCurrentWidget(self, widget): |
60 """ |
72 """ |
61 Overwritten method to set the current widget. |
73 Overwritten method to set the current widget. |
62 |
74 |
63 @param widget widget to be made current (QWidget) |
75 @param widget widget to be made current (QWidget) |
64 """ |
76 """ |
65 if isinstance(widget, QScintilla.Editor.Editor): |
77 if isinstance(widget, QScintilla.Editor.Editor): |
66 self.editors.remove(widget) |
78 self.editors.remove(widget) |
67 self.editors.insert(0, widget) |
79 self.editors.insert(0, widget) |
|
80 widget = widget.parent() |
68 super().setCurrentWidget(widget) |
81 super().setCurrentWidget(widget) |
69 |
82 |
70 def setCurrentIndex(self, index): |
83 def setCurrentIndex(self, index): |
71 """ |
84 """ |
72 Overwritten method to set the current widget by it's index. |
85 Overwritten method to set the current widget by it's index. |