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


Yet i see in TCustomListBox.DrawItem it has something the same -
 if not (odPainted in State) then

Kind Regards


Justin Smyth

----- Original Message ----- From: "cobines" <cobi...@gmail.com> To: "Justin Smyth" <delph...@smythconsulting.net>; "FPC-Pascal users discussions" <fpc-pascal@lists.freepascal.org>
Sent: Saturday, February 20, 2010 9:07 PM
Subject: Re: [fpc-pascal] Sets & FPC


If state is of type TOwnerDrawStateType then it can have only one value:

var
state: TOwnerDrawStateType;
...
if odSelected = state then
begin
 // My Code....
end;


If state is a set type of TOwnerDrawStateType then it can have more values:

var
state: set of TOwnerDrawStateType;
...
if odSelected in state then
begin
 // My Code....
end;


Maybe you meant to declare 'state' as a set.

--
cobines




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

Reply via email to