« on: April 17, 2016, 09:20:39 pm »
Can you make your own TDBLookupComboBox so that the selection color is the color i want (let's say red) under Mac OSX?
If so how do i do that because i am a noob at making new components.
P.s. This does NOT work under Mac OSX (this is only for the selection color, not for the 'arrow').
procedure TForm_Wedstrijden.CB_SeizoenDrawItem(Control: TWinControl;
Index: Integer; ARect: TRect; State: TOwnerDrawState);
var Str: string;
begin
Str := CB_Seizoen.Items[Index];
if odSelected in State then
TDBLookUpComboBox(Control).Canvas.Brush.Color := clRed
else
TDBLookUpComboBox(Control).Canvas.Brush.Color := CB_Seizoen.Color;
TDBLookUpComboBox(Control).Canvas.FillRect(ARect);
DrawText(TDBLookUpComboBox(Control).Canvas.Handle, PChar(Str), Length(Str), ARect, DT_LEFT);
end; // CB_SeizoenDrawItem
« Last Edit: April 17, 2016, 09:23:26 pm by madref »

Logged
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.
Main Platform:
--------------
Mac OS X Sequoaia 15.6.1
Lazarus 4.99 (rev main_4_99-2644-gfd63613782) FPC 3.3.1 x86_64-darwin-cocoa
Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)