itom 1.0.14
|
widget containing one or multiple script editors (tabbed). This widget can either be a docking widget, docked in a docking area in the main window or it can be a floatable window which has a standard window behaviour. More...
Public Slots | |
void | editorMarginChanged () |
Signals | |
void | removeAndDeleteScriptDockWidget (ScriptDockWidget *widget) |
void | openScriptRequest (QString filename, ScriptDockWidget *scriptDockWidget) |
void | dockScriptTab (ScriptDockWidget *widget, int index, bool closeDockIfEmpty=false) |
void | undockScriptTab (ScriptDockWidget *widget, int index, bool undockToNewScriptWindow=false, bool closeDockIfEmpty=false) |
void | pythonRunFileRequest (QString filename) |
void | pythonDebugFileRequest (QString filename) |
void | pythonInterruptExecution () |
void | pythonDebugCommand (tPythonDbgCmd cmd) |
void | pythonRunSelection (QString selectionText) |
Public Member Functions | |
ScriptDockWidget (const QString &title, bool docked, bool isDockAvailable, QWidget *parent=0, Qt::WindowFlags flags=0) | |
constructor | |
~ScriptDockWidget () | |
destructor | |
QStringList | getModifiedFileNames (bool ignoreNewScripts=false, int excludeIndex=-1) const |
returns a list of filenames, which have been modified in this ScriptDockWidget | |
RetVal | newScript () |
creates new instance of ScriptEditorWidget and appends it to the tab-widget | |
RetVal | openScript () |
method to open an existing script which can be indicated by the user by a getOpenFileName-dialog. | |
RetVal | openScript (QString filename, bool silent=false) |
opens a given filename as new tab in this ScriptDockWidget | |
RetVal | saveAllScripts (bool askFirst=true, bool ignoreNewScripts=false, int excludeIndex=-1) |
tries to save all opened scripts in this ScriptDockWidget | |
RetVal | closeAllScripts (bool saveFirst=true, bool askFirst=true, bool ignoreNewScripts=false, int excludeIndex=-1) |
closes all opened scripts in this ScriptDockWidget | |
bool | isTabIndexValid (int tabIndex) const |
int | getTabCount () const |
bool | containsNewScripts () const |
checks whether any editor in this ScriptDockWidget has no filename | |
RetVal | appendEditor (ScriptEditorWidget *editorWidget) |
append given ScriptEditorWidget as new tab | |
ScriptEditorWidget * | removeEditor (int index) |
removes ScriptEditorWidget at given tab position from tab-widget and returns its reference | |
bool | activateTabByFilename (QString filename, int line=-1) |
activates tab with script whose filename corresponds to the filename parameter. | |
bool | activeTabEnsureLineVisible (int lineNr) |
Protected Member Functions | |
ScriptEditorWidget * | getEditorByIndex (int index) const |
returns ScriptEditorWidget by given tab-index | |
ScriptEditorWidget * | getCurrentEditor () const |
returns reference to current ScriptEditorWidget | |
int | getIndexByEditor (ScriptEditorWidget *sew) const |
returns tab-index by given reference to ScriptEditorWidget | |
void | createActions () |
creates actions | |
void | createMenus () |
create menus | |
void | createToolBars () |
create toolbars | |
void | createStatusBar () |
init status bar | |
void | closeEvent (QCloseEvent *event) |
this method is invoked if this ScriptDockWidget should be closed. | |
RetVal | closeTab (int index, bool saveFirst=true) |
public method to close any specific tab with or without saving its script first | |
RetVal | saveTab (int index, bool forceSaveAs=false, bool askFirst=true) |
saves tab | |
Private Slots | |
void | tabContextMenuEvent (QContextMenuEvent *event) |
method is invoked, if a context menu is requested | |
void | findTextExpr (QString expr, bool regExpr, bool caseSensitive, bool wholeWord, bool wrap, bool forward, bool isQuickSeach) |
void | replaceTextExpr (QString expr, QString replace) |
void | replaceAllExpr (QString expr, QString replace, bool regExpr, bool caseSensitive, bool wholeWord) |
void | insertIconBrowserText (QString iconLink) |
void | currentTabChanged (int index) |
slot invoked by tab-widget if current tab changed | |
void | tabCloseRequested (int index) |
slot invoked if close button of any tab of m_tab (QTabWidgetItom) has been pressed | |
void | tabCloseRequested (ScriptEditorWidget *sew, bool ignoreModifications) |
void | scriptModificationChanged (bool changed) |
slot connected to each ScriptEditorWidget instance. Invoked if any content in any script changed. | |
void | updateEditorActions () |
updates actions which deal with editor commands | |
void | updatePythonActions () |
updates actions which deal with python commands | |
void | updateTabContextActions () |
updates actions before context menu of tabs is shown | |
void | mnuOpenIconBrowser () |
Open the icon browser. | |
void | mnuTabMoveLeft () |
moves active tab by one position to the left | |
void | mnuTabMoveRight () |
moves active tab by one position to the right | |
void | mnuTabMoveFirst () |
moves active tab to the first position | |
void | mnuTabMoveLast () |
moves active tab to the last position | |
void | mnuTabClose () |
closes active tab | |
void | mnuTabCloseOthers () |
closes every tab besides active one (asks for saving tabs, which should be closed) | |
void | mnuTabCloseAll () |
closes every tab, asks for saving first | |
void | mnuTabDock () |
dock the active tab and closes this ScriptDockWidget, if it is not docked and empty after docking | |
void | mnuTabUndock () |
undock the active tab and closes this ScriptDockWidget, if it is not docked and empty after docking | |
void | mnuNewScript () |
slot invoked by action to open a new script | |
void | mnuOpenScript () |
slot invoked by action to open an existing script | |
void | mnuSaveScript () |
slot invoked by action to save active script | |
void | mnuSaveScriptAs () |
slot invoked by action to save active script with new filename (save as) | |
void | mnuSaveAllScripts () |
slot invoked by action to save all opened scripts | |
void | mnuPrint () |
void | mnuCut () |
slot invoked to execute a cut command in active script editor | |
void | mnuCopy () |
slot invoked to execute a copy command in active script editor | |
void | mnuPaste () |
slot invoked to execute a paste command in active script editor | |
void | mnuUndo () |
slot invoked to execute an undo command in active script editor | |
void | mnuRedo () |
slot invoked to execute a redo command in active script editor | |
void | mnuComment () |
slot invoked to execute a comment command in active script editor | |
void | mnuUncomment () |
slot invoked to execute an uncomment command in active script editor | |
void | mnuIndent () |
slot invoked to execute an indentation command in active script editor | |
void | mnuUnindent () |
slot invoked to execute an unindentation command in active script editor | |
void | mnuScriptRun () |
slot invoked to run the active script in python engine | |
void | mnuScriptRunSelection () |
void | mnuScriptDebug () |
slot invoked to debug the active script in python engine | |
void | mnuScriptStop () |
slot invoked to stop python script execution | |
void | mnuScriptContinue () |
slot invoked to continue debugging process if actually waiting at breakpoint | |
void | mnuScriptStep () |
slot invoked to execute a python debugging step | |
void | mnuScriptStepOver () |
slot invoked to execute a python debugging step over | |
void | mnuScriptStepOut () |
slot invoked to execute a python debugging step out | |
void | mnuFindTextExpr () |
void | mnuReplaceTextExpr () |
void | mnuGoto () |
void | mnuToggleBookmark () |
void | mnuClearAllBookmarks () |
void | mnuGotoNextBookmark () |
void | mnuGotoPreviousBookmark () |
Private Attributes | |
QWidget * | m_pCenterWidget |
QVBoxLayout * | m_pVBox |
QTabWidgetItom * | m_tab |
WidgetFindWord * | m_pWidgetFindWord |
DialogReplace * | m_pDialogReplace |
int | m_actTabIndex |
ShortcutAction * | m_tabMoveLeftAction |
ShortcutAction * | m_tabMoveRightAction |
ShortcutAction * | m_tabMoveFirstAction |
ShortcutAction * | m_tabMoveLastAction |
ShortcutAction * | m_tabCloseAction |
ShortcutAction * | m_tabCloseOthersAction |
ShortcutAction * | m_tabCloseAllAction |
ShortcutAction * | m_tabDockAction |
ShortcutAction * | m_tabUndockAction |
ShortcutAction * | m_newScriptAction |
ShortcutAction * | m_openScriptAction |
ShortcutAction * | m_saveScriptAction |
ShortcutAction * | m_saveScriptAsAction |
ShortcutAction * | m_saveAllScriptsAction |
ShortcutAction * | m_printAction |
ShortcutAction * | m_cutAction |
ShortcutAction * | m_copyAction |
ShortcutAction * | m_pasteAction |
ShortcutAction * | m_undoAction |
ShortcutAction * | m_redoAction |
ShortcutAction * | m_commentAction |
ShortcutAction * | m_uncommentAction |
ShortcutAction * | m_indentAction |
ShortcutAction * | m_unindentAction |
ShortcutAction * | m_scriptRunAction |
ShortcutAction * | m_scriptRunSelectionAction |
ShortcutAction * | m_scriptDebugAction |
ShortcutAction * | m_scriptStopAction |
ShortcutAction * | m_scriptContinueAction |
ShortcutAction * | m_scriptStepAction |
ShortcutAction * | m_scriptStepOverAction |
ShortcutAction * | m_scriptStepOutAction |
ShortcutAction * | m_findTextExprAction |
ShortcutAction * | m_replaceTextExprAction |
ShortcutAction * | m_gotoAction |
ShortcutAction * | m_openIconBrowser |
ShortcutAction * | m_bookmarkToggle |
ShortcutAction * | m_bookmarkNext |
ShortcutAction * | m_bookmarkPrevious |
ShortcutAction * | m_bookmarkClearAll |
QMenu * | m_tabContextMenu |
QMenu * | m_fileMenu |
QMenu * | m_viewMenu |
QMenu * | m_editMenu |
QMenu * | m_scriptMenu |
QMenu * | m_winMenu |
QMenu * | m_bookmark |
QToolBar * | m_fileToolBar |
QToolBar * | m_editToolBar |
QToolBar * | m_scriptToolBar |
QToolBar * | m_bookmarkToolBar |
widget containing one or multiple script editors (tabbed). This widget can either be a docking widget, docked in a docking area in the main window or it can be a floatable window which has a standard window behaviour.
ito::ScriptDockWidget::ScriptDockWidget | ( | const QString & | title, |
bool | docked, | ||
bool | isDockAvailable, | ||
QWidget * | parent = 0 , |
||
Qt::WindowFlags | flags = 0 |
||
) |
constructor
creates a tab widget (QTabWidgetItom), which contains multiple instances of ScriptEditorWidget. Creates actions, menus, toolbars and sets some other settings.
title | Title of the DockWidget |
docked | true: this widget should be docked at creating time, else: false |
isDockAvailable | indicates whether docking functionality is available, if not, docked is always set to false |
< tab-settings
ito::ScriptDockWidget::~ScriptDockWidget | ( | ) |
destructor
cancels connections and closes every tab.
bool ito::ScriptDockWidget::activateTabByFilename | ( | QString | filename, |
int | line = -1 |
||
) |
activates tab with script whose filename corresponds to the filename parameter.
filename | Filename of the script which should be activated |
line | is the marked debugging line (default: -1, no arrow) |
RetVal ito::ScriptDockWidget::appendEditor | ( | ScriptEditorWidget * | editorWidget | ) |
append given ScriptEditorWidget as new tab
appends widget, without creating it (for drag&drop, (un)-docking...)
editorWidget | ScriptEditorWidget to append |
< activate appended tab
RetVal ito::ScriptDockWidget::closeAllScripts | ( | bool | saveFirst = true , |
bool | askFirst = true , |
||
bool | ignoreNewScripts = false , |
||
int | excludeIndex = -1 |
||
) |
closes all opened scripts in this ScriptDockWidget
if indicated, scripts will be saved first. Methods returns if saving process fails, else scripts will be closed.
saveFirst | if true, unsaved scripts are tried to be saved first |
askFirst | if true, user will be asked about script saving |
ignoreNewScripts | if true, new scripts which do not have any filename are not considered in the saving method |
excludeIndex | tab with given index will not be considered in saving method, default: -1 (consider all scripts) |
void ito::ScriptDockWidget::closeEvent | ( | QCloseEvent * | event | ) | [protected, virtual] |
this method is invoked if this ScriptDockWidget should be closed.
First, tries to save every script. If this process is successfully executed, the close event is accepted in order to close this instance, else the event is ignored. If event is accepted, the signal removeAndDeleteScriptDockWidget is emitted, such that the ScriptEditorOrganizer can manage the deletion of this instance.
event | Event of type QCloseEvent |
Reimplemented from ito::AbstractDockWidget.
RetVal ito::ScriptDockWidget::closeTab | ( | int | index, |
bool | saveFirst = true |
||
) | [protected] |
public method to close any specific tab with or without saving its script first
index | tab-index of tab in question |
saveFirst | save changes in editor first (true) or ignore changes (false) |
bool ito::ScriptDockWidget::containsNewScripts | ( | ) | const |
checks whether any editor in this ScriptDockWidget has no filename
returns number of tabs
void ito::ScriptDockWidget::createStatusBar | ( | ) | [protected, virtual] |
void ito::ScriptDockWidget::currentTabChanged | ( | int | index | ) | [private, slot] |
slot invoked by tab-widget if current tab changed
modifies title of this ScriptDockWidget instance, depending on the active tab.
index | tab-index of changed editor |
void ito::ScriptDockWidget::dockScriptTab | ( | ScriptDockWidget * | widget, |
int | index, | ||
bool | closeDockIfEmpty = false |
||
) | [signal] |
signal emitted if tab with given index of given ScriptDockWidget should be docked in a docked ScriptDockWidget
ScriptEditorWidget * ito::ScriptDockWidget::getCurrentEditor | ( | ) | const [protected] |
returns reference to current ScriptEditorWidget
ScriptEditorWidget * ito::ScriptDockWidget::getEditorByIndex | ( | int | index | ) | const [protected] |
returns ScriptEditorWidget by given tab-index
long description
index | tab-index |
int ito::ScriptDockWidget::getIndexByEditor | ( | ScriptEditorWidget * | sew | ) | const [protected] |
returns tab-index by given reference to ScriptEditorWidget
sew | reference to ScriptEditorWidget |
QStringList ito::ScriptDockWidget::getModifiedFileNames | ( | bool | ignoreUnsavedFiles = false , |
int | excludeIndex = -1 |
||
) | const |
returns a list of filenames, which have been modified in this ScriptDockWidget
long description
ignoreUnsavedFiles | if true, ignores scripts, which do not have any filename yet |
exludeIndex | tab-index which should be ignored, set to -1 in order to consider every tab |
int ito::ScriptDockWidget::getTabCount | ( | ) | const [inline] |
checks wether given tab-index is valid (true) or not (false)
RetVal ito::ScriptDockWidget::newScript | ( | ) |
creates new instance of ScriptEditorWidget and appends it to the tab-widget
RetVal ito::ScriptDockWidget::openScript | ( | QString | filename, |
bool | silent = false |
||
) |
opens a given filename as new tab in this ScriptDockWidget
Opens new ScriptEditorWidget, appends it to the tab widget and opens filename in the newly created instance.
silent | if true, no warning about invalid filename or invalid file format is shown |
RetVal ito::ScriptDockWidget::openScript | ( | ) |
method to open an existing script which can be indicated by the user by a getOpenFileName-dialog.
the script is not directly opened by this method, but the signal openScriptRequest is emitted which invokes a slot in the scriptEditorOrganizer. Then the organizer can check, if that filename is already opened in another tab and activate it instead of opening a new editor.
void ito::ScriptDockWidget::openScriptRequest | ( | QString | filename, |
ScriptDockWidget * | scriptDockWidget | ||
) | [signal] |
signal emitted if script with given filename should be opened in scriptDockWidget
void ito::ScriptDockWidget::pythonDebugCommand | ( | tPythonDbgCmd | cmd | ) | [signal] |
will be received by PythonThread, directly
void ito::ScriptDockWidget::pythonDebugFileRequest | ( | QString | filename | ) | [signal] |
will be received by scriptEditorOrganizer, in order to save all unsaved changes first
void ito::ScriptDockWidget::pythonInterruptExecution | ( | ) | [signal] |
will be received by PythonThread, directly
void ito::ScriptDockWidget::pythonRunFileRequest | ( | QString | filename | ) | [signal] |
will be received by scriptEditorOrganizer, in order to save all unsaved changes first
void ito::ScriptDockWidget::pythonRunSelection | ( | QString | selectionText | ) | [signal] |
will be received by consoleWidget, directly
void ito::ScriptDockWidget::removeAndDeleteScriptDockWidget | ( | ScriptDockWidget * | widget | ) | [signal] |
signal emitted if given ScriptDockWidget should be closed and removed by ScriptEditorOrganizer
ScriptEditorWidget * ito::ScriptDockWidget::removeEditor | ( | int | index | ) |
removes ScriptEditorWidget at given tab position from tab-widget and returns its reference
removes widget, without deleting it (for drag&drop, (un)-docking...)
index | tab index of editor, which should be removed |
RetVal ito::ScriptDockWidget::saveAllScripts | ( | bool | askFirst = true , |
bool | ignoreNewScripts = false , |
||
int | excludeIndex = -1 |
||
) |
tries to save all opened scripts in this ScriptDockWidget
First, all unsaved and modified scripts are indentified and listed. Then the user is asked for confirmation of saving these modified documents. Then these scripts will be saved, if desired.
askFirst | if true, the user is asked for confirmation, else all scripts are silently saved |
ignoreNewScripts | if true do not consider new scripts, which does not have any filename yet |
excludeIndex | ignore tab with this index, set it to -1 in order to consider every tab (default: -1) |
RetVal ito::ScriptDockWidget::saveTab | ( | int | index, |
bool | forceSaveAs = false , |
||
bool | askFirst = true |
||
) | [protected] |
saves tab
index | tab-index of tab in question |
forceSaveAs | true if script should be saved with new filename, else false |
askFirst | true if user must confirm that script will be saved |
void ito::ScriptDockWidget::scriptModificationChanged | ( | bool | changed | ) | [private, slot] |
slot connected to each ScriptEditorWidget instance. Invoked if any content in any script changed.
calls slot currentTabChanged with active tab index as parameter.
void ito::ScriptDockWidget::tabCloseRequested | ( | int | index | ) | [private, slot] |
slot invoked if close button of any tab of m_tab (QTabWidgetItom) has been pressed
tries to close the tab in question
index | tab-index of tab in question |
void ito::ScriptDockWidget::tabContextMenuEvent | ( | QContextMenuEvent * | event | ) | [private, slot] |
method is invoked, if a context menu is requested
checks if mouse click directly has been located at any tab and if yes actualizes the member m_actTabIndex.
void ito::ScriptDockWidget::undockScriptTab | ( | ScriptDockWidget * | widget, |
int | index, | ||
bool | undockToNewScriptWindow = false , |
||
bool | closeDockIfEmpty = false |
||
) | [signal] |
signal emitted if tab with given index of given ScriptDockWidget should be undocked in an undocked ScriptDockWidget
void ito::ScriptDockWidget::updateEditorActions | ( | ) | [private, slot] |
updates actions which deal with editor commands
< todo
int ito::ScriptDockWidget::m_actTabIndex [private] |
member indicating the tab-index of the active script editor
QTabWidgetItom* ito::ScriptDockWidget::m_tab [private] |
reference to QTabWidgetItom instance