diff --git a/LUA_GenDialog.cpp b/LUA_GenDialog.cpp index 911b120..2220cff 100644 --- a/LUA_GenDialog.cpp +++ b/LUA_GenDialog.cpp @@ -190,21 +190,24 @@ CALLBACK UpdateDialogSelection( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara if ( hwndDlg == nullptr) return FALSE ; // recupero il testo dell'EDIT corretto - string sIds ; + string sSel ; AtoWEX<128> wsEdit( "") ; if ( GetDlgItemText( hwndDlg, nEditId, LPWSTR( wsEdit), 128) > 0) - sIds = wstrztoA( wsEdit) ; + sSel = wstrztoA( wsEdit) ; // deseleziono tutto ExeDeselectAll() ; - // seleziono gli ID contenuti - if ( ! sIds.empty()) { - STRVECTOR vsIds; - Tokenize( sIds, ",", vsIds) ; - for ( const string& s : vsIds) { - int nId = GDB_ID_NULL ; - if ( FromString( s, nId) && nId != GDB_ID_NULL) - ExeSelectObj( nId) ; + // seleziono gli Id contenuti + if ( ! sSel.empty()) { + INTVECTOR vIds ; + FromString( sSel, vIds) ; + string sOkSel = "" ; + for ( int nId : vIds) { + if ( ExeSelectObj( nId)) + sOkSel += ToString( nId) + "," ; } + if ( ! sOkSel.empty()) + sOkSel.pop_back() ; + SetDlgItemText( hwndDlg, nEditId, stringtoW( sOkSel)) ; } // aggiorno la grafica ed esco ExeDraw() ; @@ -562,7 +565,7 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam break ; case CTRL_BUTTON : if ( GetDlgItemText( hwndDlg, IDC_EDIT1 + i, LPWSTR( wsEdit), 128) > 0) - s_sEdit[i] = wstrztoA( wsEdit) ; + s_sEdit[i] = ValidateSelection( wstrztoA( wsEdit)) ; break ; } }