FreehandMode Class Reference
#include <canvasmode_drawfreehand.h>


Public Member Functions | |
| FreehandMode (ScribusView *view) | |
| virtual void | enterEvent (QEvent *) |
| virtual void | leaveEvent (QEvent *) |
| virtual void | activate (bool) |
| virtual void | deactivate (bool) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *m) |
| virtual void | mouseReleaseEvent (QMouseEvent *m) |
| virtual void | mouseMoveEvent (QMouseEvent *m) |
| virtual void | mousePressEvent (QMouseEvent *m) |
| virtual void | drawControls (QPainter *p) |
Private Member Functions | |
| bool | GetItem (PageItem **pi) |
| void | selectPage (QMouseEvent *m) |
Private Attributes | |
| int | Cp |
| int | oldCp |
| bool | inItemCreation |
| bool | shiftSelItems |
| bool | FirstPoly |
| bool | m_MouseButtonPressed |
| int | frameResizeHandle |
| int | RotMode |
| int | dragConstrainInitPtX |
| int | dragConstrainInitPtY |
| double | Mxp |
| double | Myp |
| double | Dxp |
| double | Dyp |
| int | GxM |
| int | GyM |
| double | SeRx |
| double | SeRy |
| bool | MoveGX |
| bool | MoveGY |
| FPointArray | RecordP |
Detailed Description
Handles the creation of new pageitemsDefinition at line 32 of file canvasmode_drawfreehand.h.
Constructor & Destructor Documentation
| FreehandMode::FreehandMode | ( | ScribusView * | view | ) |
Definition at line 63 of file canvasmode_drawfreehand.cpp.
References Cp, Dxp, Dyp, FirstPoly, frameResizeHandle, GxM, GyM, inItemCreation, MoveGX, MoveGY, Mxp, Myp, oldCp, RotMode, and shiftSelItems.
Member Function Documentation
| void FreehandMode::enterEvent | ( | QEvent * | ) | [virtual] |
Reimplemented from CanvasMode.
Definition at line 95 of file canvasmode_drawfreehand.cpp.
References m_MouseButtonPressed, and CanvasMode::setModeCursor().
| void FreehandMode::leaveEvent | ( | QEvent * | e | ) | [virtual] |
Reimplemented from CanvasMode.
Definition at line 104 of file canvasmode_drawfreehand.cpp.
References m_MouseButtonPressed.
| void FreehandMode::activate | ( | bool | fromGesture | ) | [virtual] |
Is called when this mode becomes active, either because it was selected by the user (fromgesture == false) or because a gesture completed and the canvas returns back to this mode (fromGesture == true)
Reimplemented from CanvasMode.
Definition at line 111 of file canvasmode_drawfreehand.cpp.
References Cp, Dxp, Dyp, FirstPoly, frameResizeHandle, GxM, GyM, inItemCreation, MoveGX, MoveGY, Mxp, Myp, oldCp, RotMode, CanvasMode::setModeCursor(), and shiftSelItems.
| void FreehandMode::deactivate | ( | bool | forGesture | ) | [virtual] |
Is called when this mode becomes inactive, either because the canvas switches to another mode (forGesture == false) or because a gesture is activated (forGesture == true)
Reimplemented from CanvasMode.
Definition at line 127 of file canvasmode_drawfreehand.cpp.
References CanvasMode::m_view, and ScribusView::redrawMarker.
| void FreehandMode::mouseDoubleClickEvent | ( | QMouseEvent * | m | ) | [virtual] |
Reimplemented from CanvasMode.
Definition at line 133 of file canvasmode_drawfreehand.cpp.
References CanvasMode::m_canvas, m_MouseButtonPressed, mousePressEvent(), and Canvas::resetRenderMode().
| void FreehandMode::mouseReleaseEvent | ( | QMouseEvent * | m | ) | [virtual] |
Reimplemented from CanvasMode.
Definition at line 310 of file canvasmode_drawfreehand.cpp.
References Selection::addItem(), FPointArray::addPoint(), ScribusDoc::AdjustItemSize(), ScribusDoc::ApplyGridF(), ScribusDoc::ApplyGuides(), ScribusDoc::appMode, PageItem::asImageFrame(), PageItem::asLine(), PageItem::asTextFrame(), UndoManager::beginTransaction(), bezierFit(), ScribusDoc::changed(), PageItem::checkChanges(), OneClick::checkRemember, Selection::clear(), PageSelector::clearFocus(), PageItem::ClipEdited, UndoTransaction::commit(), PageItem::ContourLine, FPointArray::copy(), Selection::count(), UndoManager::Create, ScribusDoc::currentPageNumber(), ScribusView::Deselect(), toolPrefs::dPenLine, ScribusDoc::DragP, toolPrefs::dWidth, Dxp, Dyp, PageItem::emitAllToGUI(), ScribusView::endGroupTransaction(), NodeEditContext::finishTransaction(), frameResizeHandle, PageItem::FrameType, FPointArray::fromQPainterPath(), PrefsContext::getBool(), PrefsFile::getContext(), PrefsContext::getDouble(), Selection::getGroupRect(), PrefsContext::getInt(), GetItem(), getMaxClipF(), getMinClipF(), PageItem::getTransform(), UndoObject::getUName(), UndoObject::getUPixmap(), Canvas::globalToCanvas(), ScribusView::groupTransactionStarted(), ScribusView::HaveSelRect, PageItem::height, UndoManager::ICreate, PageItem::imageFlippedH(), PageItem::imageFlippedV(), PageItem::imageXScale, PageItem::imageYScale, inItemCreation, PrefsManager::instance(), UndoManager::instance(), UndoManager::IResize, Selection::isMultipleSelection(), ScribusDoc::itemAdd(), ScribusDoc::itemAddCommit(), Selection::itemAt(), PageItem::ItemNr, ScribusDoc::Items, ScribusDoc::leaveDrag, CanvasMode::m_canvas, CanvasMode::m_doc, m_MouseButtonPressed, M_PI, ScribusDoc::m_Selection, CanvasMode::m_view, Canvas::m_viewMode, ScribusDoc::masterPageMode(), ScribusView::MidButt, modeDrawBezierLine, modeDrawFreehandLine, modeDrawImage, modeDrawLine, modeDrawRegularPolygon, modeDrawShapes, modeDrawText, modeEdit, modeNormal, PageItem::moveImageInFrame(), ScribusDoc::MoveItem(), ScribusDoc::MoveRotated(), ScribusDoc::MoveSizeItem(), ScribusView::moveTimerElapsed(), Mxp, Myp, ScribusDoc::nodeEdit, CommonStrings::None, PageItem::OldB2, PageItem::OldH2, ScribusDoc::OnPage(), CanvasViewMode::operItemResizing, PageItem::OwnPage, p, ScribusDoc::Pages, ScribusView::pageSelector, FPointArray::point(), PageItem::PoLine, PageItem::PolyLine, PrefsManager::prefsFile, RecordP, ScribusView::redrawMarker, ScribusView::requestMode(), ScribusView::resetMousePressed(), Canvas::resetRenderMode(), UndoManager::Resize, FPointArray::resize(), UndoManager::ResizeFromTo, ScribusDoc::RotateItem(), PageItem::rotation, OneClick::RotationGroup, UndoManager::ScratchSpace, SeRx, SeRy, PrefsContext::set(), ScribusDoc::setCurrentPage(), Selection::setGroupRect(), PageItem::setHeight(), ScribusView::setMenTxt(), ScribusDoc::setRedrawBounding(), Canvas::setRenderModeUseBuffer(), PageItem::setWidth(), PageItem::setXPos(), PageItem::setXYPos(), PageItem::setYPos(), shiftSelItems, FPointArray::size(), ScribusDoc::SizeItem(), PageItem::Sizing, ScribusDoc::SnapGuides, OneClick::spinHeight, OneClick::spinWidth, ScribusView::stopDragTimer(), ScribusDoc::SubMode, submodePaintingDone, ScribusDoc::toolSettings, tr(), FPoint::transformPoint(), FPointArray::translate(), UndoManager::undoEnabled(), ScribusView::undoManager, unitGetRatioFromIndex(), ScribusDoc::unitIndex(), PageItem::Unspecified, SingleObservable< OBSERVED >::update(), ScribusView::updateCanvas(), PageItem::updateClip(), ScribusDoc::useRaster, PageItem::width, FPoint::x(), PageItem::xPos, FPoint::y(), PageItem::yPos, and ScribusView::zoomSpinBox.
| void FreehandMode::mouseMoveEvent | ( | QMouseEvent * | m | ) | [virtual] |
Reimplemented from CanvasMode.
Definition at line 142 of file canvasmode_drawfreehand.cpp.
References FPointArray::addPoint(), ScribusDoc::appMode, Canvas::canvasToGlobal(), Selection::count(), ScribusDoc::DragP, Dxp, Dyp, GetItem(), Canvas::globalToCanvas(), GxM, GyM, ScribusView::HaveSelRect, Selection::isMultipleSelection(), Selection::itemAt(), PageItem::locked(), CanvasMode::m_canvas, CanvasMode::m_doc, m_MouseButtonPressed, ScribusDoc::m_Selection, CanvasMode::m_view, Canvas::m_viewMode, modeDrawBezierLine, modeDrawFreehandLine, modeDrawTable, modePanning, Mxp, Myp, Canvas::newRedrawPolygon(), CanvasViewMode::operItemResizing, p, FPointArray::point(), FPointArray::pointQ(), RecordP, ScribusView::redrawMarker, Canvas::redrawPolygon(), ScribusView::requestMode(), SeRx, SeRy, CanvasMode::setModeCursor(), shiftSelItems, FPointArray::size(), ScribusView::updateCanvas(), FPoint::x(), and FPoint::y().
| void FreehandMode::mousePressEvent | ( | QMouseEvent * | m | ) | [virtual] |
Reimplemented from CanvasMode.
Definition at line 255 of file canvasmode_drawfreehand.cpp.
References ScribusDoc::ApplyGridF(), ScribusView::Deselect(), ScribusDoc::DragP, ScribusView::DrawNew(), Canvas::globalToCanvas(), guidesPrefs::grabRad, ScribusDoc::guidesSettings, ScribusView::HaveSelRect, inItemCreation, ScribusDoc::leaveDrag, CanvasMode::m_canvas, CanvasMode::m_doc, m_MouseButtonPressed, CanvasMode::m_view, ScribusView::MidButt, MoveGX, MoveGY, Mxp, Myp, p, RecordP, ScribusView::registerMousePress(), FPointArray::resize(), SeRx, SeRy, Canvas::setRenderModeFillBuffer(), ScribusView::stopGesture(), FPoint::x(), and FPoint::y().
Referenced by mouseDoubleClickEvent().
| void FreehandMode::drawControls | ( | QPainter * | p | ) | [virtual] |
Draws the controls for this mode and the selection marker. If viewmode.drawSelectionWithControls is true, also draws the selection contents first.
Reimplemented from CanvasMode.
Definition at line 78 of file canvasmode_drawfreehand.cpp.
| bool FreehandMode::GetItem | ( | PageItem ** | pi | ) | [inline, private] |
Definition at line 83 of file canvasmode_drawfreehand.cpp.
References Selection::itemAt(), CanvasMode::m_doc, and ScribusDoc::m_Selection.
Referenced by mouseMoveEvent(), and mouseReleaseEvent().
| void FreehandMode::selectPage | ( | QMouseEvent * | m | ) | [private] |
Definition at line 1014 of file canvasmode_drawfreehand.cpp.
References ScribusDoc::currentPageNumber(), ScribusView::Deselect(), NodeEditContext::deselect(), ScribusView::DrawNew(), Canvas::globalToCanvas(), guidesPrefs::grabRad, ScribusDoc::guidesSettings, CanvasMode::m_canvas, CanvasMode::m_doc, m_MouseButtonPressed, CanvasMode::m_view, ScribusDoc::masterPageMode(), Mxp, Myp, ScribusDoc::nodeEdit, ScribusDoc::OnPage(), ScribusDoc::Pages, ScribusDoc::setCurrentPage(), ScribusView::setMenTxt(), FPoint::x(), and FPoint::y().
Member Data Documentation
int FreehandMode::Cp [private] |
Definition at line 52 of file canvasmode_drawfreehand.h.
Referenced by activate(), and FreehandMode().
int FreehandMode::oldCp [private] |
Definition at line 52 of file canvasmode_drawfreehand.h.
Referenced by activate(), and FreehandMode().
bool FreehandMode::inItemCreation [private] |
Definition at line 53 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), mousePressEvent(), and mouseReleaseEvent().
bool FreehandMode::shiftSelItems [private] |
Definition at line 53 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), mouseMoveEvent(), and mouseReleaseEvent().
bool FreehandMode::FirstPoly [private] |
Definition at line 53 of file canvasmode_drawfreehand.h.
Referenced by activate(), and FreehandMode().
bool FreehandMode::m_MouseButtonPressed [private] |
Definition at line 54 of file canvasmode_drawfreehand.h.
Referenced by enterEvent(), leaveEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and selectPage().
int FreehandMode::frameResizeHandle [private] |
Definition at line 55 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), and mouseReleaseEvent().
int FreehandMode::RotMode [private] |
Definition at line 56 of file canvasmode_drawfreehand.h.
Referenced by activate(), and FreehandMode().
int FreehandMode::dragConstrainInitPtX [private] |
Definition at line 57 of file canvasmode_drawfreehand.h.
int FreehandMode::dragConstrainInitPtY [private] |
Definition at line 57 of file canvasmode_drawfreehand.h.
double FreehandMode::Mxp [private] |
Definition at line 58 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and selectPage().
double FreehandMode::Myp [private] |
Definition at line 58 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and selectPage().
double FreehandMode::Dxp [private] |
Definition at line 58 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), mouseMoveEvent(), and mouseReleaseEvent().
double FreehandMode::Dyp [private] |
Definition at line 58 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), mouseMoveEvent(), and mouseReleaseEvent().
int FreehandMode::GxM [private] |
Definition at line 59 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), and mouseMoveEvent().
int FreehandMode::GyM [private] |
Definition at line 59 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), and mouseMoveEvent().
double FreehandMode::SeRx [private] |
Definition at line 60 of file canvasmode_drawfreehand.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
double FreehandMode::SeRy [private] |
Definition at line 60 of file canvasmode_drawfreehand.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
bool FreehandMode::MoveGX [private] |
Definition at line 61 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), and mousePressEvent().
bool FreehandMode::MoveGY [private] |
Definition at line 61 of file canvasmode_drawfreehand.h.
Referenced by activate(), FreehandMode(), and mousePressEvent().
FPointArray FreehandMode::RecordP [private] |
Definition at line 62 of file canvasmode_drawfreehand.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
The documentation for this class was generated from the following files:
