Autor Téma: Lazarus na raspberry - ListBox  (Přečteno 2718 krát)

Offline BigSandy

  • Nováček
  • *
  • Příspěvků: 33
  • Karma: 0
    • Verze Delphi: XE2
Lazarus na raspberry - ListBox
« kdy: 03-08-2019, 16:14:35 »
Dobrý den.
Pod windows ok.
Přes raspi mi to děla toto.


Nenajde se tu někdo, kdo použivá a poradí?
Jak se zbavim těch mezer?
Jsem i zkoušel Style nastavit na lbOwnerDrawFixed a ItemHeight.
To už se však se mnou vůbec nebavi a text se nevykresluje.


Offline BigSandy

  • Nováček
  • *
  • Příspěvků: 33
  • Karma: 0
    • Verze Delphi: XE2
Re:Lazarus na raspberry - ListBox
« Odpověď #1 kdy: 10-08-2019, 13:29:03 »
Takže style nastavit na lbOwnerDrawFixed a ItemHeight velikost, a pak

Kód: [Vybrat]
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  ARect: TRect; State: TOwnerDrawState);
begin
  with (Control as TListBox).Canvas do begin
    Brush.Style := bsSolid;
    if not ListBox1.Selected[Index] then begin
       Brush.Color := clWhite
    end else begin
       Font.Color := clWhite;
    end;
    FillRect(aRect);
    Brush.Style := bsClear;
    TextOut(aRect.Left, aRect.Top, (Control as TListBox).Items[Index]);
  end;
I když nechapu, proč to musím nechat v tom DrawItem překreslovat, ale funguje to. ;D