|
|
1.1 root 1: /* wxform.h -- header file for World transform sample. */
2:
3:
1.1.1.2 ! root 4: LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);
! 5: LRESULT CALLBACK TransformDlgProc(HWND, UINT, WPARAM, LPARAM);
! 6: LRESULT CALLBACK MouseDlgProc (HWND, UINT, WPARAM, LPARAM);
1.1 root 7:
8:
9:
10: /* dialog id's for the Transform dialog */
11: #define IDD_EM11 101
12: #define IDD_EM12 102
13: #define IDD_EDX 103
14: #define IDD_EM21 104
15: #define IDD_EM22 105
16: #define IDD_EDY 106
17: #define IDD_13 107
18: #define IDD_23 108
19: #define IDD_33 109
20: #define IDD_SETXFORM 110
21: #define IDD_IDENTITY 111
22:
23:
24: /* dialog id's for the Mouse dialog */
25: #define IDD_SCREENX 201
26: #define IDD_SCREENY 202
27: #define IDD_DEVICEX 203
28: #define IDD_DEVICEY 204
29: #define IDD_WORLDX 205
30: #define IDD_WORLDY 206
31:
32:
33: /* special messages for doTrackobject(). */
34: #define TROB_NEW WM_USER+1
35: #define TROB_DELETE WM_USER+2
36: #define TROB_PAINT WM_USER+3
37: #define TROB_HITTEST WM_USER+5
38: #define TROB_CENTER WM_USER+6
39: #define TROB_SETXFORM WM_USER+7
40:
41: /* special user message for two of the dialogs */
42: #define WM_PUTUPFLOATS WM_USER+1
43:
44:
45: /* Different "Track modes." */
46: #define TMNONE 0x0000
47: #define TMMOVE 0x0001
48: #define TMSIZEX 0x0002
49: #define TMSIZEY 0x0004
50: #define TMSIZEXY 0x0006
51: #define TMSHEARX 0x0010
52: #define TMSHEARY 0x0020
53: #define TMROTATE 0x0008
54:
55:
56: /* misc. defines for drawing and formating */
57: #define TICKSPACE 20
58: #define MAXCHARS 32
59: #define INC 5
60: #define FORMATFLOAT "%1.2f"
61: #define GRIDCOLOR (COLORREF) 0x01000006
62:
63:
64:
65: /* structure for the track object. c.f. ptoRect */
66: typedef struct tagTrackObject{
67: RECT rect;
68: XFORM xfmChange; /* World coordinate transform */
69: XFORM xfmDown; /* transform when the mouse down happens. */
70: HDC hdc;
71: int Mode; /* TMROTATE, TMSIZEXY, TMMOVE, ... */
72: struct tagTrackObject* Next;
73: } TrackObject, *PTrackObject;
74:
75:
76: /* function prototypes. */
77: PTrackObject doTrackObject(PTrackObject, int, HWND, LONG);
78: VOID MouseMove(PTrackObject, int, HWND, LONG);
79: VOID CenterOrigin (HWND, HDC);
80:
81:
82: /* Global variables. */
83: BOOL showTransform, showMouse, showHelp;
84: HWND hwndTransform, hwndMouse, hwndHelp;
85: PTrackObject ptoRect = NULL;
86: HANDLE hInst;
87: HWND hwndMain;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.