From 538e53caadea1b6090cd57dd5f262e663b66587a Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 13 Oct 2009 09:24:26 +0000 Subject: [PATCH] lcl: use TImageIndex instead of Integer in more cases git-svn-id: trunk@22138 - --- lcl/actnlist.pas | 2 +- lcl/comctrls.pp | 8 ++++---- lcl/include/actionlink.inc | 2 +- lcl/include/menuactionlink.inc | 2 +- lcl/include/tabcontrol.inc | 7 +++---- lcl/include/toolbutton.inc | 4 ++-- lcl/menus.pp | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lcl/actnlist.pas b/lcl/actnlist.pas index 58cc1bf4a7..7d3ab0271e 100644 --- a/lcl/actnlist.pas +++ b/lcl/actnlist.pas @@ -250,7 +250,7 @@ type procedure SetHelpKeyword(const Value: string); virtual; procedure SetHelpType(Value: THelpType); virtual; procedure SetHint(const Value: string); virtual; - procedure SetImageIndex(Value: Integer); virtual; + procedure SetImageIndex(Value: TImageIndex); virtual; procedure SetShortCut(Value: TShortCut); virtual; procedure SetVisible(Value: Boolean); virtual; public diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 2f37f0c7ae..55e5d146a3 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -1453,7 +1453,7 @@ type protected procedure AssignClient(AClient: TObject); override; procedure SetChecked(Value: Boolean); override; - procedure SetImageIndex(Value: Integer); override; + procedure SetImageIndex(Value: TImageIndex); override; public function IsCheckedLinked: Boolean; override; function IsImageIndexLinked: Boolean; override; @@ -1469,7 +1469,7 @@ type FDown: Boolean; FDropdownMenu: TPopupMenu; FGrouped: Boolean; - FImageIndex: Integer; + FImageIndex: TImageIndex; FIndeterminate: Boolean; FMarked: Boolean; FMenuItem: TMenuItem; @@ -1487,7 +1487,7 @@ type procedure SetDown(Value: Boolean); procedure SetDropdownMenu(Value: TPopupMenu); procedure SetGrouped(Value: Boolean); - procedure SetImageIndex(Value: Integer); + procedure SetImageIndex(Value: TImageIndex); procedure SetIndeterminate(Value: Boolean); procedure SetMarked(Value: Boolean); procedure SetMenuItem(Value: TMenuItem); @@ -1553,7 +1553,7 @@ type property Enabled; property Grouped: Boolean read FGrouped write SetGrouped default False; property Height stored False; - property ImageIndex: Integer read FImageIndex write SetImageIndex stored IsImageIndexStored default -1; + property ImageIndex: TImageIndex read FImageIndex write SetImageIndex stored IsImageIndexStored default -1; property Indeterminate: Boolean read FIndeterminate write SetIndeterminate default False; property Marked: Boolean read FMarked write SetMarked default False; property MenuItem: TMenuItem read FMenuItem write SetMenuItem; diff --git a/lcl/include/actionlink.inc b/lcl/include/actionlink.inc index e3f8d1560b..35eff9f25a 100644 --- a/lcl/include/actionlink.inc +++ b/lcl/include/actionlink.inc @@ -112,7 +112,7 @@ begin end; -procedure TActionLink.SetImageIndex(Value: Integer); +procedure TActionLink.SetImageIndex(Value: TImageIndex); begin end; diff --git a/lcl/include/menuactionlink.inc b/lcl/include/menuactionlink.inc index dd25ad7274..bd5ea20a37 100644 --- a/lcl/include/menuactionlink.inc +++ b/lcl/include/menuactionlink.inc @@ -116,7 +116,7 @@ begin if IsHintLinked then FClient.Hint := Value; end; -procedure TMenuActionLink.SetImageIndex(Value: Integer); +procedure TMenuActionLink.SetImageIndex(Value: TImageIndex); begin if IsImageIndexLinked then FClient.ImageIndex := Value; end; diff --git a/lcl/include/tabcontrol.inc b/lcl/include/tabcontrol.inc index bf1349175c..27480ee99e 100644 --- a/lcl/include/tabcontrol.inc +++ b/lcl/include/tabcontrol.inc @@ -150,8 +150,7 @@ end; procedure TTabControlNoteBookStrings.NBGetImageIndex(Sender: TObject; TheTabIndex: Integer; var ImageIndex: Integer); begin - if Sender=nil then ; - ImageIndex:=TabControl.GetImageIndex(TheTabIndex); + ImageIndex := TabControl.GetImageIndex(TheTabIndex); end; procedure TTabControlNoteBookStrings.NBChanging(Sender: TObject; @@ -482,9 +481,9 @@ end; function TCustomTabControl.GetImageIndex(ATabIndex: Integer): Integer; begin - Result:=TabIndex; + Result := TabIndex; if Assigned(FOnGetImageIndex) then - FOnGetImageIndex(Self,TabIndex,Result); + FOnGetImageIndex(Self, TabIndex, Result); end; procedure TCustomTabControl.Loaded; diff --git a/lcl/include/toolbutton.inc b/lcl/include/toolbutton.inc index e9f7dee297..0e389e4d92 100644 --- a/lcl/include/toolbutton.inc +++ b/lcl/include/toolbutton.inc @@ -43,7 +43,7 @@ begin TToolButton(FClient).Down := Value; end; -procedure TToolButtonActionLink.SetImageIndex(Value: Integer); +procedure TToolButtonActionLink.SetImageIndex(Value: TImageIndex); begin {DebugLn(['TToolButtonActionLink.SetImageIndex A ',ClassName,' Client=', TToolButton(FClient).Name,' IsImageIndexLinked=', @@ -566,7 +566,7 @@ begin end; end; -procedure TToolButton.SetImageIndex(Value: Integer); +procedure TToolButton.SetImageIndex(Value: TImageIndex); begin if FImageIndex = Value then exit; //debugln('TToolButton.SetImageIndex ',Name,':',ClassName,' Old=',FImageIndex,' New=',Value); diff --git a/lcl/menus.pp b/lcl/menus.pp index 25e6853768..3b0927ade8 100644 --- a/lcl/menus.pp +++ b/lcl/menus.pp @@ -78,7 +78,7 @@ type procedure SetEnabled(Value: Boolean); override; procedure SetHelpContext(Value: THelpContext); override; procedure SetHint(const Value: string); override; - procedure SetImageIndex(Value: Integer); override; + procedure SetImageIndex(Value: TImageIndex); override; procedure SetShortCut(Value: TShortCut); override; procedure SetVisible(Value: Boolean); override; procedure SetOnExecute(Value: TNotifyEvent); override;