20#ifndef KPTDOUBLELISTVIEWBASE_H
21#define KPTDOUBLELISTVIEWBASE_H
25#include <tqptrvector.h>
26#include <tqsplitter.h>
28#include <tdelistview.h>
41class ListView : public TDEListView
44 ListView(TQWidget *parent)
48 virtual void paintToPrinter(TQPainter * p, int cx, int cy, int cw, int ch);
69 ListView *masterListView() const { return m_masterList; }
70 ListView *slaveListView() const { return m_slaveList; }
71 void setOpen(TQListViewItem *item, bool open);
73 void setNameHeader(TQString text);
74 void setTotalHeader(TQString text);
75 void setDescriptionHeader(TQString text);
76 void addSlaveColumn(TQString text);
77 virtual void print(KPrinter &printer);
79 virtual void calculate();
81 virtual void createSlaveItems();
82 void clearSlaveList();
83 void setFormat( int fieldwidth=0, char fmt= 'f', int prec=0);
84 void setMasterFormat( int fieldwidth=0, char fmt= 'f', int prec=0);
85 void setSlaveFormat( int fieldwidth=0, char fmt= 'f', int prec=0);
86 virtual TQSize sizeHint() const;
89 class SlaveListItem : public TDEListViewItem {
91 SlaveListItem(MasterListItem *master, TQListView *parent, TQListViewItem *after, bool highlight= false);
92 SlaveListItem(MasterListItem *master, TQListViewItem *parent, TQListViewItem *after, bool highlight= false);
94 void masterItemDeleted() { m_masterItem = 0; }
96 virtual void setColumn( int col, double value);
97 virtual void clearColumn( int col);
99 double value( int col) const { return m_valueMap[col]; }
100 void setLimit( int col, double limit);
101 void setHighlight( bool on) { m_highlight = on; }
103 virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align);
105 void setFormat( int fieldwidth=0, char fmt= 'f', int prec=0);
108 MasterListItem *m_masterItem;
112 TQMap<int, double> m_valueMap;
113 TQMap<int, double> m_limitMap;
120 class MasterListItem : public TDEListViewItem {
122 MasterListItem(TQListView *parent, bool highlight= false);
123 MasterListItem(TQListView *parent, TQString text, bool highlight= false);
124 MasterListItem(TQListViewItem *parent, bool highlight= false);
125 MasterListItem(TQListViewItem *parent, TQString text, bool highlight= false);
129 void createSlaveItems(TQListView *lv, TQListViewItem *after=0);
130 void slaveItemDeleted();
131 void setSlaveOpen( bool on);
132 SlaveListItem *slaveItem() const { return m_slaveItem; }
133 double value() const { return m_value; }
135 void setTotal( double tot);
137 void addToTotal( double v);
138 void setSlaveItem( int col, double value);
139 void setSlaveLimit( int col, double limit);
140 void setLimit( double limit) { m_limit = limit; }
141 void setHighlight( bool on) { m_highlight = on; }
142 void setSlaveHighlight( bool on);
143 void clearColumn( int col);
144 void calcSlaveItems();
145 virtual double calcSlaveItems( int col);
147 virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align);
149 void setFormat( int fieldwidth=0, char fmt= 'f', int prec=0);
152 SlaveListItem *m_slaveItem;
157 TQMap<int, double> m_valueMap;
165 virtual void paintContents(TQPainter *p);
168 void slotExpanded(TQListViewItem* item);
169 void slotCollapsed(TQListViewItem* item);
174 ListView *m_masterList;
175 ListView *m_slaveList;
The class DoubleListViewBase provides a double listview where the right listview (the slave) containe...
|