292361139a
- primo commit.
91 lines
2.8 KiB
C++
91 lines
2.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2026-2026
|
|
//----------------------------------------------------------------------------
|
|
// File : AuxDialogBox.cpp Data : 24.04.26 Versione : 3.1d4
|
|
// Contenuto : Funzioni DialogBox.
|
|
//
|
|
//
|
|
// Modifiche : 24.04.26 RE Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "EXE.h"
|
|
#include "EXE_Macro.h"
|
|
#include "AuxDialogBox.h"
|
|
#include "/EgtDev/Include/EGnStringUtils.h"
|
|
#include "/EgtDev/Include/EXeExecutor.h"
|
|
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
|
#include "/EgtDev/Include/EgtStringConverter.h"
|
|
|
|
using namespace std ;
|
|
|
|
#pragma comment( lib, "Comctl32.lib")
|
|
|
|
HWND phDlgModeless = nullptr ;
|
|
int nDlgModelessItem = -1 ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
UpdateIdsModelessDialog( HWND phDlgModeless, int nDlgModelessItem)
|
|
{
|
|
// se DialogBox Modeless non inizializzato, esco
|
|
if ( phDlgModeless == nullptr)
|
|
return false ;
|
|
// se Id del controllo da aggiornare non valido, esco
|
|
if ( nDlgModelessItem == -1)
|
|
return false ;
|
|
|
|
// recupero tutti gli elementi selezionati
|
|
string sIds ;
|
|
int nId = ExeGetFirstSelectedObj() ;
|
|
while ( nId != GDB_ID_NULL) {
|
|
sIds.append( ToString( nId) + string{","}) ;
|
|
nId = ExeGetNextSelectedObj() ;
|
|
}
|
|
if ( ! sIds.empty())
|
|
sIds.pop_back() ;
|
|
|
|
// aggiorno il contenuto nel dialogo
|
|
return ( SetDlgItemText( phDlgModeless, nDlgModelessItem, stringtoW( sIds))) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
LRESULT CALLBACK UpdateSelectionModelessDialog( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
|
|
{
|
|
if ( msg == WM_GETDLGCODE)
|
|
return DLGC_WANTALLKEYS ;
|
|
|
|
if ( msg == WM_KEYDOWN && wParam == VK_RETURN) {
|
|
// dwRefData contiene l'ID dell'EDIT
|
|
int nEditId = int( dwRefData) ;
|
|
HWND hwndDlg = GetParent(hwnd);
|
|
if ( hwndDlg == nullptr)
|
|
return FALSE ;
|
|
// recupero il testo dell'EDIT corretto
|
|
string sIds ;
|
|
AtoWEX<128> wsEdit( "") ;
|
|
if ( GetDlgItemText( hwndDlg, nEditId, LPWSTR( wsEdit), 128) > 0)
|
|
sIds = wstrztoA( wsEdit) ;
|
|
// deseleziono tutto
|
|
ExeDeselectAll() ;
|
|
// seleziono gli ID contenuti
|
|
if ( ! sIds.empty()) {
|
|
STRVECTOR vsIds;
|
|
Tokenize( sIds, ",", vsIds) ;
|
|
for ( auto& s : vsIds) {
|
|
int nId = GDB_ID_NULL ;
|
|
if ( FromString( s, nId) && nId != GDB_ID_NULL)
|
|
ExeSelectObj( nId) ;
|
|
}
|
|
}
|
|
// aggiorno la grafica ed esco
|
|
ExeDraw() ;
|
|
return TRUE ;
|
|
}
|
|
|
|
return ( DefSubclassProc(hwnd, msg, wParam, lParam)) ;
|
|
}
|