]> Shamusworld >> Repos - ttedit/blob - src/ttedit.h
Move main repo to trunk.
[ttedit] / src / ttedit.h
1 //\r
2 // TTEDIT.H: Header file\r
3 //\r
4 // by James L. Hammons\r
5 // (C) 2005 Underground Software\r
6 //\r
7 \r
8 #ifndef __TTEDIT_H__\r
9 #define __TTEDIT_H__\r
10 \r
11 #include <wx/wx.h>                                                              // So that whoever uses this can without having\r
12                                                                                                 // to pull in a bunch of references manually\r
13 #include "ttf.h"\r
14 \r
15 // Forward declarations\r
16 \r
17 class TTEditFrame;\r
18 class TTEditWindow;\r
19 class CharWindow;\r
20 class ToolWindow;\r
21 \r
22 //\r
23 // Class representing the entire Application\r
24 //\r
25 class TTEditApp: public wxApp\r
26 {\r
27         public:\r
28                 TTEditFrame * mainFrame;\r
29                 CharWindow * charWin;\r
30                 ToolWindow * toolPalette;\r
31                 TTF font;\r
32 \r
33                 bool OnInit();\r
34                 int OnExit();\r
35 };\r
36 \r
37 DECLARE_APP(TTEditApp)\r
38 \r
39 class TTEditFrame: public wxFrame\r
40 {\r
41         private:\r
42         protected:\r
43         public:\r
44                 TTEditApp & app;                                                // Reference to the application object\r
45                 // Subwindows for reference within the program.\r
46                 TTEditWindow * mainWindow;\r
47                 wxMenuBar * menuBar;\r
48 \r
49                 // Constructor and destructor\r
50                 TTEditFrame(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
51                 ~TTEditFrame(void);\r
52 \r
53                 void OnCloseWindow(wxCloseEvent &e);\r
54 \r
55                 void OnOpen(wxCommandEvent &e);\r
56                 void OnExit(wxCommandEvent &e);\r
57                 void OnAbout(wxCommandEvent &e);\r
58 //              void OnEasy(wxCommandEvent &event);\r
59 ///             void OnMedium(wxCommandEvent &event);\r
60 //              void OnDifficult(wxCommandEvent &event);\r
61 \r
62         DECLARE_EVENT_TABLE()\r
63 };\r
64 \r
65 class TTEditWindow: public wxWindow\r
66 {\r
67         private:\r
68                 TTEditApp & app;                                                // Reference to the application object\r
69                 double scale;                                                   // Window scaling factor\r
70                 int32 offsetX, offsetY;                                 // Window offsets\r
71 \r
72         protected:\r
73         public:\r
74 //              int field_width, field_height;\r
75 //              int x_cell, y_cell;\r
76                 wxBitmap * bmp;\r
77                 wxPoint pt, ptOffset, ptPrevious;\r
78 \r
79                 // Constructor and destructor\r
80                 TTEditWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);\r
81                 ~TTEditWindow(void);\r
82 \r
83                 void OnPaint(wxPaintEvent &e);\r
84                 void OnMouseEvent(wxMouseEvent &e);\r
85 //              void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);\r
86 //              void Refresh(int xc1, int yc1, int xc2, int yc2);\r
87 //              void Uncover(int x, int y);\r
88 //              void UpdateFieldSize();\r
89 \r
90         protected:\r
91                 wxPoint GetAdjustedMousePosition(wxMouseEvent &e);\r
92                 wxPoint GetAdjustedClientPosition(wxCoord x, wxCoord y);\r
93 \r
94         DECLARE_EVENT_TABLE()\r
95 };\r
96 \r
97 class CharWindow: public wxWindow\r
98 {\r
99         private:\r
100         protected:\r
101         public:\r
102 //              int field_width, field_height;\r
103 //              int x_cell, y_cell;\r
104                 wxBitmap * bmp;\r
105 \r
106                 // Constructor and destructor\r
107                 CharWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);\r
108                 ~CharWindow(void);\r
109 \r
110                 void OnPaint(wxPaintEvent &e);\r
111                 void OnMouseEvent(wxMouseEvent &e);\r
112 //              void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);\r
113 //              void Refresh(int xc1, int yc1, int xc2, int yc2);\r
114 //              void Uncover(int x, int y);\r
115 //              void UpdateFieldSize();\r
116 \r
117         DECLARE_EVENT_TABLE()\r
118 };\r
119 \r
120 class ToolWindow: public wxFrame\r
121 //class ToolWindow: public wxWindow\r
122 {\r
123         private:\r
124         protected:\r
125         public:\r
126                 wxBitmap * bmp;\r
127                 wxPoint sizeStamp, sizeTPBM;\r
128                 int prevTool;\r
129 \r
130                 // Constructor and destructor\r
131                 ToolWindow(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
132 //              ToolFrame(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
133 //              ToolWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);\r
134                 ~ToolWindow(void);\r
135 \r
136                 void OnPaint(wxPaintEvent &e);\r
137                 void OnMouseEvent(wxMouseEvent &e);\r
138 //              void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);\r
139 //              void Refresh(int xc1, int yc1, int xc2, int yc2);\r
140 //              void Uncover(int x, int y);\r
141 //              void UpdateFieldSize();\r
142                 int32 FindSelectedTool(void);\r
143 \r
144         DECLARE_EVENT_TABLE()\r
145 };\r
146 \r
147 // Resource/control IDs\r
148 /*\r
149 #define IDI_ICON                        0x01L           // IDs same as in ttedit.asm\r
150 #define IDM_MENU                        0x02L\r
151 #define IDA_ACCEL                       0x03L\r
152 #define IDD_ABOUT                       0x04L\r
153 #define IDR_TOOLBAR1            0x05L\r
154 #define IDB_TOOLBAR1            0x06L\r
155 #define IDB_TOOLPAL1            0x07L\r
156 #define IDC_CURSOR1                     0x08L\r
157 #define IDC_CURSOR2                     0x09L\r
158 #define IDC_CURSOR3                     0x0AL\r
159 #define IDC_CURSOR4                     0x0BL\r
160 #define IDC_CURSOR5                     0x0CL\r
161 #define IDC_CURSOR6                     0x0DL\r
162 #define IDC_CURSOR7                     0x0EL\r
163 #define IDC_CURSOR8                     0x0FL\r
164 \r
165 #define IDS_SYSMENU                     0x010L\r
166 #define IDM_FILEMENU            0x011L\r
167 #define IDM_HELPMENU            0x012L\r
168 \r
169 #define IDM_NEW                         0x020L\r
170 #define IDM_OPEN                        0x021L\r
171 #define IDM_SAVE                        0x022L\r
172 #define IDM_SAVEAS                      0x023L\r
173 #define IDM_EXIT                        0x024L\r
174 #define IDM_HELPTOPICS          0x025L\r
175 #define IDM_ABOUT                       0x026L\r
176 \r
177 #define ID_TBLEFT                       0x030L\r
178 #define ID_TBRIGHT                      0x031L\r
179 #define ID_TBCHARWIN            0x032L */\r
180 \r
181 #endif  // __TTEDIT_H__\r