]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormPrint.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormPrint.C
index ec0bb3744008e0a980cbb788d4f812527d079cf6..a3ea1756ea58d693198c918c3b353e46a50331ab 100644 (file)
@@ -1,39 +1,41 @@
 /**
- * \file xforms/FormPrint.C
+ * \file FormPrint.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
  * \author Allan Rae
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "xformsBC.h"
-#include "ControlPrint.h"
 #include "FormPrint.h"
+#include "ControlPrint.h"
 #include "forms/form_print.h"
-#include "Tooltips.h"
-
-#include "PrinterParams.h"
 
 #include "input_validators.h"
+#include "Tooltips.h"
 #include "xforms_helpers.h"
+#include "xformsBC.h"
+
+#include "PrinterParams.h"
 
 #include "support/lstrings.h"
-#include FORMS_H_LOCATION
+#include "support/tostr.h"
+
+#include "lyx_forms.h"
 
+using lyx::support::strToInt;
 
-typedef FormCB<ControlPrint, FormDB<FD_print> > base_class;
+using std::string;
 
-FormPrint::FormPrint()
-       : base_class(_("Print"))
+
+typedef FormController<ControlPrint, FormView<FD_print> > base_class;
+
+FormPrint::FormPrint(Dialog & parent)
+       : base_class(parent, _("Print Document"))
 {}
 
 
@@ -42,9 +44,9 @@ void FormPrint::build()
        dialog_.reset(build_print(this));
 
        // Manage the ok, apply and cancel/close buttons
-       bc().setOK(dialog_->button_ok);
-       bc().setApply(dialog_->button_apply);
-       bc().setCancel(dialog_->button_close);
+       bcview().setOK(dialog_->button_ok);
+       bcview().setApply(dialog_->button_apply);
+       bcview().setCancel(dialog_->button_close);
 
        // trigger an input event for cut&paste with middle mouse button.
        setPrehandler(dialog_->input_printer);
@@ -153,7 +155,7 @@ void FormPrint::update()
        // hmmm... maybe a bit weird but maybe not
        // we might just be remembering the last time this was printed.
        all_pages_.set(pp.all_pages);
-       
+
        string const from = ( pp.from_page ? tostr(pp.from_page) : string() );
        string const to   = ( pp.to_page   ? tostr(pp.to_page)   : string() );
        fl_set_input(dialog_->input_from_page, from.c_str());
@@ -183,7 +185,7 @@ ButtonPolicy::SMInput FormPrint::input(FL_OBJECT * ob, long)
        if (ob == dialog_->button_browse) {
                // Get the filename from the dialog
                string const in_name = getString(dialog_->input_file);
-               string const out_name = controller().Browse(in_name);
+               string const out_name = controller().browse(in_name);
 
                // Save the filename to the dialog
                if (out_name != in_name && !out_name.empty()) {