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

FXPrintDialog.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * P r i n t J o b D i a l o g *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXPrintDialog.h,v 1.17 2006/01/22 17:58:07 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXPRINTDIALOG_H
25 #define FXPRINTDIALOG_H
26 
27 #ifndef FXDIALOGBOX_H
28 #include "FXDialogBox.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXRadioButton;
35 class FXComboBox;
36 class FXListBox;
37 class FXTextField;
38 class FXSpinner;
39 class FXIcon;
40 
41 
42 /// Printer selection dialog
45 protected:
46  FXRadioButton *sendtoprinter;
47  FXComboBox *printername;
48  FXRadioButton *sendtofile;
49  FXTextField *filename;
50  FXRadioButton *printall;
51  FXRadioButton *printeven;
52  FXRadioButton *printodd;
53  FXRadioButton *printrange;
54  FXRadioButton *firstpagefirst;
55  FXRadioButton *lastpagefirst;
56  FXRadioButton *printincolor;
57  FXRadioButton *printinblacknwhite;
58  FXRadioButton *orientportrait;
59  FXRadioButton *orientlanscape;
60  FXListBox *media;
61  FXSpinner *firstpage;
62  FXSpinner *lastpage;
63  FXSpinner *numberofcopies;
64  FXIcon *landscapeIcon;
65  FXIcon *portraitIcon;
66  FXPrinter printer;
67 protected:
68  FXPrintDialog(){}
69 private:
71  FXPrintDialog &operator=(const FXPrintDialog&);
72 public:
73  long onCmdToPrinter(FXObject*,FXSelector,void*);
74  long onUpdToPrinter(FXObject*,FXSelector,void*);
75  long onCmdToFile(FXObject*,FXSelector,void*);
76  long onUpdToFile(FXObject*,FXSelector,void*);
77  long onCmdBrowse(FXObject*,FXSelector,void*);
78  long onUpdBrowse(FXObject*,FXSelector,void*);
79  long onCmdProps(FXObject*,FXSelector,void*);
80  long onUpdProps(FXObject*,FXSelector,void*);
81  long onCmdPortrait(FXObject*,FXSelector,void*);
82  long onUpdPortrait(FXObject*,FXSelector,void*);
83  long onCmdLandscape(FXObject*,FXSelector,void*);
84  long onUpdLandscape(FXObject*,FXSelector,void*);
85  long onCmdPages(FXObject*,FXSelector,void*);
86  long onUpdPages(FXObject*,FXSelector,void*);
87  long onCmdColor(FXObject*,FXSelector,void*);
88  long onUpdColor(FXObject*,FXSelector,void*);
89  long onCmdGray(FXObject*,FXSelector,void*);
90  long onUpdGray(FXObject*,FXSelector,void*);
91  long onCmdNumCopies(FXObject*,FXSelector,void*);
92  long onUpdNumCopies(FXObject*,FXSelector,void*);
93  long onCmdFirstPage(FXObject*,FXSelector,void*);
94  long onUpdFirstPage(FXObject*,FXSelector,void*);
95  long onCmdLastPage(FXObject*,FXSelector,void*);
96  long onUpdLastPage(FXObject*,FXSelector,void*);
97  long onCmdCollateNormal(FXObject*,FXSelector,void*);
98  long onUpdCollateNormal(FXObject*,FXSelector,void*);
99  long onCmdCollateReversed(FXObject*,FXSelector,void*);
100  long onUpdCollateReversed(FXObject*,FXSelector,void*);
101  long onCmdFileName(FXObject*,FXSelector,void*);
102  long onUpdFileName(FXObject*,FXSelector,void*);
103  long onCmdPrinterName(FXObject*,FXSelector,void*);
104  long onUpdPrinterName(FXObject*,FXSelector,void*);
105  long onCmdAccept(FXObject*,FXSelector,void*);
106  long onCmdMedia(FXObject*,FXSelector,void*);
107  long onUpdMedia(FXObject*,FXSelector,void*);
108 public:
109  enum{
110  ID_TO_PRINTER=FXDialogBox::ID_LAST,
111  ID_TO_FILE,
112  ID_PRINTER_NAME,
113  ID_FILE_NAME,
114  ID_LANDSCAPE,
115  ID_PORTRAIT,
116  ID_MEDIA,
117  ID_COLLATE_NORMAL,
118  ID_COLLATE_REVERSED,
119  ID_PAGES_ALL,
120  ID_PAGES_EVEN,
121  ID_PAGES_ODD,
122  ID_PAGES_RANGE,
123  ID_PAGES_FIRST,
124  ID_PAGES_LAST,
125  ID_BROWSE_FILE,
126  ID_PROPERTIES,
127  ID_COLOR_PRINTER,
128  ID_GRAY_PRINTER,
129  ID_NUM_COPIES
130  };
131 public:
132 
133  /// Construct print dialog
134  FXPrintDialog(FXWindow* owner,const FXString& name,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
135 
136  /// Create dialog
137  virtual void create();
138 
139  /// Set printer info
140  void setPrinter(const FXPrinter& pr);
141 
142  /// Get printer info
143  void getPrinter(FXPrinter& pr);
144 
145  /// Save dialog to a stream
146  virtual void save(FXStream& store) const;
147 
148  /// Load dialog from a stream
149  virtual void load(FXStream& store);
150 
151  /// Destructor
152  virtual ~FXPrintDialog();
153  };
154 
155 }
156 
157 #endif
DialogBox window.
Definition: FXDialogBox.h:40
Printer selection dialog.
Definition: FXPrintDialog.h:43
Base class for all windows.
Definition: FXWindow.h:115
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
The List Box is a control to select one of a list of options.
Definition: FXListBox.h:62
FXString name(const FXString &file)
Return name and extension part of the path name.
Describes printer.
Definition: FXDCPrint.h:89
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:45
A text field is a single-line text entry widget.
Definition: FXTextField.h:73
Spinner control.
Definition: FXSpinner.h:57
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
A radio button is a tri-state button.
Definition: FXRadioButton.h:61
A Combo Box provides a way to select a string from a list of strings.
Definition: FXComboBox.h:75
Definition: FXDialogBox.h:51
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp