Logo Search packages:      
Sourcecode: kbfx version File versions  Download package

kbfx_vista_button.h

/***************************************************************************
 *   Copyright (C) 2005 by Siraj Razick                                    *
 *   sirajr@gmail.com                                                      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef KBFX_VISTA_BUTTON_H
#define KBFX_VISTA_BUTTON_H
#include <qwidget.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qimage.h>
#include <qlabel.h>
#include <qpainter.h>
#include <qcanvas.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qmovie.h>
/**
@author Siraj Razick
*/
00036 class kbfx_vista_button : public QLabel 
{
  Q_OBJECT
public:
  kbfx_vista_button(QWidget *parent = 0, const char *name = 0);

  ~kbfx_vista_button();
  
 int kbfx_vista_button_setPixmap(QPixmap skin);
 int kbfx_vista_button_setRotate(/* STILL to Think about this*/);
 int kbfx_vista_button_loadSkins(QString , QString , QString);
 void kbfx_vista_button_setFx(bool choice);
 virtual void paintEvent(QPaintEvent *);
 virtual void timerEvent(QTimerEvent * e); 
 void startTimer();
 void kbfx_vista_button_setMovie(QMovie * mov); 
  public slots:
    
//  void onMouseClickSlot ();
   void onMouseOverSlot(); 
   void onMouseLeaveSlot();
   void onMouseClickSlot();
   void updateMovie();
   void startMenuDone(int callId, const QCString& replyType, const QByteArray &replyData);
//  void onMouseSelectionOverSlot();
       
//  void winkeyPressSlot();
//  void winkeyRelaseSlot();
  
  void skinLoadCompleteSlot(void);
  
  signals:
  void skinLoadComplete(void);
  void mouseOver(void);
  void mouseOut(void);
  void sizechange();
  
  private:

      typedef QMap<int,QPixmap> AnimBuffer;
  
  QCanvas * canvas;
  QCanvasView * view;
  
      bool fxon;

  QPixmap   over_skin;
  QPixmap   pressed_skin;
  QPixmap   release_skin;
  QPixmap   normal_skin;
  QPixmap   current_skin; 

  QTimer * _anime_timer;
  bool _anime_on;
  QMovie * normal_anime;
  QMovie * pressed_anime;
  QMovie * hover_anime;
  QMovie * current_anime;

  AnimBuffer m_normalBuffer;
  AnimBuffer m_hoverBuffer;
  AnimBuffer m_pressedBuffer;

  QString normal_path,over_path,pressed_path;

};

#endif

Generated by  Doxygen 1.6.0   Back to index