mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 17:16:01 +02:00
add measureitem to tcustomlistbox just like tcustomcombobox has
git-svn-id: trunk@5492 -
This commit is contained in:
parent
9ebdcb9f6d
commit
c5117d42da
@ -437,6 +437,16 @@ begin
|
||||
FItems.Clear;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
procedure TCustomListBox.MeasureItem(Index: Integer; var TheHeight: Integer);
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomListBox.MeasureItem(Index: Integer; var TheHeight: Integer);
|
||||
begin
|
||||
if Assigned(OnMeasureItem) then
|
||||
OnMeasureItem(Self,Index,TheHeight);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TCustomListBox.GetIndexAtY(Y: integer): integer;
|
||||
|
||||
|
@ -351,8 +351,8 @@ begin
|
||||
if Sender is TCustomListBox then
|
||||
begin
|
||||
itemHeight := TCustomListBox(Sender).ItemHeight;
|
||||
// if TCustomListBox(Sender).Style = lbOwnerDrawVariable then
|
||||
// TCustomListBox(Sender).MeasureItem(itemID, integer(itemHeight));
|
||||
if TCustomListBox(Sender).Style = lbOwnerDrawVariable then
|
||||
TCustomListBox(Sender).MeasureItem(itemID, integer(itemHeight));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -2996,6 +2996,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.113 2004/05/21 11:13:18 micha
|
||||
add measureitem to tcustomlistbox just like tcustomcombobox has
|
||||
|
||||
Revision 1.112 2004/05/20 21:28:54 marc
|
||||
* Fixed win32 listview
|
||||
|
||||
|
@ -351,6 +351,7 @@ type
|
||||
FItemHeight: Integer;
|
||||
FItemIndex: integer;
|
||||
FOnDrawItem: TDrawItemEvent;
|
||||
FOnMeasureItem: TMeasureItemEvent;
|
||||
FSorted: boolean;
|
||||
FStyle: TListBoxStyle;
|
||||
FTopIndex: integer;
|
||||
@ -383,6 +384,9 @@ type
|
||||
procedure SetStyle(Val : TListBoxStyle); virtual;
|
||||
procedure DrawItem(Index: Integer; ARect: TRect;
|
||||
State: TOwnerDrawState); virtual;
|
||||
|
||||
property OnMeasureItem: TMeasureItemEvent
|
||||
read FOnMeasureItem write FOnMeasureItem;
|
||||
public
|
||||
constructor Create(AOwner : TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -391,6 +395,7 @@ type
|
||||
function ItemRect(Index: Integer): TRect;
|
||||
function ItemVisible(Index: Integer): boolean;
|
||||
procedure MakeCurrentVisible;
|
||||
procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual;
|
||||
procedure Clear;
|
||||
public
|
||||
property Align;
|
||||
@ -1544,6 +1549,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.143 2004/05/21 11:13:18 micha
|
||||
add measureitem to tcustomlistbox just like tcustomcombobox has
|
||||
|
||||
Revision 1.142 2004/05/21 09:03:54 micha
|
||||
implement new borderstyle
|
||||
- centralize to twincontrol (protected)
|
||||
|
Loading…
Reference in New Issue
Block a user