From 24c6e23e25f0dd42784dee65be70e4bec6f05722 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Mon, 29 Mar 2010 12:15:22 +0000 Subject: print_panel.cxx: allow customization of "Print To File" string git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7355 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Printer.H | 15 ++++++++++++++- src/print_panel.cxx | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index e3a90c806..ccb2b6158 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -52,6 +52,16 @@ In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls and finish by end_page() and end_job() calls. +

On Xlib-based platforms (e.g., Linux, Unix), the static public attributes of this class + can be used to set the print dialog to other languages than English. For example, the "Printer:" + dialog item Fl_Printer::dialog_printer can be set to French with: + \code + Fl_Printer::dialog_printer = "Imprimante:"; + Fl_Printer myprinter; + myprinter.start_job(); + \endcode + Use Fl_PSfile_Device::file_chooser_title to customize the title of the file chooser dialog that opens + when using the "Print To File" option of the print dialog. */ class Fl_Printer : public Fl_Abstract_Printer { private: @@ -123,6 +133,8 @@ public: /** [this text may be customized at run-time] */ static const char *dialog_cancel_button; /** [this text may be customized at run-time] */ + static const char *dialog_print_to_file; + /** [this text may be customized at run-time] */ static const char *property_title; /** [this text may be customized at run-time] */ static const char *property_pagesize; @@ -144,7 +156,7 @@ public: class Fl_Printer : public Fl_PSfile_Device { public: - static const char *dialog_title; + static const char *dialog_title; // all of this must be duplicated above for correct documentation static const char *dialog_printer; static const char *dialog_range; static const char *dialog_copies; @@ -156,6 +168,7 @@ public: static const char *dialog_copyNo; static const char *dialog_print_button; static const char *dialog_cancel_button; + static const char *dialog_print_to_file; static const char *property_title; static const char *property_pagesize; static const char *property_mode; diff --git a/src/print_panel.cxx b/src/print_panel.cxx index 27631d8cc..75456218c 100644 --- a/src/print_panel.cxx +++ b/src/print_panel.cxx @@ -81,6 +81,7 @@ const char *Fl_Printer::dialog_properties = "Properties..."; const char *Fl_Printer::dialog_copyNo = "# Copies:"; const char *Fl_Printer::dialog_print_button = "Print"; const char *Fl_Printer::dialog_cancel_button = "Cancel"; +const char *Fl_Printer::dialog_print_to_file = "Print To File"; const char *Fl_Printer::property_title = "Printer Properties"; const char *Fl_Printer::property_pagesize = "Page Size:"; const char *Fl_Printer::property_mode = "Output Mode:"; @@ -548,7 +549,7 @@ void print_load() { } print_choice->clear(); - print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER); + print_choice->add(Fl_Printer::dialog_print_to_file, 0, 0, 0, FL_MENU_DIVIDER); print_choice->value(0); print_start = 0; -- cgit v1.2.3