kalarm/lib

combobox.h
1 /*
2  * combobox.h - combo box with read-only option
3  * Program: kalarm
4  * Copyright © 2002,2005,2006 by David Jarvie <software@astrojar.org.uk>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef COMBOBOX_H
22 #define COMBOBOX_H
23 
24 #include <tqcombobox.h>
25 
26 
37 class ComboBox : public TQComboBox
38 {
39  TQ_OBJECT
40 
41  public:
46  explicit ComboBox(TQWidget* parent = 0, const char* name = 0);
52  explicit ComboBox(bool rw, TQWidget* parent = 0, const char* name = 0);
54  bool isReadOnly() const { return mReadOnly; }
59  virtual void setReadOnly(bool readOnly);
60  protected:
61  virtual void mousePressEvent(TQMouseEvent*);
62  virtual void mouseReleaseEvent(TQMouseEvent*);
63  virtual void mouseMoveEvent(TQMouseEvent*);
64  virtual void keyPressEvent(TQKeyEvent*);
65  virtual void keyReleaseEvent(TQKeyEvent*);
66  private:
67  bool mReadOnly; // value cannot be changed
68 };
69 
70 #endif // COMBOBOX_H
A TQComboBox with read-only option.
Definition: combobox.h:38
bool isReadOnly() const
Returns true if the widget is read only.
Definition: combobox.h:54
virtual void setReadOnly(bool readOnly)
Sets whether the combo box is read-only for the user.
Definition: combobox.cpp:35
ComboBox(TQWidget *parent=0, const char *name=0)
Constructor.
Definition: combobox.cpp:25