-
Notifications
You must be signed in to change notification settings - Fork 0
/
Printer.h
75 lines (54 loc) · 1.71 KB
/
Printer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
-------------------------------------------------------------------------
OBJECT NAME: Printer.h
FULL NAME: Printer Setup Class
DESCRIPTION:
COPYRIGHT: University Corporation for Atmospheric Research, 1997
-------------------------------------------------------------------------
*/
#ifndef PRINTER_H
#define PRINTER_H
#include <string>
#include <vector>
#include "Window.h"
#define register
#include <Xm/Frame.h>
#include <Xm/Label.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/TextF.h>
#include <Xm/ToggleB.h>
#define TOTAL_PARMS 3
/* -------------------------------------------------------------------- */
class Printer : public WinForm {
public:
enum layout { LANDSCAPE, PORTRAIT };
Printer(Widget parent);
void PopUp();
void ApplyParms();
layout Shape() { return(shape); }
char *lpCommand() { return(lp_command); }
bool Color() { return(color); }
int LineWidth() { return(lineWidth); }
int Width() { return((int)(dpi * width)); }
int Height() { return((int)(dpi * height)); }
float WidthRatio() { return(width / (shape == LANDSCAPE ? 11.0 : 8.5)); }
float HeightRatio() { return(height / (shape == LANDSCAPE ? 8.5 : 11.0)); }
float FontRatio();
void SetShape(layout newShape);
void SetPrinter(int indx);
void SetColor(bool c) { color = c; }
void SetCommand(char s[]) { strcpy(lp_command, s); }
void SetLineWidth(int w) { if (w > 0 && w < 10) lineWidth = w; }
private:
static const int dpi = 288;
Widget parmsText[TOTAL_PARMS], shapeB[2], colorB[2];
char lp_command[64];
std::vector<std::string> printer_list;
float width, height;
layout shape;
bool color;
int lineWidth;
void setParms(), GetPrinterList();
}; /* END PRINTER.H */
#endif