1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
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 "object_viewer.h"
22 #include "select_string.h"
25 /////////////////////////////////////////////////////////////////////////////
26 // CSelectString dialog
29 CSelectString::CSelectString(const std::vector
<std::string
>& vectString
, const std::string
&title
, CWnd
* pParent
, bool empty
)
30 : CDialog(CSelectString::IDD
, pParent
)
32 //{{AFX_DATA_INIT(CSelectString)
41 void CSelectString::DoDataExchange(CDataExchange
* pDX
)
43 CDialog::DoDataExchange(pDX
);
44 //{{AFX_DATA_MAP(CSelectString)
45 DDX_Control(pDX
, IDEMPTY
, EmptyCtrl
);
46 DDX_Control(pDX
, IDC_LIST
, ListCtrl
);
51 BEGIN_MESSAGE_MAP(CSelectString
, CDialog
)
52 //{{AFX_MSG_MAP(CSelectString)
53 ON_LBN_DBLCLK(IDC_LIST
, OnDblclkList
)
54 ON_LBN_SELCHANGE(IDC_LIST
, OnSelchangeList
)
55 ON_BN_CLICKED(IDEMPTY
, OnEmpty
)
59 /////////////////////////////////////////////////////////////////////////////
60 // CSelectString message handlers
62 void CSelectString::OnOK()
64 // TODO: Add extra validation here
71 void CSelectString::OnDblclkList()
73 // TODO: Add your control notification handler code here
78 BOOL
CSelectString::OnInitDialog()
80 CDialog::OnInitDialog();
83 SetWindowText(nlUtf8ToTStr(Title
));
86 EmptyCtrl
.ShowWindow (Empty
?SW_SHOW
:SW_HIDE
);
89 for (uint s
=0; s
<Strings
.size(); s
++)
90 ListCtrl
.InsertString(-1, nlUtf8ToTStr(Strings
[s
]));
92 return TRUE
; // return TRUE unless you set the focus to a control
93 // EXCEPTION: OCX Property Pages should return FALSE
96 void CSelectString::OnSelchangeList()
100 Selection
=ListCtrl
.GetCurSel ();
101 if (Selection
==LB_ERR
)
105 void CSelectString::OnEmpty()
107 // TODO: Add your control notification handler code here