]> Shamusworld >> Repos - ttedit/blob - src/editwindow.h
846e891608342f6084855e7b8d5c83bb9f94dd60
[ttedit] / src / editwindow.h
1 //
2 // EDITWINDOW.H: Header file
3 //
4 // by James L. Hammons
5 // (C) 2008 Underground Software
6 //
7
8 #ifndef __EDITWINDOW_H__
9 #define __EDITWINDOW_H__
10
11 #include <wx/wx.h>                                                              // So that whoever uses this can without having
12                                                                                                 // to pull in a bunch of references manually
13 #include "types.h"
14 #include "ttedit.h"                                                             // For TTEditApp
15 #include "toolwindow.h"                                                 // For ToolType enum
16 #include "glyphpoints.h"
17
18 class TTEditWindow: public wxWindow
19 {
20         private:
21                 TTEditApp & app;                                                // Reference to the application object
22                 double scale;                                                   // Window scaling factor
23                 int32 offsetX, offsetY;                                 // Window offsets
24                 ToolType tool;                                                  // Current tool
25                 GlyphPoints pts;                                                // Glyph point structure
26                 int32 ptHighlight, oldPtHighlight, ptNextHighlight, oldPtNextHighlight;
27                 bool polyFirstPoint;
28
29         protected:
30         public:
31                 wxBitmap * bmp;
32                 wxPoint pt, ptOffset, ptPrevious;
33
34                 // Constructor and destructor
35                 TTEditWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);
36                 ~TTEditWindow(void);
37
38                 void OnPaint(wxPaintEvent &e);
39                 void OnMouseEvent(wxMouseEvent &e);
40
41         protected:
42                 wxPoint GetAdjustedMousePosition(wxMouseEvent &e);
43                 wxPoint GetAdjustedClientPosition(wxCoord x, wxCoord y);
44
45         DECLARE_EVENT_TABLE()
46 };
47
48 #endif  // __EDITWINDOW_H__