/***************************************************************************
copyright : (C) 1999 by Edwin Glaser
email : edwin@pannenleiter.de
version : $Id: dblistbox.h,v 1.1.1.1 2000/02/07 21:42:00 ege Exp $
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef DBLISTBOX_H
#define DBLISTBOX_H
#include <qwidget.h>
#include <qlistbox.h>
#include "dbdatasource.h"
#include "dbpainter.h"
/**
* A data-aware listbox
*
*@author Edwin Glaser
*/
class DBListBox : public QListBox, public DBPainter
{
Q_OBJECT
protected:
DBDataSource *data;
int column;
bool userEnabled;
bool dbSlot;
DBValueAdaptor *adaptor;
public:
DBListBox(DBDataSource *d, int col, QWidget *parent=0, const char *name=0);
~DBListBox();
virtual void paint (QPainter *p, int width, int height, int align = 0, const char *format = 0);
void setAdaptor(DBValueAdaptor *a);
DBDataSource *getDataSource() { return data; };
int getColumn() { return column; };
protected:
// virtual void keyPressEvent ( QKeyEvent * e );
protected slots:
void myTextChanged1(const char *newText);
void myTextChanged2(const QString &newText);
virtual void adaptorChanged(int);
virtual void checkEnabled();
virtual void stateChanged();
virtual void dbTextChanged();
virtual void dbTextChanged(int column);
public slots:
virtual void setEnabled ( bool );
};
class DBListBoxFactory : public DBWidgetFactory
{
protected:
static DBListBoxFactory *instance;
DBListBoxFactory() : adaptor(0) {};
DBValueAdaptor *adaptor;
public:
static DBWidgetFactory *getFactory();
static DBWidgetFactory *makeFactory(DBValueAdaptor *a);
virtual QWidget *makeEditor(DBDataSource *d, int col, QWidget *parent);
virtual DBPainter *makePainter (QWidget *editor);
};
#endif
Documentation generated by eg@wonko on Sam Feb 19 00:09:53 MET 2000