print_dlg.cpp
来自「ncbi源码」· C++ 代码 · 共 202 行
CPP
202 行
/* * =========================================================================== * PRODUCTION $Log: print_dlg.cpp,v $ * PRODUCTION Revision 1000.1 2004/06/01 21:04:01 gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.10 * PRODUCTION * =========================================================================== *//* $Id: print_dlg.cpp,v 1000.1 2004/06/01 21:04:01 gouriano Exp $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software / database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software / database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * Authors: Peter Meric * * File Description: * CPrintDlg - Print options dialog * */#include <ncbi_pch.hpp>#include <gui/print/print_dlg.hpp>#include <gui/utils/message_box.hpp>#include <FL/Fl_File_Chooser.H>#include "print_options_dlg.hpp"BEGIN_NCBI_SCOPE#include "print_dlg_.cpp"CPrintDlg::CPrintDlg(){ m_Window.reset(x_Create()); Init();}CPrintDlg::CPrintDlg(const CPrintOptions& options){ m_Window.reset(x_Create()); m_Options = options; Init();}void CPrintDlg::Init(void){ // // initialise fields // m_Postscript->argument(CPrintOptions::ePostscript); m_Pdf->argument(CPrintOptions::ePdf); m_Svg->argument(CPrintOptions::eSvg); if (m_Options.GetPrintOutput()) { m_LocationPrint->setonly(); } else { m_LocationFile->setonly(); m_Filename->value(m_Options.GetFilename().c_str()); }}void CPrintDlg::x_OnBrowse(void){ const char* fname = fl_file_chooser("Save Print Output As?", "*", 0); if (fname && *fname) { m_Filename->value(fname); }}void CPrintDlg::x_OnOK(){ const string fname(m_Filename->value()); if (fname.length() == 0) { const string mesg("Output filename must be supplied"); NcbiMessageBox(mesg); return; } x_UpdateOptions(); CDialog::x_OnOK();}void CPrintDlg::x_OnSelectPrint(void){ m_Filename->deactivate();}void CPrintDlg::x_OnSelectFile(void){ m_Filename->activate();}void CPrintDlg::x_OnOptions(void){ CPrintOptionsDlg dlg(m_Options); if (dlg.ShowModal() == eOK) { m_Options = dlg.GetOptions(); }}void CPrintDlg::x_UpdateOptions(void){ if (m_LocationFile->value() == 1) { m_Options.SetFilename(m_Filename->value()); } else { m_Options.SetPrintOutput(true); } m_Options.SetOutputFormat (static_cast<CPrintOptions::EOutputFormat> (m_Format->mvalue()->argument()));}const CPrintOptions& CPrintDlg::GetOptions(void) const{ return m_Options;}END_NCBI_SCOPE/* * =========================================================================== * $Log: print_dlg.cpp,v $ * Revision 1000.1 2004/06/01 21:04:01 gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.10 * * Revision 1.10 2004/05/21 22:27:50 gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.9 2003/09/29 15:46:36 dicuccio * Inherit dialogs from CDialog * * Revision 1.8 2003/08/15 17:02:16 meric * Updates include paths for print-related files from gui/utils to gui/print * * Revision 1.7 2003/07/15 19:10:31 meric * Removed raster output formats * * Revision 1.6 2003/06/19 00:58:30 dicuccio * Minor reformatting. Use explicit return value comapre (== eOK) for * CPrintOptionsDlg::Show(). Added missing call to Init() in default ctor * * Revision 1.5 2003/06/17 19:54:40 meric * Added direct printing support (via PDF) * * Revision 1.4 2003/06/17 19:46:53 dicuccio * Fixed storage of integer type in widget - use argument() instead of user_data() * * Revision 1.3 2003/06/16 21:36:09 meric * Fixed c'tor to set m_MainWin using return value of x_Create() * * Revision 1.2 2003/06/16 21:22:34 meric * Added "launch viewer" check box * * Revision 1.1 2003/06/16 16:01:38 dicuccio * Moved generic print code code from opengl/print to utils. * * Revision 1.2 2003/06/16 12:44:52 dicuccio * Clean-up after initial commit * * Revision 1.1 2003 / 06 / 13 18:13:56 meric * Initial version * * * =========================================================================== */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?