add header information for printing
This commit is contained in:
parent
6c0fdb6ab8
commit
e9e6c9b2e3
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
changes since 0.11.0
|
changes since 0.11.0
|
||||||
===================================
|
===================================
|
||||||
|
NEW 2012-09-24 add header information for printing.
|
||||||
NEW 2012-05-31 added Noakes-Kalvius function (see A. Yaouanc and P. Dalmas de Reotiers,
|
NEW 2012-05-31 added Noakes-Kalvius function (see A. Yaouanc and P. Dalmas de Reotiers,
|
||||||
"Muon Spin Rotation, Relaxation, and Resonance" Oxford, Section 6.4.1.3).
|
"Muon Spin Rotation, Relaxation, and Resonance" Oxford, Section 6.4.1.3).
|
||||||
NEW 2012-05-25 musredit/musrgui: added a dump muSR data header file information.
|
NEW 2012-05-25 musredit/musrgui: added a dump muSR data header file information.
|
||||||
|
@ -970,6 +970,11 @@ void PTextEdit::filePrint()
|
|||||||
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
|
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
|
||||||
|
|
||||||
// print msr-file
|
// print msr-file
|
||||||
|
QString fln = *fFilenames.find(currentEditor());
|
||||||
|
QString header1(fln);
|
||||||
|
QFileInfo flnInfo(fln);
|
||||||
|
QString header2 = QString("last modified: ") + flnInfo.lastModified().toString("dd.MM.yyyy - hh:mm:ss");
|
||||||
|
QString line("-------------------------------------");
|
||||||
QStringList strList = currentEditor()->toPlainText().split("\n");
|
QStringList strList = currentEditor()->toPlainText().split("\n");
|
||||||
for (QStringList::Iterator it = strList.begin(); it != strList.end(); ++it) {
|
for (QStringList::Iterator it = strList.begin(); it != strList.end(); ++it) {
|
||||||
// new page needed?
|
// new page needed?
|
||||||
@ -978,6 +983,24 @@ void PTextEdit::filePrint()
|
|||||||
yPos = 0; // back to top of page
|
yPos = 0; // back to top of page
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (yPos == 0) { // print header
|
||||||
|
font.setPointSize( 8 );
|
||||||
|
p.setFont( font );
|
||||||
|
|
||||||
|
p.drawText(margin, margin+yPos, printer.width(), fm.lineSpacing(),
|
||||||
|
Qt::TextExpandTabs | Qt::TextDontClip, header1);
|
||||||
|
yPos += fm.lineSpacing();
|
||||||
|
p.drawText(margin, margin+yPos, printer.width(), fm.lineSpacing(),
|
||||||
|
Qt::TextExpandTabs | Qt::TextDontClip, header2);
|
||||||
|
yPos += fm.lineSpacing();
|
||||||
|
p.drawText(margin, margin+yPos, printer.width(), fm.lineSpacing(),
|
||||||
|
Qt::TextExpandTabs | Qt::TextDontClip, line);
|
||||||
|
yPos += 1.5*fm.lineSpacing();
|
||||||
|
|
||||||
|
font.setPointSize( 10 );
|
||||||
|
p.setFont( font );
|
||||||
|
}
|
||||||
|
|
||||||
// print data
|
// print data
|
||||||
p.drawText(margin, margin+yPos, printer.width(), fm.lineSpacing(),
|
p.drawText(margin, margin+yPos, printer.width(), fm.lineSpacing(),
|
||||||
Qt::TextExpandTabs | Qt::TextDontClip, *it);
|
Qt::TextExpandTabs | Qt::TextDontClip, *it);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user