mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 15:49:10 +02:00
LCL: fix showing empty filelistbox (bug #7465)
git-svn-id: trunk@10399 -
This commit is contained in:
parent
71de954bd0
commit
d082e56c6d
@ -256,7 +256,8 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
i:=ItemIndex;
|
||||
if i<0 then
|
||||
// in a multiselect listbox, the itemindex can be 0 in an empty list
|
||||
if (i<0) or (i>=Items.Count) then
|
||||
FFileName := ''
|
||||
else begin
|
||||
FFileName := FDirectory+DirectorySeparator+Items[i];
|
||||
|
@ -471,6 +471,11 @@ end;
|
||||
|
||||
class function TWin32WSCustomListBox.GetItemIndex(const ACustomListBox: TCustomListBox): integer;
|
||||
begin
|
||||
if ACustomListBox.MultiSelect then
|
||||
// Return focused item for multiselect listbox
|
||||
Result := SendMessage(ACustomListBox.Handle, LB_GETCARETINDEX, 0, 0)
|
||||
else
|
||||
// LB_GETCURSEL is only for single select listbox
|
||||
Result := SendMessage(ACustomListBox.Handle, LB_GETCURSEL, 0, 0);
|
||||
if Result = LB_ERR then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user