2
0
Эх сурвалжийг харах

Add new HighContrastActive support function.

Martijn Laan 1 долоо хоног өмнө
parent
commit
6490c2510c

+ 1 - 0
Examples/CodeClasses.iss

@@ -249,6 +249,7 @@ begin
   LinkLabel.Anchors := [akLeft, akRight, akBottom];
   LinkLabel.Caption := 'TNew<a id="jrsoftware">Link</a>Label with more text and an adjusted label height so it''s multi-line with a second <a id="jrsoftware">link</a> on the second line.';
   LinkLabel.Width := StaticText2.Width;
+  LinkLabel.UseVisualStyle := HighContrastActive;
   LinkLabel.OnLinkClick := @LinkLabelOnLinkClick;
   LinkLabel.Parent := Page.Surface;
   LinkLabel.AdjustHeight;

+ 4 - 0
Projects/Src/Setup.ScriptFunc.pas

@@ -790,6 +790,10 @@ var
       var N := Stack.GetString(PStart-2);
       Stack.SetBool(PStart, WildcardMatch(PChar(S), PChar(N)));
     end);
+    RegisterScriptFunc('HighContrastActive', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
+    begin
+      Stack.SetBool(PStart, HighContrastActive);
+    end);
   end;
 
   procedure RegisterInstallScriptFuncs;

+ 3 - 2
Projects/Src/Shared.ScriptFunc.pas

@@ -287,7 +287,7 @@ initialization
     'function RegQueryMultiStringValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;',
     'function RegDeleteKeyIncludingSubkeys(const RootKey: Integer; const SubkeyName: String): Boolean;',
     'function RegDeleteKeyIfEmpty(const RootKey: Integer; const SubkeyName: String): Boolean;',
-    //not really in CmnFunc2
+    //not really in CommonFunc
     'function RegKeyExists(const RootKey: Integer; const SubKeyName: String): Boolean;',
     'function RegDeleteValue(const RootKey: Integer; const SubKeyName, ValueName: String): Boolean;',
     'function RegGetSubkeyNames(const RootKey: Integer; const SubKeyName: String; var Names: TArrayOfString): Boolean;',
@@ -310,7 +310,8 @@ initialization
     'function CharLength(const S: String; const Index: Integer): Integer;',
     'function SetNTFSCompression(const FileOrDir: String; Compress: Boolean): Boolean;',
     'function IsWildcard(const Pattern: String): Boolean;',
-    'function WildcardMatch(const Text, Pattern: String): Boolean;'
+    'function WildcardMatch(const Text, Pattern: String): Boolean;',
+    'function HighContrastActive: Boolean;'
   ];
 
   ScriptFuncTables[sftInstall] :=

+ 1 - 1
whatsnew.htm

@@ -81,7 +81,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
   <li>Added dark mode support for command line options /cc and /wizard.</li>
 </ul>
 </li>
-<li>Pascal Scripting: Added new <tt>LogFmt</tt> support function.</li>
+<li>Pascal Scripting: Added new <tt>HighContrastActive</tt> and <tt>LogFmt</tt> support functions.</li>
 <li>Minor tweaks and fixes.</li>
 </ul>