Updated SWH plugins and added missing hermes_filter plugin
[lmms/mlankhorst.git] / include / text_float.h
blobb631ca8785985aebcb04507cadfca96e5e72d033
1 /*
2 * text_float.h - class textFloat, a floating text-label
4 * Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
26 #ifndef _TEXT_FLOAT
27 #define _TEXT_FLOAT
29 #include <QtGui/QWidget>
30 #include <QtGui/QPixmap>
32 #include "export.h"
35 class EXPORT textFloat : public QWidget
37 public:
38 textFloat();
39 virtual ~textFloat()
43 void setTitle( const QString & _title );
44 void setText( const QString & _text );
45 void setPixmap( const QPixmap & _pixmap );
47 void setVisibilityTimeOut( int _msecs );
50 static textFloat * displayMessage( const QString & _msg,
51 int _timeout = 2000,
52 QWidget * _parent = NULL,
53 int _add_y_margin = 0 );
54 static textFloat * displayMessage( const QString & _title,
55 const QString & _msg,
56 const QPixmap & _pixmap =
57 QPixmap(),
58 int _timeout = 2000,
59 QWidget * _parent = NULL );
61 void moveGlobal( QWidget * _w, const QPoint & _offset )
63 move( _w->mapToGlobal( QPoint( 0, 0 ) )+_offset );
67 protected:
68 virtual void paintEvent( QPaintEvent * _me );
69 virtual void mousePressEvent( QMouseEvent * _me );
72 private:
73 void updateSize();
75 QString m_title;
76 QString m_text;
77 QPixmap m_pixmap;
79 } ;
82 #endif