Browse Source

Using Configuration.GetColor

git-svn-id: https://svn-dept.inf.ethz.ch/svn/lecturers/a2/trunk@8936 8c9fc860-2736-0410-a75d-ab315db34111
infsvn.sage 6 years ago
parent
commit
6e5528e0ce
2 changed files with 7 additions and 14 deletions
  1. 5 10
      source/PET.Mod
  2. 2 4
      source/TFPET.Mod

+ 5 - 10
source/PET.Mod

@@ -42,7 +42,7 @@ MODULE PET; (** AUTHOR "TF, PL"; PURPOSE "Programmer's Editing Tool"; *)
  *)
 
 IMPORT
-	KernelLog, KernelLogger, Modules, Commands, Options, Streams, Inputs, Files, WMRestorable, XML, XMLScanner, XMLParser, XMLObjects,
+	KernelLog, Modules, Commands, Options, Streams, Inputs, Files, WMRestorable, XML, XMLScanner, XMLParser, XMLObjects,
 	WMStandardComponents, WMGraphics, CompilerInterface, WhitespaceRemover,
 	WMComponents, WMRectangles, WMMessages, WMDialogs, WMDiagnostics,
 	WMTextView, WMEditors, Strings, TextUtilities, Texts,
@@ -312,18 +312,13 @@ TYPE
 			Configuration.GetBoolean("Applications.PET.General.EnableWhitespaceWarnings", enableWhitespaceWarnings, res);
 			Configuration.GetBoolean("Applications.PET.General.ShowLineNumbers", showLineNumbers, res);
 			Configuration.GetBoolean("Applications.PET.General.IndicateTabs", indicateTabs, res);
-			Configuration.Get("Applications.PET.General.CurrentLineColor", string, res);
+			Configuration.GetColor("Applications.PET.General.CurrentLineColor", temp, res);
 			IF (res = Configuration.Ok) THEN
-				Strings.TrimWS(string);
-				Strings.HexStrToInt(string, temp, res);
-				IF (res = Strings.Ok) THEN currentLineColor := temp; END;
+				currentLineColor := temp
 			END;
-
-			Configuration.Get("Applications.PET.General.BackgroundColor", string, res);
+			Configuration.GetColor("Applications.PET.General.BackgroundColor", temp, res);
 			IF (res = Configuration.Ok) THEN
-				Strings.TrimWS(string);
-				Strings.HexStrToInt(string, temp, res);
-				IF (res = Strings.Ok) THEN backgroundColor := temp; END;
+				backgroundColor := temp
 			END;
 
 			(* Compiler *)

+ 2 - 4
source/TFPET.Mod

@@ -310,11 +310,9 @@ TYPE
 			Configuration.GetBoolean("Applications.PET.General.EnableWhitespaceWarnings", enableWhitespaceWarnings, res);
 			Configuration.GetBoolean("Applications.PET.General.ShowLineNumbers", showLineNumbers, res);
 			Configuration.GetBoolean("Applications.PET.General.IndicateTabs", indicateTabs, res);
-			Configuration.Get("Applications.PET.General.CurrentLineColor", string, res);
+			Configuration.GetColor("Applications.PET.General.CurrentLineColor", temp, res);
 			IF (res = Configuration.Ok) THEN
-				Strings.TrimWS(string);
-				Strings.HexStrToInt(string, temp, res);
-				IF (res = Strings.Ok) THEN currentLineColor := temp; END;
+				currentLineColor := temp
 			END;
 
 			(* Compiler *)