]> Shamusworld >> Repos - guemap/blob - src/mainwin.h
Fix room adding to work properly, misc. small changes.
[guemap] / src / mainwin.h
1 //
2 // GUEmap
3 // Copyright 1997-2007 by Christopher J. Madsen
4 // (C) 2019 James Hammons
5 //
6 // GUEmap is licensed under either version 2 of the GPL, or (at your option)
7 // any later version.  See LICENSE file for details.
8 //
9 // MainFrm.h: interface of the MainFrame class
10 //
11
12 #ifndef __MAINWIN_H__
13 #define __MAINWIN_H__
14
15 #include <QtWidgets>
16
17 // Useful definitions
18
19 #define MRU_MAX 10
20
21 class AboutWindow;
22 class MapView;
23 class RoomWidget;
24
25 //wants to be an MDI window... (And now is!!!)
26 class MainWin: public QMainWindow
27 {
28         // All Qt apps require this macro
29         Q_OBJECT
30
31         public:
32                 MainWin();
33
34         protected:
35                 void closeEvent(QCloseEvent * event);
36
37         protected slots:
38                 void FileNew(void);
39                 void FileOpen(void);
40                 void FileOpenRecent(void);
41                 void FileSaveBase(MapView *, QString);
42                 void FileSave(void);
43                 void FileSaveAs(void);
44                 void FileClose(void);
45                 void EditUndo(void);
46                 void MenuFixUndo(void);
47                 void EditDelete(void);
48                 void EditSelectAll(void);
49                 void HelpAbout(void);
50
51         private:
52                 void LoadFile(QString);
53                 void CreateActions(void);
54                 void CreateMenus(void);
55                 void CreateToolbars(void);
56                 void ReadSettings(void);
57                 void WriteSettings(void);
58                 void UpdateMRUActionList(void);
59                 void AdjustMRU(const QString & filePath);
60
61         public:
62 //              CDialogBar wndNavBar;
63                 QMdiArea mdiArea;
64                 QSettings settings;
65                 AboutWindow * aboutWin;
66                 RoomWidget * rw;
67                 QString documentName;
68
69         private:
70                 QAction * fileNewAct;
71                 QAction * fileOpenAct;
72                 QAction * fileSaveAct;
73                 QAction * fileSaveAsAct;
74                 QAction * fileCloseAct;
75                 QAction * exitAct;
76                 QAction * undoAct;
77                 QAction * deleteAct;
78                 QAction * selectAllAct;
79                 QAction * aboutAct;
80                 QList<QAction *> mruAct;
81 #if 0
82         public:
83 //              void setStatusBar(LPCTSTR text) {m_wndStatusBar.SetWindowText(text);};
84
85         // Overrides
86         // ClassWizard generated virtual function overrides
87         //{{AFX_VIRTUAL(CMainFrame)
88 //              virtual BOOL PreCreateWindow(CREATESTRUCT & cs);
89         //}}AFX_VIRTUAL
90
91         // Implementation
92 //      public:
93 //              ~MainFrame();
94
95 //              void DockControlBarLeftOf(CControlBar * Bar,CControlBar * LeftOf);
96
97         protected:  // control bar embedded members
98 //              CStatusBar  m_wndStatusBar;
99 //              CToolBar    m_wndToolBar;
100
101         // Generated message map functions
102         protected:
103 //              int OnCreate(LPCREATESTRUCT lpCreateStruct);
104 //              void OnActivateApp(BOOL bActive, HTASK hTask);
105 //              void OnDestroy();
106
107 //      DECLARE_MESSAGE_MAP();
108 #endif
109 };
110
111 #endif  // __MAINWIN_H__