A special view class which sends the messages from the application to the editor and embeds it in a window. More...
#include <EditorView.h>
Public Types | |
| enum | DisplayName { FullName, FileName, BaseName } |
Public Types inherited from Gui::MDIView | |
| enum | ViewMode { Child, TopLevel, FullScreen } |
| MDI view mode enum. More... | |
Public Member Functions | |
| bool | canClose (void) |
| Checking on close state. More... | |
| EditorView (QPlainTextEdit *editor, QWidget *parent) | |
| Constructs a EditorView which is a child of 'parent', with the name 'name'. More... | |
| QPlainTextEdit * | getEditor () const |
| const char * | getName (void) const |
| returns the name of the view (important for messages) More... | |
| void | OnChange (Base::Subject< const char * > &rCaller, const char *rcReason) |
| bool | onHasMsg (const char *pMsg) const |
| Checks if the action pMsg is available. More... | |
| bool | onMsg (const char *pMsg, const char **ppReturn) |
| Runs the action specified by pMsg. More... | |
| void | onUpdate (void) |
| get called when the document is updated More... | |
| void | setDisplayName (DisplayName) |
| ~EditorView () | |
| Destroys the object and frees any allocated resources. More... | |
Public Member Functions inherited from Gui::MDIView | |
| virtual void | deleteSelf () |
| delete itself More... | |
| virtual PyObject * | getPyObject () |
| This method returns the Python wrapper for a C++ object. More... | |
| MDIView (Gui::Document *pcDocument, QWidget *parent, Qt::WindowFlags wflags=0) | |
| View constructor Attach the view to the given document. More... | |
| virtual void | onRelabel (Gui::Document *pDoc) |
| get called when the document is updated More... | |
| virtual void | viewAll () |
| ~MDIView () | |
| View destructor Detach the view from the document, if attached. More... | |
| QSize | minimumSizeHint () const |
| virtual void | setCurrentViewMode (ViewMode mode) |
| If b is set to FullScreen the MDI view is displayed in full screen mode, if b is set to TopLevel then it is displayed as an own top-level window, otherwise (Normal) as tabbed window. More... | |
| ViewMode | currentViewMode () const |
| template<typename _T > | |
| _T | getActiveObject (const char *name, App::DocumentObject **parent=0, std::string *subname=0) const |
| access getter for the active object list More... | |
| void | setActiveObject (App::DocumentObject *o, const char *n, const char *subname=0) |
| bool | hasActiveObject (const char *n) const |
| bool | isActiveObject (App::DocumentObject *o, const char *n, const char *subname=0) const |
| virtual bool | containsViewProvider (const ViewProvider *) const |
| containsViewProvider Checks if the given view provider is part of this view. The default implementation returns false. More... | |
Public Member Functions inherited from Gui::BaseView | |
| BaseView (Gui::Document *pcDocument=0) | |
| View constructor Attach the view to the given document. More... | |
| virtual | ~BaseView () |
| View destructor Detach the view from the document, if attached! More... | |
| void | setDocument (Gui::Document *pcDocument) |
| sets the view to another document (called by Application) More... | |
| void | onClose (void) |
| is sent from the document in order to close the document More... | |
| Gui::Document * | getGuiDocument () const |
| returns the document the view is attached to More... | |
| App::Document * | getAppDocument () const |
| returns the document the view is attached to More... | |
| bool | isPassive (void) const |
| indicates if the view is in passive mode More... | |
| virtual void | onRename (Gui::Document *) |
| get called when the document is renamed (change of its internal name) More... | |
Public Member Functions inherited from Base::BaseClass | |
| BaseClass () | |
| Construction. More... | |
| virtual Type | getTypeId (void) const |
| bool | isDerivedFrom (const Type type) const |
| virtual void | setPyObject (PyObject *) |
| virtual | ~BaseClass () |
| Destruction. More... | |
Public Member Functions inherited from Gui::WindowParameter | |
| ParameterGrp::handle | getWindowParameter (void) |
| return the parameter group of this window More... | |
| void | OnChange (Base::Subject< const char * > &rCaller, const char *sReason) |
| bool | setGroupName (const char *name) |
| Sets the group of the window to name. More... | |
| WindowParameter (const char *name) | |
| virtual | ~WindowParameter () |
Standard actions of the editor | |
| bool | open (const QString &f) |
| Opens the file fileName. More... | |
| bool | saveAs () |
| Saves the content of the editor to a file specified by the appearing file dialog. More... | |
| void | cut () |
| Copies the selected text to the clipboard and deletes it from the text edit. More... | |
| void | copy () |
| Copies any selected text to the clipboard. More... | |
| void | paste () |
| Pastes the text from the clipboard into the text edit at the current cursor position. More... | |
| void | undo () |
| Undoes the last operation. More... | |
| void | redo () |
| Redoes the last operation. More... | |
| void | print () |
| Shows the printer dialog. More... | |
| void | printPdf () |
| Prints the document into a Pdf file. More... | |
| void | printPreview () |
| Show a preview dialog. More... | |
| void | print (QPrinter *) |
| QStringList | undoActions () const |
| Get the undo history. More... | |
| QStringList | redoActions () const |
| Get the redo history. More... | |
| QString | fileName () const |
| void | focusInEvent (QFocusEvent *e) |
| void | showEvent (QShowEvent *) |
| void | hideEvent (QHideEvent *) |
| void | closeEvent (QCloseEvent *) |
| void | changeFileName (const QString &) |
Additional Inherited Members | |
Public Slots inherited from Gui::MDIView | |
| virtual void | setOverrideCursor (const QCursor &) |
| virtual void | restoreOverrideCursor () |
Signals inherited from Gui::MDIView | |
| void | message (const QString &, int) |
Static Public Member Functions inherited from Base::BaseClass | |
| static void * | create (void) |
| static Type | getClassTypeId (void) |
| static void | init (void) |
Static Public Member Functions inherited from Gui::WindowParameter | |
| static ParameterGrp::handle | getDefaultParameter (void) |
| get the parameters More... | |
Protected Slots inherited from Gui::MDIView | |
| virtual void | windowStateChanged (MDIView *) |
| This method gets called from the main window this view is attached to whenever the window state of the active view changes. More... | |
Protected Member Functions inherited from Gui::MDIView | |
| void | closeEvent (QCloseEvent *e) |
| void | changeEvent (QEvent *e) |
Static Protected Member Functions inherited from Base::BaseClass | |
| static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Protected Attributes inherited from Gui::MDIView | |
| PyObject * | pythonObject |
Protected Attributes inherited from Gui::BaseView | |
| bool | bIsDetached |
| bool | bIsPassive |
Detailed Description
A special view class which sends the messages from the application to the editor and embeds it in a window.
Member Enumeration Documentation
◆ DisplayName
Constructor & Destructor Documentation
◆ EditorView()
| EditorView::EditorView | ( | QPlainTextEdit * | editor, |
| QWidget * | parent | ||
| ) |
Constructs a EditorView which is a child of 'parent', with the name 'name'.
References Gui::EditorViewP::aboutToClose, Gui::EditorViewP::activityTimer, Base::Subject< _MessageType >::Attach(), Gui::EditorViewP::displayName, FullName, Gui::getMainWindow(), Gui::WindowParameter::getWindowParameter(), Gui::EditorViewP::lock, ParameterGrp::NotifyAll(), and Gui::EditorViewP::textEdit.
◆ ~EditorView()
| EditorView::~EditorView | ( | ) |
Destroys the object and frees any allocated resources.
References Gui::EditorViewP::activityTimer, Base::Subject< _MessageType >::Detach(), and Gui::WindowParameter::getWindowParameter().
Member Function Documentation
◆ canClose()
|
virtual |
◆ changeFileName
|
signal |
Referenced by Gui::PythonEditorView::PythonEditorView().
◆ closeEvent()
|
protected |
References Gui::EditorViewP::aboutToClose, Gui::MDIView::closeEvent(), and Gui::getMainWindow().
◆ copy()
| void EditorView::copy | ( | ) |
Copies any selected text to the clipboard.
References Gui::EditorViewP::textEdit.
Referenced by onMsg().
◆ cut()
| void EditorView::cut | ( | ) |
Copies the selected text to the clipboard and deletes it from the text edit.
If there is no selected text nothing happens.
References Gui::EditorViewP::textEdit.
Referenced by onMsg().
◆ fileName()
| QString EditorView::fileName | ( | ) | const |
References Gui::EditorViewP::fileName.
Referenced by Gui::PythonEditorView::executeScript(), Gui::PythonDebugger::hideDebugMarker(), open(), and Gui::PythonDebugger::showDebugMarker().
◆ focusInEvent()
|
protected |
References Gui::EditorViewP::textEdit.
◆ getEditor()
| QPlainTextEdit * EditorView::getEditor | ( | ) | const |
References Gui::EditorViewP::textEdit.
◆ getName()
|
virtual |
returns the name of the view (important for messages)
Reimplemented from Gui::BaseView.
◆ hideEvent()
|
protected |
◆ OnChange()
| void EditorView::OnChange | ( | Base::Subject< const char * > & | rCaller, |
| const char * | rcReason | ||
| ) |
References Gui::WindowParameter::getWindowParameter().
◆ onHasMsg()
|
virtual |
Checks if the action pMsg is available.
This is for enabling/disabling the corresponding buttons or menu items for this action.
Reimplemented from Gui::MDIView.
Reimplemented in Gui::PythonEditorView.
References Gui::EditorViewP::aboutToClose, and Gui::EditorViewP::textEdit.
Referenced by Gui::PythonEditorView::executeScript(), and Gui::PythonEditorView::onHasMsg().
◆ onMsg()
|
virtual |
Runs the action specified by pMsg.
Reimplemented from Gui::MDIView.
Reimplemented in Gui::PythonEditorView.
References Gui::EditorViewP::aboutToClose, copy(), cut(), paste(), redo(), saveAs(), and undo().
Referenced by Gui::PythonEditorView::executeScript(), and Gui::PythonEditorView::onMsg().
◆ onUpdate()
|
virtual |
get called when the document is updated
Reimplemented from Gui::BaseView.
Referenced by shipAreasCurve.TaskPanel.TaskPanel::initValues(), and shipAreasCurve.TaskPanel.TaskPanel::onData().
◆ open()
| bool EditorView::open | ( | const QString & | f | ) |
Opens the file fileName.
References Gui::EditorViewP::activityTimer, fileName(), Gui::EditorViewP::lock, Gui::EditorViewP::redos, Gui::EditorViewP::textEdit, Gui::EditorViewP::timeStamp, and Gui::EditorViewP::undos.
Referenced by Gui::Dialog::DlgMacroExecuteImp::on_createButton_clicked(), Gui::Dialog::DlgMacroExecuteImp::on_editButton_clicked(), Gui::PythonDebugger::showDebugMarker(), Gui::Application::sInsert(), and Gui::Application::sOpen().
◆ paste()
| void EditorView::paste | ( | ) |
Pastes the text from the clipboard into the text edit at the current cursor position.
If there is no text in the clipboard nothing happens.
References Gui::EditorViewP::textEdit.
Referenced by onMsg().
◆ print() [1/2]
|
virtual |
Shows the printer dialog.
Reimplemented from Gui::MDIView.
References Gui::EditorViewP::textEdit.
Referenced by printPreview().
◆ print() [2/2]
|
virtual |
Reimplemented from Gui::MDIView.
References Gui::EditorViewP::textEdit.
◆ printPdf()
|
virtual |
Prints the document into a Pdf file.
Reimplemented from Gui::MDIView.
References Gui::FileDialog::getSaveFileName(), and Gui::EditorViewP::textEdit.
◆ printPreview()
|
virtual |
◆ redo()
| void EditorView::redo | ( | ) |
Redoes the last operation.
If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.
References Gui::EditorViewP::lock, Gui::EditorViewP::redos, Gui::EditorViewP::textEdit, and Gui::EditorViewP::undos.
Referenced by onMsg().
◆ redoActions()
| QStringList EditorView::redoActions | ( | ) | const |
Get the redo history.
References Gui::EditorViewP::redos.
Referenced by Gui::Dialog::RedoDialog::onFetchInfo().
◆ saveAs()
| bool EditorView::saveAs | ( | ) |
Saves the content of the editor to a file specified by the appearing file dialog.
References Gui::FileDialog::getSaveFileName().
Referenced by onMsg().
◆ setDisplayName()
| void EditorView::setDisplayName | ( | EditorView::DisplayName | type | ) |
References Gui::EditorViewP::displayName.
Referenced by Gui::Dialog::DlgMacroExecuteImp::on_editButton_clicked().
◆ showEvent()
|
protected |
References Gui::getMainWindow().
◆ undo()
| void EditorView::undo | ( | ) |
Undoes the last operation.
If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.
References Gui::EditorViewP::lock, Gui::EditorViewP::redos, Gui::EditorViewP::textEdit, and Gui::EditorViewP::undos.
Referenced by onMsg().
◆ undoActions()
| QStringList EditorView::undoActions | ( | ) | const |
Get the undo history.
References Gui::EditorViewP::undos.
Referenced by Gui::Dialog::UndoDialog::onFetchInfo().
The documentation for this class was generated from the following files:
- src/Gui/EditorView.h
- src/Gui/EditorView.cpp
Public Types inherited from
1.8.17