summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-10-29 14:50:04 +0000
committerManolo Gouy <Manolo>2011-10-29 14:50:04 +0000
commitc9345e7d01b1b10f36432d7a6b3e1369a6f775d2 (patch)
tree2b90efe10d7c9f743ed6cb55a2013b79817fdc41 /src
parent1e88511efa6c12ed98d99f15ffc24ce7db37ff02 (diff)
Added more paper sizes for Fl_PostScript_Printer.
Fixed saving of the paper size preference for the "Print to File" printer. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9158 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_PostScript.cxx32
-rw-r--r--src/print_panel.cxx15
2 files changed, 41 insertions, 6 deletions
diff --git a/src/Fl_PostScript.cxx b/src/Fl_PostScript.cxx
index 3234cef48..d42dfbd7a 100644
--- a/src/Fl_PostScript.cxx
+++ b/src/Fl_PostScript.cxx
@@ -140,7 +140,7 @@ Fl_PostScript_File_Device::~Fl_PostScript_File_Device() {
#ifndef FL_DOXYGEN
#if ! (defined(__APPLE__) || defined(WIN32) )
- #include "print_panel.cxx"
+# include "print_panel.cxx"
#endif
// Prolog string
@@ -1538,7 +1538,35 @@ int Fl_PostScript_Printer::start_job(int pages, int *firstpage, int *lastpage) {
// get options
- format = print_page_size->value() ? Fl_Paged_Device::A4 : Fl_Paged_Device::LETTER;
+ switch (print_page_size->value()) {
+ case 0:
+ format = Fl_Paged_Device::LETTER;
+ break;
+ case 2:
+ format = Fl_Paged_Device::LEGAL;
+ break;
+ case 3:
+ format = Fl_Paged_Device::EXECUTIVE;
+ break;
+ case 4:
+ format = Fl_Paged_Device::A3;
+ break;
+ case 5:
+ format = Fl_Paged_Device::A5;
+ break;
+ case 6:
+ format = Fl_Paged_Device::B5;
+ break;
+ case 7:
+ format = Fl_Paged_Device::ENVELOPE;
+ break;
+ case 8:
+ format = Fl_Paged_Device::DLE;
+ break;
+ default:
+ format = Fl_Paged_Device::A4;
+ }
+
{ // page range choice
int from = 1, to = pages;
if (print_pages->value()) {
diff --git a/src/print_panel.cxx b/src/print_panel.cxx
index 6f0ca506d..66ffa351d 100644
--- a/src/print_panel.cxx
+++ b/src/print_panel.cxx
@@ -111,8 +111,15 @@ static void cb_print_properties_panel(Fl_Double_Window*, void*) {
}
static Fl_Menu_Item menu_print_page_size[] = {
- {"Letter", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
- {"A4", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Letter", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"A4", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Legal", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Executive", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"A3", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"A5", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"B5", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Com10", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"DL", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0}
};
@@ -218,10 +225,10 @@ static void cb_Save(Fl_Return_Button*, void*) {
int val;
const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
- snprintf(name, sizeof(name), "%s/page_size", printer);
+ snprintf(name, sizeof(name), "%s/page_size", printer == NULL ? "" : printer);
print_prefs.set(name, print_page_size->value());
- snprintf(name, sizeof(name), "%s/output_mode", printer);
+ snprintf(name, sizeof(name), "%s/output_mode", printer == NULL ? "" : printer);
for (val = 0; val < 4; val ++) {
if (print_output_mode[val]->value()) break;
}