[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

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

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Justin Smyth
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

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
procedure TJvCustomListBox.CNDrawItem(var Msg: TWMDrawItem); var State: TOwnerDrawState; begin with Msg.DrawItemStruct^ do begin State := TOwnerDrawState(word(itemState and $)); Canvas.Handle := hDC; Canvas.Font := Font; Canvas.Brush := Brush; if Integer(itemID) >= 0 then

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 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, 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: Re[4]: [fpc-pascal] Re: Ido not understand UTF8 in Windows

2010-02-20 Thread Tomas Hajny
On Sat, February 20, 2010 01:15, JoshyFun wrote: > Hello Tomas, > > Friday, February 19, 2010, 11:55:39 PM, you wrote: > > TH> No, this can't work that way, otherwise output of any accented > TH> character in one of the Windows codepages would result in the same > TH> error. > > Tested the "wrong"

Re: Re[4]: [fpc-pascal] Re: Ido not understand UTF8 in Windows

2010-02-20 Thread Michael Van Canneyt
On Sat, 20 Feb 2010, Tomas Hajny wrote: On Sat, February 20, 2010 01:15, JoshyFun wrote: Hello Tomas, Friday, February 19, 2010, 11:55:39 PM, you wrote: TH> No, this can't work that way, otherwise output of any accented TH> character in one of the Windows codepages would result in the same

Re[6]: [fpc-pascal] Re: Ido not understand UTF8 in Windows

2010-02-20 Thread JoshyFun
Hello FPC-Pascal, Saturday, February 20, 2010, 3:21:51 PM, you wrote: MVC> I fail to see how this can be an FPC problem. MVC> See MVC> http://msdn.microsoft.com/en-us/library/aa365747(VS.85).aspx MVC> and MVC> http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx MVC> For an explanation. I

[fpc-pascal] some new features to delphi prisem

2010-02-20 Thread ik
Hello, REM Objects released an interesting document regarding some changes (that looks so much like Ruby) to their Delphi Prisem. For example assignment of a value regarding a condition: x := if Something then 2; y := case Other of bla : 'hello'; foo : 'bye'; baz : 'ad

Re: [fpc-pascal] Re: FPC from subversion without root access

2010-02-20 Thread Osvaldo Filho
Thank you. I have my own compiler - files from another computer - not the ubuntu package. How can I say the Make program where are the files of the compiler? They are in: ~/apps/fpc/bin and ~/apps/fpc/lib 2010/2/18 Marc Weustink : > Osvaldo Filho wrote: >> >> Sorry: >> >> How can I get the FPC s

Re: [fpc-pascal] some new features to delphi prisem

2010-02-20 Thread Jürgen Hestermann
y := case Other of bla : 'hello'; foo : 'bye'; baz : 'adius'; end; What do you gain with this? Doesn't look much different to case Other of bla : y := 'hello'; foo : y := 'bye'; baz : y := 'adius'; end; __

Re: [fpc-pascal] some new features to delphi prisem

2010-02-20 Thread ik
On Sat, Feb 20, 2010 at 20:01, Jürgen Hestermann wrote: > > > y := case Other of >> bla : 'hello'; >> foo : 'bye'; >> baz : 'adius'; >> end; >> > > What do you gain with this? > Doesn't look much different to > > case Other of > bla : y := 'hello'; > foo : y := 'b

Re: [fpc-pascal] some new features to delphi prisem

2010-02-20 Thread Marco van de Voort
In our previous episode, ik said: > > > > Shorter write imho. Or something easily marketable to make people upgrade. Not a problem of FPC. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pasca

Re: [fpc-pascal] Re: FPC from subversion without root access

2010-02-20 Thread Marc Weustink
Osvaldo Filho wrote: Thank you. I have my own compiler - files from another computer - not the ubuntu package. How can I say the Make program where are the files of the compiler? They are in: ~/apps/fpc/bin and ~/apps/fpc/lib add ~/apps/fpc/bin to your path ( if you use bash: add the followi

Re: [fpc-pascal] Sets & FPC

2010-02-20 Thread Justin Smyth
I'm still getting the same errors 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 "" heres my code procedure TJvCustomListBox.CNDrawItem(var Msg: TWMDrawItem