-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExitAppCmd.hpp
57 lines (44 loc) · 1.12 KB
/
ExitAppCmd.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
////////////////////////////////////////////////////////////////////////////////
//! \file ExitAppCmd.hpp
//! \brief The ExitAppCmd class declaration.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef APP_EXITAPPCMD_HPP
#define APP_EXITAPPCMD_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include <WCL/UiCommandBase.hpp>
#include "AppWnd.hpp"
////////////////////////////////////////////////////////////////////////////////
//! The command to exit the application.
class ExitAppCmd : public WCL::UiCommandBase
{
public:
//! Constructor.
ExitAppCmd(AppWnd& appWnd);
//
// IUiCommand methods.
//
//! Execute the command.
virtual void execute();
private:
//
// Members.
//
AppWnd& m_appWnd; //! The app window.
};
////////////////////////////////////////////////////////////////////////////////
//! Constructor.
inline ExitAppCmd::ExitAppCmd(AppWnd& appWnd)
: WCL::UiCommandBase(ID_FILE_EXIT)
, m_appWnd(appWnd)
{
}
////////////////////////////////////////////////////////////////////////////////
//! Execute the command.
inline void ExitAppCmd::execute()
{
m_appWnd.Close();
}
#endif // APP_EXITAPPCMD_HPP