itom
3.0.0
|
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 () |
void | updateClassesBox (ScriptEditorWidget *editor) |
Public Slots inherited from ito::AbstractDockWidget | |
void | setEnabled (bool) |
virtual void | setVisible (bool visible) |
virtual void | dockedToMainWindow (AbstractDockWidget *) |
virtual void | removedFromMainWindow (AbstractDockWidget *) |
virtual void | pythonStateChanged (tPythonTransitions pyTransition) |
slot invoked if python state changed. Sets the specific member variables according to the python transition. More... | |
void | raiseAndActivate () |
activates this dock widget or window and raises it on top of all opened windows More... | |
void | setDockSize (int newWidth, int newHeight) |
void | dockWidget () |
docks this dockWidget. More... | |
void | undockWidget (bool show_it=true) |
undocks this dockWidget. More... | |
Signals | |
void | removeAndDeleteScriptDockWidget (ScriptDockWidget *widget) |
void | openScriptRequest (const 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, const QString &objName, bool docked, bool isDockAvailable, QWidget *parent=0, Qt::WindowFlags flags=0) | |
constructor More... | |
~ScriptDockWidget () | |
destructor More... | |
QStringList | getModifiedFileNames (bool ignoreNewScripts=false, int excludeIndex=-1) const |
returns a list of filenames, which have been modified in this ScriptDockWidget More... | |
QStringList | getAllFilenames () const |
returns a list of all filenames of all opened scripts (besides new scripts) More... | |
RetVal | newScript () |
creates new instance of ScriptEditorWidget and appends it to the tab-widget More... | |
RetVal | openScript () |
method to open an existing script which can be indicated by the user by a getOpenFileName-dialog. More... | |
RetVal | openScript (QString filename, bool silent=false) |
opens a given filename as new tab in this ScriptDockWidget More... | |
RetVal | saveAllScripts (bool askFirst=true, bool ignoreNewScripts=false, int excludeIndex=-1) |
tries to save all opened scripts in this ScriptDockWidget More... | |
RetVal | closeAllScripts (bool saveFirst=true, bool askFirst=true, bool ignoreNewScripts=false, int excludeIndex=-1) |
closes all opened scripts in this ScriptDockWidget More... | |
bool | isTabIndexValid (int tabIndex) const |
int | getTabCount () const |
int | getCurrentIndex () const |
void | setCurrentIndex (int index) |
bool | containsNewScripts () const |
checks whether any editor in this ScriptDockWidget has no filename More... | |
RetVal | appendEditor (ScriptEditorWidget *editorWidget) |
append given ScriptEditorWidget as new tab More... | |
ScriptEditorWidget * | removeEditor (int index) |
removes ScriptEditorWidget at given tab position from tab-widget and returns its reference More... | |
bool | activateTabByFilename (const QString &filename, int line=-1) |
activates tab with script whose filename corresponds to the filename parameter. More... | |
bool | activeTabEnsureLineVisible (const int lineNr, bool errorMessageClick=false) |
QList< ito::ScriptEditorStorage > | saveScriptState () const |
RetVal | restoreScriptState (const QList< ito::ScriptEditorStorage > &states) |
Public Member Functions inherited from ito::AbstractDockWidget | |
AbstractDockWidget (bool docked, bool isDockAvailable, tFloatingStyle floatingStyle, tMovingStyle movingStyle, const QString &title=QString(), const QString &objName=QString(), QWidget *parent=0) | |
constructor More... | |
virtual | ~AbstractDockWidget () |
destructor | |
bool | docked () const |
RetVal | setAdvancedWindowTitle (QString newCompleteTitle=QString(), bool appendToBasicTitle=true) |
changes the title of widget More... | |
RetVal | setTopLevel (tTopLevelStyle topLevel) |
void | setParent (QWidget *parent) |
QWidget * | getActiveInstance () |
QRect | frameGeometry () const |
const QRect & | geometry () const |
QRect | normalGeometry () const |
int | x () const |
int | y () const |
QPoint | pos () const |
QSize | frameSize () const |
QSize | size () const |
int | width () const |
int | height () const |
QRect | rect () const |
QRect | childrenRect () const |
QRegion | childrenRegion () const |
void | move (int x, int y) |
void | move (const QPoint &) |
void | resize (int w, int h) |
void | resize (const QSize &) |
void | setGeometry (int x, int y, int w, int h) |
void | setGeometry (const QRect &) |
QString | windowTitle () |
void | setWindowTitle (const QString &title) |
bool | isEnabled () const |
bool | isVisible () const |
void | saveState (const QString &iniName) const |
void | restoreState (const QString &iniName) |
void | synchronizeTopLevelState () |
synchronizes the top level state of the dock widget with the floating settings of this abstract dock widget More... | |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
Protected Member Functions | |
ScriptEditorWidget * | getEditorByIndex (int index) const |
returns ScriptEditorWidget by given tab-index More... | |
ScriptEditorWidget * | getCurrentEditor () const |
returns reference to current ScriptEditorWidget More... | |
int | getIndexByEditor (const ScriptEditorWidget *sew) const |
returns tab-index by given reference to ScriptEditorWidget More... | |
void | createActions () |
creates actions | |
void | createMenus () |
create menus | |
void | createToolBars () |
create toolbars | |
void | createStatusBar () |
init status bar More... | |
void | closeEvent (QCloseEvent *event) |
this method is invoked if this ScriptDockWidget should be closed. More... | |
RetVal | closeTab (int index, bool saveFirst=true) |
public method to close any specific tab with or without saving its script first More... | |
RetVal | saveTab (int index, bool forceSaveAs=false, bool askFirst=true) |
saves tab More... | |
Protected Member Functions inherited from ito::AbstractDockWidget | |
bool | eventFilter (QObject *obj, QEvent *event) |
eventFilter for m_pWindow More... | |
void | init () |
init method, called by constructor More... | |
virtual void | updateActions () |
virtual void | updatePythonActions ()=0 |
Qt::WindowFlags | modifyFlags (const Qt::WindowFlags &flags, const Qt::WindowFlags &setFlags, const Qt::WindowFlags &unsetFlags) |
virtual void | windowStateChanged (bool) |
void | setContentWidget (QWidget *widget) |
sets any given QWidget as central widget of QMainWindow and inversely sets this QWidget's parent to the instance of QMainWindget More... | |
QWidget * | getContentWidget () const |
QMainWindow * | getCanvas () |
bool | pythonBusy () const |
bool | pythonDebugMode () const |
bool | pythonInWaitingMode () const |
QToolBar * | getToolBar (QString key) const |
returns reference to toolbar with given key-value More... | |
QMenuBar * | getMenuBar () const |
RetVal | addToolBar (QToolBar *tb, const QString &key, Qt::ToolBarArea area=Qt::TopToolBarArea, int section=1) |
RetVal | removeToolBar (const QString &key) |
Private Slots | |
void | tabContextMenuEvent (QContextMenuEvent *event) |
method is invoked, if a context menu is requested More... | |
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, int findIn) |
void | insertIconBrowserText (QString iconLink) |
void | currentTabChanged (int index) |
slot invoked by tab-widget if current tab changed More... | |
void | tabCloseRequested (int index) |
slot invoked if close button of any tab of m_tab (QTabWidgetItom) has been pressed More... | |
void | tabCloseRequested (ScriptEditorWidget *sew, bool ignoreModifications) |
void | scriptModificationChanged (bool changed) |
slot connected to each ScriptEditorWidget instance. Invoked if any content in any script changed. More... | |
void | updateEditorActions () |
updates actions which deal with editor commands More... | |
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 () |
void | mnuInsertCodec () |
void | menuLastFilesAboutToShow () |
void | lastFileOpen (const QString &path) |
void | classChosen (const QString &text) |
void | methodChosen (const QString &text) |
void | loadSettings () |
void | findWordWidgetFinished () |
Private Member Functions | |
void | fillClassBox (const ClassNavigatorItem *parent, QString prefix) |
void | fillMethodBox (const ClassNavigatorItem *parent) |
void | showClassNavigator (bool show) |
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_findTextExprActionSC |
ShortcutAction * | m_replaceTextExprAction |
ShortcutAction * | m_gotoAction |
ShortcutAction * | m_openIconBrowser |
ShortcutAction * | m_bookmarkToggle |
ShortcutAction * | m_bookmarkNext |
ShortcutAction * | m_bookmarkPrevious |
ShortcutAction * | m_bookmarkClearAll |
ShortcutAction * | m_insertCodecAct |
QMenu * | m_tabContextMenu |
QMenu * | m_fileMenu |
QMenu * | m_lastFilesMenu |
QMenu * | m_viewMenu |
QMenu * | m_editMenu |
QMenu * | m_scriptMenu |
QMenu * | m_winMenu |
QMenu * | m_bookmark |
QSignalMapper * | m_lastFilesMapper |
QToolBar * | m_fileToolBar |
QToolBar * | m_editToolBar |
QToolBar * | m_scriptToolBar |
QToolBar * | m_bookmarkToolBar |
QWidget * | m_classMenuBar |
QComboBox * | m_classBox |
QComboBox * | m_methodBox |
bool | m_ClassNavigatorEnabled |
QMap< int, ClassNavigatorItem * > | m_rootElements |
Additional Inherited Members | |
Public Types inherited from ito::AbstractDockWidget | |
enum | tFloatingStyle { floatingNone, floatingStandard, floatingWindow } |
enum | tMovingStyle { movingDisabled, movingEnabled } |
enum | tTopLevelStyle { topLevelOverall, topLevelParentOnly, topLevelNothing } |
Protected Attributes inherited from ito::AbstractDockWidget | |
QAction * | m_actStayOnTop |
QAction * | m_actStayOnTopOfApp |
Properties inherited from ito::AbstractDockWidget | |
bool | visible |
bool | enabled |
QRect | geometry |
QRect | frameGeometry |
QRect | normalGeometry |
int | x |
int | y |
QPoint | pos |
QSize | frameSize |
QSize | size |
int | width |
int | height |
QRect | rect |
QRect | childrenRect |
QRegion | childrenRegion |
QString | windowTitle |
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, |
const QString & | objName, | ||
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 | ( | const 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) |
|
protectedvirtual |
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.
|
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
|
protectedvirtual |
|
privateslot |
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 |
|
signal |
signal emitted if tab with given index of given ScriptDockWidget should be docked in a docked ScriptDockWidget
QStringList ito::ScriptDockWidget::getAllFilenames | ( | ) | const |
returns a list of all filenames of all opened scripts (besides new scripts)
|
protected |
returns reference to current ScriptEditorWidget
|
protected |
returns ScriptEditorWidget by given tab-index
long description
index | tab-index |
|
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 |
|
inline |
returns number of tabs
|
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 | ( | ) |
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.
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 |
|
signal |
signal emitted if script with given filename should be opened in scriptDockWidget
|
signal |
will be received by PythonThread, directly
|
signal |
will be received by scriptEditorOrganizer, in order to save all unsaved changes first
|
signal |
will be received by PythonThread, directly
|
signal |
will be received by scriptEditorOrganizer, in order to save all unsaved changes first
|
signal |
will be received by consoleWidget, directly
|
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) |
|
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 |
|
privateslot |
slot connected to each ScriptEditorWidget instance. Invoked if any content in any script changed.
calls slot currentTabChanged with tab index of scriptEditorWidget that sent the signal or the active tab index if no sender is available.
|
privateslot |
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 |
|
privateslot |
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.
|
signal |
signal emitted if tab with given index of given ScriptDockWidget should be undocked in an undocked ScriptDockWidget
|
privateslot |
updates actions which deal with editor commands
< todo
|
private |
member indicating the tab-index of the active script editor
|
private |
reference to QTabWidgetItom instance