Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / tile_edit / DialogEditList.cpp
blob4a73b00f332fc42cdf2c050412742a6a6c9d2c2f
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 #include "stdafx.h"
18 #include "tile_edit_exe.h"
19 #include "DialogEditList.h"
20 #include <vector>
22 #ifdef _DEBUG
23 #define new DEBUG_NEW
24 #undef THIS_FILE
25 static char THIS_FILE[] = __FILE__;
26 #endif
28 /////////////////////////////////////////////////////////////////////////////
29 // CDialogEditList dialog
32 CDialogEditList::CDialogEditList(CWnd* pParent /*=NULL*/)
33 : CDialog(CDialogEditList::IDD, pParent)
35 //{{AFX_DATA_INIT(CDialogEditList)
36 //}}AFX_DATA_INIT
40 void CDialogEditList::DoDataExchange(CDataExchange* pDX)
42 CDialog::DoDataExchange(pDX);
43 //{{AFX_DATA_MAP(CDialogEditList)
44 DDX_Control(pDX, IDC_LIST1, m_ctrlList);
45 DDX_Control(pDX, IDC_COMBO1, m_ctrlCombo);
46 //}}AFX_DATA_MAP
50 BEGIN_MESSAGE_MAP(CDialogEditList, CDialog)
51 //{{AFX_MSG_MAP(CDialogEditList)
52 ON_BN_CLICKED(ID_ADD, OnAdd)
53 ON_BN_CLICKED(ID_DEL, OnDel)
54 //}}AFX_MSG_MAP
55 END_MESSAGE_MAP()
57 /////////////////////////////////////////////////////////////////////////////
58 // CDialogEditList message handlers
60 void CDialogEditList::OnAdd()
62 // TODO: Add your control notification handler code here
63 UpdateData ();
64 CString str;
65 m_ctrlCombo.GetWindowText (str);
66 if (m_ctrlList.FindStringExact (0, str)==LB_ERR)
68 m_ctrlList.InsertString (-1, str);
70 UpdateData (FALSE);
73 BOOL CDialogEditList::OnInitDialog()
75 CDialog::OnInitDialog();
77 OnInit ();
78 UpdateData ();
79 m_ctrlCombo.SetCurSel (0);
80 UpdateData (FALSE);
82 // TODO: Add extra initialization here
84 return TRUE; // return TRUE unless you set the focus to a control
85 // EXCEPTION: OCX Property Pages should return FALSE
88 void CDialogEditList::OnOK()
90 // TODO: Add extra validation here
91 OnOk ();
93 CDialog::OnOK();
96 void CDialogEditList::OnDel()
98 // TODO: Add your control notification handler code here
99 UpdateData ();
100 if (m_ctrlList.GetSelCount())
102 std::vector<int> vect (m_ctrlList.GetSelCount());
103 m_ctrlList.GetSelItems (m_ctrlList.GetSelCount(), &*vect.begin());
104 for (int i=m_ctrlList.GetSelCount()-1; i>=0; i--)
105 m_ctrlList.DeleteString (vect[i]);
106 m_ctrlCombo.SetCurSel (0);
108 UpdateData (FALSE);