summaryrefslogtreecommitdiffstats
path: root/quanta/components/tableeditor/tableitem.h
blob: 12e2b4b0383630acb9d478badde25d18dc93966e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/***************************************************************************
                          tableitem.h  -  description
                             -------------------
    begin                : Mon 15 Mar 2004
    copyright            : (C) 2004 by Michal Rudolf <mrudolf@tdewebdev.org>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 TABLEITEM_H
#define TABLEITEM_H

#include <tqtable.h>
#include <tdeversion.h>

class TableItem : public TQTableItem
{
private:
  TQt::AlignmentFlags m_halign;
  TQt::AlignmentFlags m_valign;
  bool m_header;
public:
  // Standard constructors copied from TQTableItem
  TableItem(TQTable* table, EditType et);
  TableItem(TQTable* table, EditType et, const TQString& text);
  TableItem (TQTable* table, EditType et, const TQString& text, const TQPixmap& p);
  // Use TQTextEdit instead of standard TQLineEdit
  virtual TQWidget* createEditor() const;
  // Get text from TQTextEdit
  virtual void setContentFromEditor(TQWidget *w);
  // Paint cell - handle tqalignment (horizontal and vertical) and bold for header
  virtual void paint(TQPainter* p, const TQColorGroup& cg, const TQRect& cr, bool selected);
  // Return A bit larger tqsizeHint because TQTextEdit has some margin around
  virtual TQSize tqsizeHint() const;
  // Get and set vertical aligment
  TQt::AlignmentFlags vAlignment()	{return m_valign;}
  void setVAlignment(TQt::AlignmentFlags flags)	{m_valign = flags;}
  // Get and set horizontal aligment
  TQt::AlignmentFlags tqalignment()	{return m_halign;}
  void tqsetAlignment(TQt::AlignmentFlags flags)	{m_halign = flags;}
  // Get and set header status (use true for TH, false for TD)
  bool header()	{return m_header;}
  void setHeader(bool h)  {m_header = h;}
};



#endif