2
* advwidget.h - AdvancedWidget template class
3
* Copyright (C) 2005 Michail Pishchagin
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
class GAdvancedWidget : public QObject
30
GAdvancedWidget(QWidget *parent, const char *name = 0);
33
static bool stickEnabled();
34
static void setStickEnabled(bool val);
37
static void setStickAt(int val);
39
static bool stickToWindows();
40
static void setStickToWindows(bool val);
42
void doFlash(bool on);
45
bool winEvent(MSG *msg);
49
void postSetCaption();
51
void windowActivationChange(bool oldstate);
59
template <class BaseClass>
60
class AdvancedWidget : public BaseClass
63
GAdvancedWidget *gAdvWidget;
66
AdvancedWidget( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 )
67
: BaseClass( parent, name, f )
69
gAdvWidget = new GAdvancedWidget( this );
72
static bool stickEnabled() { return GAdvancedWidget::stickEnabled(); }
73
static void setStickEnabled( bool val ) { GAdvancedWidget::setStickEnabled( val ); }
75
static int stickAt() { return GAdvancedWidget::stickAt(); }
76
static void setStickAt( int val ) { GAdvancedWidget::setStickAt( val ); }
78
static bool stickToWindows() { return GAdvancedWidget::stickToWindows(); }
79
static void setStickToWindows( bool val ) { GAdvancedWidget::setStickToWindows( val ); }
81
void doFlash( bool on )
83
gAdvWidget->doFlash( on );
87
bool winEvent( MSG *msg )
89
return gAdvWidget->winEvent( msg );
93
void setCaption( const QString &c )
95
gAdvWidget->preSetCaption();
96
BaseClass::setCaption( c );
97
gAdvWidget->postSetCaption();
101
void windowActivationChange( bool oldstate )
103
gAdvWidget->windowActivationChange( oldstate );
104
BaseClass::windowActivationChange( oldstate );