]> Shamusworld >> Repos - ttedit/blobdiff - src/ttedit.h
Converted project from wxWidgets to Qt. This will be the LAST time this
[ttedit] / src / ttedit.h
index de526f880b9280cfef86516ac075aa4a93f860df..d92c33aa611d28f98a35570201b0b44e37a4dbb0 100755 (executable)
-//\r
-// TTEDIT.H: Header file\r
-//\r
-// by James L. Hammons\r
-// (C) 2005 Underground Software\r
-//\r
-\r
-#ifndef __TTEDIT_H__\r
-#define __TTEDIT_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
-#include "ttf.h"\r
-\r
-// Forward declarations\r
-\r
-class TTEditFrame;\r
-class TTEditWindow;\r
-class CharWindow;\r
-class ToolWindow;\r
-\r
-//\r
-// Class representing the entire Application\r
-//\r
-class TTEditApp: public wxApp\r
-{\r
-       public:\r
-               TTEditFrame * mainFrame;\r
-               CharWindow * charWin;\r
-               ToolWindow * toolPalette;\r
-               TTF font;\r
-\r
-               bool OnInit();\r
-               int OnExit();\r
-};\r
-\r
-DECLARE_APP(TTEditApp)\r
-\r
-class TTEditFrame: public wxFrame\r
-{\r
-       private:\r
-       protected:\r
-       public:\r
-               TTEditApp & app;                                                // Reference to the application object\r
-               // Subwindows for reference within the program.\r
-               TTEditWindow * mainWindow;\r
-               wxMenuBar * menuBar;\r
-\r
-               // Constructor and destructor\r
-               TTEditFrame(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
-               ~TTEditFrame(void);\r
-\r
-               void OnCloseWindow(wxCloseEvent &e);\r
-\r
-               void OnOpen(wxCommandEvent &e);\r
-               void OnExit(wxCommandEvent &e);\r
-               void OnAbout(wxCommandEvent &e);\r
-//             void OnEasy(wxCommandEvent &event);\r
-///            void OnMedium(wxCommandEvent &event);\r
-//             void OnDifficult(wxCommandEvent &event);\r
-\r
-       DECLARE_EVENT_TABLE()\r
-};\r
-\r
-class TTEditWindow: public wxWindow\r
-{\r
-       private:\r
-               TTEditApp & app;                                                // Reference to the application object\r
-               double scale;                                                   // Window scaling factor\r
-               int32 offsetX, offsetY;                                 // Window offsets\r
-\r
-       protected:\r
-       public:\r
-//             int field_width, field_height;\r
-//             int x_cell, y_cell;\r
-               wxBitmap * bmp;\r
-               wxPoint pt, ptOffset, ptPrevious;\r
-\r
-               // Constructor and destructor\r
-               TTEditWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);\r
-               ~TTEditWindow(void);\r
-\r
-               void OnPaint(wxPaintEvent &e);\r
-               void OnMouseEvent(wxMouseEvent &e);\r
-//             void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);\r
-//             void Refresh(int xc1, int yc1, int xc2, int yc2);\r
-//             void Uncover(int x, int y);\r
-//             void UpdateFieldSize();\r
-\r
-       protected:\r
-               wxPoint GetAdjustedMousePosition(wxMouseEvent &e);\r
-               wxPoint GetAdjustedClientPosition(wxCoord x, wxCoord y);\r
-\r
-       DECLARE_EVENT_TABLE()\r
-};\r
-\r
-class CharWindow: public wxWindow\r
-{\r
-       private:\r
-       protected:\r
-       public:\r
-//             int field_width, field_height;\r
-//             int x_cell, y_cell;\r
-               wxBitmap * bmp;\r
-\r
-               // Constructor and destructor\r
-               CharWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);\r
-               ~CharWindow(void);\r
-\r
-               void OnPaint(wxPaintEvent &e);\r
-               void OnMouseEvent(wxMouseEvent &e);\r
-//             void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);\r
-//             void Refresh(int xc1, int yc1, int xc2, int yc2);\r
-//             void Uncover(int x, int y);\r
-//             void UpdateFieldSize();\r
-\r
-       DECLARE_EVENT_TABLE()\r
-};\r
-\r
-class ToolWindow: public wxFrame\r
-//class ToolWindow: public wxWindow\r
-{\r
-       private:\r
-       protected:\r
-       public:\r
-               wxBitmap * bmp;\r
-               wxPoint sizeStamp, sizeTPBM;\r
-               int prevTool;\r
-\r
-               // Constructor and destructor\r
-               ToolWindow(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
-//             ToolFrame(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);\r
-//             ToolWindow(wxFrame * parent, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0);\r
-               ~ToolWindow(void);\r
-\r
-               void OnPaint(wxPaintEvent &e);\r
-               void OnMouseEvent(wxMouseEvent &e);\r
-//             void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);\r
-//             void Refresh(int xc1, int yc1, int xc2, int yc2);\r
-//             void Uncover(int x, int y);\r
-//             void UpdateFieldSize();\r
-               int32 FindSelectedTool(void);\r
-\r
-       DECLARE_EVENT_TABLE()\r
-};\r
-\r
-// Resource/control IDs\r
-/*\r
-#define        IDI_ICON                        0x01L           // IDs same as in ttedit.asm\r
-#define        IDM_MENU                        0x02L\r
-#define        IDA_ACCEL                       0x03L\r
-#define        IDD_ABOUT                       0x04L\r
-#define IDR_TOOLBAR1           0x05L\r
-#define IDB_TOOLBAR1           0x06L\r
-#define IDB_TOOLPAL1           0x07L\r
-#define IDC_CURSOR1                    0x08L\r
-#define IDC_CURSOR2                    0x09L\r
-#define IDC_CURSOR3                    0x0AL\r
-#define IDC_CURSOR4                    0x0BL\r
-#define IDC_CURSOR5                    0x0CL\r
-#define IDC_CURSOR6                    0x0DL\r
-#define IDC_CURSOR7                    0x0EL\r
-#define IDC_CURSOR8                    0x0FL\r
-\r
-#define        IDS_SYSMENU                     0x010L\r
-#define        IDM_FILEMENU            0x011L\r
-#define        IDM_HELPMENU            0x012L\r
-\r
-#define        IDM_NEW                         0x020L\r
-#define        IDM_OPEN                        0x021L\r
-#define        IDM_SAVE                        0x022L\r
-#define        IDM_SAVEAS                      0x023L\r
-#define        IDM_EXIT                        0x024L\r
-#define        IDM_HELPTOPICS          0x025L\r
-#define        IDM_ABOUT                       0x026L\r
-\r
-#define        ID_TBLEFT                       0x030L\r
-#define        ID_TBRIGHT                      0x031L\r
-#define        ID_TBCHARWIN            0x032L */\r
-\r
-#endif // __TTEDIT_H__\r
+//
+// TTEDIT.H: Header file
+//
+// by James L. Hammons
+// (C) 2009 Underground Software
+//
+
+#ifndef __TTEDIT_H__
+#define __TTEDIT_H__
+
+//Hrm. uh??? I thought this wasn't the way to do this stuff...???
+#include <QtGui>
+
+#if 0
+//#include <wx/wx.h>                                                           // So that whoever uses this can without having
+                                                                                               // to pull in a bunch of references manually
+//#include "ttf.h"
+
+// Forward declarations
+
+//class TTEditWin;
+//class TTEditWindow;
+//class CharWindow;
+//class ToolWindow;
+
+//
+// Class representing the entire Application
+//
+class TTEditApp: public QMainWindow
+{
+       public:
+               TTEditFrame * mainFrame;
+               CharWindow * charWin;
+               ToolWindow * toolPalette;
+               TTF font;
+               wxCursor * cur[8];
+
+               bool OnInit();
+               int OnExit();
+               void CreateResources(void);
+};
+
+DECLARE_APP(TTEditApp)
+#endif
+// Forward declarations
+
+//class TTEditWin;
+class EditWindow;
+
+
+class TTEMainWindow: public QMainWindow
+{
+       // All Qt apps require this macro
+       Q_OBJECT
+
+       public:
+               TTEMainWindow();
+
+       protected:
+               void closeEvent(QCloseEvent * event);
+
+       private slots:
+               void Open();
+
+       private:
+               void ReadSettings(void);
+               void WriteSettings(void);
+
+               EditWindow * editWnd;
+#if 0
+       private:
+       protected:
+       public:
+               TTEditApp & app;                                                // Reference to the application object
+               // Subwindows for reference within the program.
+               TTEditWindow * mainWindow;
+               wxMenuBar * menuBar;
+
+               // Constructor and destructor
+               TTEditFrame(wxFrame * parent, const wxString &title, const wxPoint &pos, const wxSize &size, long style);
+               ~TTEditFrame(void);
+
+               void OnCloseWindow(wxCloseEvent &e);
+               void OnOpen(wxCommandEvent &e);
+               void OnExit(wxCommandEvent &e);
+               void OnAbout(wxCommandEvent &e);
+               void OnCharWindow(wxCommandEvent &e);
+
+       DECLARE_EVENT_TABLE()
+#endif
+};
+
+#endif // __TTEDIT_H__