Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / tile_edit / choose_veget_set.cpp
blob2ed8f570d49c6dce3deb9adc3226c951a22ad44e
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "stdafx.h"
21 #include "tile_edit_exe.h"
22 #include "choose_veget_set.h"
24 #ifdef _DEBUG
25 #define new DEBUG_NEW
26 #undef THIS_FILE
27 static char THIS_FILE[] = __FILE__;
28 #endif
30 /////////////////////////////////////////////////////////////////////////////
31 // CChooseVegetSet dialog
34 CChooseVegetSet::CChooseVegetSet(SelectionTerritoire* pParent, const std::string &oldFile)
35 : CDialog((UINT)CChooseVegetSet::IDD, (CWnd*)pParent)
37 //{{AFX_DATA_INIT(CChooseVegetSet)
38 // NOTE: the ClassWizard will add member initialization here
39 //}}AFX_DATA_INIT
40 FileName = oldFile;
41 Parent = pParent;
45 void CChooseVegetSet::DoDataExchange(CDataExchange* pDX)
47 CDialog::DoDataExchange(pDX);
48 //{{AFX_DATA_MAP(CChooseVegetSet)
49 DDX_Control(pDX, IDC_BROWSE, Name);
50 //}}AFX_DATA_MAP
54 BEGIN_MESSAGE_MAP(CChooseVegetSet, CDialog)
55 //{{AFX_MSG_MAP(CChooseVegetSet)
56 ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
57 ON_BN_CLICKED(IDRESET, OnReset)
58 //}}AFX_MSG_MAP
59 END_MESSAGE_MAP()
61 /////////////////////////////////////////////////////////////////////////////
62 // CChooseVegetSet message handlers
64 void CChooseVegetSet::OnBrowse()
66 // Select a veget set
67 static TCHAR BASED_CODE szFilter[] = _T("NeL VegetSet Files (*.vegetset)|*.vegetset|All Files (*.*)|*.*||");
69 // Create a file dialog
70 CFileDialog dialog ( TRUE, _T("*.vegetset"), _T("*.vegetset"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter, (CWnd*)Parent);
71 if (dialog.DoModal() == IDOK)
73 // Get the file name
74 FileName = NLMISC::tStrToUtf8(dialog.GetFileName());
75 Name.SetWindowText(nlUtf8ToTStr(FileName));
79 BOOL CChooseVegetSet::OnInitDialog()
81 CDialog::OnInitDialog();
83 if (!FileName.empty())
84 Name.SetWindowText(nlUtf8ToTStr(FileName));
85 else
86 Name.SetWindowText (_T("Browse..."));
88 return TRUE; // return TRUE unless you set the focus to a control
89 // EXCEPTION: OCX Property Pages should return FALSE
92 void CChooseVegetSet::OnReset()
94 FileName.clear();
95 Name.SetWindowText (_T("Browse..."));