Re: [fpc-pascal] Sets & FPC

2018-05-29 Thread martin_wynne
Justin Smyth wrote > how do I do something like this > > if odSelected in state then > begin > // My Code > end; > > I get this error - Error: Incompatible types: got "TOwnerDrawStateType" > expected " > > " Hi Justin, I'm sure you have fixed this by now, but for anyone else, the answer

Re: [fpc-pascal] Sets & FPC

2010-02-21 Thread Jonas Maebe
On 21 Feb 2010, at 13:20, Justin Smyth wrote: > The orginal code comes from JVCL , which wont complile under FPC , the actual > unit is jvlistbox.pas Without full source code that compiles rather than uncompilable snippets it takes a lot more time to help you. Please post the full source code

Re: [fpc-pascal] Sets & FPC

2010-02-21 Thread Justin Smyth
riginal Message - From: "Jonas Maebe" To: "Justin Smyth" ; "FPC-Pascal users discussions" Sent: Sunday, February 21, 2010 8:11 PM Subject: Re: [fpc-pascal] Sets & FPC On 21 Feb 2010, at 07:26, Justin Smyth wrote: I've done the bit Micheal suggest n

Re: [fpc-pascal] Sets & FPC

2010-02-21 Thread Jonas Maebe
On 21 Feb 2010, at 07:26, Justin Smyth wrote: > I've done the bit Micheal suggest now which i highlight TWMDrawItem it says > its comes from TLMDrawItems. > > i still get Error: Incompatible types: got "TOwnerDrawStateType" expected > "" Can you post the full program somewhere? (or the full s

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Justin Smyth
; Cc: "Justin Smyth" Sent: Saturday, February 20, 2010 11:43 PM Subject: Re: [fpc-pascal] Sets & FPC On Sat, 20 Feb 2010, Jonas Maebe wrote: On 20 Feb 2010, at 13:15, Michael Van Canneyt wrote: On Sat, 20 Feb 2010, Justin Smyth wrote: procedure TJvCustomListBox.CNDrawIt

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Michael Van Canneyt
On Sat, 20 Feb 2010, Jonas Maebe wrote: On 20 Feb 2010, at 13:15, Michael Van Canneyt wrote: On Sat, 20 Feb 2010, Justin Smyth wrote: procedure TJvCustomListBox.CNDrawItem(var Msg: TWMDrawItem); var State: TOwnerDrawState; Try State : Set of TOwnerDrawState; It is already a set: lc

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Jonas Maebe
On 20 Feb 2010, at 13:15, Michael Van Canneyt wrote: > On Sat, 20 Feb 2010, Justin Smyth wrote: > >> procedure TJvCustomListBox.CNDrawItem(var Msg: TWMDrawItem); >> var >> State: TOwnerDrawState; > > Try > > State : Set of TOwnerDrawState; It is already a set: lcltype.pp: TOwnerDrawState =

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Michael Van Canneyt
On Sat, 20 Feb 2010, Justin Smyth wrote: procedure TJvCustomListBox.CNDrawItem(var Msg: TWMDrawItem); var State: TOwnerDrawState; Try State : Set of TOwnerDrawState; Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://li

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Justin Smyth
lRect(rcItem); if odFocused in State then DrawFocusRect(hDC, rcItem); end; end; Canvas.Handle := 0; end; end; - Original Message - From: "Jonas Maebe" To: "Justin Smyth" ; "FPC-Pascal users discussions" Sent: Saturday, February 20, 20

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Jonas Maebe
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

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Justin Smyth
Kind Regards Justin Smyth - Original Message - From: "cobines" To: "Justin Smyth" ; "FPC-Pascal users discussions" Sent: Saturday, February 20, 2010 9:07 PM Subject: Re: [fpc-pascal] Sets & FPC If state is of type TOwnerDrawStateType then it c

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread cobines
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 odSelec

[fpc-pascal] Sets & FPC

2010-02-20 Thread Justin Smyth
I've got a piece of code which uses TOwnerDrawStateType and TBaseOwnerDrawState which is set of TOwnerDrawStateType , if i have on variable called state which is TOwnerDrawStateType how do i do something like this if odSelected in state then begin // My Code end; i get this error - Error