VR-Forces 4.0.4 Class Documentation
include/vrfGuiCoreQt/widgetAnimator.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2009 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: DtWidgetAnimator.h,v $ $Revision: 1.1.2.2 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #pragma once
00010 
00011 #include <vrvUtil/signalslib.h>
00012 #include <vrfGuiCoreQt/vrfGuiCoreQt.h>
00013 #include <QtCore/QTimeLine>
00014 #include <QtCore/QPoint>
00015 #include <QtGui/QWidget>
00016 #include <QtGui/QPaintEvent>
00017 
00018 namespace makVrf
00019 {
00020    enum AnimationType
00021    {
00022       Move,
00023       SlideOpenLToR,
00024       SlideOpenRToL,
00025       SlideCloseLToR,
00026       SlideCloseRToL,
00027       SlideClose
00028    };
00029 
00032 
00035    class RenderArea : public QWidget
00036    {
00037       Q_OBJECT
00038 
00039    public:
00040    
00041       RenderArea(QWidget* parent = 0);
00042    
00043       void setPixmap( QPixmap& px);
00044 
00045    protected:
00046 
00047       void paintEvent(QPaintEvent *event);
00048 
00049    private:
00050 
00051       QPixmap myPixmap;
00052    };
00053 
00057    class DT_DLL_VRFGUICOREQT DtWidgetAnimator : public QObject
00058    {
00059       Q_OBJECT
00060 
00061    public:
00062 
00064       DtWidgetAnimator(QObject* parent = 0);
00065 
00067       virtual ~DtWidgetAnimator();         
00068 
00071       void move(QWidget* w, int top, int left, int time = 800);
00072 
00074       void reset();
00075 
00078       void slide(QWidget* w, AnimationType type=SlideOpenRToL, int time = 200);
00079 
00080    protected:
00081 
00083       void setup();
00084 
00085    protected slots:
00086 
00088       void slot_timeLineFrameChanged(int);
00089 
00091       void slot_timeLineStateChanged(QTimeLine::State);
00092 
00094       void widgetDestroyed();
00095 
00096    protected:
00097 
00098       QTimeLine* myTimeLine;
00099       AnimationType myAnimationType;
00100       QWidget* myWidget;
00101       QPixmap myPixmap;
00102       RenderArea* myRendering;
00103       QPoint myOrigin;
00104       QPoint myDestination;
00105       QPoint myVector;
00106    };
00107 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)