LCL: implemented TCustomListBox.SelectAll (issue #1603)

git-svn-id: trunk@15266 -
This commit is contained in:
vincents 2008-05-28 08:02:34 +00:00
parent ab422b9665
commit baab4f3e05
2 changed files with 26 additions and 17 deletions

View File

@ -594,6 +594,22 @@ begin
OnMeasureItem(Self, Index, TheHeight);
end;
procedure TCustomListBox.SelectAll;
var
i: Integer;
begin
if MultiSelect then
begin
for i := 0 to Items.Count - 1 do
Selected[i] := true;
end else
begin
i := ItemIndex;
if (i>=0) and (i<Count) then
Selected[i] := true;
end;
end;
{------------------------------------------------------------------------------
function TCustomListBox.GetIndexAtY(Y: integer): integer;

View File

@ -514,19 +514,20 @@ type
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure Click; override; // make it public
procedure Clear; virtual;
procedure ClearSelection;
function GetIndexAtY(Y: integer): integer;
function GetSelectedText: string;
function ItemAtPos(const Pos: TPoint; Existing: Boolean): Integer;
function ItemRect(Index: Integer): TRect;
function ItemVisible(Index: Integer): boolean;
function ItemFullyVisible(Index: Integer): boolean;
procedure LockSelectionChange;
procedure MakeCurrentVisible;
procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual;
procedure Clear; virtual;
procedure ClearSelection;
procedure LockSelectionChange;
procedure SelectAll; virtual;
procedure UnlockSelectionChange;
procedure Click; override; // make it public
public
property Align;
property Anchors;
@ -863,6 +864,7 @@ type
property Font;
property Lines;
property MaxLength;
property ParentBidiMode;
property OnChange;
property OnClick;
property OnDblClick;
@ -881,14 +883,10 @@ type
property OnMouseEnter;
property OnMouseLeave;
property OnStartDrag;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ScrollBars;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
@ -1161,6 +1159,7 @@ type
property DragMode;
property Enabled;
property Font;
property Hint;
property OnChange;
property OnChangeBounds;
property OnClick;
@ -1250,6 +1249,7 @@ type
property Anchors;
property Constraints;
property Hint;
property Font;
property OnClick;
property OnDblClick;
@ -1289,6 +1289,7 @@ type
property DragKind;
property DragMode;
property Enabled;
property Hint;
property OnChange;
property OnClick;
property OnDragDrop;
@ -1335,6 +1336,7 @@ type
property DragMode;
property Enabled;
property Font;
property Hint;
property OnChange;
property OnChangeBounds;
property OnClick;
@ -1536,12 +1538,3 @@ initialization
end.