procedure TJvCustomListBox.CNDrawItem(var Msg: TWMDrawItem);
var
 State: TOwnerDrawState;
begin
 with Msg.DrawItemStruct^ do
 begin
   State := TOwnerDrawState(word(itemState and $FFFF));
   Canvas.Handle := hDC;
   Canvas.Font := Font;
   Canvas.Brush := Brush;
   if Integer(itemID) >= 0 then
   begin
     if (odSelected in state) then
     begin
       Canvas.Brush.Color := FSelectedColor;
       Canvas.Font.Color := FSelectedTextColor;
     end;
     if (([odDisabled, odGrayed] * State) <> []) or not Enabled then
       Canvas.Font.Color := FDisabledTextColor;
   end;
   if Integer(itemID) >= 0 then
     DrawItem(itemID, rcItem, State)
   else
   begin
     if Background.DoDraw then
     begin
       Perform(WM_ERASEBKGND, Canvas.Handle, 0);
       if (odFocused in State) then
         DrawFocusRect(hDC, rcItem);
     end
     else
     begin
       Canvas.FillRect(rcItem);
       if odFocused in State then
         DrawFocusRect(hDC, rcItem);
     end;
   end;
   Canvas.Handle := 0;
 end;
end;

----- Original Message ----- From: "Jonas Maebe" <jonas.ma...@elis.ugent.be> To: "Justin Smyth" <delph...@smythconsulting.net>; "FPC-Pascal users discussions" <fpc-pascal@lists.freepascal.org>
Sent: Saturday, February 20, 2010 10:39 PM
Subject: Re: [fpc-pascal] Sets & FPC



On 20 Feb 2010, at 12:32, Justin Smyth wrote:

Opps re reading the code it was actually

if (odSelected in State)  then

and state is defined as TOwnerDrawState which points back to -TBaseOwnerDrawState which is a set of TOwnerDrawStateType

Please post sample code that should compile and that demonstrates the problem.


Jonas


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to