2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
29 #include "../../idlib/precompiled.h"
38 static char THIS_FILE[] = __FILE__;
41 /////////////////////////////////////////////////////////////////////////////
45 CWaitDlg::CWaitDlg(CWnd* pParent, const char *msg)
46 : CDialog(CWaitDlg::IDD, pParent)
48 //{{AFX_DATA_INIT(CWaitDlg)
51 cancelPressed = false;
52 Create(CWaitDlg::IDD);
53 //g_pParentWnd->SetBusy(true);
56 CWaitDlg::~CWaitDlg() {
57 g_pParentWnd->SetBusy(false);
60 void CWaitDlg::DoDataExchange(CDataExchange* pDX)
62 CDialog::DoDataExchange(pDX);
63 //{{AFX_DATA_MAP(CWaitDlg)
64 DDX_Text(pDX, IDC_WAITSTR, waitStr);
69 BEGIN_MESSAGE_MAP(CWaitDlg, CDialog)
70 //{{AFX_MSG_MAP(CWaitDlg)
74 /////////////////////////////////////////////////////////////////////////////
75 // CWaitDlg message handlers
77 BOOL CWaitDlg::OnInitDialog()
79 CDialog::OnInitDialog();
80 //GetDlgItem(IDC_WAITSTR)->SetWindowText(waitStr);
81 GetDlgItem(IDC_WAITSTR)->SetFocus();
85 // cancel disabled by default
88 // TODO: Add extra initialization here
90 return TRUE; // return TRUE unless you set the focus to a control
91 // EXCEPTION: OCX Property Pages should return FALSE
94 void CWaitDlg::SetText(const char *msg, bool append) {
106 ShowWindow (SW_SHOWNORMAL);
109 void CWaitDlg::AllowCancel( bool enable ) {
110 // this shows or hides the Cancel button
111 CWnd* pCancelButton = GetDlgItem (IDCANCEL);
112 ASSERT (pCancelButton);
114 pCancelButton->ShowWindow (SW_NORMAL);
116 pCancelButton->ShowWindow (SW_HIDE);
120 bool CWaitDlg::CancelPressed( void ) {
122 MSG *msg = AfxGetCurrentMessage(); // TODO Robert fix me!!
124 MSG *msg = &m_msgCur;
127 while( ::PeekMessage(msg, NULL, NULL, NULL, PM_NOREMOVE) ) {
129 if ( !AfxGetApp()->PumpMessage() ) {
133 return cancelPressed;
136 void CWaitDlg::OnCancel() {
137 cancelPressed = true;