Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / leveldesign / master / ExportCBDlg.cpp
blob37e42546dc13df88243d78150fae58b29dfef156
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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
20 #include "stdafx.h"
21 #include "master.h"
22 #include "ExportCBDlg.h"
24 #ifdef _DEBUG
25 # ifdef new
26 # undef new
27 # endif
28 #define new DEBUG_NEW
29 #undef THIS_FILE
30 static char THIS_FILE[] = __FILE__;
31 #endif
33 /////////////////////////////////////////////////////////////////////////////
34 // CExportCB
36 /////////////////////////////////////////////////////////////////////////////
37 CExportCB::CExportCB()
39 _Canceled = false;
42 /////////////////////////////////////////////////////////////////////////////
43 void CExportCB::setExportCBDlg (CExportCBDlg *dlg)
45 _Dialog = dlg;
48 /////////////////////////////////////////////////////////////////////////////
49 void CExportCB::cancel ()
51 _Canceled = true;
54 /////////////////////////////////////////////////////////////////////////////
55 void CExportCB::pump()
57 MSG msg;
58 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
60 TranslateMessage (&msg);
61 DispatchMessage (&msg);
65 /////////////////////////////////////////////////////////////////////////////
66 bool CExportCB::isCanceled ()
68 pump();
69 return _Canceled;
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();
79 pump();
82 /////////////////////////////////////////////////////////////////////////////
83 void CExportCB::dispPassProgress (float percentage)
85 _Dialog->ProgressBar.SetPos ((sint32)(100*percentage));
86 _Dialog->UpdateData (FALSE); // Upload
87 pump();
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
95 pump();
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
103 pump();
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
111 pump();
114 /////////////////////////////////////////////////////////////////////////////
115 // CExportCBDlg dialog
118 /////////////////////////////////////////////////////////////////////////////
119 CExportCBDlg::CExportCBDlg(CWnd* pParent /*=NULL*/)
120 : CDialog(CExportCBDlg::IDD, pParent)
122 //{{AFX_DATA_INIT(CExportCBDlg)
123 PassText = _T("");
124 InfoText = _T("");
125 _Finished = false;
126 //}}AFX_DATA_INIT
129 /////////////////////////////////////////////////////////////////////////////
130 void CExportCBDlg::setFinishedButton ()
132 CButton *but = (CButton*)GetDlgItem (IDCANCEL);
133 but->SetWindowText ("FINISHED");
134 Invalidate ();
135 pump ();
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);
147 //}}AFX_DATA_MAP
151 BEGIN_MESSAGE_MAP(CExportCBDlg, CDialog)
152 //{{AFX_MSG_MAP(CExportCBDlg)
153 //}}AFX_MSG_MAP
154 END_MESSAGE_MAP()
156 /////////////////////////////////////////////////////////////////////////////
157 // CExportCBDlg message handlers
159 /////////////////////////////////////////////////////////////////////////////
160 void CExportCBDlg::OnCancel()
162 CButton *but = (CButton*)GetDlgItem (IDCANCEL);
163 CString zeText;
164 but->GetWindowText (zeText);
165 if (zeText == "Cancel")
166 _ExportCB.cancel ();
167 else
168 _Finished = true;
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