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/>.
18 #include "tile_edit_exe.h"
19 #include "DialogEditList.h"
25 static char THIS_FILE
[] = __FILE__
;
28 /////////////////////////////////////////////////////////////////////////////
29 // CDialogEditList dialog
32 CDialogEditList::CDialogEditList(CWnd
* pParent
/*=NULL*/)
33 : CDialog(CDialogEditList::IDD
, pParent
)
35 //{{AFX_DATA_INIT(CDialogEditList)
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
);
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
)
57 /////////////////////////////////////////////////////////////////////////////
58 // CDialogEditList message handlers
60 void CDialogEditList::OnAdd()
62 // TODO: Add your control notification handler code here
65 m_ctrlCombo
.GetWindowText (str
);
66 if (m_ctrlList
.FindStringExact (0, str
)==LB_ERR
)
68 m_ctrlList
.InsertString (-1, str
);
73 BOOL
CDialogEditList::OnInitDialog()
75 CDialog::OnInitDialog();
79 m_ctrlCombo
.SetCurSel (0);
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
96 void CDialogEditList::OnDel()
98 // TODO: Add your control notification handler code here
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);