diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-04-11 18:42:35 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-04-11 18:42:35 +0000 |
| commit | 6359f8be73ac42d3dd989e2d463a0e972c37f036 (patch) | |
| tree | 84ec17f32390ff1ffc6c77110c493f03112df043 | |
| parent | 896c6c27664e679907195f9cc9a32e55c81998fb (diff) | |
Made the printer dialog customization strings platform independent, so that
they can be set on all platforms to avoid platform-specific end user code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7480 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl_Abstract_Printer.H | 1 | ||||
| -rw-r--r-- | FL/Fl_Printer.H | 57 | ||||
| -rw-r--r-- | src/Fl_Printer.cxx | 22 | ||||
| -rw-r--r-- | src/print_panel.cxx | 21 |
4 files changed, 44 insertions, 57 deletions
diff --git a/FL/Fl_Abstract_Printer.H b/FL/Fl_Abstract_Printer.H index a869d6a58..919126fac 100644 --- a/FL/Fl_Abstract_Printer.H +++ b/FL/Fl_Abstract_Printer.H @@ -91,4 +91,3 @@ public: // // End of "$Id$" // - diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index e0d54a4e8..8aba8dc81 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -65,7 +65,7 @@ \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_RGB_Image prints but looses its transparency if it has one. + Class Fl_RGB_Image prints but loses its transparency if it has one. <li>MSWindows platform: Transparent Fl_RGB_Image 's don't print with exact transparency on most printers. Fl_RGB_Image 's don't rotate() well. A workaround is to use the print_window_part() call. @@ -113,11 +113,30 @@ public: #endif int end_page (void); void end_job (void); + /** @brief The destructor. */ ~Fl_Printer(void); -#ifdef FL_DOXYGEN + +#else // Xlib (Linux/Unix) + +#include <FL/Fl_PSfile_Device.H> + +class Fl_Printer : public Fl_PSfile_Device { + +public: + + Fl_Printer(void) {}; + ~Fl_Printer(void) {}; + int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL); + +#endif // Fl_Printer (platform-dependent) + + // Fl_Printer:: common for all platforms + +public: // just to be sure ... + /** \name These attributes apply to the Xlib platform only. \{ */ @@ -160,40 +179,8 @@ public: /** [this text may be customized at run-time] */ static const char *property_cancel; /** \} */ -#endif -}; -#else - -#include <FL/Fl_PSfile_Device.H> - -class Fl_Printer : public Fl_PSfile_Device { -public: - 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; - static const char *dialog_all; - static const char *dialog_pages; - static const char *dialog_from; - static const char *dialog_to; - static const char *dialog_properties; - 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; - static const char *property_use; - static const char *property_save; - static const char *property_cancel; - - Fl_Printer(void) {}; - ~Fl_Printer(void) {}; - int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL); -}; -#endif +}; // class Fl_Printer /** This plugin socket allows the integration of new device drivers for special diff --git a/src/Fl_Printer.cxx b/src/Fl_Printer.cxx index ff5d1c962..d6e8425b3 100644 --- a/src/Fl_Printer.cxx +++ b/src/Fl_Printer.cxx @@ -36,6 +36,28 @@ #include <src/Fl_PS_Printer.cxx> +// print dialog customization strings + +const char *Fl_Printer::dialog_title = "Print"; +const char *Fl_Printer::dialog_printer = "Printer:"; +const char *Fl_Printer::dialog_range = "Print Range"; +const char *Fl_Printer::dialog_copies = "Copies"; +const char *Fl_Printer::dialog_all = "All"; +const char *Fl_Printer::dialog_pages = "Pages"; +const char *Fl_Printer::dialog_from = "From:"; +const char *Fl_Printer::dialog_to = "To:"; +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:"; +const char *Fl_Printer::property_use = "Use"; +const char *Fl_Printer::property_save = "Save"; +const char *Fl_Printer::property_cancel = "Cancel"; + // // End of "$Id$". // diff --git a/src/print_panel.cxx b/src/print_panel.cxx index 75456218c..f63946c55 100644 --- a/src/print_panel.cxx +++ b/src/print_panel.cxx @@ -69,27 +69,6 @@ static Fl_Spinner *print_copies=(Fl_Spinner *)0; static int print_start = 0; // 1 if print_okay has been clicked static int print_pipe = 0; // 0 = file, 1 = pipe (lp) -const char *Fl_Printer::dialog_title = "Print"; -const char *Fl_Printer::dialog_printer = "Printer:"; -const char *Fl_Printer::dialog_range = "Print Range"; -const char *Fl_Printer::dialog_copies = "Copies"; -const char *Fl_Printer::dialog_all = "All"; -const char *Fl_Printer::dialog_pages = "Pages"; -const char *Fl_Printer::dialog_from = "From:"; -const char *Fl_Printer::dialog_to = "To:"; -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:"; -const char *Fl_Printer::property_use = "Use"; -const char *Fl_Printer::property_save = "Save"; -const char *Fl_Printer::property_cancel = "Cancel"; - - static void cb_print_choice(Fl_Choice*, void*) { print_update_status(); } |
