]> Shamusworld >> Repos - guemap/blob - src/mainwin.h
Add MRU file list, adjustments to room edge labels.
[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 //              QAction * Act;
81                 QList<QAction *> mruAct;
82 #if 0
83         public:
84 //              void setStatusBar(LPCTSTR text) {m_wndStatusBar.SetWindowText(text);};
85
86         // Overrides
87         // ClassWizard generated virtual function overrides
88         //{{AFX_VIRTUAL(CMainFrame)
89 //              virtual BOOL PreCreateWindow(CREATESTRUCT & cs);
90         //}}AFX_VIRTUAL
91
92         // Implementation
93 //      public:
94 //              ~MainFrame();
95
96 //              void DockControlBarLeftOf(CControlBar * Bar,CControlBar * LeftOf);
97
98         protected:  // control bar embedded members
99 //              CStatusBar  m_wndStatusBar;
100 //              CToolBar    m_wndToolBar;
101
102         // Generated message map functions
103         protected:
104 //              int OnCreate(LPCREATESTRUCT lpCreateStruct);
105 //              void OnActivateApp(BOOL bActive, HTASK hTask);
106 //              void OnDestroy();
107
108 //      DECLARE_MESSAGE_MAP();
109 #endif
110 };
111
112 #endif  // __MAINWIN_H__
113