EgtInterface 1.6a7 :

- aggiunta gestione nome file di progetto e suo stato
- aggiunta gestione pezzo e layer
- riordino generale.
This commit is contained in:
Dario Sassi
2015-01-30 08:16:05 +00:00
parent f039e22297
commit 0c41c8c631
20 changed files with 868 additions and 178 deletions
+41 -9
View File
@@ -30,7 +30,9 @@ __stdcall EgtSetLevel( int nId, int nLevel)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto il livello
return ( pGeomDB->SetLevel( nId, nLevel) ? TRUE : FALSE) ;
bool bOk = pGeomDB->SetLevel( nId, nLevel) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -40,7 +42,9 @@ __stdcall EgtRevertLevel( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// porto il livello allo stato precedente
return ( pGeomDB->RevertLevel( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->RevertLevel( nId) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -76,7 +80,9 @@ __stdcall EgtSetMode( int nId, int nMode)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto il modo
return ( pGeomDB->SetMode( nId, nMode) ? TRUE : FALSE) ;
bool bOk = pGeomDB->SetMode( nId, nMode) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -86,7 +92,9 @@ __stdcall EgtRevertMode( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// porto il modo allo stato precedente
return ( pGeomDB->RevertMode( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->RevertMode( nId) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -123,6 +131,16 @@ __stdcall EgtSetStatus( int nId, int nStat)
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto il modo
bool bOk = pGeomDB->SetStatus( nId, nStat) ;
// se nascosto pezzo corrente o layer corrente
if ( nStat == GDB_ST_OFF) {
int nCurrPartId = EgtGetCurrPart() ;
if ( nId == nCurrPartId)
EgtResetCurrPartLayer() ;
else if ( nId == EgtGetCurrLayer())
EgtSetCurrPartLayer( nCurrPartId, EgtGetFirstVisibleLayer( nCurrPartId)) ;
}
// dichiaro progetto modificato
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sStat = "'ON'" ;
@@ -146,7 +164,9 @@ __stdcall EgtRevertStatus( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// porto lo stato al valore precedente
return ( pGeomDB->RevertStatus( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->RevertStatus( nId) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -182,7 +202,9 @@ __stdcall EgtSetMark( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto l'evidenziazione
return ( pGeomDB->SetMark( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->SetMark( nId) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -192,7 +214,9 @@ __stdcall EgtResetMark( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// cancello l'evidenziazione
return ( pGeomDB->ResetMark( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->ResetMark( nId) ;
EgtSetModified() ;
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -258,6 +282,7 @@ __stdcall EgtSetColor( int nId, const int ObjCol[4])
nI = pGeomDB->GetNextSelectedObj() ;
}
}
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSetColor(" + ( nId != GDB_ID_SEL ? ToString( nId): "GDB_ID_SEL") + ",{" +
@@ -289,6 +314,7 @@ __stdcall EgtResetColor( int nId)
nI = pGeomDB->GetNextSelectedObj() ;
}
}
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtResetColor(" + ( nId != GDB_ID_SEL ? ToString( nId): "GDB_ID_SEL") + ")" +
@@ -352,6 +378,7 @@ EgtSetName( int nId, const string& sName)
VERIFY_GEOMDB( pGeomDB, false)
// assegno il nome
bool bOk = pGeomDB->SetName( nId, sName) ;
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSetName(" + ToString( nId) + ",'" +
@@ -368,7 +395,7 @@ BOOL
__stdcall EgtGetName( int nId, wchar_t*& wsName)
{
if ( &wsName == nullptr)
return false ;
return FALSE ;
string sName ;
if ( ! EgtGetName( nId, sName))
return FALSE ;
@@ -404,6 +431,7 @@ __stdcall EgtRemoveName( int nId)
VERIFY_GEOMDB( pGeomDB, FALSE)
// rimuovo il nome
bool bOk = pGeomDB->RemoveName( nId) ;
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemoveName(" + ToString( nId) + ")" +
@@ -429,6 +457,7 @@ EgtSetInfo( int nId, const string& sKey, const string& sInfo)
VERIFY_GEOMDB( pGeomDB, FALSE)
// assegno la info
bool bOk = pGeomDB->SetInfo( nId, sKey, sInfo) ;
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSetInfo(" + ToString( nId) + ",'" +
@@ -455,7 +484,9 @@ EgtSetInfo( int nId, const string& sKey, int nInfo)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// assegno la info
return pGeomDB->SetInfo( nId, sKey, nInfo) ;
bool bOk = pGeomDB->SetInfo( nId, sKey, nInfo) ;
EgtSetModified() ;
return bOk ;
}
//-----------------------------------------------------------------------------
@@ -532,6 +563,7 @@ EgtRemoveInfo( int nId, const string& sKey)
VERIFY_GEOMDB( pGeomDB, FALSE)
// rimuovo la info
bool bOk = pGeomDB->RemoveInfo( nId, sKey) ;
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemoveInfo(" + ToString( nId) + ",'" +