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 // ExportCBDlg.cpp : implementation file
22 #include "ExportCBDlg.h"
30 static char THIS_FILE
[] = __FILE__
;
33 /////////////////////////////////////////////////////////////////////////////
36 /////////////////////////////////////////////////////////////////////////////
37 CExportCB::CExportCB()
42 /////////////////////////////////////////////////////////////////////////////
43 void CExportCB::setExportCBDlg (CExportCBDlg
*dlg
)
48 /////////////////////////////////////////////////////////////////////////////
49 void CExportCB::cancel ()
54 /////////////////////////////////////////////////////////////////////////////
55 void CExportCB::pump()
58 while (PeekMessage(&msg
, NULL
, 0, 0, PM_REMOVE
))
60 TranslateMessage (&msg
);
61 DispatchMessage (&msg
);
65 /////////////////////////////////////////////////////////////////////////////
66 bool CExportCB::isCanceled ()
72 /////////////////////////////////////////////////////////////////////////////
73 void CExportCB::dispPass (const std::string
&Text
)
75 _Dialog
->PassText
= Text
.c_str();
76 _Dialog
->ProgressBar
.SetPos (0);
77 _Dialog
->UpdateData (FALSE
); // Upload
78 _Dialog
->Invalidate();
82 /////////////////////////////////////////////////////////////////////////////
83 void CExportCB::dispPassProgress (float percentage
)
85 _Dialog
->ProgressBar
.SetPos ((sint32
)(100*percentage
));
86 _Dialog
->UpdateData (FALSE
); // Upload
90 /////////////////////////////////////////////////////////////////////////////
91 void CExportCB::dispInfo (const std::string
&Text
)
93 _Dialog
->InfoText
= CString(Text
.c_str()) + "\r\n" + _Dialog
->InfoText
;
94 _Dialog
->UpdateData (FALSE
); // Upload
98 /////////////////////////////////////////////////////////////////////////////
99 void CExportCB::dispWarning (const std::string
&Text
)
101 _Dialog
->InfoText
= CString("WARNING : ") + CString(Text
.c_str()) + "\r\n" + _Dialog
->InfoText
;
102 _Dialog
->UpdateData (FALSE
); // Upload
106 /////////////////////////////////////////////////////////////////////////////
107 void CExportCB::dispError (const std::string
&Text
)
109 _Dialog
->InfoText
= CString("ERROR : ") + CString(Text
.c_str()) + "\r\n" + _Dialog
->InfoText
;
110 _Dialog
->UpdateData (FALSE
); // Upload
114 /////////////////////////////////////////////////////////////////////////////
115 // CExportCBDlg dialog
118 /////////////////////////////////////////////////////////////////////////////
119 CExportCBDlg::CExportCBDlg(CWnd
* pParent
/*=NULL*/)
120 : CDialog(CExportCBDlg::IDD
, pParent
)
122 //{{AFX_DATA_INIT(CExportCBDlg)
129 /////////////////////////////////////////////////////////////////////////////
130 void CExportCBDlg::setFinishedButton ()
132 CButton
*but
= (CButton
*)GetDlgItem (IDCANCEL
);
133 but
->SetWindowText ("FINISHED");
138 /////////////////////////////////////////////////////////////////////////////
139 void CExportCBDlg::DoDataExchange(CDataExchange
* pDX
)
141 CDialog::DoDataExchange(pDX
);
142 //{{AFX_DATA_MAP(CExportCBDlg)
143 DDX_Control(pDX
, IDC_EDIT1
, EditCtrl
);
144 DDX_Control(pDX
, IDC_PROGRESS1
, ProgressBar
);
145 DDX_Text(pDX
, IDC_PASS
, PassText
);
146 DDX_Text(pDX
, IDC_EDIT1
, InfoText
);
151 BEGIN_MESSAGE_MAP(CExportCBDlg
, CDialog
)
152 //{{AFX_MSG_MAP(CExportCBDlg)
156 /////////////////////////////////////////////////////////////////////////////
157 // CExportCBDlg message handlers
159 /////////////////////////////////////////////////////////////////////////////
160 void CExportCBDlg::OnCancel()
162 CButton
*but
= (CButton
*)GetDlgItem (IDCANCEL
);
164 but
->GetWindowText (zeText
);
165 if (zeText
== "Cancel")
169 //CDialog::OnCancel();
172 /////////////////////////////////////////////////////////////////////////////
173 BOOL
CExportCBDlg::OnInitDialog()
175 CDialog::OnInitDialog();
177 // TODO: Add extra initialization here
178 _ExportCB
.setExportCBDlg (this);
179 ProgressBar
.SetRange (0, 100);
180 EditCtrl
.SetLimitText (200);
181 return TRUE
; // return TRUE unless you set the focus to a control
182 // EXCEPTION: OCX Property Pages should return FALSE