* made naming more consistent. Intfxxx methods are called by the interface, WSxxx methods call the interface

git-svn-id: trunk@9785 -
This commit is contained in:
marc 2006-09-02 16:21:55 +00:00
parent 504a3626cd
commit 352eaa11ed
6 changed files with 52 additions and 52 deletions

View File

@ -585,9 +585,9 @@ type
function GetSubItemImages(const AIndex: Integer): Integer; function GetSubItemImages(const AIndex: Integer): Integer;
function GetSubItems: TStrings; function GetSubItems: TStrings;
function IntfUpdateAllowed: Boolean; function WSUpdateAllowed: Boolean;
procedure IntfUpdateText; procedure WSUpdateText;
procedure IntfUpdateImages; procedure WSUpdateImages;
procedure SetChecked(AValue: Boolean); procedure SetChecked(AValue: Boolean);
procedure SetState(const ALisOrd: Integer; const AIsSet: Boolean); procedure SetState(const ALisOrd: Integer; const AIsSet: Boolean);
@ -638,8 +638,8 @@ type
FItems: TList; FItems: TList;
FCacheIndex: Integer; // Caches the last used item FCacheIndex: Integer; // Caches the last used item
FCacheItem: TListItem; // FCacheItem: TListItem; //
procedure IntfCreateCacheItem; procedure WSCreateCacheItem;
function IntfUpdateAllowed: Boolean; function WSUpdateAllowed: Boolean;
procedure ItemDestroying(const AItem: TListItem); //called by TListItem when freed procedure ItemDestroying(const AItem: TListItem); //called by TListItem when freed
procedure ReadData(Stream: TStream); procedure ReadData(Stream: TStream);
procedure WriteData(Stream: TStream); procedure WriteData(Stream: TStream);
@ -647,7 +647,7 @@ type
procedure DefineProperties(Filer: TFiler); override; procedure DefineProperties(Filer: TFiler); override;
function GetCount : Integer; function GetCount : Integer;
function GetItem(const AIndex: Integer): TListItem; function GetItem(const AIndex: Integer): TListItem;
procedure IntfCreateItems; procedure WSCreateItems;
procedure SetItem(const AIndex: Integer; const AValue: TListItem); procedure SetItem(const AIndex: Integer; const AValue: TListItem);
public public
function Add: TListItem; function Add: TListItem;
@ -685,8 +685,8 @@ type
FImageIndex: Integer; FImageIndex: Integer;
FTag: Integer; FTag: Integer;
function GetWidth: TWidth; function GetWidth: TWidth;
procedure IntfCreateColumn; procedure WSCreateColumn;
function IntfUpdateAllowed: Boolean; function WSUpdateAllowed: Boolean;
procedure SetVisible(const AValue: Boolean); procedure SetVisible(const AValue: Boolean);
procedure SetAutoSize(const AValue: Boolean); procedure SetAutoSize(const AValue: Boolean);
procedure SetMinWidth(const AValue: TWidth); procedure SetMinWidth(const AValue: TWidth);
@ -724,7 +724,7 @@ type
FItemNeedsUpdate: TCollectionItem; FItemNeedsUpdate: TCollectionItem;
FNeedsUpdate: boolean; FNeedsUpdate: boolean;
function GetItem(const AIndex: Integer): TListColumn; function GetItem(const AIndex: Integer): TListColumn;
procedure IntfCreateColumns; procedure WSCreateColumns;
procedure SetItem(const AIndex: Integer; const AValue: TListColumn); procedure SetItem(const AIndex: Integer; const AValue: TListColumn);
protected protected
public public

View File

@ -209,7 +209,7 @@ begin
LVC.SetViewStyle(Self, FViewStyle); LVC.SetViewStyle(Self, FViewStyle);
// add columns // add columns
FColumns.IntfCreateColumns; FColumns.WSCreateColumns;
// set imagelists and item depending properties // set imagelists and item depending properties
for lvil := Low(TListViewImageList) to High(TListViewImageList) do for lvil := Low(TListViewImageList) to High(TListViewImageList) do
@ -223,7 +223,7 @@ begin
LVC.SetSort(Self, FSortType, FSortColumn); LVC.SetSort(Self, FSortType, FSortColumn);
// add items // add items
FListItems.IntfCreateItems; FListItems.WSCreateItems;
// set other properties // set other properties
LVC.SetAllocBy(Self, FAllocBy); LVC.SetAllocBy(Self, FAllocBy);
@ -702,7 +702,7 @@ end;
procedure TCustomListView.Loaded; procedure TCustomListView.Loaded;
begin begin
// create interface columns if needed // create interface columns if needed
FColumns.IntfCreateColumns; FColumns.WSCreateColumns;
inherited Loaded; inherited Loaded;
end; end;

View File

@ -51,8 +51,8 @@ begin
FImageIndex := -1; FImageIndex := -1;
inherited Create(ACollection); inherited Create(ACollection);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
IntfCreateColumn; WSCreateColumn;
end; end;
destructor TListColumn.Destroy; destructor TListColumn.Destroy;
@ -64,7 +64,7 @@ var
WSC: TWSCustomListViewClass; WSC: TWSCustomListViewClass;
begin begin
idx := Index; idx := Index;
UpdAllowed := IntfUpdateAllowed; UpdAllowed := WSUpdateAllowed;
if Collection is TListColumns if Collection is TListColumns
then begin then begin
@ -83,7 +83,7 @@ begin
WSC.ColumnDelete(LV, Idx); WSC.ColumnDelete(LV, Idx);
end; end;
procedure TListColumn.IntfCreateColumn; procedure TListColumn.WSCreateColumn;
var var
LV: TCustomListView; LV: TCustomListView;
WSC: TWSCustomListViewClass; WSC: TWSCustomListViewClass;
@ -101,7 +101,7 @@ begin
WSC.ColumnSetVisible(LV, Index, Self, FVisible); WSC.ColumnSetVisible(LV, Index, Self, FVisible);
end; end;
function TListColumn.IntfUpdateAllowed: Boolean; function TListColumn.WSUpdateAllowed: Boolean;
begin begin
Result := (Collection <> nil) Result := (Collection <> nil)
and (TListColumns(Collection).FOwner <> nil) and (TListColumns(Collection).FOwner <> nil)
@ -115,7 +115,7 @@ var
LV: TCustomListView; LV: TCustomListView;
WSC: TWSCustomListViewClass; WSC: TWSCustomListViewClass;
begin begin
if IntfUpdateAllowed if WSUpdateAllowed
then begin then begin
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -134,7 +134,7 @@ begin
if FAlignment = AValue then Exit; if FAlignment = AValue then Exit;
FAlignment := AValue; FAlignment := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -149,7 +149,7 @@ begin
if AValue = FCaption then Exit; if AValue = FCaption then Exit;
FCaption := AValue; FCaption := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -164,7 +164,7 @@ begin
if FWidth = AValue then Exit; if FWidth = AValue then Exit;
FWidth := AValue; FWidth := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -179,7 +179,7 @@ begin
if FMaxWidth = AValue then Exit; if FMaxWidth = AValue then Exit;
FMaxWidth := AValue; FMaxWidth := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -194,7 +194,7 @@ begin
if FMinWidth = AValue then Exit; if FMinWidth = AValue then Exit;
FMinWidth := AValue; FMinWidth := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -209,7 +209,7 @@ begin
if FAutoSize = AValue then Exit; if FAutoSize = AValue then Exit;
FAutoSize := AValue; FAutoSize := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -224,7 +224,7 @@ begin
if FImageIndex = AValue then Exit; if FImageIndex = AValue then Exit;
FImageIndex := AValue; FImageIndex := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -241,7 +241,7 @@ begin
inherited; inherited;
if OldIndex = Index then Exit; if OldIndex = Index then Exit;
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);
@ -262,7 +262,7 @@ begin
if FVisible = AValue then Exit; if FVisible = AValue then Exit;
FVisible := AValue; FVisible := AValue;
Changed(False); Changed(False);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := TListColumns(Collection).FOwner; LV := TListColumns(Collection).FOwner;
WSC := TWSCustomListViewClass(LV.WidgetSetClass); WSC := TWSCustomListViewClass(LV.WidgetSetClass);

View File

@ -86,12 +86,12 @@ begin
Result := TListColumn(inherited GetItem(AIndex)); Result := TListColumn(inherited GetItem(AIndex));
end; end;
procedure TListColumns.IntfCreateColumns; procedure TListColumns.WSCreateColumns;
var var
n: Integer; n: Integer;
begin begin
for n :=0 to Count - 1 do for n :=0 to Count - 1 do
GetItem(n).IntfCreateColumn; GetItem(n).WSCreateColumn;
end; end;
procedure TListColumns.SetItem(const AIndex: Integer; const AValue: TListColumn); procedure TListColumns.SetItem(const AIndex: Integer; const AValue: TListColumn);

View File

@ -71,7 +71,7 @@ var
WSC: TWSCustomListViewClass; WSC: TWSCustomListViewClass;
begin begin
if (FOwner <> nil) if (FOwner <> nil)
and FOwner.IntfUpdateAllowed and FOwner.WSUpdateAllowed
and ((FChangeIndex = -1) or (FUpdate <> [])) and ((FChangeIndex = -1) or (FUpdate <> []))
then begin then begin
LV := FOwner.FOwner.FOwner; LV := FOwner.FOwner.FOwner;
@ -367,7 +367,7 @@ end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
{ TListItem IntfUpdateText } { TListItem IntfUpdateText }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
procedure TListItem.IntfUpdateText; procedure TListItem.WSUpdateText;
var var
LV: TCustomListView; LV: TCustomListView;
n, Idx, Cnt, ColCnt: Integer; n, Idx, Cnt, ColCnt: Integer;
@ -399,7 +399,7 @@ end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
{ TListItem IntfUpdateImages } { TListItem IntfUpdateImages }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
procedure TListItem.IntfUpdateImages; procedure TListItem.WSUpdateImages;
var var
LV: TCustomListView; LV: TCustomListView;
n, Idx, Cnt, ColCnt: Integer; n, Idx, Cnt, ColCnt: Integer;
@ -431,11 +431,11 @@ end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
{ TListItem IntfUpdateAllowed } { TListItem IntfUpdateAllowed }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
function TListItem.IntfUpdateAllowed: Boolean; function TListItem.WSUpdateAllowed: Boolean;
begin begin
Result := (FFlags * [lifDestroying, lifCreated] = [lifCreated]) Result := (FFlags * [lifDestroying, lifCreated] = [lifCreated])
and (FOwner <> nil) and (FOwner <> nil)
and FOwner.IntfUpdateAllowed; and FOwner.WSUpdateAllowed;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
@ -471,7 +471,7 @@ begin
AState := TListItemState(ALisOrd); AState := TListItemState(ALisOrd);
LV := FOwner.FOwner; LV := FOwner.FOwner;
if IntfUpdateAllowed if WSUpdateAllowed
and TWSCustomListViewClass(LV.WidgetSetClass).ItemGetState(LV, GetIndex, Self, AState, Result) and TWSCustomListViewClass(LV.WidgetSetClass).ItemGetState(LV, GetIndex, Self, AState, Result)
then begin then begin
// update FStates // update FStates
@ -528,7 +528,7 @@ begin
if FCaption = AValue then Exit; if FCaption = AValue then Exit;
FCaption := AValue; FCaption := AValue;
LV := FOwner.FOwner; LV := FOwner.FOwner;
if IntfUpdateAllowed if WSUpdateAllowed
then TWSCustomListViewClass(LV.WidgetSetClass).ItemSetText(LV, GetIndex, Self, 0, FCaption); then TWSCustomListViewClass(LV.WidgetSetClass).ItemSetText(LV, GetIndex, Self, 0, FCaption);
end; end;
@ -540,7 +540,7 @@ var
LV: TCustomListView; LV: TCustomListView;
begin begin
LV := FOwner.FOwner; LV := FOwner.FOwner;
if LV.Checkboxes and IntfUpdateAllowed if LV.Checkboxes and WSUpdateAllowed
then TWSCustomListViewClass(LV.WidgetSetClass).ItemSetChecked(LV, GetIndex, Self, AValue); then TWSCustomListViewClass(LV.WidgetSetClass).ItemSetChecked(LV, GetIndex, Self, AValue);
end; end;
@ -562,7 +562,7 @@ begin
FImageIndex := AValue; FImageIndex := AValue;
if IntfUpdateAllowed if WSUpdateAllowed
then TWSCustomListViewClass(FOwner.FOwner.WidgetSetClass).ItemSetImage(FOwner.FOwner, GetIndex, Self, 0, FImageIndex); then TWSCustomListViewClass(FOwner.FOwner.WidgetSetClass).ItemSetImage(FOwner.FOwner, GetIndex, Self, 0, FImageIndex);
end; end;
@ -582,7 +582,7 @@ begin
then Include(FStates, AState) then Include(FStates, AState)
else Exclude(FStates, AState); else Exclude(FStates, AState);
if not IntfUpdateAllowed then Exit; if not WSUpdateAllowed then Exit;
LV := FOwner.FOwner; LV := FOwner.FOwner;
TWSCustomListViewClass(LV.WidgetSetClass).ItemSetState(LV, GetIndex, Self, AState, AIsSet); TWSCustomListViewClass(LV.WidgetSetClass).ItemSetState(LV, GetIndex, Self, AState, AIsSet);
end; end;

View File

@ -70,10 +70,10 @@ begin
FCacheIndex := AIndex; FCacheIndex := AIndex;
FCacheItem := AValue; FCacheItem := AValue;
if AValue.IntfUpdateAllowed if AValue.WSUpdateAllowed
then begin then begin
AValue.IntfUpdateText; AValue.WSUpdateText;
AValue.IntfUpdateImages; AValue.WSUpdateImages;
end; end;
end; end;
@ -94,8 +94,8 @@ begin
FCacheIndex := FItems.Add(AItem); FCacheIndex := FItems.Add(AItem);
FCacheItem := AItem; FCacheItem := AItem;
if IntfUpdateAllowed if WSUpdateAllowed
then IntfCreateCacheItem; then WSCreateCacheItem;
//Notify parent TListView that something was added. //Notify parent TListView that something was added.
if FOwner <> nil if FOwner <> nil
@ -122,18 +122,18 @@ end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
{ TListItems IntfCreateItem } { TListItems IntfCreateItem }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
procedure TListItems.IntfCreateCacheItem; procedure TListItems.WSCreateCacheItem;
begin begin
TWSCustomListViewClass(FOwner.WidgetSetClass).ItemInsert(FOwner, FCacheIndex, FCacheItem); TWSCustomListViewClass(FOwner.WidgetSetClass).ItemInsert(FOwner, FCacheIndex, FCacheItem);
Include(FCacheItem.FFlags, lifCreated); Include(FCacheItem.FFlags, lifCreated);
FCacheItem.IntfUpdateText; FCacheItem.WSUpdateText;
FCacheItem.IntfUpdateImages; FCacheItem.WSUpdateImages;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
{ TListItems IntfCreateItems } { TListItems IntfCreateItems }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
procedure TListItems.IntfCreateItems; procedure TListItems.WSCreateItems;
var var
n: integer; n: integer;
begin begin
@ -141,14 +141,14 @@ begin
begin begin
FCacheItem := TListItem(FItems[n]); FCacheItem := TListItem(FItems[n]);
FCacheIndex := n; FCacheIndex := n;
IntfCreateCacheItem; WSCreateCacheItem;
end; end;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
{ TListItems IntfUpdateAllowed } { TListItems IntfUpdateAllowed }
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
function TListItems.IntfUpdateAllowed: Boolean; function TListItems.WSUpdateAllowed: Boolean;
begin begin
Result := (FOwner <> nil) Result := (FOwner <> nil)
and FOwner.HandleAllocated and FOwner.HandleAllocated
@ -225,8 +225,8 @@ begin
FCacheIndex := AIndex; FCacheIndex := AIndex;
FCacheItem := AItem; FCacheItem := AItem;
if IntfUpdateAllowed if WSUpdateAllowed
then IntfCreateCacheItem; then WSCreateCacheItem;
//Notify parent TListView that something was added. //Notify parent TListView that something was added.
if FOwner <> nil if FOwner <> nil