Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi TbsSkinComboBox OnDrawEvent (https://www.delphipraxis.net/101885-tbsskincombobox-ondrawevent.html)

nachti1505 19. Okt 2007 15:54


TbsSkinComboBox OnDrawEvent
 
Ich möchte eine generische OnDraw Methode für die Almdev TbsSkinComboBox / ListBox / Etc.Box - Komponenten schreiben. Dummerweise geben diesen als EventHeader folgenden vor:

Delphi-Quellcode:
procedure TfrmPersonal.bsSkinComboBox1ListBoxDrawItem(Cnvs: TCanvas; Index,
  ItemWidth, ItemHeight: Integer; TxtRect: TRect; State: TOwnerDrawState);
Sprich, da ist kein Sender: TObject bei. Jemand ne Idee, wie ich trotzdem an den Sender (und damit, viel wichtiger an die Items der jeweiligen Komponente) komme? Hab schon versucht mich über die TCanvas irgendwie durchzuhangeln... aber dat ging nicht.

toms 10. Feb 2008 20:32

Re: TbsSkinComboBox OnDrawEvent
 
Delphi-Quellcode:
procedure bsSkinComboBoxListBoxDrawItem(Sender: TbsSkinComboBox; Cnvs: TCanvas; Index,
  ItemWidth, ItemHeight: Integer; TxtRect: TRect; State: TOwnerDrawState);
begin
  //..
end;

procedure TForm1.bsSkinComboBox1ListBoxDrawItem(Cnvs: TCanvas; Index,
  ItemWidth, ItemHeight: Integer; TxtRect: TRect; State: TOwnerDrawState);
begin
 bsSkinComboBoxListBoxDrawItem(bsSkinComboBox1, Cnvs, Index, ItemWidth, ItemHeight, TxtRect, State);
end;

procedure TForm1.bsSkinComboBox2ListBoxDrawItem(Cnvs: TCanvas; Index,
  ItemWidth, ItemHeight: Integer; TxtRect: TRect; State: TOwnerDrawState);
begin
  bsSkinComboBoxListBoxDrawItem(bsSkinComboBox2, Cnvs, Index, ItemWidth, ItemHeight, TxtRect, State);
end;
(Auch wenn der Thread schon älter ist:)

Es gibt glaub keine andere Möglichkeit, als jeder Komponente ein OnListBoxDrawItem zuzuweisen und dann den jeweiligen Sender einer allgemeinen Funktion zu übergeben


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz