From 8e8bc1a5c1730ed47695d4061415329f532f7b9e Mon Sep 17 00:00:00 2001 From: Irwin Rodriguez Date: Sat, 9 May 2026 12:50:58 +0200 Subject: [PATCH] feature: implement ISPEN() and IMESTATUS() functions --- src/Runtime/XSharp.VFP.Tests/MiscTests.prg | 13 +++++ src/Runtime/XSharp.VFP/MiscFunctions.prg | 12 +++++ src/Runtime/XSharp.VFP/ToDo-HI.prg | 15 ------ .../XSharp.VFP/functionsToImplement.txt | 47 ++----------------- 4 files changed, 28 insertions(+), 59 deletions(-) diff --git a/src/Runtime/XSharp.VFP.Tests/MiscTests.prg b/src/Runtime/XSharp.VFP.Tests/MiscTests.prg index 88c59612a3..b1e701b209 100644 --- a/src/Runtime/XSharp.VFP.Tests/MiscTests.prg +++ b/src/Runtime/XSharp.VFP.Tests/MiscTests.prg @@ -331,6 +331,19 @@ BEGIN NAMESPACE XSharp.VFP.Tests Assert.True(nLine > 0) END METHOD + [Fact, Trait("Category", "UI")]; + METHOD IsPenTest() AS VOID + Assert.False(IsPen()) + END METHOD + + [Fact, Trait("Category", "UI")]; + METHOD ImeStatusTest() AS VOID + // No IME installed + Assert.Equal(0, ImeStatus()) + Assert.Equal(0, ImeStatus(0)) + Assert.Equal(0, ImeStatus(1)) + END METHOD + END CLASS END NAMESPACE diff --git a/src/Runtime/XSharp.VFP/MiscFunctions.prg b/src/Runtime/XSharp.VFP/MiscFunctions.prg index a034abc0d1..1061774bd8 100644 --- a/src/Runtime/XSharp.VFP/MiscFunctions.prg +++ b/src/Runtime/XSharp.VFP/MiscFunctions.prg @@ -225,3 +225,15 @@ FUNCTION IsNull(eExpression AS USUAL) AS LOGIC RETURN System.Convert.IsDBNull(eExpression) ENDFUNC + +/// +[FoxProFunction("IMESTATUS", FoxFunctionCategory.UIAndWindow, FoxEngine.UI, FoxFunctionStatus.Full, FoxCriticality.Low)]; +FUNCTION ImeStatus(nExpression := 0 AS LONG) AS LONG + RETURN 0 +ENDFUNC + +/// +[FoxProFunction("ISPEN", FoxFunctionCategory.EnvironmentAndSystem, FoxEngine.UI, FoxFunctionStatus.Full, FoxCriticality.Low)]; +FUNCTION IsPen() AS LOGIC + RETURN FALSE +ENDFUNC diff --git a/src/Runtime/XSharp.VFP/ToDo-HI.prg b/src/Runtime/XSharp.VFP/ToDo-HI.prg index b385849f62..d4de1e53e7 100644 --- a/src/Runtime/XSharp.VFP/ToDo-HI.prg +++ b/src/Runtime/XSharp.VFP/ToDo-HI.prg @@ -5,14 +5,6 @@ // #pragma options("vo15", on) - -/// -- todo -- -/// -[FoxProFunction("IMESTATUS", FoxFunctionCategory.UIAndWindow, FoxEngine.UI, FoxFunctionStatus.Stub, FoxCriticality.Low)]; -FUNCTION ImeStatus( nExpression ) AS LONG - THROW NotImplementedException{} - // RETURN 0 - /// -- todo -- /// [FoxProFunction("INDBC", FoxFunctionCategory.Database, FoxEngine.WorkArea, FoxFunctionStatus.Stub, FoxCriticality.Medium)]; @@ -48,13 +40,6 @@ FUNCTION IsMemoFetched( uField , uArea) AS LOGIC THROW NotImplementedException{} // RETURN FALSE -/// -- todo -- -/// -[FoxProFunction("ISPEN", FoxFunctionCategory.EnvironmentAndSystem, FoxEngine.UI, FoxFunctionStatus.Stub, FoxCriticality.Low)]; -FUNCTION IsPen( ) AS LOGIC - THROW NotImplementedException{} - // RETURN FALSE - /// -- todo -- /// [FoxProFunction("ISTRANSACTABLE", FoxFunctionCategory.Database, FoxEngine.WorkArea, FoxFunctionStatus.Stub, FoxCriticality.High)]; diff --git a/src/Runtime/XSharp.VFP/functionsToImplement.txt b/src/Runtime/XSharp.VFP/functionsToImplement.txt index ba27cb5729..01575d315d 100644 --- a/src/Runtime/XSharp.VFP/functionsToImplement.txt +++ b/src/Runtime/XSharp.VFP/functionsToImplement.txt @@ -42,84 +42,50 @@ A table must be written like this: In theory you can also include tables in the tags but that usually does not produce very nice documentation. We think it is better to include the tables in the section and to refer to that section in the tag. -List of functions that need work: -================================= +List of functions that need work (58 remaining): +================================================ ACLASS( ) -ADATABASES( ) ADBOBJECTS( ) -AGETFILEVERSION( ) -ALINES( ) -AMEMBERS( ) ANETRESOURCES( ) -APRINTERS( ) ASESSIONS( ) ASTACKINFO( ) -ASUBSCRIPT( ) -AT_C( ) ATAGINFO( ) -AUSED( ) -BINTOC( ) CANDIDATE( ) CAST( ) -COMPOBJ( ) COMPILE() CPCONVERT( ) -CREATEOBJECTEX( ) CREATEOFFLINE( ) -CTOBIN( ) -CTOT( ) CURSORGETPROP( ) CURSORSETPROP( ) CURSORTOXML( ) CURVAL( ) -DESCENDING( ) -DIFFERENCE( ) -DisplayPath( ) DODEFAULT( ) DROPOFFLINE( ) -EXECSCRIPT( ) -FIELD( ) // needs testing, no caption yet (needs DBC support) FLDLIST( ) FONTMETRIC( ) -FORCEEXT( ) -FORCEPATH( ) -FULLPATH( ) GETAUTOINCVALUE( ) GETCP( ) -GETDIR( ) -GETFILE( ) +GETCURSORADAPTER( ) GETFLDSTATE( ) -GETFONT( ) GETNEXTMODIFIED( ) GETOBJECT( ) -GETPICT( ) GETPRINTER( ) GETRESULTSET( ) -GETCURSORADAPTER( ) -IMESTATUS( ) INDBC( ) INDEXSEEK( ) INPUTBOX( ) -ISBLANK( ) ISEXCLUSIVE( ) ISMEMOFETCHED( ) -ISNULL( ) -ISPEN( ) ISTRANSACTABLE( ) KEYMATCH( ) -LINENO( ) -LOADPICTURE( ) LOCFILE( ) -LOCK( ) LOOKUP( ) MAKETRANSACTABLE( ) NEWOBJECT( ) -NORMALIZE( ) OLDVAL( ) PCOL( ) PRIMARY( ) -PROGRAM( ) PROW( ) PRTINFO( ) PUTFILE( ) @@ -129,18 +95,11 @@ REQUERY( ) RGBSCHEME( ) SAVEPICTURE( ) SCHEME( ) -SEEK( ) SETFLDSTATE( ) SETRESULTSET( ) -SQLIDLEDISCONNECT( ) -STRCONV( ) -STREXTRACT( ) -SYSMETRIC( ) TABLEREVERT( ) TABLEUPDATE( ) -TTOC( ) TXNLEVEL( ) TXTWIDTH( ) -VARTYPE( ) XMLTOCURSOR( ) XMLUPDATEGRAM( )