@@ -1186,7 +1186,7 @@ void regex_playground()
1186
1186
{ DI_EDIT, {{5 , 8 }, {45 , 8 }}, DIF_HISTORY, },
1187
1187
{ DI_TEXT, {{5 , 9 }, {0 , 9 }}, DIF_NONE, L" Result:" },
1188
1188
{ DI_EDIT, {{5 , 10 }, {45 ,10 }}, DIF_READONLY, },
1189
- { DI_LISTBOX, {{47 , 2 }, {70 ,11 }}, DIF_NONE , L" Matches" },
1189
+ { DI_LISTBOX, {{47 , 2 }, {70 ,11 }}, DIF_LISTNOCLOSE , L" Matches" },
1190
1190
{ DI_TEXT, {{5 , 11 }, {0 , 11 }}, DIF_NONE, L" Status:" },
1191
1191
{ DI_EDIT, {{5 , 12 }, {70 ,12 }}, DIF_READONLY, },
1192
1192
{ DI_TEXT, {{-1 ,13 }, {0 , 13 }}, DIF_SEPARATOR, },
@@ -1350,6 +1350,26 @@ void regex_playground()
1350
1350
return update_test ();
1351
1351
};
1352
1352
1353
+ const auto update_selection = [&](size_t const Index)
1354
+ {
1355
+ if (Dlg->SendMessage (DM_GETFOCUS, 0 , {}) != rp_list_matches)
1356
+ return ;
1357
+
1358
+ const auto & m = Match.Matches [Index];
1359
+
1360
+ EditorSelect Select
1361
+ {
1362
+ sizeof (Select),
1363
+ BTYPE_STREAM,
1364
+ 0 ,
1365
+ m.start ,
1366
+ m.end - m.start ,
1367
+ 1
1368
+ };
1369
+
1370
+ Dlg->SendMessage (DM_SETSELECTION, rp_edit_test, &Select);
1371
+ };
1372
+
1353
1373
switch (Msg)
1354
1374
{
1355
1375
case DN_CTLCOLORDLGITEM:
@@ -1380,6 +1400,12 @@ void regex_playground()
1380
1400
}
1381
1401
}
1382
1402
break ;
1403
+
1404
+ case DN_LISTCHANGE:
1405
+ if (Param1 == rp_list_matches)
1406
+ update_selection (std::bit_cast<size_t >(Param2));
1407
+
1408
+ break ;
1383
1409
}
1384
1410
1385
1411
return Dlg->DefProc (Msg, Param1, Param2);
0 commit comments