Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Examples  

qdbtintcell.h

00001 #ifndef _QDBTINTCELL_H
00002 #define _QDBTINTCELL_H
00003 
00004 #include <qstring.h>
00005 #include <qrect.h>
00006 
00007 #include <qdbt/qdbtglobal.h>
00008 #include "qdbtbasecell.h"
00009 
00010 class QPainter;
00011 class QdbtBaseTabular;
00012 
00013 class QDBT_EXPORT QdbtIntCell : public QdbtBaseCell
00014 {
00015 public:
00016 
00017   QdbtIntCell();
00018   QdbtIntCell( const QdbtIntCell & );
00019   QdbtIntCell( int value, int align = Qt::AlignLeft, bool edit = FALSE );
00020   virtual ~QdbtIntCell();
00021   
00022   void setValue( int value )
00023     {
00024       _value = value;
00025     }
00026   int  value() const
00027     {
00028       return _value;
00029     }
00030   
00031   virtual QString text() const
00032     {
00033       return QString::number( _value );
00034     }
00035   
00036   void setAlignment( int alignment )
00037     {
00038       align = alignment;
00039     }
00040   int alignment() const
00041     {
00042       return align;
00043     }
00044   
00045   virtual int widthHint( const QFontMetrics &fm ) const;
00046   virtual int heightHint( const QFontMetrics &fm ) const;
00047   
00048 protected:
00049   virtual QWidget *editor( QdbtBaseTabular * ) const;
00050   virtual void paint( QPainter *p, QdbtBaseTabular *t, const QRect & r,
00051                       bool selected, bool editing = FALSE );
00052   virtual QRect getTextArea() const;
00053   virtual QRect getEditArea( int width ) const;
00054   virtual QdbtBaseCell *clone( QdbtBaseTabular * ) const;
00055 
00056   virtual bool beginEdit( QdbtBaseTabular *, int row, int col,
00057                           const QRect cellGeometry ) const;
00058   virtual bool acceptEdit( QdbtBaseTabular *, int row, int col );
00059   virtual bool cancelEdit( QdbtBaseTabular *, int row, int col );
00060   
00061 private:
00062   int     _value;
00063 
00064   QRect   tr;
00065   int     align;
00066 };
00067 
00068 #endif

Generated on Mon Apr 22 12:21:53 2002 for QdbtTabular by doxygen1.2.15-20020421