[Lazarus] Possible bug?

2013-09-11 Thread Richard Mace
If you put a TPairSplitter on a form, then in the right sire add a
TNotebook, then add a page, then add a memo that is anchored Top,Left and
Right. When you resize the main form in design, the memo correctly wraps,
but at runtime it doesn't.

Is this a bug?

Richard
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Extended Feature, inactive IFDEF: Quick fold all inactive ifdef

2013-09-11 Thread Mattias Gaertner
On Tue, 10 Sep 2013 22:31:55 +0100
Martin laza...@mfriebe.de wrote:

 Just right click the foldgutter (the small vertical space containing the 
 [+] and [-])
 
 And select Fold inactive IFdef

I only see one menu item Hide comments.
The inactive IFDEFs have no folder icon in the gutter.

 
 Note:
 
 1) single line entries can not fold
 a:= {$IFDEF Foo} @{$ENDIF}MyMethood
 
 2) if you have code after the EndIf of a multi-line ifdef, then this 
 code will be in the fold too
 
   {$IFDEF Foo}
// code here
   {$ENDIF}  // more code on this line

Mattias
 

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Antonio Fortuny


Le 11/09/2013 07:51, Richard Mace a écrit :

Hi,
Can anyone give me an example of adding and retrieving an integer 
value to a TTreenode via it's data property please?


I've tried the below, but it doesn't seem to work.

Set:
with 
tvMain.Items.AddChildObject(tvMain.Selected,'string',TObject(fUserList.Items[I].Id)) 
do

change to:
with tvMain.Items.AddChildObject(tvMain.Selected,'string', 
*Pointer*(fUserList.Items[I].Id)) do



and getting as, throws an exception on start:
procedure TfrmMain.tvMainChange(Sender: TObject; Node: TTreeNode);
begin
  ShowMessage('Node ' + IntToStr(Integer(Node.Data)));

change to:
ShowMessage('Node ' + IntToStr(*PtrInt***(Node.Data)));

Antonio.

end;

Thanks in advance

Richard


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Howard Page-Clark

On 11/09/2013 09:24, Antonio Fortuny wrote:

Le 11/09/2013 07:51, Richard Mace a écrit :

procedure TfrmMain.tvMainChange(Sender: TObject; Node: TTreeNode);
begin
  ShowMessage('Node ' + IntToStr(Integer(Node.Data)));

change to:
ShowMessage('Node ' + IntToStr(*PtrInt***(Node.Data)));


Also unless you want the treeview to behave as if it were fully 
initialised with Data integer values of zero, you would need to add:



procedure TfrmMain.tvMainChange(Sender: TObject; Node: TTreeNode);
begin
  if Assigned(Node) then
ShowMessage('Node ' + IntToStr(PtrInt(Node.Data)));



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Extended Feature, inactive IFDEF: Quick fold all inactive ifdef

2013-09-11 Thread Martin

On 11/09/2013 09:18, Mattias Gaertner wrote:

On Tue, 10 Sep 2013 22:31:55 +0100
Martin laza...@mfriebe.de wrote:


Just right click the foldgutter (the small vertical space containing the
[+] and [-])

And select Fold inactive IFdef

I only see one menu item Hide comments.
The inactive IFDEFs have no folder icon in the gutter.


It is only their if there are inactive ifdef in that file, it is per file.

If you have a selection (that  I forgot to mention), then it will only 
check (and act on) the selected text



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Graeme Geldenhuys
On 2013-09-11 06:51, Richard Mace wrote:
 Can anyone give me an example of adding and retrieving an integer value to
 a TTreenode via it's data property please?

The Data property holds a pointer value, so don't assign an Integer
directly. Rather define a Record structure (or a Class) that holds the
data you want (in your case an Integer field), then assign the pointer
to the record structure to the Treenode.Data property.

There is an example in the LCL documentation:

  http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreenode.data.html


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE - SynEdit not accept accented characters

2013-09-11 Thread Martin

On 08/09/2013 13:14, Junior wrote:

Lazarus 1.1 r42677M FPC 2.6.2 i386-linux-gtk 2 (Ubuntu 12.04)

(É - é - Ã - ã - Â - â ...)

ShowMessage('É Á');

appears

ShowMessage('E A');


I can confirm this on
Fedora 18
gnome 3.6.3

dead keys to not work


german key layout:

- pressing the key for any accent on the next char: nothing 
(expected/correct)
- pressing the key for any accent on the next char TWICE: showing the 
accent (actually backtick) (expected/correct)
- pressing the key for any accent on the next char, then a vocal that 
can be accented: nothing  (wrong)


works in gedit on the same system/ same settings


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Extended Feature, inactive IFDEF: Quick fold all inactive ifdef

2013-09-11 Thread Mattias Gaertner

 Martin laza...@mfriebe.de hat am 11. September 2013 um 11:12 geschrieben:


 On 11/09/2013 09:18, Mattias Gaertner wrote:
  On Tue, 10 Sep 2013 22:31:55 +0100
  Martin laza...@mfriebe.de wrote:
 
  Just right click the foldgutter (the small vertical space containing the
  [+] and [-])
 
  And select Fold inactive IFdef
  I only see one menu item Hide comments.
  The inactive IFDEFs have no folder icon in the gutter.

 It is only their if there are inactive ifdef in that file, it is per file.
 
I assumed so.
It does not even work neither with synedit.pp nor synedit.inc.
 
 If you have a selection (that I forgot to mention), then it will only
 check (and act on) the selected text

 
Mattias
 

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE - SynEdit not accept accented characters / revision found

2013-09-11 Thread Martin

On 11/09/2013 11:45, Martin wrote:

On 08/09/2013 13:14, Junior wrote:

Lazarus 1.1 r42677M FPC 2.6.2 i386-linux-gtk 2 (Ubuntu 12.04)

(É - é - Ã - ã - Â - â ...)

ShowMessage('É Á');

appears

ShowMessage('E A');


I can confirm this on
Fedora 18
gnome 3.6.3


It was introduced in
Revision: 42581
Author: juha
Date: 04 September 2013 01:06:33
Message:
LCL: Fix accent chars in GTK2. Remove Gtk2LatinAccents define after 
testing. Issues #24750 and #22507. Original patch from Éderson Cássio


Modified : /trunk/lcl/interfaces/gtk2/gtk2proc.inc





dead keys to not work


german key layout:

- pressing the key for any accent on the next char: nothing 
(expected/correct)
- pressing the key for any accent on the next char TWICE: showing the 
accent (actually backtick) (expected/correct)
- pressing the key for any accent on the next char, then a vocal that 
can be accented: nothing  (wrong)


works in gedit on the same system/ same settings


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Richard Mace
Thanks for the reply.
Can't it be type casted because both a pointer and integer are 4 bytes?
On 11 Sep 2013 10:46, Graeme Geldenhuys gra...@geldenhuys.co.uk wrote:

 On 2013-09-11 06:51, Richard Mace wrote:
  Can anyone give me an example of adding and retrieving an integer value
 to
  a TTreenode via it's data property please?

 The Data property holds a pointer value, so don't assign an Integer
 directly. Rather define a Record structure (or a Class) that holds the
 data you want (in your case an Integer field), then assign the pointer
 to the record structure to the Treenode.Data property.

 There is an example in the LCL documentation:

   http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreenode.data.html


 Regards,
   Graeme

 --
 fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
 http://fpgui.sourceforge.net/


 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] IDE - SynEdit not accept accented characters / revision found

2013-09-11 Thread Juha Manninen
On Wed, Sep 11, 2013 at 2:42 PM, Martin laza...@mfriebe.de wrote:
 It was introduced in
 Revision: 42581
 Author: juha
 Date: 04 September 2013 01:06:33
 Message:
 LCL: Fix accent chars in GTK2. Remove Gtk2LatinAccents define after testing.
 Issues #24750 and #22507. Original patch from Éderson Cássio
 
 Modified : /trunk/lcl/interfaces/gtk2/gtk2proc.inc

Ok, now it appparently got testers. The define was there for a long
time and nobody complained.
These are nasty errors because they don't happen in every machine or locale.
I detached myself from the issue. Somebody else can continue.

Regards,
Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Juha Manninen
On Wed, Sep 11, 2013 at 3:24 PM, Richard Mace richard.m...@gmail.com wrote:
 Can't it be type casted because both a pointer and integer are 4 bytes?

They  are both 4 bytes only in 32-bit computers.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Graeme Geldenhuys
On 2013-09-11 14:02, Juha Manninen wrote:
 
 They  are both 4 bytes only in 32-bit computers.


+1



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Hans-Peter Diettrich

Richard Mace schrieb:

Thanks for the reply.
Can't it be type casted because both a pointer and integer are 4 bytes?


Dunno about Lazarus, but casts work in Delphi.

Hint: pointers may be longer than integers, but never shorter. So you 
won't loose information when e.g. storing an 32 bit integer into a 64 
bit pointer field. Consequently the opposite direction, i.e. storing an 
pointer in an integer field, may not work.


That's why newer Delphi versions also have the Tag properties expanded, 
so that it's possible to store pointers there.


DoDi


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Hans-Peter Diettrich

Antonio Fortuny schrieb:


Le 11/09/2013 07:51, Richard Mace a écrit :

Hi,
Can anyone give me an example of adding and retrieving an integer 
value to a TTreenode via it's data property please?


I've tried the below, but it doesn't seem to work.

Set:
with 
tvMain.Items.AddChildObject(tvMain.Selected,'string',TObject(fUserList.Items[I].Id)) 
do

change to:
with tvMain.Items.AddChildObject(tvMain.Selected,'string', 
*Pointer*(fUserList.Items[I].Id)) do


I'd store fUserList.Items[I] there, which is an address and allows 
access to further values later.


DoDi


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Lukasz Sokol
On 11/09/13 14:02, Juha Manninen wrote:
 On Wed, Sep 11, 2013 at 3:24 PM, Richard Mace richard.m...@gmail.com wrote:
 Can't it be type casted because both a pointer and integer are 4 bytes?
 
 They  are both 4 bytes only in 32-bit computers.
 
 Juha
 

And if your program is compiled to 32bit executable and ran on 64bit mode 
Windows 
in compat mode (e.g. win7+)?

(i guess this question is rhetorical ;)

-L.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Howard Page-Clark

On 11/09/2013 18:03, Flávio Etrusco wrote:

On Wed, Sep 11, 2013 at 5:41 AM, Howard Page-Clark h...@talktalk.net wrote:



Also unless you want the treeview to behave as if it were fully initialised
with Data integer values of zero, you would need to add:



procedure TfrmMain.tvMainChange(Sender: TObject; Node: TTreeNode);
begin
   if Assigned(Node) then
 ShowMessage('Node ' + IntToStr(PtrInt(Node.Data)));



I guess you mean if Assigned(Node.Data) then ?


Indeed that is what I meant, not what I wrote!


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Web Services Toolkit designtime package doesn't compile with fpc 2.6.2

2013-09-11 Thread Dimitrios Chr. Ioannidis
Hi,

  is it possible, someone, to resolve the
http://bugs.freepascal.org/view.php?id=24091 ticket so i can close it ?

regards,

-- 
Dimitrios Chr. Ioannidis
Nephelae - http://www.nephelae.eu

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Flávio Etrusco
On Wed, Sep 11, 2013 at 5:41 AM, Howard Page-Clark h...@talktalk.net wrote:


 Also unless you want the treeview to behave as if it were fully initialised
 with Data integer values of zero, you would need to add:



 procedure TfrmMain.tvMainChange(Sender: TObject; Node: TTreeNode);
 begin
   if Assigned(Node) then
 ShowMessage('Node ' + IntToStr(PtrInt(Node.Data)));


I guess you mean if Assigned(Node.Data) then ?

-Flávio

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Hans-Peter Diettrich

Howard Page-Clark schrieb:

On 11/09/2013 18:03, Flávio Etrusco wrote:
On Wed, Sep 11, 2013 at 5:41 AM, Howard Page-Clark h...@talktalk.net 



procedure TfrmMain.tvMainChange(Sender: TObject; Node: TTreeNode);
begin
   if Assigned(Node) then
 ShowMessage('Node ' + IntToStr(PtrInt(Node.Data)));



I guess you mean if Assigned(Node.Data) then ?


Indeed that is what I meant, not what I wrote!


In this case you can omit the if entirely.

DoDi


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Flávio Etrusco
On Wed, Sep 11, 2013 at 6:19 AM, Graeme Geldenhuys
gra...@geldenhuys.co.uk wrote:
 On 2013-09-11 06:51, Richard Mace wrote:
 Can anyone give me an example of adding and retrieving an integer value to
 a TTreenode via it's data property please?

 The Data property holds a pointer value, so don't assign an Integer
 directly. Rather define a Record structure (or a Class) that holds the
 data you want (in your case an Integer field), then assign the pointer
 to the record structure to the Treenode.Data property.

 There is an example in the LCL documentation:

   http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreenode.data.html


 Regards,
   Graeme

I don't agree this is a rule of thumb. If you know what you're doing
you should store whatever data fits in Data (pointer size) and avoid
the hundreds of tiny annoying allocations...

Regards,
Flávio

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TTreenode.data

2013-09-11 Thread Richard Mace
On 11 September 2013 10:19, Graeme Geldenhuys gra...@geldenhuys.co.ukwrote:

 On 2013-09-11 06:51, Richard Mace wrote:
  Can anyone give me an example of adding and retrieving an integer value
 to
  a TTreenode via it's data property please?

 The Data property holds a pointer value, so don't assign an Integer
 directly. Rather define a Record structure (or a Class) that holds the
 data you want (in your case an Integer field), then assign the pointer
 to the record structure to the Treenode.Data property.

 There is an example in the LCL documentation:

   http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreenode.data.html


OK, thanks for everyone's input. I have re-written it with the following,
but ShowMessage still isn't display the correct User.Id
For clarification fUserList is a TObjectList

with tvMain.Items.AddChild(tvMain.Selected,IntToStr(fUserList.Items[I].Id))
do
  begin
Data := fUserList.Items[I];
ImageIndex := 2;
  end;
procedure TfrmMain.tvMainSelectionChanged(Sender: TObject);
begin
  if Assigned(TTreeNode(Sender).Data) then
ShowMessage('Node ' + IntToStr(TUser(TTreeNode(Sender).Data).Id));
end;

I'm obviously doing something a bit daft, but can't work out what?
Any input would be greatly received.

Thanks

Richard
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus