1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // master.cpp : Defines the class behaviors for the application.
27 static char THIS_FILE
[] = __FILE__
;
34 /////////////////////////////////////////////////////////////////////////////
37 BEGIN_MESSAGE_MAP(CMasterApp
, CWinApp
)
38 //{{AFX_MSG_MAP(CMasterApp)
39 ON_COMMAND(ID_APP_ABOUT
, OnAppAbout
)
40 // NOTE - the ClassWizard will add and remove mapping macros here.
41 // DO NOT EDIT what you see in these blocks of generated code!
43 // Standard file based document commands
44 ON_COMMAND(ID_FILE_NEW
, CWinApp::OnFileNew
)
45 ON_COMMAND(ID_FILE_OPEN
, CWinApp::OnFileOpen
)
48 /////////////////////////////////////////////////////////////////////////////
49 // CMasterApp construction
51 CMasterApp::CMasterApp()
53 // TODO: add construction code here,
54 // Place all significant initialization in InitInstance
58 /////////////////////////////////////////////////////////////////////////////
59 // The one and only CMasterApp object
63 /////////////////////////////////////////////////////////////////////////////
64 // CMasterApp initialization
66 BOOL
CMasterApp::InitInstance()
68 AfxEnableControlContainer();
70 // Standard initialization
71 // If you are not using these features and wish to reduce the size
72 // of your final executable, you should remove from the following
73 // the specific initialization routines you do not need.
76 Enable3dControls(); // Call this when using MFC in a shared DLL
78 Enable3dControlsStatic(); // Call this when linking to MFC statically
81 // Change the registry key under which our settings are stored.
82 // TODO: You should modify this string to be something appropriate
83 // such as the name of your company or organization.
84 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
86 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
88 CMainFrame
*pMF
= new CMainFrame();
89 pMF
->LoadFrame(IDR_MAINFRAME
);
92 // Parse command line for standard shell commands, DDE, file open
93 CCommandLineInfo cmdInfo
;
94 ParseCommandLine(cmdInfo
);
96 // Dispatch commands specified on the command line
97 if (!ProcessShellCommand(cmdInfo
))
100 // The one and only window has been initialized, so show and update it.
101 m_pMainWnd
->ShowWindow(SW_SHOW
);
102 m_pMainWnd
->UpdateWindow();
107 BOOL
CMasterApp::PreTranslateMessage (MSG
*pMsg
)
109 if (m_pMainWnd
!= NULL
)
110 return ((CMainFrame
*)m_pMainWnd
)->PreTranslateMessage (pMsg
);
114 /////////////////////////////////////////////////////////////////////////////
115 // CAboutDlg dialog used for App About
117 class CAboutDlg
: public CDialog
123 //{{AFX_DATA(CAboutDlg)
124 enum { IDD
= IDD_ABOUTBOX
};
127 // ClassWizard generated virtual function overrides
128 //{{AFX_VIRTUAL(CAboutDlg)
130 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
135 //{{AFX_MSG(CAboutDlg)
136 // No message handlers
138 DECLARE_MESSAGE_MAP()
141 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD
)
143 //{{AFX_DATA_INIT(CAboutDlg)
147 void CAboutDlg::DoDataExchange(CDataExchange
* pDX
)
149 CDialog::DoDataExchange(pDX
);
150 //{{AFX_DATA_MAP(CAboutDlg)
154 BEGIN_MESSAGE_MAP(CAboutDlg
, CDialog
)
155 //{{AFX_MSG_MAP(CAboutDlg)
156 // No message handlers
160 // App command to run the dialog
161 void CMasterApp::OnAppAbout()
167 /////////////////////////////////////////////////////////////////////////////
168 // CMasterApp message handlers