Scribus
Open source desktop publishing at your fingertips
CanvasMode Class Reference

#include <canvasmode.h>

Inheritance diagram for CanvasMode:
Collaboration diagram for CanvasMode:

Public Member Functions

virtual void activate (bool fromGesture)
 
virtual void deactivate (bool forGesture)
 
virtual void enterEvent (QEvent *)
 
virtual void leaveEvent (QEvent *)
 
virtual void dragEnterEvent (QDragEnterEvent *e)
 
virtual void dragMoveEvent (QDragMoveEvent *e)
 
virtual void dragLeaveEvent (QDragLeaveEvent *e)
 
virtual void dropEvent (QDropEvent *e)
 
virtual void mouseDoubleClickEvent (QMouseEvent *m)
 
virtual void mouseReleaseEvent (QMouseEvent *m)
 
virtual void mouseMoveEvent (QMouseEvent *m)
 
virtual void mousePressEvent (QMouseEvent *m)
 
virtual void keyPressEvent (QKeyEvent *e)
 
virtual void keyReleaseEvent (QKeyEvent *e)
 
virtual void inputMethodEvent (QInputMethodEvent *e)
 
virtual bool handleKeyEvents ()
 
virtual void updateViewMode (CanvasViewMode *viewmode)
 
virtual void drawControls (QPainter *p)
 
void drawSelectionHandles (QPainter *psx, QRectF selectionRect, bool background, bool insideGroup=false, double sx=1.0, double sy=1.0)
 
void drawSelection (QPainter *psx, bool drawHandles)
 
void drawSnapLine (QPainter *psx)
 
void drawOutline (QPainter *p, double scalex=1.0, double scaley=1.0, double deltax=0.0, double deltay=0.0)
 
QCursor modeCursor ()
 
void setModeCursor ()
 
virtual CanvasModedelegate ()
 
ScribusViewview () const
 

Static Public Member Functions

static CanvasModecreateForAppMode (ScribusView *view, int appMode)
 

Protected Member Functions

 CanvasMode (ScribusView *view)
 
void setResizeCursor (int how, double rot=0.0)
 
bool commonMouseMove (QMouseEvent *m)
 
void commonDrawControls (QPainter *p, bool drawHandles)
 
void commonDrawTextCursor (QPainter *p, PageItem_TextFrame *textframe, const QPointF &offset)
 Draws the text cursor for textframe, offset by offset.
 
void commonkeyPressEvent_NormalNodeEdit (QKeyEvent *e)
 
void commonkeyReleaseEvent (QKeyEvent *e)
 

Protected Attributes

ScribusView *const m_view
 
Canvas *const m_canvas
 
ScribusDoc *const m_doc
 
PanGesturem_panGesture
 
UndoManagerundoManager
 
double xSnap
 
double ySnap
 

Detailed Description

This class is a superclass for all mode handlers. By default, all events are ignored.

Member Function Documentation

void CanvasMode::commonkeyPressEvent_NormalNodeEdit ( QKeyEvent *  e)
protected

If we have a doc and we are not changing the page or zoom level in the status bar

With no item selected we can:

  • With space, get into panning mode (modePanning)
  • With PageUp, scroll up
  • With PageDown, scroll down
  • With Tab, change active document windowActivated

    Now if we have an item selected

  • In normal mode we can: – Use backspace or delete to delete the item – Use itemRaise action shortcut to raise an item (actionmanager.cpp connect, no code here) – Use itemLower action shortcut to lower an item (actionmanager.cpp connect, no code here) – Use the arrow keys to move an item or group around for !inches: With no meta, by 1.0 unit Ctrl, by 10.0 units Shift by 0.1 units Ctrl Shift 0.01 units
    • For inches: With no meta, by 1.0 pt Ctrl, by 1.0 unit Shift by 0.1 units Ctrl Shift 0.01 units – Use the arrow keys to resize an item: Alt right arrow, move right side outwards (expand) Alt left arrow, move left side outwards (expand) Alt Shift right arrow, move left side inwards (shrink) Alt Shift left arrow, move right side inwards (shrink) – In edit mode of an image frame, use the arrow keys to resize the image: (flows to pageitem_imageframe for control) Alt right arrow, move right side of image outwards (expand) Alt left arrow, move right side inwards (shrink) Alt down arrow, move bottom side downwards (expand) Alt up arrow, move top side inwards (shrink)
virtual CanvasMode* CanvasMode::delegate ( )
inlinevirtual

main canvas modes dont have a delegate

Reimplemented in CanvasGesture.

void CanvasMode::drawOutline ( QPainter *  p,
double  scalex = 1.0,
double  scaley = 1.0,
double  deltax = 0.0,
double  deltay = 0.0 
)

Draws an outline of selected items

void CanvasMode::drawSelection ( QPainter *  psx,
bool  drawHandles 
)

Draws the regular selection marker

void CanvasMode::drawSelectionHandles ( QPainter *  psx,
QRectF  selectionRect,
bool  background,
bool  insideGroup = false,
double  sx = 1.0,
double  sy = 1.0 
)

Draws the handles for the selection marker

void CanvasMode::drawSnapLine ( QPainter *  psx)

Draws an outline of selected items

void CanvasMode::updateViewMode ( CanvasViewMode viewmode)
virtual

Sets appropiate values for this canvas mode


The documentation for this class was generated from the following files: