-
Notifications
You must be signed in to change notification settings - Fork 2
/
PWindow.h
91 lines (71 loc) · 3.06 KB
/
PWindow.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
86
87
88
89
90
91
//==============================================================================
// File: PWindow.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __PWindow_h__
#define __PWindow_h__
#include <Xm/Xm.h>
#if defined(LESSTIF) || defined(ANTI_ALIAS)
#define RADIO_OFFSET 0
#else
#define RADIO_OFFSET 2
#endif
class PMenu;
class PMenuHandler;
struct MenuStruct;
struct ImageData;
struct SWindowData;
struct SWindowGeometry;
class PWindow {
public:
PWindow(ImageData *data,Widget shell=0,Widget mainPane=0);
virtual ~PWindow();
virtual void Update();
virtual void UpdateSelf() { }
virtual void Show();
virtual char * Class() { return sWindowClass; }
virtual void SetShell(Widget w);
virtual void SetTitle(char *str=NULL);
void Raise();
char * GetTitle();
void GetFullName(char *buff);
void Resize(int width, int height);
void ResizeToFit(Widget w);
void SaveWindowData();
void SetMainWindow();
void SetDirty(int flag=0x01);
int IsDirty() { return mDirty; }
int IsVisible() { return mVisible; }
int WasResized() { return mWasResized; }
Widget GetShell() { return mShell; }
void SetMainPane(Widget w) { mMainPane = w; }
Widget GetMainPane() { return mMainPane; }
ImageData * GetData() { return mData; }
void CreateMenu(Widget menu, MenuStruct *menuList, int nItems, PMenuHandler *handler);
PMenu * GetMenu() { return mMenu; }
int SelectMenuItem(int id);
void SetMenuItemText(int id, char *str);
void GetWindowGeometry(SWindowGeometry *geo);
void CheckWindowOffset(int border_width);
static void HandleUpdates();
static Widget CreateShell(char *name,Widget parent,Arg *wargs=NULL,int n=0);
// public variables
PWindow * mNextMainWindow;
static PWindow* sMainWindow;
static char * sWindowClass;
protected:
ImageData * mData;
PMenu * mMenu;
static int sWindowDirty;
private:
static void DestroyWindProc(Widget w, PWindow *aWind, caddr_t call_data);
Widget mShell; // window shell widget
Widget mMainPane; // main form or rowcolumn widget
Widget mResizeWidget; // widget to resize to when shown
int mWasResized; // non-zero if window was resized
int mDirty; // flag indicating the window needs redrawing
int mVisible; // flag indicates window is visible
static int sOffsetDone; // true if window position resource offset was set
};
#endif // __Window_h__