23#include <formmanager.h>
24#include <kexidb/utils.h>
25#include <kexidb/connection.h>
28#include "kexireportview.h"
29#include "reportwidgets.h"
31Label::Label(
const TQString &text, TQWidget *parent,
const char *name)
32: TQLabel(text, parent, name)
34 setPaletteBackgroundColor(white);
39ReportLine::ReportLine(TQWidget *parent,
const char *name)
40: TQWidget(parent, name)
42 m_lineStyle = (ReportLineStyle)TQt::SolidLine;
44 m_capStyle = (CapStyle)TQt::FlatCap;
45 m_color = paletteForegroundColor();
46 setPaletteBackgroundColor(white);
49ReportLine::ReportLineStyle
50ReportLine::lineStyle()
const
56ReportLine::setLineStyle(ReportLineStyle style)
63ReportLine::lineWidth()
const
69ReportLine::setLineWidth(
int width)
76ReportLine::color()
const
82ReportLine::setColor(
const TQColor &color)
89ReportLine::capStyle()
const
95ReportLine::setCapStyle(CapStyle capStyle)
97 m_capStyle = capStyle;
102ReportLine::paintEvent (TQPaintEvent *ev)
106 p.eraseRect(0, 0, width(), height());
107 TQPen pen(m_color, m_lineWidth, (TQt::PenStyle)m_lineStyle);
108 pen.setCapStyle((TQt::PenCapStyle)m_capStyle);
110 p.drawLine(0, 0, width() -1, height() - 1);
116PicLabel::PicLabel(
const TQPixmap &pix, TQWidget *parent,
const char *name)
117 : TQLabel(parent, name)
120 setScaledContents(
false);
121 setPaletteBackgroundColor(white);
125PicLabel::setProperty(
const char *name,
const TQVariant &value)
127 if(TQString(name) ==
"pixmap")
128 resize(value.toPixmap().height(), value.toPixmap().width());
129 return TQLabel::setProperty(name, value);
134KexiSubReport::KexiSubReport(TQWidget *parent,
const char *name)
135: TQScrollView(parent, name), m_form(0), m_widget(0)
137 setFrameStyle(TQFrame::Plain | TQFrame::Box);
138 viewport()->setPaletteBackgroundColor(white);
142KexiSubReport::setReportName(
const TQString &name)
148 TQWidget *w = parentWidget();
149 while(w && !w->isA(
"KexiReportView"))
150 w = w->parentWidget();
151 KexiReportView *view = (KexiReportView*)w;
162 m_widget =
new TQWidget(viewport(),
"kexisubreport_widget");
166 m_form->createToplevel(m_widget);
170 tristate res = view->connection()->
loadDataBlock(
id, data , TQString());
174 KFormDesigner::FormIO::loadFormFromString(m_form, m_widget, data);
175 m_form->setDesignMode(
false);
180#include "reportwidgets.moc"
tristate loadDataBlock(int objectID, TQString &dataString, const TQString &dataID)
static KFormDesigner::WidgetLibrary * library()
KexiDialogBase * parentDialog() const
KEXI_DB_EXPORT int idForObjectName(Connection &conn, const TQString &objName, int objType)