EgtExecutor 1.9c3 :

- aggiunta a Exe funzione ExeTextGetFont
- aggiunte a Lua funzioni EgtTextGetContent e EgtTextGetFont.
This commit is contained in:
Dario Sassi
2018-03-10 10:38:26 +00:00
parent 2bd359121f
commit d638f57a3d
3 changed files with 51 additions and 0 deletions
+15
View File
@@ -1302,6 +1302,21 @@ ExeTextGetContent( int nId, string& sText)
return true ;
}
//----------------------------------------------------------------------------
bool
ExeTextGetFont( int nId, string& sFont)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero il testo
const IExtText* pTxt = GetExtText( pGeomDB->GetGeoObj( nId)) ;
if ( pTxt == nullptr)
return false ;
// recupero il font
sFont = pTxt->GetFont() ;
return true ;
}
//-------------------------------------------------------------------------------
// Geo Transforms
//-------------------------------------------------------------------------------
BIN
View File
Binary file not shown.
+36
View File
@@ -938,6 +938,40 @@ LuaTextNormVersor( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaTextContent( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il contenuto
string sText ;
if ( ExeTextGetContent( nId, sText))
LuaSetParam( L, sText) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaTextFont( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il font
string sFont ;
if ( ExeTextGetFont( nId, sFont))
LuaSetParam( L, sFont) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGeoSnap( LuaMgr& luaMgr)
@@ -989,5 +1023,7 @@ LuaInstallGeoSnap( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapPartCount", LuaVolZmapPartCount) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapPartVolume", LuaVolZmapPartVolume) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTextNormVersor", LuaTextNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTextContent", LuaTextContent) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTextFont", LuaTextFont) ;
return bOk ;
}