]> Shamusworld >> Repos - ttedit/blobdiff - src/toolwindow.h
Added preview window to file loading dialog. :-)
[ttedit] / src / toolwindow.h
old mode 100755 (executable)
new mode 100644 (file)
index d4eab9f..6fc3723
@@ -2,46 +2,51 @@
 // TOOLWINDOW.H: Header file
 //
 // by James L. Hammons
-// (C) 2008 Underground Software
+// (C) 2009 Underground Software
 //
 
 #ifndef __TOOLWINDOW_H__
 #define __TOOLWINDOW_H__
 
-#include <wx/wx.h>                                                             // So that whoever uses this can without having
-                                                                                               // to pull in a bunch of references manually
+#include <QtWidgets>
 
-// Enumerations (prolly go into ToolWindow class--?)
+// 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
+       TOOLNone = -1,          // No tool
+       TOOLSelect = 0,         // The "selection" tool
+       TOOLPolySelect,         // Polygon selection tool
+       TOOLMultiSelect,        // Rectangle selection 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
+       TOOLFlipWinding,        // Change polygon's winding direction tool
+       TOOLScroll                      // Scroll window tool
 };
 
-class ToolWindow: public wxFrame
+class ToolWindow: public QWidget
 {
-       private:
-       protected:
+       Q_OBJECT
+
        public:
-               wxBitmap * bmp;
-               wxPoint sizeStamp, sizeTPBM;
-               ToolType prevTool;
+               ToolWindow(void);
+               ToolType FindSelectedTool(void);
 
-               // Constructor and destructor
-               ToolWindow(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);
-               ~ToolWindow(void);
+       protected:
+               QSize sizeHint() const;
+               void paintEvent(QPaintEvent * event);
 
-               void OnPaint(wxPaintEvent &e);
-               ToolType FindSelectedTool(void);
+       public:
+               ToolType prevTool;
 
-       DECLARE_EVENT_TABLE()
+       private:
+               QImage img;
+               QPoint sizeStamp, sizeTPBM;
 };
 
 #endif // __TOOLWINDOW_H__
+