fixed 1.0.10 compilation from Vincent

git-svn-id: trunk@5679 -
This commit is contained in:
mattias 2004-07-14 15:57:53 +00:00
parent 0f998e6fcc
commit 043ab6bf3a
5 changed files with 64 additions and 4 deletions

View File

@ -106,7 +106,10 @@ var
implementation
uses
StrUtils, FileCtrl;
{$ifndef ver1_0}
StrUtils,
{$endif}
FileCtrl;
Type
PCharArray = Array[0..16+5] of PChar;
@ -535,6 +538,13 @@ Var
TodoFLag := Flag;
Result := Pos(UpperCase(Flag),UpperCase(TokenString)) > 1;
end;
{$ifdef ver1_0}
//fpc 1.0.x has no strutils unit.
Function AnsiStartsText(const ASubText, AText: string): Boolean;
begin
Result:=Copy(AText,1,Length(AsubText))=ASubText;
end;
{$endif}
begin
if IsTodoFlag(cTodoFlag) or IsTodoFlag(cAltTodoFlag) then
begin

View File

@ -2155,7 +2155,8 @@ end;
function TPropertyEditor.GetObjectValueAt(Index: Integer): TObject;
begin
with FPropList^[Index] do Result:=GetObjectProp(Instance,PropInfo);
with FPropList^[Index] do
Result:=GetObjectProp(Instance,PropInfo,nil); // nil for fpc 1.0.x
end;
function TPropertyEditor.GetDefaultOrdValue: Longint;

View File

@ -312,6 +312,7 @@ type
function IsEqual(const AItem: TListItem): Boolean;
public
procedure Assign(ASource: TPersistent); override;
constructor Create(AOwner : TListItems);
destructor Destroy; override;
procedure Delete;
@ -546,6 +547,11 @@ type
property OnDeletion: TLVDeletedEvent read FOnDeletion write FOnDeletion;
property OnSelectItem: TLVSelectItemEvent read FOnSelectItem write FOnSelectItem;
property BorderStyle default bsSingle;
{$ifdef ver1_0}
// repeated as workaround for fpc 1.0.x bug,
// which can't access a protected property defined in another unit.
property WidgetSetClass;
{$endif}
public
constructor Create(Aowner: TComponent); override;
destructor Destroy; override;
@ -2298,6 +2304,9 @@ end.
{ =============================================================================
$Log$
Revision 1.137 2004/07/14 15:57:53 mattias
fixed 1.0.10 compilation from Vincent
Revision 1.136 2004/07/11 17:20:47 marc
* Implemented most of TListColoum/Item in the Ws for gtk and win32

View File

@ -1470,6 +1470,11 @@ type
// properties which are not supported by all descendents
property BorderStyle: TBorderStyle read GetBorderStyle write SetBorderStyle default bsNone;
property OnGetSiteInfo: TGetSiteInfoEvent read FOnGetSiteInfo write FOnGetSiteInfo;
{$ifdef ver1_0}
// repeated as workaround for fpc 1.0.x bug,
// which can't access a protected property defined in another unit.
property WidgetSetClass;
{$endif}
public
// properties which are supported by all descendents
property BorderWidth: TBorderWidth read FBorderWidth write SetBorderWidth default 0;
@ -2341,6 +2346,9 @@ end.
{ =============================================================================
$Log$
Revision 1.226 2004/07/14 15:57:53 mattias
fixed 1.0.10 compilation from Vincent
Revision 1.225 2004/07/11 13:03:53 mattias
extended RolesForForm to manage multiple roles for on control

View File

@ -123,10 +123,20 @@ end;
procedure TListItemSubItems.Clear;
var
n: Integer;
{$ifdef ver1_0}
// fpc 1.0.x needs a var parameter for dispose.
io: PListItemImageObject;
{$endif}
begin
for n := 0 to Count - 1 do
Dispose(PListItemImageObject(inherited GetObject(n)));
{$ifdef ver1_0}
begin
io := PListItemImageObject(inherited GetObject(n));
Dispose(io);
end;
{$else}
Dispose(PListItemImageObject(pointer(inherited GetObject(n))));
{$endif}
inherited;
end;
@ -139,13 +149,23 @@ begin
end;
procedure TListItemSubItems.Delete(AIndex: Integer);
{$ifdef ver1_0}
// fpc 1.0.x needs a var parameter for dispose.
var
io: PListItemImageObject;
{$endif}
begin
if AIndex = Count
then FChangeIndex := AIndex
else FChangeIndex := -1;
FUpdate := [siuText, siuImage];
try
{$ifdef ver1_0}
io := PListItemImageObject(inherited GetObject(AIndex));
Dispose(io);
{$else}
Dispose(PListItemImageObject(inherited GetObject(AIndex)));
{$endif}
inherited;
finally
FUpdate := [];
@ -271,17 +291,26 @@ end;
{ TListItem.Assign }
{------------------------------------------------------------------------------}
procedure TListItem.Assign(ASource: TPersistent);
begin
if ASource is TListItem
then begin
Caption := TListItem(ASource).Caption;
Data := TListItem(ASource).Data;
ImageIndex := TListItem(ASource).ImageIndex;
SubItems := TListItem(ASource).SubItems;
end
else inherited Assign(ASource);
end;
{------------------------------------------------------------------------------}
{ TListItem Constructor }
{------------------------------------------------------------------------------}
@ -535,6 +564,9 @@ end;
{ =============================================================================
$Log$
Revision 1.19 2004/07/14 15:57:53 mattias
fixed 1.0.10 compilation from Vincent
Revision 1.18 2004/07/11 17:20:47 marc
* Implemented most of TListColoum/Item in the Ws for gtk and win32