1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
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/>.
21 #include "tile_edit_exe.h"
22 #include "choose_veget_set.h"
27 static char THIS_FILE
[] = __FILE__
;
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
45 void CChooseVegetSet::DoDataExchange(CDataExchange
* pDX
)
47 CDialog::DoDataExchange(pDX
);
48 //{{AFX_DATA_MAP(CChooseVegetSet)
49 DDX_Control(pDX
, IDC_BROWSE
, Name
);
54 BEGIN_MESSAGE_MAP(CChooseVegetSet
, CDialog
)
55 //{{AFX_MSG_MAP(CChooseVegetSet)
56 ON_BN_CLICKED(IDC_BROWSE
, OnBrowse
)
57 ON_BN_CLICKED(IDRESET
, OnReset
)
61 /////////////////////////////////////////////////////////////////////////////
62 // CChooseVegetSet message handlers
64 void CChooseVegetSet::OnBrowse()
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
)
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
));
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()
95 Name
.SetWindowText (_T("Browse..."));