Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract IPageList interface in a interface only unit #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions jvcl/run/JvPageList.pas
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,11 @@ interface
{$IFDEF COMPILER9_UP}
Types,
{$ENDIF COMPILER9_UP}
JvComponent, JvThemes;
JvComponent, JvThemes, JvPageListInterface;

type
EPageListError = class(Exception);

IPageList = interface
['{6BB90183-CFB1-4431-9CFD-E9A032E0C94C}']
function CanChange(AIndex: Integer): Boolean;
procedure SetActivePageIndex(AIndex: Integer);
function GetPageCount: Integer;
function GetPageCaption(AIndex: Integer): string;
procedure AddPage(const ACaption: string);
procedure DeletePage(Index: Integer);
procedure MovePage(CurIndex, NewIndex: Integer);
procedure PageCaptionChanged(Index: Integer; const NewCaption: string);
end;

TJvCustomPageList = class;

TJvPagePaintEvent = procedure(Sender: TObject; ACanvas: TCanvas; ARect: TRect) of object;
Expand Down
45 changes: 45 additions & 0 deletions jvcl/run/JvPageListInterface.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: JvPageListInterface.pas, released on 2019-04-25.

The Initial Developer of the Original Code is Markus Humm <Markus dott Humm att gmail dott com>
Portions created by Markus Humm are Copyright (C) 2019 Markus Humm
All Rights Reserved.

Contributor(s):

You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.delphi-jedi.org

Known Issues:
-----------------------------------------------------------------------------}
// $Id$

unit JvPageListInterface;

interface

type
IPageList = interface
['{6BB90183-CFB1-4431-9CFD-E9A032E0C94C}']
function CanChange(AIndex: Integer): Boolean;
procedure SetActivePageIndex(AIndex: Integer);
function GetPageCount: Integer;
function GetPageCaption(AIndex: Integer): string;
procedure AddPage(const ACaption: string);
procedure DeletePage(Index: Integer);
procedure MovePage(CurIndex, NewIndex: Integer);
procedure PageCaptionChanged(Index: Integer; const NewCaption: string);
end;

implementation

end.
14 changes: 1 addition & 13 deletions jvcl/run/JvTabBar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface
{$IFDEF HAS_UNIT_SYSTEM_UITYPES}
System.UITypes,
{$ENDIF HAS_UNIT_SYSTEM_UITYPES}
JvThemes;
JvThemes, JvPageListInterface;

type
TJvCustomTabBar = class;
Expand All @@ -52,18 +52,6 @@ TJvTabBarItem = class;
TJvGetModifiedEvent = procedure(Sender: TJvTabBarItem; var Modified: Boolean) of object;
TJvGetEnabledEvent = procedure(Sender: TJvTabBarItem; var Enabled: Boolean) of object;

IPageList = interface
['{6BB90183-CFB1-4431-9CFD-E9A032E0C94C}']
function CanChange(AIndex: Integer): Boolean;
procedure SetActivePageIndex(AIndex: Integer);
function GetPageCount: Integer;
function GetPageCaption(AIndex: Integer): string;
procedure AddPage(const ACaption: string);
procedure DeletePage(Index: Integer);
procedure MovePage(CurIndex, NewIndex: Integer);
procedure PageCaptionChanged(Index: Integer; const NewCaption: string);
end;

TJvTabBarItem = class(TCollectionItem)
private
FLeft: Integer; // used for calculating DisplayRect
Expand Down