EgtExecutor 1.9e2 :
- aggiunta alla funzione lua EgtDialogBox la possibilità di gestire dei combobox.
This commit is contained in:
Binary file not shown.
+28
-5
@@ -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 :
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user