make compatible with LCL version 2.2

This commit is contained in:
Basile Burg 2021-09-13 11:45:03 +02:00
parent fcad680170
commit 02fb0749c2
9 changed files with 61 additions and 15 deletions

View File

@ -10,7 +10,11 @@
## Bugs fixed ## Bugs fixed
- GDB comm&nder: 5 empty arguments were passed to the main function called by libc. (#86) - GDB commander: 5 empty arguments were passed to the main function called by libc. (#86)
## Other
- can be build with Lazarus 2.2 but backward compatible 2.0
# v3.9.11 # v3.9.11

View File

@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="12"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="dexed"/> <Title Value="dexed"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>

View File

@ -9,7 +9,8 @@ uses
ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs, LazFileUtils, ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs, LazFileUtils,
SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, AnchorDocking, u_dialogs, SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, AnchorDocking, u_dialogs,
u_widget, u_interfaces, u_synmemo, u_dlang, u_common, u_dcd, u_observer, u_widget, u_interfaces, u_synmemo, u_dlang, u_common, u_dcd, u_observer,
u_sharedres, u_controls, u_writableComponent, u_dsgncontrols, LMessages; u_sharedres, u_controls, u_writableComponent, u_dsgncontrols, LMessages,
SynEditTypes;
type type

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, Graphics, SynEdit, SynEditMouseCmds, SynEditMiscClasses, Classes, SysUtils, Graphics, SynEdit, SynEditMouseCmds, SynEditMiscClasses,
SynEditKeyCmds, Menus, LCLProc, SynEditKeyCmds, Menus, LCLProc, SynEditTypes,
u_interfaces, u_observer, u_common, u_writableComponent, u_synmemo, u_interfaces, u_observer, u_common, u_writableComponent, u_synmemo,
u_d2syn, u_txtsyn; u_d2syn, u_txtsyn;

View File

@ -11,7 +11,7 @@ object MainForm: TMainForm
OnDropFiles = FormDropFiles OnDropFiles = FormDropFiles
OnResize = FormResize OnResize = FormResize
ShowHint = True ShowHint = True
LCLVersion = '2.0.10.0' LCLVersion = '2.2.0.1'
object mainMenu: TMainMenu object mainMenu: TMainMenu
Top = 1 Top = 1
object MenuItem1: TMenuItem object MenuItem1: TMenuItem

View File

@ -9,7 +9,7 @@ uses
StdCtrls, AnchorDocking, AnchorDockStorage, AnchorDockOptionsDlg, Controls, StdCtrls, AnchorDocking, AnchorDockStorage, AnchorDockOptionsDlg, Controls,
Graphics, strutils, Dialogs, Menus, ActnList, ExtCtrls, process, Graphics, strutils, Dialogs, Menus, ActnList, ExtCtrls, process,
{$IFDEF WINDOWS}Windows, {$ENDIF} XMLPropStorage, SynExportHTML, {$IFDEF WINDOWS}Windows, {$ENDIF} XMLPropStorage, SynExportHTML,
fpjson, jsonscanner, LCLIntf, fpjson, jsonscanner, LCLIntf, LCLVersion,
u_common, u_ceproject, u_synmemo, u_writableComponent, u_simpleget, u_compilers, u_common, u_ceproject, u_synmemo, u_writableComponent, u_simpleget, u_compilers,
u_widget, u_messages, u_interfaces, u_editor, u_projinspect, u_ceprojeditor, u_widget, u_messages, u_interfaces, u_editor, u_projinspect, u_ceprojeditor,
u_search, u_miniexplorer, u_libman, u_libmaneditor, u_todolist, u_observer, u_search, u_miniexplorer, u_libman, u_libmaneditor, u_todolist, u_observer,
@ -1725,7 +1725,11 @@ begin
begin begin
DockMaster.MakeDockSite(Self, [akBottom], admrpChild); DockMaster.MakeDockSite(Self, [akBottom], admrpChild);
DockMaster.OnShowOptions := @ShowAnchorDockOptions; DockMaster.OnShowOptions := @ShowAnchorDockOptions;
{$if lcl_fullversion < 2020000}
DockMaster.HeaderStyle := adhsPoints; DockMaster.HeaderStyle := adhsPoints;
{$else}
DockMaster.HeaderStyle := 'Points';
{$endif}
DockMaster.HideHeaderCaptionFloatingControl := true; DockMaster.HideHeaderCaptionFloatingControl := true;
// makes widget dockable // makes widget dockable
for i := 0 to fWidgList.Count-1 do for i := 0 to fWidgList.Count-1 do

View File

@ -95,6 +95,9 @@ type
procedure sendShortcuts; procedure sendShortcuts;
function anItemIsSelected: boolean; function anItemIsSelected: boolean;
protected
procedure SetVisible(value: boolean); override;
public public
constructor create(TheOwner: TComponent); override; constructor create(TheOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;
@ -194,8 +197,8 @@ begin
fObservers := TEditableShortCutSubject.create; fObservers := TEditableShortCutSubject.create;
fShortcuts := TShortCutCollection.create(self); fShortcuts := TShortCutCollection.create(self);
fBackup := TShortCutCollection.create(self); fBackup := TShortCutCollection.create(self);
EntitiesConnector.addObserver(self); EntitiesConnector.addObserver(self);
propedit.TIObject := propvalue;
propedit.PropertyEditorHook.AddHandlerModified(@propeditModified); propedit.PropertyEditorHook.AddHandlerModified(@propeditModified);
end; end;
@ -206,6 +209,13 @@ begin
inherited; inherited;
end; end;
procedure TShortcutEditor.SetVisible(value: boolean);
begin
inherited SetVisible(value);
if value and propedit.TIObject.isNotAssigned then
propedit.TIObject := propvalue;
end;
procedure TShortcutEditor.updateScaling; procedure TShortcutEditor.updateScaling;
begin begin
if fHasScaled then if fHasScaled then

View File

@ -10,7 +10,7 @@ uses
SynHighlighterLFM, SynEditHighlighter, SynEditMouseCmds, SynEditFoldedView, SynHighlighterLFM, SynEditHighlighter, SynEditMouseCmds, SynEditFoldedView,
SynEditMarks, SynEditTypes, SynHighlighterJScript, SynBeautifier, dialogs, SynEditMarks, SynEditTypes, SynHighlighterJScript, SynBeautifier, dialogs,
md5, Spin, LCLIntf, LazFileUtils, LMessages, SynHighlighterCpp, math, md5, Spin, LCLIntf, LazFileUtils, LMessages, SynHighlighterCpp, math,
SynGutterMarks, SynGutterBase, SynGutterMarks, SynGutterBase, LCLVersion,
//SynEditMarkupFoldColoring, //SynEditMarkupFoldColoring,
Clipbrd, fpjson, jsonparser, LazUTF8, LazUTF8Classes, Buttons, StdCtrls, Clipbrd, fpjson, jsonparser, LazUTF8, LazUTF8Classes, Buttons, StdCtrls,
u_common, u_writableComponent, u_d2syn, u_txtsyn, u_dialogs, u_common, u_writableComponent, u_d2syn, u_txtsyn, u_dialogs,
@ -839,7 +839,13 @@ begin
begin begin
// - CollapsedLineForFoldAtLine() does not handle the sub-folding. // - CollapsedLineForFoldAtLine() does not handle the sub-folding.
// - TextView visibility is increased so this is not the standard way of getting the infos. // - TextView visibility is increased so this is not the standard way of getting the infos.
{$if lcl_fullversion < 2020000}
start := fMemo.TextView.CollapsedLineForFoldAtLine(i); start := fMemo.TextView.CollapsedLineForFoldAtLine(i);
{$else}
start := TSynEditFoldedView(fMemo.TextViewsManager.SynTextViewByClass[TSynEditFoldedView]).CollapsedLineForFoldAtLine(i);
{$endif}
if start.equals(-1) then if start.equals(-1) then
continue; continue;
if start = prev then if start = prev then
@ -871,7 +877,11 @@ begin
itm := TFoldCache(fFolds.Items[i]); itm := TFoldCache(fFolds.Items[i]);
if not itm.isCollapsed then if not itm.isCollapsed then
continue; continue;
{$if lcl_fullversion < 2020000}
fMemo.TextView.FoldAtLine(itm.lineIndex-1); fMemo.TextView.FoldAtLine(itm.lineIndex-1);
{$else}
TSynEditFoldedView(fMemo.TextViewsManager.SynTextViewByClass[TSynEditFoldedView]).FoldAtLine(itm.lineIndex-1);
{$endif}
end; end;
fMemo.SelStart := fCaretPosition; fMemo.SelStart := fCaretPosition;
@ -1153,7 +1163,12 @@ begin
fTempFileName := GetTempDir(false) + 'temp_' + uniqueObjStr(self) + '.d'; fTempFileName := GetTempDir(false) + 'temp_' + uniqueObjStr(self) + '.d';
fFilename := newdocPageCaption; fFilename := newdocPageCaption;
fModified := false; fModified := false;
{$if lcl_fullversion < 2020000}
TextBuffer.AddNotifyHandler(senrUndoRedoAdded, @changeNotify); TextBuffer.AddNotifyHandler(senrUndoRedoAdded, @changeNotify);
{$else}
TextViewsManager.SynTextView[0].AddNotifyHandler(senrUndoRedoAdded, @changeNotify);
{$endif}
Gutter.MarksPart.Visible:=false; Gutter.MarksPart.Visible:=false;

View File

@ -6,7 +6,8 @@ interface
uses uses
Classes, SysUtils, Graphics, LCLType, LCLIntf, LCLProc, Controls, ImgList, Classes, SysUtils, Graphics, LCLType, LCLIntf, LCLProc, Controls, ImgList,
math, SynGutterBase, SynEditMiscClasses, SynEditMarks; LCLVersion, SynGutterBase, SynEditMiscClasses, SynEditMiscProcs,
SynEditMarks, SynEditFoldedView, LazSynEditText;
type type
@ -86,10 +87,20 @@ var
markRect: TRect; markRect: TRect;
mark : TSynEditMark; mark : TSynEditMark;
i, h, w : integer; i, h, w : integer;
{$if lcl_fullversion >= 2020000}
iRange: TLineRange;
{$endif}
begin begin
Result := False; Result := False;
aFirstCustomColumnIdx := 0; aFirstCustomColumnIdx := 0;
{$if lcl_fullversion < 2020000}
i := FoldView.TextIndex[aScreenLine]; i := FoldView.TextIndex[aScreenLine];
{$else}
aScreenLine := aScreenLine + ToIdx(GutterArea.TextArea.TopLine);
i := ViewedTextBuffer.DisplayView.ViewToTextIndexEx(aScreenLine, iRange);
if aScreenLine <> iRange.Top then
exit;
{$endif}
if (i < 0) or (i >= TCustomSynEdit(SynEdit).Lines.Count) then if (i < 0) or (i >= TCustomSynEdit(SynEdit).Lines.Count) then
exit; exit;
markLine := TCustomSynEdit(SynEdit).Marks.Line[i + 1]; markLine := TCustomSynEdit(SynEdit).Marks.Line[i + 1];
@ -146,6 +157,5 @@ end;
end. end.
end. end.