]> Shamusworld >> Repos - ttedit/blobdiff - src/toolwindow.h
Added individual polygon rotation tool.
[ttedit] / src / toolwindow.h
index 5d1ee3ee74eac42bc3ed8e48d38c8bae89f880df..f9134bc2f0392ecde8ec627f544f2e2abcb504ad 100755 (executable)
@@ -1,47 +1,49 @@
-//\r
-// TOOLWINDOW.H: Header file\r
-//\r
-// by James L. Hammons\r
-// (C) 2008 Underground Software\r
-//\r
-\r
-#ifndef __TOOLWINDOW_H__\r
-#define __TOOLWINDOW_H__\r
-\r
-#include <wx/wx.h>                                                             // So that whoever uses this can without having\r
-                                                                                               // to pull in a bunch of references manually\r
-\r
-// Enumerations (prolly go into ToolWindow class--?)\r
-\r
-enum ToolType {\r
-       TOOLNone = -1,                                                  // No tool\r
-       TOOLSelect = 0,                                                 // The "selection" tool\r
-       TOOLPolySelect,                                                 // Polygon selection tool\r
-       TOOLScroll,                                                             // Scroll window tool\r
-       TOOLZoom,                                                               // Zoom window tool\r
-       TOOLAddPt,                                                              // Add point tool\r
-       TOOLAddPoly,                                                    // Polygon creation tool\r
-       TOOLDelPt,                                                              // Delete point tool\r
-       TOOLDelPoly                                                             // Delete polygon tool\r
-};\r
-\r
-class ToolWindow: public wxFrame\r
-{\r
-       private:\r
-       protected:\r
-       public:\r
-               wxBitmap * bmp;\r
-               wxPoint sizeStamp, sizeTPBM;\r
-               ToolType prevTool;\r
-\r
-               // Constructor and destructor\r
-               ToolWindow(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
-               ~ToolWindow(void);\r
-\r
-               void OnPaint(wxPaintEvent &e);\r
-               ToolType FindSelectedTool(void);\r
-\r
-       DECLARE_EVENT_TABLE()\r
-};\r
-\r
-#endif // __TOOLWINDOW_H__\r
+//
+// TOOLWINDOW.H: Header file
+//
+// by James L. Hammons
+// (C) 2009 Underground Software
+//
+
+#ifndef __TOOLWINDOW_H__
+#define __TOOLWINDOW_H__
+
+#include <QtGui>
+
+// Enumerations
+
+enum ToolType {
+       TOOLNone = -1,                                                  // No tool
+       TOOLSelect = 0,                                                 // The "selection" tool
+       TOOLPolySelect,                                                 // Polygon selection tool
+       TOOLScroll,                                                             // Scroll window tool
+       TOOLZoom,                                                               // Zoom window tool
+       TOOLAddPt,                                                              // Add point tool
+       TOOLAddPoly,                                                    // Polygon creation tool
+       TOOLDelPt,                                                              // Delete point tool
+       TOOLDelPoly,                                                    // Delete polygon tool
+       TOOLRotate,                                                             // Rotate tool
+       TOOLRotatePoly                                                  // Rotate polygon around centroid tool
+};
+
+class ToolWindow: public QWidget
+{
+       Q_OBJECT
+
+       public:
+               ToolWindow(void);
+               ToolType FindSelectedTool(void);
+
+       protected:
+               QSize sizeHint() const;
+               void paintEvent(QPaintEvent * event);
+
+       public:
+               ToolType prevTool;
+
+       private:
+               QImage img;
+               QPoint sizeStamp, sizeTPBM;
+};
+
+#endif // __TOOLWINDOW_H__