-
Notifications
You must be signed in to change notification settings - Fork 2
/
PPrintWindow.h
75 lines (60 loc) · 2.79 KB
/
PPrintWindow.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
//==============================================================================
// File: PPrintWindow.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __PPrintWindow_h__
#define __PPrintWindow_h__
#include "ImageData.h"
#include "PWindow.h"
#include "PNotifyRaised.h"
#include "PListener.h"
enum EPrintType {
kPrintImage,
kPrintWindow
};
const short kMaxPrintArgs = 20;
class AgedWindow;
class PImageWindow;
class PPrintWindow : public PWindow, public PNotifyRaised, public PListener {
public:
PPrintWindow(ImageData *data, EPrintType printType);
~PPrintWindow();
void DoPrint();
void SetPrintType(EPrintType printType);
int GetSaveCol() { return mSaveCol; }
int GetSaveLabel() { return mSaveLabel; }
virtual void Listen(int message, void *dataPt);
virtual void NotifyRaised(PImageWindow *aWindow);
private:
void SetColours(int colourSet);
void ShowLabels(int on);
void SetTarget(int to_file);
void SaveSettings();
void PromptToClick();
void ContinuePrinting(PImageWindow *aWindow);
static void ToPrinterProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void ToFileProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void PrintProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void ColoursProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void GreyProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void PrintLabelProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void CancelProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void WarnOKProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void WarnCancelProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
static void WarnDestroyProc(Widget w, PPrintWindow *printWin, caddr_t call_data);
EPrintType mPrintType; // type of print window open
int mSaveCol; // save colours before printing
int mSaveLabel; // save labels before printing
Widget print_text, cmd_label, print_button, cancel_button;
Widget col_toggle, grey_toggle, label_toggle;
Widget target_label, target_radio[2];
int mArgc;
char * mArgs[kMaxPrintArgs];
char mPrintName[FILELEN];
char mTempFilename[256];
int mPrintFlags;
int mToFile;
Widget mWarnDialog;
};
#endif // __PPrintWindow_h__