3 * Copyright 1995-2002 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
12 #pragma implementation
17 #include "lyxrc.h" // lyxrc.show_banner
18 #include "version.h" // lyx_version
20 #include "support/filetools.h" // LibFileSearch
21 #include "support/lstrings.h"
22 #include "support/LAssert.h"
27 #include "QWorkArea.h"
29 #include <qapplication.h>
32 #include <qmainwindow.h>
40 QWorkArea::QWorkArea(int, int, int, int)
41 : WorkArea(), QWidget(qApp->mainWidget()), painter_(*this)
43 // Add a splash screen to the centre of the work area
44 string const splash_file = (lyxrc.show_banner) ?
45 LibFileSearch("images", "banner", "xpm") : string();
47 if (!splash_file.empty()) {
51 scrollbar_ = new QScrollBar(QScrollBar::Vertical, this);
52 content_ = new QContentPane(this);
54 (static_cast<QMainWindow*>(qApp->mainWidget()))->setCentralWidget(this);
58 content_->setBackgroundColor(lcolor.getX11Name(LColor::background).c_str());
60 QHBoxLayout * vl = new QHBoxLayout(this);
61 vl->addWidget(content_, 5);
62 vl->addWidget(scrollbar_, 0);
68 QWorkArea::~QWorkArea()
73 void QWorkArea::setScrollbarParams(int h, int pos, int line_h)
75 // do what cursor movement does (some grey)
78 int max = h - height();
81 scrollbar_->setRange(0, max);
82 scrollbar_->setValue(pos);
83 scrollbar_->setLineStep(line_h);
84 scrollbar_->setPageStep(height());
88 void QWorkArea::haveSelection(bool ) const
94 string const QWorkArea::getClipboard() const
101 void QWorkArea::putClipboard(string const &) const