# eric4.Plugins.ViewManagerPlugins.Tabview.Tabview

Module implementing a tabbed viewmanager class.

### Global Attributes

None

### Classes

TabBar | Class implementing a customized tab bar supporting drag & drop.
TabWidget | Class implementing a custimized tab widget.
Tabview | Class implementing a tabbed viewmanager class embedded in a splitter.

### Functions

None

## TabBar

Class implementing a customized tab bar supporting drag & drop.

### Signals

tabCopyRequested(int, int)
  emitted to signal a clone request giving the old and new index position
tabCopyRequested(long, int, int)
  emitted to signal a clone request giving the id of the source tab widget, the index in the source tab widget and the new index position
tabMoveRequested(int, int)
  emitted to signal a tab move request giving the old and new index position
tabRelocateRequested(long, int, int)
  emitted to signal a tab relocation request giving the id of the old tab widget, the index in the old tab widget and the new index position

### Derived from

E4WheelTabBar

### Class Attributes

None

### Class Methods

None

### Methods

TabBar | Constructor
dragEnterEvent | Protected method to handle drag enter events.
dropEvent | Protected method to handle drop events.
mouseMoveEvent | Protected method to handle mouse move events.
mousePressEvent | Protected method to handle mouse press events.

### Static Methods

None

#### TabBar (Constructor)

TabBar(parent = None)

Constructor

parent
  reference to the parent widget (QWidget)

#### TabBar.dragEnterEvent

dragEnterEvent(event)

Protected method to handle drag enter events.

event
  reference to the drag enter event (QDragEnterEvent)

#### TabBar.dropEvent

dropEvent(event)

Protected method to handle drop events.

event
  reference to the drop event (QDropEvent)

#### TabBar.mouseMoveEvent

mouseMoveEvent(event)

Protected method to handle mouse move events.

event
  reference to the mouse move event (QMouseEvent)

#### TabBar.mousePressEvent

mousePressEvent(event)

Protected method to handle mouse press events.

event
  reference to the mouse press event (QMouseEvent)

Up

## TabWidget

Class implementing a custimized tab widget.

### Derived from

E4TabWidget

### Class Attributes

None

### Class Methods

None

### Methods

TabWidget | Constructor
__captionChange | Private method to handle Caption change signals from the editor.
__closeButtonClicked | Private method to handle the press of the close button.
__closeRequested | Private method to handle the press of the individual tab close button.
__contextMenuClose | Private method to close the selected tab.
__contextMenuCloseAll | Private method to close all tabs.
__contextMenuCloseOthers | Private method to close the other tabs.
__contextMenuCopyPathToClipboard | Private method to copy the file name of the editor to the clipboard.
__contextMenuMoveFirst | Private method to move a tab to the first position.
__contextMenuMoveLast | Private method to move a tab to the last position.
__contextMenuMoveLeft | Private method to move a tab one position to the left.
__contextMenuMoveRight | Private method to move a tab one position to the right.
__contextMenuPrintFile | Private method to print the selected tab.
__contextMenuSave | Private method to save the selected tab.
__contextMenuSaveAll | Private method to save all tabs.
__contextMenuSaveAs | Private method to save the selected tab to a new file.
__initMenu | Private method to initialize the tab context menu.
__navigationMenuTriggered | Private slot called to handle the navigation button menu selection.
__showContextMenu | Private slot to show the tab context menu.
__showNavigationMenu | Private slot to show the navigation button menu.
addTab | Overwritten method to add a new tab.
copyTab | Public method to copy an editor.
copyTabOther | Public method to copy an editor from another TabWidget.
currentWidget | Overridden method to return a reference to the current page.
hasEditor | Public method to check for an editor.
hasEditors | Public method to test, if any editor is managed.
insertWidget | Overwritten method to insert a new tab.
mouseDoubleClickEvent | Protected method handling double click events.
relocateTab | Public method to relocate an editor from another TabWidget.
removeWidget | Public method to remove a widget.
showIndicator | Public slot to set the indicator on or off.

### Static Methods

None

#### TabWidget (Constructor)

TabWidget(vm)

Constructor

vm
  view manager widget (Tabview)

#### TabWidget.__captionChange

__captionChange(cap, editor)

Private method to handle Caption change signals from the editor.

Updates the listview text to reflect the new caption information.

cap
  Caption for the editor
editor
  Editor to update the caption for

#### TabWidget.__closeButtonClicked

__closeButtonClicked()

Private method to handle the press of the close button.

#### TabWidget.__closeRequested

__closeRequested(index)

Private method to handle the press of the individual tab close button.

index
  index of the tab (integer)

#### TabWidget.__contextMenuClose

__contextMenuClose()

Private method to close the selected tab.

#### TabWidget.__contextMenuCloseAll

__contextMenuCloseAll()

Private method to close all tabs.

#### TabWidget.__contextMenuCloseOthers

__contextMenuCloseOthers()

Private method to close the other tabs.

#### TabWidget.__contextMenuCopyPathToClipboard

__contextMenuCopyPathToClipboard()

Private method to copy the file name of the editor to the clipboard.

#### TabWidget.__contextMenuMoveFirst

__contextMenuMoveFirst()

Private method to move a tab to the first position.

#### TabWidget.__contextMenuMoveLast

__contextMenuMoveLast()

Private method to move a tab to the last position.

#### TabWidget.__contextMenuMoveLeft

__contextMenuMoveLeft()

Private method to move a tab one position to the left.

#### TabWidget.__contextMenuMoveRight

__contextMenuMoveRight()

Private method to move a tab one position to the right.

#### TabWidget.__contextMenuPrintFile

__contextMenuPrintFile()

Private method to print the selected tab.

#### TabWidget.__contextMenuSave

__contextMenuSave()

Private method to save the selected tab.

#### TabWidget.__contextMenuSaveAll

__contextMenuSaveAll()

Private method to save all tabs.

#### TabWidget.__contextMenuSaveAs

__contextMenuSaveAs()

Private method to save the selected tab to a new file.

#### TabWidget.__initMenu

__initMenu()

Private method to initialize the tab context menu.

#### TabWidget.__navigationMenuTriggered

__navigationMenuTriggered(act)

Private slot called to handle the navigation button menu selection.

act
  reference to the selected action (QAction)

#### TabWidget.__showContextMenu

__showContextMenu(coord, index)

Private slot to show the tab context menu.

coord
  the position of the mouse pointer (QPoint)
index
  index of the tab the menu is requested for (integer)

#### TabWidget.__showNavigationMenu

__showNavigationMenu()

Private slot to show the navigation button menu.

#### TabWidget.addTab

addTab(editor, title)

Overwritten method to add a new tab.

editor
  the editor object to be added (QScintilla.Editor.Editor)
title
  title for the new tab (string or QString)

#### TabWidget.copyTab

copyTab(sourceIndex, targetIndex)

Public method to copy an editor.

sourceIndex
  index of the tab (integer)
targetIndex
  index position to place it to (integer)

#### TabWidget.copyTabOther

copyTabOther(sourceId, sourceIndex, targetIndex)

Public method to copy an editor from another TabWidget.

sourceId
  id of the TabWidget to get the editor from (long)
sourceIndex
  index of the tab in the old tab widget (integer)
targetIndex
  index position to place it to (integer)

#### TabWidget.currentWidget

currentWidget()

Overridden method to return a reference to the current page.

Returns:
  reference to the current page (QWidget)

#### TabWidget.hasEditor

hasEditor(editor)

Public method to check for an editor.

editor
  editor object to check for

Returns:
  flag indicating, whether the editor to be checked belongs to the list of editors managed by this tab widget.

#### TabWidget.hasEditors

hasEditors()

Public method to test, if any editor is managed.

Returns:
  flag indicating editors are managed

#### TabWidget.insertWidget

insertWidget(index, editor, title)

Overwritten method to insert a new tab.

index
  index position for the new tab (integer)
editor
  the editor object to be added (QScintilla.Editor.Editor)
title
  title for the new tab (string or QString)

Returns:
  index of the inserted tab (integer)

#### TabWidget.mouseDoubleClickEvent

mouseDoubleClickEvent(event)

Protected method handling double click events.

event
  reference to the event object (QMouseEvent)

#### TabWidget.relocateTab

relocateTab(sourceId, sourceIndex, targetIndex)

Public method to relocate an editor from another TabWidget.

sourceId
  id of the TabWidget to get the editor from (long)
sourceIndex
  index of the tab in the old tab widget (integer)
targetIndex
  index position to place it to (integer)

#### TabWidget.removeWidget

removeWidget(object)

Public method to remove a widget.

object
  object to be removed (QWidget)

#### TabWidget.showIndicator

showIndicator(on)

Public slot to set the indicator on or off.

on
  flag indicating the dtate of the indicator (boolean)

Up

## Tabview

Class implementing a tabbed viewmanager class embedded in a splitter.

### Signals

changeCaption(string)
  emitted if a change of the caption is necessary
editorChanged(string)
  emitted when the current editor has changed

### Derived from

QSplitter, ViewManager

### Class Attributes

None

### Class Methods

None

### Methods

Tabview | Constructor
__currentChanged | Private slot to handle the currentChanged signal.
_addView | Protected method to add a view (i.e.
_initWindowActions | Protected method to define the user interface actions for window handling.
_modificationStatusChanged | Protected slot to handle the modificationStatusChanged signal.
_removeAllViews | Protected method to remove all views (i.e.
_removeView | Protected method to remove a view (i.e.
_showView | Protected method to show a view (i.e.
_syntaxErrorToggled | Protected slot to handle the syntaxerrorToggled signal.
activeWindow | Public method to return the active (i.e.
addSplit | Public method used to split the current view.
canCascade | Public method to signal if cascading of managed windows is available.
canSplit | public method to signal if splitting of the view is available.
canTile | Public method to signal if tiling of managed windows is available.
cascade | Public method to cascade the managed windows.
eventFilter | Public method called to filter the event queue.
getTabWidgetById | Public method to get a reference to a tab widget knowing its ID.
insertView | Protected method to add a view (i.e.
nextSplit | Public slot used to move to the next split.
preferencesChanged | Public slot to handle the preferencesChanged signal.
prevSplit | Public slot used to move to the previous split.
removeSplit | Public method used to remove the current split view.
setEditorName | Public method to change the displayed name of the editor.
setSplitOrientation | Public method used to set the orientation of the split view.
showWindowMenu | Public method to set up the viewmanager part of the Window menu.
tile | Public method to tile the managed windows.

### Static Methods

None

#### Tabview (Constructor)

Tabview(parent)

Constructor

parent
  parent widget (QWidget)
ui
  reference to the main user interface
dbs
  reference to the debug server object

#### Tabview.__currentChanged

__currentChanged(index)

Private slot to handle the currentChanged signal.

index
  index of the current tab

#### Tabview._addView

_addView(win, fn = None, noName = "")

Protected method to add a view (i.e. window)

win
  editor window to be added
fn
  filename of this editor
noName
  name to be used for an unnamed editor (string or QString)

#### Tabview._initWindowActions

_initWindowActions()

Protected method to define the user interface actions for window handling.

#### Tabview._modificationStatusChanged

_modificationStatusChanged(m, editor)

Protected slot to handle the modificationStatusChanged signal.

m
  flag indicating the modification status (boolean)
editor
  editor window changed

#### Tabview._removeAllViews

_removeAllViews()

Protected method to remove all views (i.e. windows)

#### Tabview._removeView

_removeView(win)

Protected method to remove a view (i.e. window)

win
  editor window to be removed

#### Tabview._showView

_showView(win, fn = None)

Protected method to show a view (i.e. window)

win
  editor window to be shown
fn
  filename of this editor

#### Tabview._syntaxErrorToggled

_syntaxErrorToggled(editor)

Protected slot to handle the syntaxerrorToggled signal.

editor
  editor that sent the signal

#### Tabview.activeWindow

activeWindow()

Public method to return the active (i.e. current) window.

Returns:
  reference to the active editor

#### Tabview.addSplit

addSplit()

Public method used to split the current view.

#### Tabview.canCascade

canCascade()

Public method to signal if cascading of managed windows is available.

Returns:
  flag indicating cascading of windows is available

#### Tabview.canSplit

canSplit()

public method to signal if splitting of the view is available.

Returns:
  flag indicating splitting of the view is available.

#### Tabview.canTile

canTile()

Public method to signal if tiling of managed windows is available.

Returns:
  flag indicating tiling of windows is available

#### Tabview.cascade

cascade()

Public method to cascade the managed windows.

#### Tabview.eventFilter

eventFilter(watched, event)

Public method called to filter the event queue.

watched
  the QObject being watched
event
  the event that occurred

Returns:
  always False

#### Tabview.getTabWidgetById

getTabWidgetById(id_)

Public method to get a reference to a tab widget knowing its ID.

id_
  id of the tab widget (long)

Returns:
  reference to the tab widget (TabWidget)

#### Tabview.insertView

insertView(win, tabWidget, index, fn = None, noName = "")

Protected method to add a view (i.e. window)

win
  editor window to be added
tabWidget
  reference to the tab widget to insert the editor into (TabWidget)
index
  index position to insert at (integer)
fn
  filename of this editor
noName
  name to be used for an unnamed editor (string or QString)

#### Tabview.nextSplit

nextSplit()

Public slot used to move to the next split.

#### Tabview.preferencesChanged

preferencesChanged()

Public slot to handle the preferencesChanged signal.

#### Tabview.prevSplit

prevSplit()

Public slot used to move to the previous split.

#### Tabview.removeSplit

removeSplit()

Public method used to remove the current split view.

Returns:
  flag indicating successfull removal

#### Tabview.setEditorName

setEditorName(editor, newName)

Public method to change the displayed name of the editor.

editor
  editor window to be changed
newName
  new name to be shown (string or QString)

#### Tabview.setSplitOrientation

setSplitOrientation(orientation)

Public method used to set the orientation of the split view.

orientation
  orientation of the split (Qt.Horizontal or Qt.Vertical)

#### Tabview.showWindowMenu

showWindowMenu(windowMenu)

Public method to set up the viewmanager part of the Window menu.

windowMenu
  reference to the window menu

#### Tabview.tile

tile()

Public method to tile the managed windows.

Up