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
This commit is contained in:
Manolo Gouy 2010-03-29 12:15:22 +00:00
parent 82be53f64d
commit 24c6e23e25
2 changed files with 16 additions and 2 deletions

View File

@ -52,6 +52,16 @@
</ul>
In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls
and finish by end_page() and end_job() calls.
<p>On Xlib-based platforms (<i>e.g.</i>, 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;

View File

@ -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;