20 #include "kphpgl2page.h"
22 #include <tqcheckbox.h>
23 #include <tqgroupbox.h>
25 #include <tqwhatsthis.h>
26 #include <tdelocale.h>
27 #include <knuminput.h>
29 KPHpgl2Page::KPHpgl2Page(TQWidget *parent,
const char *name)
33 TQString whatsThisBlackplotHpgl2Page = i18n(
" <qt> "
34 " <b>Print in Black Only (Blackplot)</b> "
35 " <p>The \'blackplot\' option specifies that all pens should plot in black-only:"
36 " The default is to use the colors defined in the plot file, or the standard "
37 " pen colors defined in the HP-GL/2 reference manual from Hewlett Packard. </p> "
40 " <p><em><b>Additional hint for power users:</b> This TDEPrint GUI element matches "
41 " with the CUPS commandline job option parameter:</em> "
48 TQString whatsThisFitplotHpgl2Page = i18n(
" <qt> "
49 " <b>Scale Print Image to Page Size</b> "
50 " <p>The 'fitplot' option specifies that the HP-GL image should be scaled to fill "
51 " exactly the page with the (elsewhere selected) media size. </p> "
52 " <p>The default is 'fitplot is disabled'. The default will therefore use the absolute "
53 " distances specified in the plot file. (You should be aware that HP-GL files are very "
54 " often CAD drawings intended for large format plotters. On standard office printers "
55 " they will therefore lead to the drawing printout being spread across multiple pages.) </p> "
56 " <p><b>Note:</b>This feature depends upon an accurate plot size (PS) command in the "
57 " HP-GL/2 file. If no plot size is given in the file the filter converting the HP-GL "
58 " to PostScript assumes the plot is ANSI E size. </p> "
61 " <p><em><b>Additional hint for power users:</b> This TDEPrint GUI element matches with the CUPS commandline job option parameter:</em> "
68 TQString whatsThisPenwidthHpgl2Page = i18n(
" <qt> "
69 " <b>Set Pen Width for HP-GL (if not defined in file)</b>. "
70 " <p>The pen width value can be set here in case the original HP-GL file does not have it "
71 " set. The pen width specifies the value in micrometers. The default value of 1000 produces "
72 " lines that are 1000 micrometers == 1 millimeter in width. Specifying a pen width of 0 "
73 " produces lines that are exactly 1 pixel wide. </p> "
74 " <p><b>Note:</b> The penwidth option set here is ignored if the pen widths are set inside "
75 " the plot file itself..</p> "
78 " <p><em><b>Additional hint for power users:</b> This TDEPrint GUI element matches with the CUPS commandline job option parameter:</em> "
80 " -o penwidth=... # example: \"2000\" or \"500\" "
85 TQString whatsThisAllOptionsHpgl2Page = i18n(
" <qt> "
86 " <b>HP-GL Print Options</b> "
87 " <p>All options on this page are only applicable if you use TDEPrint to send HP-GL and "
88 " HP-GL/2 files to one of your printers. </p> "
89 " <p>HP-GL and HP-GL/2 are page description languages developed by Hewlett-Packard to drive "
90 " Pen Plotting devices. </p> "
91 " <p>TDEPrint can (with the help of CUPS) convert the HP-GL file format and print it "
92 " on any installed printer. </p> "
93 " <p><b>Note 1:</b> To print HP-GL files, start 'kprinter' and simply load the file into "
94 " the running kprinter.</p>"
95 " <p><b>Note 2:</b> The 'fitplot' parameter provided on this dialog does also work for "
96 " printing PDF files (if your CUPS version is more recent than 1.1.22).</p> "
99 " <p><em><b>Additional hint for power users:</b> These TDEPrint GUI elements match with CUPS commandline job option parameters:</em> "
101 " -o blackplot=... # examples: \"true\" or \"false\" "
103 " -o fitplot=... # examples: \"true\" or \"false\" "
105 " -o penwidth=... # examples: \"true\" or \"false\" "
113 TQGroupBox *box =
new TQGroupBox(0, TQt::Vertical, i18n(
"HP-GL/2 Options"),
this);
115 m_blackplot =
new TQCheckBox(i18n(
"&Use only black pen"), box);
116 TQWhatsThis::add(m_blackplot, whatsThisBlackplotHpgl2Page);
118 m_fitplot =
new TQCheckBox(i18n(
"&Fit plot to page"), box);
119 TQWhatsThis::add(m_fitplot, whatsThisFitplotHpgl2Page);
121 m_penwidth =
new KIntNumInput(1000, box);
122 m_penwidth->setLabel(i18n(
"&Pen width:"), TQt::AlignLeft|TQt::AlignVCenter);
123 m_penwidth->setSuffix(
" [um]");
124 m_penwidth->setRange(0, 10000, 100,
true);
125 TQWhatsThis::add(m_penwidth, whatsThisPenwidthHpgl2Page);
127 TQVBoxLayout *l0 =
new TQVBoxLayout(
this, 0, 10);
131 TQVBoxLayout *l1 =
new TQVBoxLayout(box->layout(), 10);
132 l1->addWidget(m_blackplot);
133 l1->addWidget(m_fitplot);
134 l1->addWidget(m_penwidth);
135 TQWhatsThis::add(
this, whatsThisAllOptionsHpgl2Page);
138 KPHpgl2Page::~KPHpgl2Page()
142 void KPHpgl2Page::setOptions(
const TQMap<TQString,TQString>& opts)
145 if (opts.contains(
"blackplot") && ((value=opts[
"blackplot"]).isEmpty() || value ==
"true"))
146 m_blackplot->setChecked(
true);
147 if (opts.contains(
"fitplot") && ((value=opts[
"fitplot"]).isEmpty() || value ==
"true"))
148 m_fitplot->setChecked(
true);
149 if (!(value=opts[
"penwidth"]).isEmpty())
150 m_penwidth->setValue(value.toInt());
153 void KPHpgl2Page::getOptions(TQMap<TQString,TQString>& opts,
bool incldef)
155 if (incldef || m_penwidth->value() != 1000)
156 opts[
"penwidth"] = TQString::number(m_penwidth->value());
157 if (m_blackplot->isChecked())
158 opts[
"blackplot"] =
"true";
160 opts[
"blackplot"] =
"false";
162 opts.remove(
"blackplot");
163 if (m_fitplot->isChecked())
164 opts[
"fitplot"] =
"true";
166 opts[
"fitplot"] =
"false";
168 opts.remove(
"fitplot");
This class is intended to be used as base class for customized print dialog page.