KVIrc  4.9.2
DeveloperAPIs
KviScriptButton.h
Go to the documentation of this file.
1 #ifndef _KVI_SCRIPTBUTTON_H_
2 #define _KVI_SCRIPTBUTTON_H_
3 //=============================================================================
4 //
5 // File : KviScriptButton.h
6 // Creation date : Wed Nov 14 15:43:39 2001 GMT by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "kvi_settings.h"
28 #include "KviCString.h"
29 
30 #include <QToolButton>
31 #include <QToolBar>
32 
33 class KviKvsScript;
34 class KviWindow;
35 
36 class KVIRC_API KviScriptUserButton : public QToolButton
37 {
38  Q_OBJECT
39 public:
40  KviScriptUserButton(QWidget * par, const char * name);
42 
43 protected:
45 
46 public:
47  void setButtonCode(KviKvsScript * pScript);
48  virtual void setButtonPixmap(const QPixmap & pix) { setIcon(pix); };
49  void setButtonText(const QString & text) { setText(text); };
50  virtual KviWindow * window();
51 protected slots:
52  void btnClicked();
53 };
54 
56 {
57  Q_OBJECT
58 public:
59  KviWindowScriptButton(QWidget * p, KviWindow * wnd, const char * name);
61 
62 protected:
64 
65 public:
66  virtual void setButtonPixmap(const QPixmap & pix)
67  {
68  setIcon(QIcon(pix));
69  setIconSize(QSize(22, 22));
70  };
71  virtual KviWindow * window() { return m_pWnd; };
72 };
73 
74 #endif //_KVI_SCRIPTBUTTON_H_
virtual void setButtonPixmap(const QPixmap &pix)
Definition: KviScriptButton.h:66
#define KVIRC_API
Definition: kvi_settings.h:128
The KVIrc Script class.
Definition: KviKvsScript.h:59
Definition: KviScriptButton.h:55
void setButtonText(const QString &text)
Definition: KviScriptButton.h:49
KviKvsScript * m_pScript
Definition: KviScriptButton.h:44
Definition: KviScriptButton.h:36
virtual void setButtonPixmap(const QPixmap &pix)
Definition: KviScriptButton.h:48
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
KviWindow * m_pWnd
Definition: KviScriptButton.h:63
QString name()
Definition: KviRuntimeInfo.cpp:655
This file contains compile time settings.
virtual KviWindow * window()
Definition: KviScriptButton.h:71
#define p
Definition: detector.cpp:80