diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 976034a..79450a6 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_General.cpp b/LUA_General.cpp index 42eebf4..94ba5df 100644 --- a/LUA_General.cpp +++ b/LUA_General.cpp @@ -26,6 +26,7 @@ #include "/EgtDev/Include/EgtPerfCounter.h" #include "/EgtDev/Include/EgtIniFile.h" #include "/EgtDev/Include/EgtStringConverter.h" +#include "Windowsx.h" using namespace std ; @@ -602,6 +603,7 @@ static int s_nCtrls = 0 ; static string s_sCaption ; static string s_sText[MAX_CTRLS] ; static string s_sEdit[MAX_CTRLS] ; +static bool s_bCBox[MAX_CTRLS] ; //------------------------------------------------------------------------------- BOOL @@ -629,11 +631,27 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam for ( int i = 0 ; i < MAX_CTRLS ; ++ i) { if ( i < s_nCtrls) { SetDlgItemText( hwndDlg, IDC_TEXT1 + i, stringtoW( s_sText[i])) ; - SetDlgItemText( hwndDlg, IDC_EDIT1 + i, stringtoW( s_sEdit[i])) ; + if ( s_sEdit[i].find( "CB:") != 0) { + SetDlgItemText( hwndDlg, IDC_EDIT1 + i, stringtoW( s_sEdit[i])) ; + ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ; + s_bCBox[i] = false ; + } + else { + string sList = s_sEdit[i].substr( 3) ; + STRVECTOR vsVal ; + Tokenize( sList, ",", vsVal) ; + HWND hwndCBox = GetDlgItem( hwndDlg, IDC_COMBO1 + i) ; + for ( int j = 0 ; j < int( vsVal.size()) ; ++ j) + ComboBox_AddString( hwndCBox, stringtoW( vsVal[j])) ; + ComboBox_SetCurSel( hwndCBox, 0) ; + ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ; + s_bCBox[i] = true ; + } } else { ShowWindow( GetDlgItem( hwndDlg, IDC_TEXT1 + i), SW_HIDE) ; ShowWindow( GetDlgItem( hwndDlg, IDC_EDIT1 + i), SW_HIDE) ; + ShowWindow( GetDlgItem( hwndDlg, IDC_COMBO1 + i), SW_HIDE) ; } } break ; @@ -642,10 +660,15 @@ CALLBACK DialogBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam case IDOK : for ( int i = 0 ; i < s_nCtrls ; ++ i) { AtoWEX<128> wsEdit( "") ; - if ( GetDlgItemText( hwndDlg, IDC_EDIT1 + i, LPWSTR( wsEdit), 128) > 0) - s_sEdit[i] = wstrztoA( wsEdit) ; - else - s_sEdit[i] = "" ; + s_sEdit[i] = "" ; + if ( ! s_bCBox[i]) { + if ( GetDlgItemText( hwndDlg, IDC_EDIT1 + i, LPWSTR( wsEdit), 128) > 0) + s_sEdit[i] = wstrztoA( wsEdit) ; + } + else { + if ( GetDlgItemText( hwndDlg, IDC_COMBO1 + i, LPWSTR( wsEdit), 128) > 0) + s_sEdit[i] = wstrztoA( wsEdit) ; + } } // continua di seguito case IDCANCEL : diff --git a/resource.h b/resource.h index 653332c..add2a5f 100644 Binary files a/resource.h and b/resource.h differ