Hello General mailing list!

I have on a form TListView and I found TListView doesn't report
correct value in SelCount in the case, that the owner form is not
shown.

When I ask for SelCount before I close the Windows then it reports
>0, but after ShowModal reports =0;

After closing the windows HandleAllocated results FALSE.

function TCustomListView.GetSelCount: Integer;
begin
  if HandleAllocated
  then Result := TWSCustomListViewClass(WidgetSetClass).GetSelCount(Self)
  else Result := 0;
end;

I can make a workaround for this, that I will save the value before
windows is closed, but I think, that it is bug.

Is it purpose or bug?

----------------------------------------
Example:
----------------------------------------

FUNCTION Unit2Execute (MVisible:BOOLEAN):BOOLEAN;
var i:integer;
BEGIN
  WITH TForm2.Create (Application) DO begin
    ShowModal;
    i := ListView1.SelCount;
    ShowMessage (Inttostr (i));
    Free;
  END;
END;


{ TForm2 }

procedure TForm2.Button1Click(Sender: TObject);
var i:integer;
begin
  i := ListView1.SelCount;
  ShowMessage (Inttostr (i));
  ModalResult := mrOK;
end;


-- 
Best regards, TRoland
http://www.rotursoft.sk
http://exekutor.rotursoft.sk

_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to