Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXPrintDialog.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        P r i n t   J o b   D i a l o g                        *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXPrintDialog.h,v 1.21 2009/01/06 13:07:26 fox Exp $                     *
00022 ********************************************************************************/
00023 #ifndef FXPRINTDIALOG_H
00024 #define FXPRINTDIALOG_H
00025 
00026 #ifndef FXDIALOGBOX_H
00027 #include "FXDialogBox.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 class FXRadioButton;
00034 class FXComboBox;
00035 class FXListBox;
00036 class FXTextField;
00037 class FXSpinner;
00038 class FXIcon;
00039 
00040 
00041 /// Printer selection dialog
00042 class FXAPI FXPrintDialog : public FXDialogBox {
00043   FXDECLARE(FXPrintDialog)
00044 protected:
00045   FXRadioButton *sendtoprinter;
00046   FXComboBox    *printername;
00047   FXRadioButton *sendtofile;
00048   FXTextField   *filename;
00049   FXRadioButton *printall;
00050   FXRadioButton *printeven;
00051   FXRadioButton *printodd;
00052   FXRadioButton *printrange;
00053   FXRadioButton *firstpagefirst;
00054   FXRadioButton *lastpagefirst;
00055   FXRadioButton *printincolor;
00056   FXRadioButton *printinblacknwhite;
00057   FXRadioButton *orientportrait;
00058   FXRadioButton *orientlanscape;
00059   FXListBox     *media;
00060   FXSpinner     *firstpage;
00061   FXSpinner     *lastpage;
00062   FXSpinner     *numberofcopies;
00063   FXIcon        *landscapeIcon;
00064   FXIcon        *portraitIcon;
00065   FXPrinter      printer;
00066 protected:
00067   FXPrintDialog(){}
00068 private:
00069   FXPrintDialog(const FXPrintDialog&);
00070   FXPrintDialog &operator=(const FXPrintDialog&);
00071 public:
00072   long onCmdToPrinter(FXObject*,FXSelector,void*);
00073   long onUpdToPrinter(FXObject*,FXSelector,void*);
00074   long onCmdToFile(FXObject*,FXSelector,void*);
00075   long onUpdToFile(FXObject*,FXSelector,void*);
00076   long onCmdBrowse(FXObject*,FXSelector,void*);
00077   long onUpdBrowse(FXObject*,FXSelector,void*);
00078   long onCmdProps(FXObject*,FXSelector,void*);
00079   long onUpdProps(FXObject*,FXSelector,void*);
00080   long onCmdPortrait(FXObject*,FXSelector,void*);
00081   long onUpdPortrait(FXObject*,FXSelector,void*);
00082   long onCmdLandscape(FXObject*,FXSelector,void*);
00083   long onUpdLandscape(FXObject*,FXSelector,void*);
00084   long onCmdPages(FXObject*,FXSelector,void*);
00085   long onUpdPages(FXObject*,FXSelector,void*);
00086   long onCmdColor(FXObject*,FXSelector,void*);
00087   long onUpdColor(FXObject*,FXSelector,void*);
00088   long onCmdGray(FXObject*,FXSelector,void*);
00089   long onUpdGray(FXObject*,FXSelector,void*);
00090   long onCmdNumCopies(FXObject*,FXSelector,void*);
00091   long onUpdNumCopies(FXObject*,FXSelector,void*);
00092   long onCmdFirstPage(FXObject*,FXSelector,void*);
00093   long onUpdFirstPage(FXObject*,FXSelector,void*);
00094   long onCmdLastPage(FXObject*,FXSelector,void*);
00095   long onUpdLastPage(FXObject*,FXSelector,void*);
00096   long onCmdCollateNormal(FXObject*,FXSelector,void*);
00097   long onUpdCollateNormal(FXObject*,FXSelector,void*);
00098   long onCmdCollateReversed(FXObject*,FXSelector,void*);
00099   long onUpdCollateReversed(FXObject*,FXSelector,void*);
00100   long onCmdFileName(FXObject*,FXSelector,void*);
00101   long onUpdFileName(FXObject*,FXSelector,void*);
00102   long onCmdPrinterName(FXObject*,FXSelector,void*);
00103   long onUpdPrinterName(FXObject*,FXSelector,void*);
00104   long onCmdAccept(FXObject*,FXSelector,void*);
00105   long onCmdMedia(FXObject*,FXSelector,void*);
00106   long onUpdMedia(FXObject*,FXSelector,void*);
00107 public:
00108   enum{
00109     ID_TO_PRINTER=FXDialogBox::ID_LAST,
00110     ID_TO_FILE,
00111     ID_PRINTER_NAME,
00112     ID_FILE_NAME,
00113     ID_LANDSCAPE,
00114     ID_PORTRAIT,
00115     ID_MEDIA,
00116     ID_COLLATE_NORMAL,
00117     ID_COLLATE_REVERSED,
00118     ID_PAGES_ALL,
00119     ID_PAGES_EVEN,
00120     ID_PAGES_ODD,
00121     ID_PAGES_RANGE,
00122     ID_PAGES_FIRST,
00123     ID_PAGES_LAST,
00124     ID_BROWSE_FILE,
00125     ID_PROPERTIES,
00126     ID_COLOR_PRINTER,
00127     ID_GRAY_PRINTER,
00128     ID_NUM_COPIES
00129     };
00130 public:
00131 
00132   /// Construct print dialog
00133   FXPrintDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00134 
00135   /// Create dialog
00136   virtual void create();
00137 
00138   /// Set printer info
00139   void setPrinter(const FXPrinter& pr);
00140 
00141   /// Get printer info
00142   void getPrinter(FXPrinter& pr);
00143 
00144   /// Save dialog to a stream
00145   virtual void save(FXStream& store) const;
00146 
00147   /// Load dialog from a stream
00148   virtual void load(FXStream& store);
00149 
00150   /// Destructor
00151   virtual ~FXPrintDialog();
00152   };
00153 
00154 }
00155 
00156 #endif

Copyright © 1997-2009 Jeroen van der Zijp