00001 /**************************************************************************** 00002 00003 File: supertable.h 00004 Created: by Aidan Lane, December 16, 2003 00005 Updated: by Aidan Lane, February 19, 2004 00006 00007 This file is part of Glitch 00008 Copyright (C) 2003-2004 Monash University, Clayton Campus, Australia 00009 Created by Aidan Lane, under the supervision of Jon McCormack. 00010 00011 This program was developed to aid the students studying the CSE3313 00012 Computer Graphics course at Monash University. 00013 00014 This software may contain portions that are copyright (C) 1993, 00015 Silicon Graphics, Inc. All Rights Reserved. 00016 00017 Glitch is free software; you can redistribute it and/or modify 00018 it under the terms of the GNU General Public License as published by 00019 the Free Software Foundation, version 2. 00020 00021 Glitch is distributed in the hope that it will be useful, 00022 but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00024 GNU General Public License for more details. 00025 00026 You should have received a copy of the GNU General Public License 00027 along with this program; if not, write to the Free Software 00028 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00029 00030 *****************************************************************************/ 00031 00032 #ifndef __SUPERTABLE_H__ 00033 #define __SUPERTABLE_H__ 00034 00035 00036 #include <qtable.h> 00037 #include <qmap.h> 00038 00054 class SuperTable : public QTable 00055 { 00056 public: 00057 SuperTable( QWidget* parent=NULL, const char* name=NULL ); 00058 SuperTable( int numRows, int numCols, 00059 QWidget* parent=NULL, const char* name=NULL ); 00060 00061 void keyPressEvent( QKeyEvent* event ); 00062 00063 void setRowBackground( uint row, bool filled, QColor c = Qt::white ); 00064 void setRowDisabledLook( uint row, bool disabledLook ); 00065 00066 virtual void paintCell( QPainter* p, int row, int col, const QRect& cr, 00067 bool selected, const QColorGroup& cg ); 00068 00069 public slots: 00070 virtual void setNumRows( int rows ); 00071 virtual void removeRow( int row ); 00072 virtual void removeRows( const QMemArray<int>& rows ); 00073 00074 private: 00075 QMap<int, QColor> rowBkgrndColourMap; // alternative background colours 00076 QMap<int, bool> rowDisabledLookMap; 00077 }; 00078 00079 00080 #endif // __SUPERTABLE_H__
1.3.2