jvcllaz: Fix compilation of JvTabBar_NotebookPages demo with Laz 2.0.8 (or earlier). Remove version check in JvNotebookPageList.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7399 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-04-24 18:08:41 +00:00
parent cbf60e2a8b
commit ce8d2e3dba
4 changed files with 11 additions and 11 deletions

View File

@ -25,7 +25,6 @@
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<FormatVersion Value="2"/> <FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams> </RunParams>
<RequiredPackages Count="3"> <RequiredPackages Count="3">
<Item1> <Item1>

View File

@ -1064,7 +1064,6 @@ object Form1: TForm1
DirectiveAttri.Style = [fsBold] DirectiveAttri.Style = [fsBold]
CompilerMode = pcmDelphi CompilerMode = pcmDelphi
NestedComments = False NestedComments = False
TypeHelpers = True
left = 157 left = 157
top = 111 top = 111
end end

View File

@ -6,7 +6,8 @@ interface
uses uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
ActnList, StdActns, Menus, SynEdit, SynHighlighterPas, SynHighlighterXML, ActnList, Menus, LCLVersion,
SynEdit, SynHighlighterPas, SynHighlighterXML,
JvTabBar, JvNotebookPageList, JvTabBarXPPainter; JvTabBar, JvNotebookPageList, JvTabBarXPPainter;
type type
@ -50,6 +51,9 @@ procedure TForm1.FormCreate(Sender: TObject);
var var
dir: String; dir: String;
begin begin
{$IF LCL_FullVersion >= 2010000}
JvTabBar1.PageListTabLink := true;
{$IFEND}
dir := ExpandFileName(Application.Location + '../../examples/JvTabBar_NotebookPages/'); dir := ExpandFileName(Application.Location + '../../examples/JvTabBar_NotebookPages/');
PasSynEdit.Lines.LoadfromFile(dir + 'main.pas'); PasSynEdit.Lines.LoadfromFile(dir + 'main.pas');
XMLSynEdit.Lines.LoadFromFile(dir + 'JvTabBarDemo_NotebookPages.lpi'); XMLSynEdit.Lines.LoadFromFile(dir + 'JvTabBarDemo_NotebookPages.lpi');

View File

@ -21,7 +21,7 @@ unit JvNotebookPageList;
interface interface
uses uses
Classes, SysUtils, ExtCtrls, LCLVersion, Classes, SysUtils, ExtCtrls,
JvPageList; JvPageList;
type type
@ -100,13 +100,11 @@ end;
procedure TJvNotebookPageList.MovePage(CurIndex, NewIndex: Integer); procedure TJvNotebookPageList.MovePage(CurIndex, NewIndex: Integer);
begin begin
{$IF LCL_FullVersion >= 2010000} Pages.Move(CurIndex, NewIndex);
Pages.Move(CurIndex, NewIndex); // Fix for issue #36956 // Note: This code is not working for Laz < 2.1 (issue #36956),
{$ELSE} // it exchanges the captions only (not the pages) when PageListTabLink is false
Pages.Exchange(CurIndex, NewIndex); // or crashes when PageListTabLink is true.
// Note: This code is not working (issue #36956), it exchanges the captions, // Required changes in TNotebook are available only in Laz 2.1+
// not the pages. Required changes in TNotebook are available only in Laz 2.1+
{$IFEND}
end; end;
procedure TJvNotebookPagelist.PageCaptionChanged(AIndex: Integer; procedure TJvNotebookPagelist.PageCaptionChanged(AIndex: Integer;