From 2a149990befb5a0f7a39baa426012a2a2ecf1078 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 6 Aug 2016 19:17:41 +0000 Subject: [PATCH] EgtInterface 1.6t2 : - aggiunte EgtSetInfoBool, EgtGetInfoBool. --- API_GdbObjAttribs.cpp | 24 +++++++++++++++++++++++- API_Lua.cpp | 2 +- API_MachMgr.cpp | 4 ++-- API_Nesting.cpp | 2 +- EgtInterface.rc | Bin 11726 -> 11726 bytes 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/API_GdbObjAttribs.cpp b/API_GdbObjAttribs.cpp index cccd2b0..a5795db 100644 --- a/API_GdbObjAttribs.cpp +++ b/API_GdbObjAttribs.cpp @@ -159,7 +159,7 @@ __stdcall EgtSetColor( int nId, const int ObjCol[4], BOOL bSetAlpha) // sistemo il colore Color cCol( ObjCol) ; // eseguo - return ( ExeSetColor( vIds, cCol, (bSetAlpha != FALSE)) ? TRUE : FALSE) ; + return ( ExeSetColor( vIds, cCol, ( bSetAlpha != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- @@ -259,6 +259,13 @@ __stdcall EgtSetInfo( int nId, const wchar_t* wsKey, const wchar_t* wsInfo) return ( ExeSetInfo( nId, wstrztoA( wsKey), string( wstrztoA( wsInfo))) ? TRUE : FALSE) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetInfoBool( int nId, const wchar_t* wsKey, BOOL bInfo) +{ + return ( ExeSetInfo( nId, wstrztoA( wsKey), ( bInfo != FALSE)) ? TRUE : FALSE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtSetInfoInt( int nId, const wchar_t* wsKey, int nInfo) @@ -297,6 +304,21 @@ __stdcall EgtGetInfo( int nId, const wchar_t* wsKey, wchar_t*& wsInfo) return (( wsInfo == nullptr) ? FALSE : TRUE) ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetInfoBool( int nId, const wchar_t* wsKey, BOOL* pbInfo) +{ + // verifico il parametro + if ( pbInfo == nullptr) + return FALSE ; + // recupero info + bool bInfo ; + if ( ! ExeGetInfo( nId, wstrztoA( wsKey), bInfo)) + return FALSE ; + *pbInfo = ( bInfo ? TRUE : FALSE) ; + return TRUE ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtGetInfoInt( int nId, const wchar_t* wsKey, int* pnInfo) diff --git a/API_Lua.cpp b/API_Lua.cpp index 6d2057d..1ea5bda 100644 --- a/API_Lua.cpp +++ b/API_Lua.cpp @@ -31,7 +31,7 @@ __stdcall EgtLuaCreateGlobTable( const wchar_t* wsVar) BOOL __stdcall EgtLuaSetGlobBoolVar( const wchar_t* wsVar, BOOL bVal) { - return ( ExeLuaSetGlobBoolVar( wstrztoA( wsVar), ( bVal != FALSE ? true : false)) ? TRUE : FALSE) ; + return ( ExeLuaSetGlobBoolVar( wstrztoA( wsVar), ( bVal != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index d868082..a4f976d 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -906,7 +906,7 @@ __stdcall EgtSetAllOperationsMode( BOOL bActive) BOOL __stdcall EgtSetOperationStatus( int nId, BOOL bShow) { - return ( ExeSetOperationStatus( nId, bShow != FALSE) ? TRUE : FALSE) ; + return ( ExeSetOperationStatus( nId, ( bShow != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- @@ -953,7 +953,7 @@ __stdcall EgtGetPhaseDisposition( int nPhase) BOOL __stdcall EgtSpecialApplyDisposition( int nId, BOOL bRecalc) { - return ( ExeSpecialApplyDisposition( nId, bRecalc != FALSE) ? TRUE : FALSE) ; + return ( ExeSpecialApplyDisposition( nId, ( bRecalc != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- diff --git a/API_Nesting.cpp b/API_Nesting.cpp index cfbbaa6..cebd220 100644 --- a/API_Nesting.cpp +++ b/API_Nesting.cpp @@ -45,7 +45,7 @@ BOOL __stdcall EgtPackBox( int nId, double dXmin, double dYmin, double dXmax, double dYmax, double dOffs, BOOL bBottomUp) { - return ( ExePackBox( nId, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp != FALSE) ? TRUE : FALSE) ; + return ( ExePackBox( nId, dXmin, dYmin, dXmax, dYmax, dOffs, ( bBottomUp != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- diff --git a/EgtInterface.rc b/EgtInterface.rc index 7d2f84590f1d15fff2011bf32cee1a2d0b9459dc..84322e84108587e23814cfb0b25fd9c219492819 100644 GIT binary patch delta 113 zcmX>XeJ*;#A2vp#%@4(HGEKh5na5}}`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp?WhmtU delta 113 zcmX>XeJ*;#A2vqA%@4(HGEKh5na5~2`6H+9WG^L)&3#f*jGK>e8!&^VPclv3Cs+lM i-t491#khHcFjUGNr~*ls7YjlI&*XKAP&0v=TDSp=n<(7?