-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAgedWindow.h
85 lines (69 loc) · 2.96 KB
/
AgedWindow.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
76
77
78
79
80
81
82
83
84
85
//==============================================================================
// File: AgedWindow.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __AgedWindow_h__
#define __AgedWindow_h__
#include <Xm/Xm.h>
#include "PImageWindow.h"
#include "PListener.h"
#include "PSpeaker.h"
#include "PMenu.h"
#include "TextSpec.h"
const short kLabelSize = 1024;
const short kMaxLabelLines = 64;
enum ELabelFlags {
kLabelRun = 0x00000001, // rn
kLabelEvID = 0x00000002, // ev
kLabelTime = 0x00000004, // ti
kLabelDate = 0x00000008, // da
kLabelNhit = 0x00000010, // nh
};
class AgedWindow : public PImageWindow,
public PListener,
public PSpeaker,
public PMenuHandler
{
public:
AgedWindow(int load_settings=1);
virtual ~AgedWindow();
virtual void UpdateSelf();
virtual void DoMenuCommand(int anID);
virtual int CheckMenuCommand(int anID, int flags);
virtual void Listen(int message, void *dataPt);
virtual void SetTitle(char *str=NULL);
void CreateWindow(int anID);
void ShowWindow(int id);
MenuList * GetPopupMenuItem(int id);
void SaveResources(int force_save=0);
void LabelFormatChanged();
TextSpec * GetLabelText();
int GetLabelHeight() { return mLabelHeight; }
long GetLabelFlags() { return mLabelFlags; }
void AboutAged();
static long BuildLabelString(ImageData *data, TextSpec *aTextOut,
char *aLabelFormat, char *aBuffer);
private:
void SetHitMaskMenuToggles();
void MakeLabel();
void SetLabelDirty();
void WarnQuit();
static void SetupSum(ImageData *data);
static int GetPrecision(char *fmt, int def_prec);
static void DestroyDialogProc(Widget w, Widget **dialogPtr, caddr_t call_data);
static void CancelProc(Widget w, Widget aShell, caddr_t call_data);
static void WarnCancelProc(Widget w, AgedWindow *win, caddr_t call_data);
static void WarnOKProc(Widget w, AgedWindow *win, caddr_t call_data);
static void WarnDestroyProc(Widget w, AgedWindow *win, caddr_t call_data);
char mLabelString[kLabelSize];// label for this event
TextSpec mLabelText[kMaxLabelLines];
int mLabelHeight; // pixel height of label
long mLabelFlags; // label flags
int mLabelDirty; // non-zero if label needs remaking
int mPrintType;
Widget disp_text;
Widget aboutbox; // about box
Widget mWarnDialog; // warning dialog
};
#endif // __AgedWindow_h__