From 9d3f64653b0f255d3e7ac9d937587e46332d30a0 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 19 Mar 2018 08:47:50 +0000 Subject: [PATCH] jvcllaz: Avoid using Windows-specific units. Some cleanup. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6259 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jvcllaz/run/JvCore/JvComponent.pas | 2 +- .../jvcllaz/run/JvCore/JvExExtCtrls.pas | 2 ++ components/jvcllaz/run/JvCore/JvJCLUtils.pas | 8 +++--- components/jvcllaz/run/JvCore/JvJVCLUtils.pas | 3 ++- components/jvcllaz/run/JvCore/JvResources.pas | 2 +- .../jvcllaz/run/JvCtrls/JvMovableBevel.pas | 4 +-- .../run/JvCustomControls/jvoutlookbar.pas | 3 --- components/jvcllaz/run/JvDB/JvDBTreeView.pas | 10 +++---- .../jvcllaz/run/JvJans/JvMarkupCommon.pas | 11 -------- .../jvcllaz/run/JvJans/JvMarkupViewer.pas | 2 +- components/jvcllaz/run/JvJans/JvYearGrid.pas | 7 ----- .../jvcllaz/run/JvJans/JvYearGridEditForm.pas | 3 +-- .../run/JvPageComps/JvNavigationPane.pas | 5 ++-- .../jvcllaz/run/JvPageComps/JvPageList.pas | 5 ++-- .../run/JvRuntimeDesign/jvdesignclip.pas | 19 -------------- .../run/JvRuntimeDesign/jvdesignimp.pas | 26 +++---------------- .../jvcllaz/run/JvStdCtrls/JvButton.pas | 4 ++- .../jvcllaz/run/JvValidators/JvValidators.pas | 4 +-- components/jvcllaz/run/JvXPCtrls/JvXPBar.pas | 12 +++++---- .../jvcllaz/run/JvXPCtrls/JvXPContainer.pas | 3 ++- .../jvcllaz/run/JvXPCtrls/JvXPCoreUtils.pas | 5 ++-- 21 files changed, 44 insertions(+), 96 deletions(-) diff --git a/components/jvcllaz/run/JvCore/JvComponent.pas b/components/jvcllaz/run/JvCore/JvComponent.pas index 0bd2eddc4..0fb5edfc8 100644 --- a/components/jvcllaz/run/JvCore/JvComponent.pas +++ b/components/jvcllaz/run/JvCore/JvComponent.pas @@ -35,7 +35,7 @@ unit JvComponent; interface uses - Classes, Controls, Forms, LMessages, JvExControls; + Classes, Controls, Forms, JvExControls; type TJvGraphicControl = TJvExGraphicControl; diff --git a/components/jvcllaz/run/JvCore/JvExExtCtrls.pas b/components/jvcllaz/run/JvCore/JvExExtCtrls.pas index e46143a1b..42f680314 100644 --- a/components/jvcllaz/run/JvCore/JvExExtCtrls.pas +++ b/components/jvcllaz/run/JvCore/JvExExtCtrls.pas @@ -27,6 +27,8 @@ Known Issues: // Conversion is done in incremental way: as types / classes / routines // are needed they are converted. +{$mode objfpc}{$H+} + unit JvExExtCtrls; {MACROINCLUDE JvExControls.macros} diff --git a/components/jvcllaz/run/JvCore/JvJCLUtils.pas b/components/jvcllaz/run/JvCore/JvJCLUtils.pas index 094b298ff..c1b631111 100644 --- a/components/jvcllaz/run/JvCore/JvJCLUtils.pas +++ b/components/jvcllaz/run/JvCore/JvJCLUtils.pas @@ -46,7 +46,7 @@ interface // the JCL has the same problem with CLX it should not make any difference. uses - Classes, Graphics, LCLIntf, LCLType, LMessages; + Classes, Graphics, LCLIntf, LCLType; const (******************** NOT CONVERTED @@ -8284,11 +8284,11 @@ begin if hDLL <> 0 then begin Result := True; - (* You must get this function explicitly + { You must get this function explicitly because earlier versions of the DLL's don't implement this function. That makes the lack of implementation - of the function a version marker in itself. *) + of the function a version marker in itself. } @pDllGetVersion := GetProcAddress(hDLL, PChar('DllGetVersion')); if Assigned(pDllGetVersion) then begin @@ -8301,7 +8301,7 @@ begin pdwMinor := Dvi.dwMinorVersion; end; end - else (* If GetProcAddress failed, the DLL is a version previous to the one shipped with IE 3.x. *) + else { If GetProcAddress failed, the DLL is a version previous to the one shipped with IE 3.x. } begin pdwMajor := 4; pdwMinor := 0; diff --git a/components/jvcllaz/run/JvCore/JvJVCLUtils.pas b/components/jvcllaz/run/JvCore/JvJVCLUtils.pas index 1fd101861..4eb7bc9df 100644 --- a/components/jvcllaz/run/JvCore/JvJVCLUtils.pas +++ b/components/jvcllaz/run/JvCore/JvJVCLUtils.pas @@ -1541,8 +1541,9 @@ procedure CopyParentImage(Control: TControl; Dest: TCanvas); var I, Count, SaveIndex: Integer; DC: HDC; - R, SelfR, CtlR: TRect; + SelfR, CtlR: TRect; ViewPortOrg: TPoint; + R: TRect = (Left:0; Top:0; Right:0; Bottom:0); begin if (Control = nil) or (Control.Parent = nil) then Exit; diff --git a/components/jvcllaz/run/JvCore/JvResources.pas b/components/jvcllaz/run/JvCore/JvResources.pas index aad8a0ce8..a510349b8 100644 --- a/components/jvcllaz/run/JvCore/JvResources.pas +++ b/components/jvcllaz/run/JvCore/JvResources.pas @@ -28,7 +28,7 @@ Known Issues: unit JvResources; -//{.$I jvcl.inc} +{$mode objfpc}{$H+} interface diff --git a/components/jvcllaz/run/JvCtrls/JvMovableBevel.pas b/components/jvcllaz/run/JvCtrls/JvMovableBevel.pas index 78ea9549d..0f18ee8a9 100644 --- a/components/jvcllaz/run/JvCtrls/JvMovableBevel.pas +++ b/components/jvcllaz/run/JvCtrls/JvMovableBevel.pas @@ -30,9 +30,7 @@ unit JvMovableBevel; interface uses - SysUtils, Classes, - //Windows, Messages, - Controls, Forms, ExtCtrls, + SysUtils, Classes, Controls, Forms, ExtCtrls, JvExExtCtrls; type diff --git a/components/jvcllaz/run/JvCustomControls/jvoutlookbar.pas b/components/jvcllaz/run/JvCustomControls/jvoutlookbar.pas index 0aaf6bd98..4e5ee473d 100644 --- a/components/jvcllaz/run/JvCustomControls/jvoutlookbar.pas +++ b/components/jvcllaz/run/JvCustomControls/jvoutlookbar.pas @@ -48,9 +48,6 @@ uses LCLType, LCLIntf, LMessages, Types, LCLVersion, SysUtils, Classes, ActnList, Buttons, Controls, Graphics, ImgList, Forms, StdCtrls, ExtCtrls, Themes, - {$IFDEF HAS_UNIT_SYSTEM_UITYPES} - System.UITypes, - {$ENDIF HAS_UNIT_SYSTEM_UITYPES} JvJCLUtils, JvComponent; const diff --git a/components/jvcllaz/run/JvDB/JvDBTreeView.pas b/components/jvcllaz/run/JvDB/JvDBTreeView.pas index 8d3460f10..88f571859 100644 --- a/components/jvcllaz/run/JvDB/JvDBTreeView.pas +++ b/components/jvcllaz/run/JvDB/JvDBTreeView.pas @@ -59,9 +59,7 @@ interface uses LCLIntf, LCLType, LMessages, - Messages, CommCtrl, Classes, Controls, ExtCtrls, ComCtrls, DB; -// JvExtComponent; type TJvDBTreeNode = class; @@ -106,7 +104,7 @@ type procedure SetStartMasterValue(Value: string); function GetDataSource: TDataSource; procedure SetDataSource(Value: TDataSource); - procedure CMGetDataLink(var Msg: TMessage); message CM_GETDATALINK; + procedure CMGetDataLink(var Msg: TLMessage); message CM_GETDATALINK; { wp -- removed procedure SetMirror(Value: Boolean); } @@ -577,7 +575,7 @@ begin Value.FreeNotification(Self); end; -procedure TJvCustomDBTreeView.CMGetDataLink(var Msg: TMessage); +procedure TJvCustomDBTreeView.CMGetDataLink(var Msg: TLMessage); begin Msg.Result := LRESULT(FDataLink); end; @@ -1397,10 +1395,10 @@ end; procedure TJvCustomDBTreeView.TimerDnDTimer(Sender: TObject); begin if YDragPos < DnDScrollArea then - Perform(WM_VSCROLL, SB_LINEUP, 0) + Perform(LM_VSCROLL, SB_LINEUP, 0) else if YDragPos > ClientHeight - DnDScrollArea then - Perform(WM_VSCROLL, SB_LINEDOWN, 0); + Perform(LM_VSCROLL, SB_LINEDOWN, 0); end; procedure TJvCustomDBTreeView.DragOver(Source: TObject; X, Y: Integer; diff --git a/components/jvcllaz/run/JvJans/JvMarkupCommon.pas b/components/jvcllaz/run/JvJans/JvMarkupCommon.pas index 0eb9d2537..eef611f44 100644 --- a/components/jvcllaz/run/JvJans/JvMarkupCommon.pas +++ b/components/jvcllaz/run/JvJans/JvMarkupCommon.pas @@ -87,19 +87,8 @@ type end; -{$IFDEF UNITVERSIONING} -const - UnitVersioning: TUnitVersionInfo = ( - RCSfile: '$URL$'; - Revision: '$Revision$'; - Date: '$Date$'; - LogPath: 'JVCL\run' - ); -{$ENDIF UNITVERSIONING} - implementation - //=== { TJvHTMLElement } ===================================================== procedure TJvHTMLElement.Breakup(ACanvas: TCanvas; Available: Integer); diff --git a/components/jvcllaz/run/JvJans/JvMarkupViewer.pas b/components/jvcllaz/run/JvJans/JvMarkupViewer.pas index 3de7a5aec..4d95ed45b 100644 --- a/components/jvcllaz/run/JvJans/JvMarkupViewer.pas +++ b/components/jvcllaz/run/JvJans/JvMarkupViewer.pas @@ -31,7 +31,7 @@ interface uses SysUtils, Classes, - Messages, Graphics, Forms, Controls, StdCtrls, + Graphics, Forms, Controls, StdCtrls, JvMarkupCommon; type diff --git a/components/jvcllaz/run/JvJans/JvYearGrid.pas b/components/jvcllaz/run/JvJans/JvYearGrid.pas index c1cad99f9..32815d98c 100644 --- a/components/jvcllaz/run/JvJans/JvYearGrid.pas +++ b/components/jvcllaz/run/JvJans/JvYearGrid.pas @@ -33,15 +33,8 @@ interface uses LCLIntf, Types, - {$IFDEF MSWINDOWS} - //ShellAPI, - {$ENDIF MSWINDOWS} - //Windows, Messages, Graphics, Controls, Forms, Dialogs, Grids, Menus, Clipbrd, SysUtils, StdCtrls, Classes, - {$IFDEF HAS_UNIT_SYSTEM_UITYPES} - System.UITypes, - {$ENDIF HAS_UNIT_SYSTEM_UITYPES} JvJVCLUtils, JvTypes; const diff --git a/components/jvcllaz/run/JvJans/JvYearGridEditForm.pas b/components/jvcllaz/run/JvJans/JvYearGridEditForm.pas index 8505a5a70..64c2a3589 100644 --- a/components/jvcllaz/run/JvJans/JvYearGridEditForm.pas +++ b/components/jvcllaz/run/JvJans/JvYearGridEditForm.pas @@ -30,8 +30,7 @@ unit JvYearGridEditForm; interface uses - SysUtils, Classes, Windows, Messages, Graphics, Controls, - Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, + SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, JvComponent; type diff --git a/components/jvcllaz/run/JvPageComps/JvNavigationPane.pas b/components/jvcllaz/run/JvPageComps/JvNavigationPane.pas index 6cfec0a60..0f6dea393 100644 --- a/components/jvcllaz/run/JvPageComps/JvNavigationPane.pas +++ b/components/jvcllaz/run/JvPageComps/JvNavigationPane.pas @@ -47,8 +47,9 @@ unit JvNavigationPane; interface uses - SysUtils, Classes, Controls, ExtCtrls, Graphics, ImgList, JvButton, - JvComponent, JvExExtCtrls, JvPageList, JvTypes, LCLIntf, LCLType, LMessages, Menus; + LCLIntf, LCLType, LMessages, + SysUtils, Classes, Controls, ExtCtrls, Graphics, ImgList, JvButton, Menus, + JvComponent, JvExExtCtrls, JvPageList, JvTypes; const CM_PARENTSTYLEMANAGERCHANGE = CM_BASE + 1; diff --git a/components/jvcllaz/run/JvPageComps/JvPageList.pas b/components/jvcllaz/run/JvPageComps/JvPageList.pas index 1e35228fb..6b2cde1f6 100644 --- a/components/jvcllaz/run/JvPageComps/JvPageList.pas +++ b/components/jvcllaz/run/JvPageComps/JvPageList.pas @@ -35,8 +35,9 @@ unit JvPageList; interface uses - Classes, Controls, Graphics, JvComponent, LCLIntf, LCLType, LMessages, - SysUtils; + LCLIntf, LCLType, LMessages, + SysUtils, Classes, Controls, Graphics, + JvComponent; type EPageListError = class(Exception); diff --git a/components/jvcllaz/run/JvRuntimeDesign/jvdesignclip.pas b/components/jvcllaz/run/JvRuntimeDesign/jvdesignclip.pas index bcae66bd6..ff61e2d78 100644 --- a/components/jvcllaz/run/JvRuntimeDesign/jvdesignclip.pas +++ b/components/jvcllaz/run/JvRuntimeDesign/jvdesignclip.pas @@ -5,9 +5,6 @@ unit JvDesignClip; interface uses - {$IFDEF UNITVERSIONING} - JclUnitVersioning, - {$ENDIF UNITVERSIONING} LCLProc, LCLType, LResources, LCLIntf, LMessages, Classes; type @@ -35,15 +32,6 @@ procedure DesignSaveComponentToBinaryStream(InStream: TStream; InComponent: TCom procedure DesignCopyStreamFromClipboard(InFmt: Cardinal; InS: TStream); procedure DesignCopyStreamToClipboard(InFmt: Cardinal; InS: TStream); -{$IFDEF UNITVERSIONING} -const - UnitVersioning: TUnitVersionInfo = ( - RCSfile: '$URL: https://jvcl.svn.sourceforge.net/svnroot/jvcl/tags/JVCL3_39/run/JvDesignClip.pas $'; - Revision: '$Revision: 12515 $'; - Date: '$Date: 2009-09-23 09:51:16 +0200 (mer., 23 sept. 2009) $'; - LogPath: 'JVCL\run' - ); -{$ENDIF UNITVERSIONING} implementation @@ -214,14 +202,7 @@ end; initialization { The following string should not be localized } CF_COMPONENTSTREAM := RegisterClipboardFormat('Delphi Components'); - {$IFDEF UNITVERSIONING} - RegisterUnitVersion(HInstance, UnitVersioning); - {$ENDIF UNITVERSIONING} -finalization - {$IFDEF UNITVERSIONING} - UnregisterUnitVersion(HInstance); - {$ENDIF UNITVERSIONING} end. diff --git a/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas b/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas index 31997af9e..c9b3eba10 100644 --- a/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas +++ b/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas @@ -5,12 +5,9 @@ unit JvDesignImp; interface uses - {$IFDEF UNITVERSIONING} - JclUnitVersioning, - {$ENDIF UNITVERSIONING} - LCLProc, LCLType, LResources, LCLIntf, LMessages, SysUtils, Classes, Controls, Graphics, - Forms, ExtCtrls, Contnrs, JvDesignUtils, - JvDesignSurface; + LCLProc, LCLType, LResources, LCLIntf, LMessages, + SysUtils, Classes, Controls, Graphics, Forms, ExtCtrls, Contnrs, + JvDesignUtils, JvDesignSurface; const cJvDesignDefaultHandleWidth = 8; @@ -178,7 +175,7 @@ type procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; end; - TJvDesignDesigner = class( TIDesigner)// TComponent, IDesignerHook) + TJvDesignDesigner = class(TIDesigner)// TComponent, IDesignerHook) private FMessenger: TJvDesignCustomMessenger; public @@ -276,15 +273,6 @@ type procedure DesignComponent(AComponent: TComponent; ADesigning: Boolean); override; end; -{$IFDEF UNITVERSIONING} -const - UnitVersioning: TUnitVersionInfo = ( - RCSfile: '$URL: https://jvcl.svn.sourceforge.net/svnroot/jvcl/trunk/jvcl/run/JvDesignImp.pas $'; - Revision: '$Revision: 12931 $'; - Date: '$Date: 2010-11-28 15:36:50 +0200 (Κυρ, 28 Νοε 2010) $'; - LogPath: 'JVCL\run' - ); -{$ENDIF UNITVERSIONING} implementation @@ -1466,15 +1454,9 @@ begin end; initialization - {$IFDEF UNITVERSIONING} - RegisterUnitVersion(HInstance, UnitVersioning); - {$ENDIF UNITVERSIONING} finalization FreeShadedBits; - {$IFDEF UNITVERSIONING} - UnregisterUnitVersion(HInstance); - {$ENDIF UNITVERSIONING} end. diff --git a/components/jvcllaz/run/JvStdCtrls/JvButton.pas b/components/jvcllaz/run/JvStdCtrls/JvButton.pas index 7f14b12ec..7f237a692 100644 --- a/components/jvcllaz/run/JvStdCtrls/JvButton.pas +++ b/components/jvcllaz/run/JvStdCtrls/JvButton.pas @@ -34,7 +34,9 @@ unit JvButton; interface uses - Classes, Controls, Graphics, JvComponent, JvConsts, JvTypes, LMessages, Menus; + LMessages, + Classes, Controls, Graphics, Menus, + JvComponent, JvConsts, JvTypes; type TJvButtonMouseState = (bsMouseInside, bsMouseDown); diff --git a/components/jvcllaz/run/JvValidators/JvValidators.pas b/components/jvcllaz/run/JvValidators/JvValidators.pas index 63f5a7667..1ac1a7914 100644 --- a/components/jvcllaz/run/JvValidators/JvValidators.pas +++ b/components/jvcllaz/run/JvValidators/JvValidators.pas @@ -100,9 +100,9 @@ type public {$IFDEF JVVALIDATORS_SUPPORTS_DBCONTROLS} // return a TDataLink if the control is a DB control or nil if is not - function GetDataLink(AControl:TControl):TDataLink;virtual; + function GetDataLink(AControl:TControl):TDataLink; virtual; {$ELSE} - function GetDataLink(AControl:TControl):TObject;virtual; + function GetDataLink(AControl:TControl):TObject; virtual; {$ENDIF JVVALIDATORS_SUPPORTS_DBCONTROLS} // register a new base validator class. DisplayName is used by the design-time editor. // A class with an empty DisplayName will not sshow up in the editor diff --git a/components/jvcllaz/run/JvXPCtrls/JvXPBar.pas b/components/jvcllaz/run/JvXPCtrls/JvXPBar.pas index b709ccffd..8de453f8a 100644 --- a/components/jvcllaz/run/JvXPCtrls/JvXPBar.pas +++ b/components/jvcllaz/run/JvXPCtrls/JvXPBar.pas @@ -51,8 +51,8 @@ unit JvXPBar; interface uses - ActnList, Classes, Controls, Graphics, ExtCtrls, Forms, ImgList, - LCLIntf, LCLProc, LCLType, LMessages, LResources, SysUtils, + LCLIntf, LCLProc, LCLType, LMessages, LResources, + SysUtils, Classes, Controls, Graphics, ExtCtrls, Forms, ImgList, ActnList, JvXPCore, JvXPCoreUtils; type @@ -224,7 +224,7 @@ type function GetItem(Index: Integer): TJvXPBarItem; procedure SetItem(Index: Integer; Value: TJvXPBarItem); protected - procedure Update(Item: TCollectionItem); override; + procedure Update({%H-}Item: TCollectionItem); override; function GetOwner: TPersistent; override; class function GetItemClass: TJvXPBarItemClass; virtual; public @@ -557,6 +557,8 @@ uses resourcestring RsUntitled = 'untitled'; + +const RsUntitledFmt = '(%s %d)'; RsHintShortcutFmt = '%s (%s)'; @@ -1442,14 +1444,14 @@ begin FTopSpace := 5; FFont := TFont.Create; - FFont.Color := dxColor_FontColorXP; //$00840000; + FFont.Color := dxColor_FontColorXP; // $00840000; FFont.Size := 0; //8; FFont.OnChange := @FontChange; FHeaderHeight := 28; FHeaderRounded := True; FGradientWidth := 0; FHeaderFont := TFont.Create; - FHeaderFont.Color := dxColor_HeaderFontColorXP; //$00840000; + FHeaderFont.Color := dxColor_HeaderFontColorXP; // $00840000; FHeaderFont.Size := 0; //8; FHeaderFont.Style := [fsBold]; FHeaderFont.OnChange := @FontChange; diff --git a/components/jvcllaz/run/JvXPCtrls/JvXPContainer.pas b/components/jvcllaz/run/JvXPCtrls/JvXPContainer.pas index 44f5af5dc..9950f270e 100644 --- a/components/jvcllaz/run/JvXPCtrls/JvXPContainer.pas +++ b/components/jvcllaz/run/JvXPCtrls/JvXPContainer.pas @@ -33,7 +33,8 @@ unit JvXPContainer; interface uses - TypInfo, Classes, LCLIntf, LCLProc, LCLType, Controls, Graphics, StdCtrls, ExtCtrls, + LCLIntf, LCLProc, LCLType, + TypInfo, Classes, Controls, Graphics, StdCtrls, ExtCtrls, JvXPCore, JvXPCoreUtils; type diff --git a/components/jvcllaz/run/JvXPCtrls/JvXPCoreUtils.pas b/components/jvcllaz/run/JvXPCtrls/JvXPCoreUtils.pas index 7ce21b78b..9d7bdeccf 100644 --- a/components/jvcllaz/run/JvXPCtrls/JvXPCoreUtils.pas +++ b/components/jvcllaz/run/JvXPCtrls/JvXPCoreUtils.pas @@ -34,8 +34,9 @@ unit JvXPCoreUtils; interface uses - Classes, Controls, Graphics, LCLIntf, LCLType, SysUtils, - TypInfo, JvXPCore; + LCLIntf, LCLType, SysUtils, + Classes, Controls, Graphics, TypInfo, + JvXPCore; function JvXPMethodsEqual(const Method1, Method2: TMethod): Boolean;