From 0f522e8d81c63b8f2ce3a6f9371294bf177f62db Mon Sep 17 00:00:00 2001 From: Maxim Ganetsky Date: Wed, 12 Jul 2023 01:23:24 +0300 Subject: [PATCH] Removed unit UITypes from LazUtils. Use System.UITypes instead. Try 2. --- components/buildintf/lazmsgworker.pas | 2 +- components/buildintf/packageintf.pas | 3 +- components/buildintf/packagelinkintf.pas | 3 +- components/buildintf/projectintf.pas | 3 +- components/ideintf/propedits.pp | 4 +- components/lazutils/fpmake.pp | 2 - components/lazutils/lazutils.lpk | 4 - components/lazutils/lazutils.pas | 3 +- components/lazutils/uitypes.pas | 111 ----------------------- ide/lazbuild.lpr | 4 +- lcl/controls.pp | 6 +- lcl/dialogs.pp | 44 ++++----- lcl/interfaces/win32/win32wsdialogs.pp | 6 +- 13 files changed, 37 insertions(+), 158 deletions(-) delete mode 100644 components/lazutils/uitypes.pas diff --git a/components/buildintf/lazmsgworker.pas b/components/buildintf/lazmsgworker.pas index c730b994b0..cec45dad72 100644 --- a/components/buildintf/lazmsgworker.pas +++ b/components/buildintf/lazmsgworker.pas @@ -6,7 +6,7 @@ interface uses // LazUtils - UITypes; + System.UITypes; type TLazMessageWorker = function(const aCaption, aMsg: string; diff --git a/components/buildintf/packageintf.pas b/components/buildintf/packageintf.pas index d6e4c1dcbb..2d84d287be 100644 --- a/components/buildintf/packageintf.pas +++ b/components/buildintf/packageintf.pas @@ -16,8 +16,7 @@ unit PackageIntf; interface uses - Classes, SysUtils, Contnrs, - {$IF FPC_FULLVERSION >= 30200}System.{$ENDIF}UITypes, + Classes, SysUtils, Contnrs, System.UITypes, // LazUtils LazConfigStorage, LazMethodList, LazLoggerBase, // BuildIntf diff --git a/components/buildintf/packagelinkintf.pas b/components/buildintf/packagelinkintf.pas index aa151a3e3b..8387be3529 100644 --- a/components/buildintf/packagelinkintf.pas +++ b/components/buildintf/packagelinkintf.pas @@ -5,8 +5,7 @@ unit PackageLinkIntf; interface uses - SysUtils, Classes, - {$IF FPC_FULLVERSION >= 30200}System.{$ENDIF}UITypes, + SysUtils, Classes, System.UITypes, // LazUtils LazFileUtils, // BuildIntf diff --git a/components/buildintf/projectintf.pas b/components/buildintf/projectintf.pas index c2f9e5ac0f..af812c3c6e 100644 --- a/components/buildintf/projectintf.pas +++ b/components/buildintf/projectintf.pas @@ -16,8 +16,7 @@ unit ProjectIntf; interface uses - Classes, SysUtils, Contnrs, - {$IF FPC_FULLVERSION >= 30200}System.{$ENDIF}UITypes, + Classes, SysUtils, Contnrs, System.UITypes, // LazUtils FileUtil, LazFileUtils, LazFileCache, LazMethodList, AvgLvlTree, // BuildIntf diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index 2a232513bc..a296eed0f2 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -24,7 +24,7 @@ interface uses // RTL / FCL Classes, TypInfo, SysUtils, types, RtlConsts, variants, Contnrs, strutils, FGL, - Math, + Math, System.UITypes, // LCL LCLType, LCLIntf, LCLProc, Forms, Controls, ButtonPanel, Graphics, StdCtrls, Buttons, Menus, ExtCtrls, ComCtrls, Dialogs, EditBtn, Grids, ValEdit, @@ -33,7 +33,7 @@ uses CheckBoxThemed, // LazUtils FileUtil, StringHashList, LazMethodList, LazLoggerBase, LazUtilities, LazStringUtils, - GraphType, UITypes, FPCAdds, // for StrToQWord in older fpc versions + GraphType, FPCAdds, // for StrToQWord in older fpc versions // IdeIntf ObjInspStrConsts, PropEditUtils, TextTools, // Forms with .lfm files diff --git a/components/lazutils/fpmake.pp b/components/lazutils/fpmake.pp index 27d6f9c5d4..b5dac77ced 100644 --- a/components/lazutils/fpmake.pp +++ b/components/lazutils/fpmake.pp @@ -113,7 +113,6 @@ begin D := T.Dependencies.AddUnit('StringHashList'); D := T.Dependencies.AddUnit('TextStrings'); D := T.Dependencies.AddUnit('Translations'); - D := T.Dependencies.AddUnit('UITypes'); D := T.Dependencies.AddInclude('unixfileutil.inc'); D := T.Dependencies.AddInclude('unixlazfileutils.inc'); D := T.Dependencies.AddInclude('unixlazutf8.inc'); @@ -180,7 +179,6 @@ begin T := P.Targets.AddImplicitUnit('stringhashlist.pas'); T := P.Targets.AddImplicitUnit('textstrings.pas'); T := P.Targets.AddImplicitUnit('translations.pas'); - T := P.Targets.AddImplicitUnit('uitypes.pas'); T := P.Targets.AddImplicitUnit('utf8process.pp'); // copy the compiled file, so the IDE knows how the package was compiled diff --git a/components/lazutils/lazutils.lpk b/components/lazutils/lazutils.lpk index 862d4d50b1..254683dd70 100644 --- a/components/lazutils/lazutils.lpk +++ b/components/lazutils/lazutils.lpk @@ -294,10 +294,6 @@ - - - - diff --git a/components/lazutils/lazutils.pas b/components/lazutils/lazutils.pas index 6f97633594..db81e62eae 100644 --- a/components/lazutils/lazutils.pas +++ b/components/lazutils/lazutils.pas @@ -19,8 +19,7 @@ uses LazPasReadUtil, LazStringUtils, LazSysUtils, LazTracer, LazUnicode, LazUTF16, LazUTF8, LazUtilities, LazUtilsStrConsts, LazVersion, LConvEncoding, LCSVUtils, LookupStringList, Maps, Masks, ObjectLists, - StringHashList, TextStrings, Translations, UITypes, UTF8Process, - LazarusPackageIntf; + StringHashList, TextStrings, Translations, UTF8Process, LazarusPackageIntf; implementation diff --git a/components/lazutils/uitypes.pas b/components/lazutils/uitypes.pas deleted file mode 100644 index 92d59bb13d..0000000000 --- a/components/lazutils/uitypes.pas +++ /dev/null @@ -1,111 +0,0 @@ -unit UITypes -{$IF FPC_FULLVERSION >= 30200} -deprecated 'Use System.UITypes instead (available since FPC 3.2.0)'; - -{$mode objfpc}{$H+} - -interface - -uses - System.UITypes; - -const - mtWarning = System.UITypes.TMsgDlgType.mtWarning; - mtError = System.UITypes.TMsgDlgType.mtError; - mtInformation = System.UITypes.TMsgDlgType.mtInformation; - mtConfirmation = System.UITypes.TMsgDlgType.mtConfirmation; - mtCustom = System.UITypes.TMsgDlgType.mtCustom; - - mbYes = System.UITypes.TMsgDlgBtn.mbYes; - mbNo = System.UITypes.TMsgDlgBtn.mbNo; - mbOK = System.UITypes.TMsgDlgBtn.mbOK; - mbCancel = System.UITypes.TMsgDlgBtn.mbCancel; - mbAbort = System.UITypes.TMsgDlgBtn.mbAbort; - mbRetry = System.UITypes.TMsgDlgBtn.mbRetry; - mbIgnore = System.UITypes.TMsgDlgBtn.mbIgnore; - mbAll = System.UITypes.TMsgDlgBtn.mbAll; - mbNoToAll = System.UITypes.TMsgDlgBtn.mbNoToAll; - mbYesToAll = System.UITypes.TMsgDlgBtn.mbYesToAll; - mbHelp = System.UITypes.TMsgDlgBtn.mbHelp; - mbClose = System.UITypes.TMsgDlgBtn.mbClose; - -type - // Message dialog related - TMsgDlgType = System.UITypes.TMsgDlgType; - TMsgDlgBtn = System.UITypes.TMsgDlgBtn; - TMsgDlgButtons = set of System.UITypes.TMsgDlgBtn; - - // ModalResult - TModalResult = System.UITypes.TModalResult; - PModalResult = System.UITypes.PModalResult; - -const - // Used for ModalResult - mrNone = System.UITypes.mrNone; - mrOK = System.UITypes.mrOK; - mrCancel = System.UITypes.mrCancel; - mrAbort = System.UITypes.mrAbort; - mrRetry = System.UITypes.mrRetry; - mrIgnore = System.UITypes.mrIgnore; - mrYes = System.UITypes.mrYes; - mrNo = System.UITypes.mrNo; - mrAll = System.UITypes.mrAll; - mrNoToAll = System.UITypes.mrNoToAll; - mrYesToAll = System.UITypes.mrYesToAll; - mrClose = System.UITypes.mrClose; - mrLast = System.UITypes.mrLast; -{$ELSE} -; - -{$mode objfpc}{$H+} - -interface - -type - // Message dialog related - TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); - TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, - mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); - TMsgDlgButtons = set of TMsgDlgBtn; - - // ModalResult - TModalResult = low(Integer)..high(Integer); - PModalResult = ^TModalResult; - -const - // Used for ModalResult - mrNone = 0; - mrOK = mrNone + 1; - mrCancel = mrNone + 2; - mrAbort = mrNone + 3; - mrRetry = mrNone + 4; - mrIgnore = mrNone + 5; - mrYes = mrNone + 6; - mrNo = mrNone + 7; - mrAll = mrNone + 8; - mrNoToAll = mrNone + 9; - mrYesToAll = mrNone + 10; - mrClose = mrNone + 11; - mrLast = mrClose; -{$ENDIF} - - // String representation of ModalResult values - ModalResultStr: array[mrNone..mrLast] of shortstring = ( - 'mrNone', - 'mrOk', - 'mrCancel', - 'mrAbort', - 'mrRetry', - 'mrIgnore', - 'mrYes', - 'mrNo', - 'mrAll', - 'mrNoToAll', - 'mrYesToAll', - 'mrClose'); - - -implementation - -end. - diff --git a/ide/lazbuild.lpr b/ide/lazbuild.lpr index 3bbb0495da..3ad230e82b 100644 --- a/ide/lazbuild.lpr +++ b/ide/lazbuild.lpr @@ -28,11 +28,11 @@ uses {$IFDEF unix} cthreads, {$ENDIF} - Classes, SysUtils, math, CustApp, + Classes, SysUtils, Math, CustApp, System.UITypes, Interfaces, // this includes the NoGUI widgetset // LazUtils Masks, LConvEncoding, FileUtil, LazFileUtils, LazLoggerBase, LazUtilities, - LazUTF8, Laz2_XMLCfg, UITypes, LazStringUtils, + LazUTF8, Laz2_XMLCfg, LazStringUtils, // LCL LCLPlatformDef, Forms, // Codetools diff --git a/lcl/controls.pp b/lcl/controls.pp index 8b2004bb16..0cd3a39dfb 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -62,9 +62,9 @@ const mrClose = System.UITypes.mrClose; mrLast = System.UITypes.mrLast; -function GetModalResultStr(ModalResult: TModalResult): ShortString; - deprecated 'Use the ModalResultStr array from unit System.UITypes directly.'; -property ModalResultStr[ModalResult: TModalResult]: shortstring read GetModalResultStr; +//function GetModalResultStr(ModalResult: TModalResult): ShortString; +// deprecated 'Use the ModalResultStr array from unit System.UITypes directly.'; +//property ModalResultStr[ModalResult: TModalResult]: shortstring read GetModalResultStr; const // define aliases for Delphi compatibility diff --git a/lcl/dialogs.pp b/lcl/dialogs.pp index 24f69c5ac7..52db045c22 100644 --- a/lcl/dialogs.pp +++ b/lcl/dialogs.pp @@ -22,40 +22,40 @@ interface uses // RTL + FCL - Types, typinfo, Classes, SysUtils, + Types, TypInfo, Classes, SysUtils, System.UITypes, // LCL LMessages, LResources, LCLIntf, InterfaceBase, LCLStrConsts, LCLType, Forms, Controls, Themes, Graphics, Buttons, ButtonPanel, StdCtrls, ExtCtrls, LCLClasses, ClipBrd, Menus, LCLTaskDialog, DialogRes, // LazUtils - GraphType, UITypes, FileUtil, LazFileUtils, LazStringUtils, LazLoggerBase; + GraphType, FileUtil, LazFileUtils, LazStringUtils, LazLoggerBase; type // Aliases for types in UITypes. - TMsgDlgType = UITypes.TMsgDlgType; - TMsgDlgBtn = UITypes.TMsgDlgBtn; - TMsgDlgButtons = UITypes.TMsgDlgButtons; + TMsgDlgType = System.UITypes.TMsgDlgType; + TMsgDlgBtn = System.UITypes.TMsgDlgBtn; + TMsgDlgButtons = System.UITypes.TMsgDlgButtons; const // Aliases for enum values in UITypes. - mtWarning = UITypes.TMsgDlgType.mtWarning; - mtError = UITypes.TMsgDlgType.mtError; - mtInformation = UITypes.TMsgDlgType.mtInformation; - mtConfirmation = UITypes.TMsgDlgType.mtConfirmation; - mtCustom = UITypes.TMsgDlgType.mtCustom; + mtWarning = System.UITypes.TMsgDlgType.mtWarning; + mtError = System.UITypes.TMsgDlgType.mtError; + mtInformation = System.UITypes.TMsgDlgType.mtInformation; + mtConfirmation = System.UITypes.TMsgDlgType.mtConfirmation; + mtCustom = System.UITypes.TMsgDlgType.mtCustom; - mbYes = UITypes.TMsgDlgBtn.mbYes; - mbNo = UITypes.TMsgDlgBtn.mbNo; - mbOK = UITypes.TMsgDlgBtn.mbOK; - mbCancel = UITypes.TMsgDlgBtn.mbCancel; - mbAbort = UITypes.TMsgDlgBtn.mbAbort; - mbRetry = UITypes.TMsgDlgBtn.mbRetry; - mbIgnore = UITypes.TMsgDlgBtn.mbIgnore; - mbAll = UITypes.TMsgDlgBtn.mbAll; - mbNoToAll = UITypes.TMsgDlgBtn.mbNoToAll; - mbYesToAll = UITypes.TMsgDlgBtn.mbYesToAll; - mbHelp = UITypes.TMsgDlgBtn.mbHelp; - mbClose = UITypes.TMsgDlgBtn.mbClose; + mbYes = System.UITypes.TMsgDlgBtn.mbYes; + mbNo = System.UITypes.TMsgDlgBtn.mbNo; + mbOK = System.UITypes.TMsgDlgBtn.mbOK; + mbCancel = System.UITypes.TMsgDlgBtn.mbCancel; + mbAbort = System.UITypes.TMsgDlgBtn.mbAbort; + mbRetry = System.UITypes.TMsgDlgBtn.mbRetry; + mbIgnore = System.UITypes.TMsgDlgBtn.mbIgnore; + mbAll = System.UITypes.TMsgDlgBtn.mbAll; + mbNoToAll = System.UITypes.TMsgDlgBtn.mbNoToAll; + mbYesToAll = System.UITypes.TMsgDlgBtn.mbYesToAll; + mbHelp = System.UITypes.TMsgDlgBtn.mbHelp; + mbClose = System.UITypes.TMsgDlgBtn.mbClose; // Combinations of buttons. mbYesNoCancel = [mbYes, mbNo, mbCancel]; diff --git a/lcl/interfaces/win32/win32wsdialogs.pp b/lcl/interfaces/win32/win32wsdialogs.pp index 81ae6c56e7..6e46d4c291 100644 --- a/lcl/interfaces/win32/win32wsdialogs.pp +++ b/lcl/interfaces/win32/win32wsdialogs.pp @@ -30,12 +30,12 @@ uses //////////////////////////////////////////////////// // rtl Windows, shlobj, ShellApi, ActiveX, SysUtils, Classes, CommDlg, + {$ifdef DebugCommonDialogEvents} + System.UITypes, + {$endif} // lcl LCLProc, LCLType, Dialogs, Controls, Graphics, Forms, Masks, // LazUtils - {$ifdef DebugCommonDialogEvents} - UITypes, - {$endif} LazFileUtils, LazUTF8, // ws WSDialogs, WSLCLClasses, Win32Extra, Win32Int, InterfaceBase,