Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ScrollView Class Reference

Stores all the information concerning the view and is responsible for the user interaction. More...

#include <ScrollView.h>

Inheritance diagram for ScrollView::

List of all members.

Public Slots

void zoomIn (QPoint=QPoint(-1,-1))
 Zoom in the view at point p. More...

void zoomOut (QPoint=QPoint(-1,-1))
 Zoom out the view at point p If p = (-1,-1) the middle of the view is taken.

void zoomReset ()
 Set Zoom to 100%.

void updateCanvasSize ()
 Updates canvas size. More...

void objectsPasted ()
 Called when several objects have been pasted into this scrollview.

void allSelected ()
 Called when all objects have been selected.

void contextMenuHiding ()
 Called when the context menu is closing.


Signals

void setMode (int)
 Emited when the mode of the document changes.

void updateCanvasSize (int, int, double)
 Emited when the canvas size changed.

void zoomedToPercentage (int)
 Emited when zoomed to a certain percentage.


Public Methods

 ScrollView (QWidget *parent=0, const char *name=0)
 Constructor.

 ~ScrollView ()
 Destructor.

void resetState ()
 Resets all variables storing the state of the view.

void reset ()
 Resets the scrollview (by reseting the state and deselecting all objects).

void updateBackground ()
 Updates the background.

void setDragMultiple (bool dm=TRUE)
 Sets the state to dragging multiple objects.

bool getDragMultiple ()
 Returns TRUE if user drags several objects at once otherwise FALSE.

SelectiongetSelection ()
 Returns current selection.

double getScale ()
 Returns the current scale.

DRect getSelectionRect ()
 Returns the current selection rectangle.

void setSelectionRect (DRect r)
 Sets the current seleciton rectangle.

void drawTransition (GTransition *, bool clear=FALSE)
 Draw a transition. More...

void drawInitialTransition (GITransition *, bool clear=FALSE)
 Draw initial transition. More...

QRect tooltipRect (const QPoint &p, QString &info)
 Returns the tooltip rectangle of the point p.

void showContext (QPoint p)
 Shows the context menu for point point.

GObjectgetContextObject (int &type)
 Returns the context object (when right clicked on an object). More...

void resetContext ()
 Resets the context (used for context menu).


Private Methods

void contentsMousePressEvent (QMouseEvent *)
 Invoked when user presses a mouse button.

void contentsMouseMoveEvent (QMouseEvent *)
 Invoked when user moves the mouse.

void contentsMouseReleaseEvent (QMouseEvent *)
 Invoked when user releases a mouse button.

void contentsMouseDoubleClickEvent (QMouseEvent *)
 Invoked when users double clicks with the mouse.

void viewportPaintEvent (QPaintEvent *)
 Invoked when viewport needs to be repainted.


Private Attributes

QPoint lastLClicked
 Position where the left mouse button was clicked most recently.

bool left_down
 TRUE if the left mouse button is down.

bool drag
 If TRUE mouse dragging is initiated.

double dragStartX
 X coordinate of drag start position.

double dragStartY
 Y coordinate of drag start position.

double lastMovePosX
 X coordinate of the last mouse position (with snap to grid).

double lastMovePosY
 Y coordinate of the last mouse position (with snap to grid).

double lastMousePosX
 X coordinate of the last mouse position (without snap to grid).

double lastMousePosY
 Y coordinate of the last mouse position (without snap to grid).

double lastMovePosCont1X
 X coordinate of the last position of the first control point of a transition.

double lastMovePosCont1Y
 Y coordinate of the last position of the first control point of a transition.

double lastMovePosCont2X
 X coordinate of the last position of the second control point of a transition.

double lastMovePosCont2Y
 Y coordinate of the last position of the second control point of a transition.

GStatelastStateClicked
 Pointer to the state that was clicked most recently (with the left mouse button).

GObjectlastObjectRClicked
 Pointer to the object that was clicked most recently (with the right mouse button).

GTransitionlastTransitionDragged
 Pointer to the transition that was dragged most recently.

GTransitionlastTransitionClicked
 Pointer to the transition that was clicked most recently.

GTransitiondragTransition
 Temporary transition (when dragging).

GITransitiondragITransition
 Temporary initial transition (when dragging).

GState savedState
 Saved Objects for undo.

GITransition savedITrans
 Saved initial transition.

int lastTransitionControl
 Control of the transition that was clicked most recently.

bool firstTransitionDraw
 If TRUE, this is the first step when dragging a transition.

bool drawControlLines
 If TRUE, the (dotted) control lines of a transition are drawn (when dragging).

bool dragRect
 If TRUE, a rectangle is being dragged.

bool dragMultiple
 If TRUE, a multiple selection has been made.

bool onSelection
 If TRUE, the user has clicked on the selection.

DRect selectionRect
 Selection rectangle.

MainWindowmain
 Main window.

Zoomzoom
 Zoom object.

Selectionselection
 Selection.

Drawdraw
 Draw object.

Gridgrid
 Grid object.

ToolTipSVtooltip
 Tooltip window.


Detailed Description

Stores all the information concerning the view and is responsible for the user interaction.


Member Function Documentation

void ScrollView::drawInitialTransition GITransition * t,
bool clear = FALSE
 

Draw initial transition.

Parameters:
t   transition to draw.
clear   if TRUE it is the first transition in a sequence (draging) otherwise it is not.

void ScrollView::drawTransition GTransition * t,
bool clear = FALSE
 

Draw a transition.

Parameters:
t   transition to draw.
clear   if TRUE it is the first transition in a sequence (draging) otherwise it is not.

GObject * ScrollView::getContextObject int & type
 

Returns the context object (when right clicked on an object).

Parameters:
type   Type of the object returned (see ObjectType)
Returns:
The object

void ScrollView::updateCanvasSize [slot]
 

Updates canvas size.

Updates the size of the scroll view according to the canvas size stored in the machine

void ScrollView::zoomIn QPoint p = QPoint(-1,-1) [slot]
 

Zoom in the view at point p.

If p = (-1,-1) the middle of the view is taken.


The documentation for this class was generated from the following files:
Generated at Fri Apr 11 22:37:17 2003 for Qfsm by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001