EgtExecutor 1.9c3 :
- aggiunta a Exe funzione ExeTextGetFont - aggiunte a Lua funzioni EgtTextGetContent e EgtTextGetFont.
This commit is contained in:
@@ -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
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
Binary file not shown.
@@ -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 ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user