]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QWorkArea.C
remove show_banner + keyboard_shortcuts as discussed
[lyx.git] / src / frontends / qt2 / QWorkArea.C
1 /**
2  * \file QWorkArea.C
3  * Copyright 1995-2002 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #include <config.h>
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include "debug.h"
16 #include "LyXView.h"
17 #include "lyxrc.h" // lyxrc.show_banner
18 #include "version.h" // lyx_version
19
20 #include "support/filetools.h" // LibFileSearch
21 #include "support/lstrings.h"
22 #include "support/LAssert.h"
23
24 #include <cmath>
25 #include <cctype>
26
27 #include "QWorkArea.h"
28  
29 #include <qapplication.h>
30 #include <qevent.h> 
31 #include <qpainter.h>
32 #include <qmainwindow.h>
33 #include <qlayout.h>
34  
35 using std::endl;
36 using std::abs;
37 using std::hex;
38
39  
40 QWorkArea::QWorkArea(int, int, int, int)
41         : WorkArea(), QWidget(qApp->mainWidget()), painter_(*this)
42 {
43         scrollbar_ = new QScrollBar(QScrollBar::Vertical, this);
44         content_ = new QContentPane(this);
45
46         (static_cast<QMainWindow*>(qApp->mainWidget()))->setCentralWidget(this);
47  
48         content_->show();
49
50         content_->setBackgroundColor(lcolor.getX11Name(LColor::background).c_str());
51
52         QHBoxLayout * vl = new QHBoxLayout(this);
53         vl->addWidget(content_, 5);
54         vl->addWidget(scrollbar_, 0);
55  
56         show();
57 }
58
59
60 QWorkArea::~QWorkArea()
61 {
62 }
63
64
65 void QWorkArea::setScrollbarParams(int h, int pos, int line_h)
66 {
67         // do what cursor movement does (some grey)
68         h += height() / 4;
69  
70         int max = h - height();
71         if (max < 0)
72                 max = 0;
73         scrollbar_->setRange(0, max);
74         scrollbar_->setValue(pos);
75         scrollbar_->setLineStep(line_h);
76         scrollbar_->setPageStep(height());
77 }
78
79
80 void QWorkArea::haveSelection(bool ) const
81 {
82         // FIXME 
83 }
84
85  
86 string const QWorkArea::getClipboard() const 
87 {
88         // FIXME 
89         return "nothing"; 
90 }
91
92         
93 void QWorkArea::putClipboard(string const &) const
94 {
95         // FIXME
96 }