/**
- * \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"))
{}
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);
// 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());
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()) {