[Lazarus] TToolButton dropdown

2012-04-09 Thread Richard Mace
Hi, I have a TToolButton in a tool bar, with it's style set to tbsDropDown and have linked the DropDownMenu property to a drop down menu. All is working fine when I click on the down arrow to the right of the button, however, I'd really like the button to also activate the dropdown menu when it is

Re: [Lazarus] TToolButton dropdown

2012-04-09 Thread Juha Manninen
2012/4/9 Richard Mace richard.m...@gmail.com Hi, I have a TToolButton in a tool bar, with it's style set to tbsDropDown and have linked the DropDownMenu property to a drop down menu. All is working fine when I click on the down arrow to the right of the button, however, I'd really like the

Re: [Lazarus] TToolButton dropdown

2012-04-09 Thread Mattias Gaertner
On Mon, 9 Apr 2012 11:48:33 +0300 Juha Manninen juha.mannine...@gmail.com wrote: 2012/4/9 Richard Mace richard.m...@gmail.com Hi, I have a TToolButton in a tool bar, with it's style set to tbsDropDown and have linked the DropDownMenu property to a drop down menu. All is working fine

Re: [Lazarus] Lazarus 1.0 is branched

2012-04-09 Thread Bernd
2012/4/9 waldo kitty wkitt...@windstream.net: interesting... i do not recall useride in what i was looking at in the makefile but... where do you see this listed as a make target? A few months ago I noticed a commit regarding this (I have the svn log in my rss reader) which made me curious

Re: [Lazarus] Is it meaningful or possible to change the visibility or the properties and events in a form or datamodule, ie make the private or protected?

2012-04-09 Thread Frank Church
On 23 March 2012 14:15, michael.vancann...@wisa.be wrote: On Fri, 23 Mar 2012, Michael Fuchs wrote: Am 23.03.2012 14:55, schrieb Frank Church: [...]  I'd prefer to look only at the public section and say, Oh, this is what it does for the program's other modules. Whatever isn't there is

Re: [Lazarus] Is it meaningful or possible to change the visibility or the properties and events in a form or datamodule, ie make the private or protected?

2012-04-09 Thread Michael Van Canneyt
On Mon, 9 Apr 2012, Frank Church wrote: On 23 March 2012 14:15, michael.vancann...@wisa.be wrote: On Fri, 23 Mar 2012, Michael Fuchs wrote: Am 23.03.2012 14:55, schrieb Frank Church: [...]  I'd prefer to look only at the public section and say, Oh, this is what it does for the

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 12:30 AM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Sat, 7 Apr 2012 23:49:42 -0300 Marcos Douglas m...@delfire.net wrote: Hi, Using FPC 2.6.1 and Laz trunk on Windows, there is a better way to not to do such codes below? Examples 1- I'm on the

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Felipe Monteiro de Carvalho
On Mon, Apr 9, 2012 at 2:04 PM, Marcos Douglas m...@delfire.net wrote: Ops... you're right. I was confused because IncludeTrailingPathDelimiter is part of RTL and it not works with UTF8. The code uses Length and Result[l]... so, I thought this is would be problem. Some routines made for Ansi

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 9:19 AM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Mon, Apr 9, 2012 at 2:04 PM, Marcos Douglas m...@delfire.net wrote: Ops... you're right. I was confused because IncludeTrailingPathDelimiter is part of RTL and it not works with UTF8.

[Lazarus] How get a handle for a TComponent descendant under GTK2

2012-04-09 Thread Fabio Luis Girardi
I'm trying to get a handle for a TComponent descendent class under GTK2. On Tmyclass.Create(..) I did: begin ... fHandle := AllocateHWnd(wndMessagesMethod); ... end; But when I call PostMessage(objectofMyClass.fhandle, LM_MYMESSAGE,0,0); I got the exception: GetLCLObject=nil

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Felipe Monteiro de Carvalho
On Mon, Apr 9, 2012 at 2:37 PM, Marcos Douglas m...@delfire.net wrote: The result is 5 not 3, but you did know this of course. If you study carefully UTF-8 and follow the code of the RTL routines you will find out that some routines work with UTF-8 without changes, regardless of the fact that

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marco van de Voort
On Mon, Apr 09, 2012 at 09:37:16AM -0300, Marcos Douglas wrote: Lenght function do not works with UTF8 correctly. procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text := '??b??'; ShowMessage(IntToStr(Length(Edit1.Text))); end; The result is 5 not 3, but you did know this

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 11:14 AM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Mon, Apr 9, 2012 at 2:37 PM, Marcos Douglas m...@delfire.net wrote: The result is 5 not 3, but you did know this of course. If you study carefully UTF-8 and follow the code of the RTL

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 11:18 AM, Marco van de Voort mar...@stack.nl wrote: On Mon, Apr 09, 2012 at 09:37:16AM -0300, Marcos Douglas wrote: Lenght function do not works with UTF8 correctly. procedure TForm1.Button1Click(Sender: TObject); begin   Edit1.Text := '??b??';  

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Mattias Gaertner
On Mon, 9 Apr 2012 11:50:37 -0300 Marcos Douglas m...@delfire.net wrote: On Mon, Apr 9, 2012 at 11:14 AM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Mon, Apr 9, 2012 at 2:37 PM, Marcos Douglas m...@delfire.net wrote: The result is 5 not 3, but you did know

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 12:17 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Mon, 9 Apr 2012 11:50:37 -0300 Marcos Douglas m...@delfire.net wrote: On Mon, Apr 9, 2012 at 11:14 AM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Mon, Apr 9, 2012 at 2:37 PM,

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marco van de Voort
On Mon, Apr 09, 2012 at 11:56:50AM -0300, Marcos Douglas wrote: The result is 5 not 3, but you did know this of course. Both are valid results. The first is needed when you copy the string (bytes to move) the second to display the string (since it will probably be around 3 glyphs (yes, I

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Jürgen Hestermann
Marcos Douglas schrieb: For the Lazarus sources yes, but not for RTL. I still think about: DirectoryExists or DirectoryExistsUTF8 ForceDirectoriesUTF8 or ForceDirectories Pos or UTF8Pos etc Depends what part of code you are... Yes, it's a real pain. I once used the Windows API function

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Jürgen Hestermann
Marcos Douglas schrieb: Lenght function do not works with UTF8 correctly. procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text := 'ábç'; ShowMessage(IntToStr(Length(Edit1.Text))); end; The result is 5 not 3, but you did know this of course. Yes. For Unicode encoding we

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 2:18 PM, Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Marcos Douglas schrieb: For the Lazarus sources yes, but not for RTL. I still think about: DirectoryExists or DirectoryExistsUTF8 ForceDirectoriesUTF8 or ForceDirectories Pos or UTF8Pos etc Depends what

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Mattias Gaertner
On Mon, 09 Apr 2012 19:18:15 +0200 Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Marcos Douglas schrieb: For the Lazarus sources yes, but not for RTL. I still think about: DirectoryExists or DirectoryExistsUTF8 ForceDirectoriesUTF8 or ForceDirectories Pos or UTF8Pos etc

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Mattias Gaertner
On Mon, 09 Apr 2012 19:23:08 +0200 Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Marcos Douglas schrieb: Lenght function do not works with UTF8 correctly. procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text := 'ábç'; ShowMessage(IntToStr(Length(Edit1.Text)));

Re: [Lazarus] Lazarus 1.0 is branched

2012-04-09 Thread Mattias Gaertner
On Mon, 9 Apr 2012 12:25:43 +0200 Bernd prof7...@googlemail.com wrote: 2012/4/9 waldo kitty wkitt...@windstream.net: interesting... i do not recall useride in what i was looking at in the makefile but... where do you see this listed as a make target? A few months ago I noticed a commit

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 3:39 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Mon, 09 Apr 2012 19:23:08 +0200 Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Marcos Douglas schrieb:   Lenght function do not works with UTF8 correctly.   procedure TForm1.Button1Click(Sender:

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Felipe Monteiro de Carvalho
On Mon, Apr 9, 2012 at 4:50 PM, Marcos Douglas m...@delfire.net wrote: Agree. But I did not wanted to check every single function if will work or not. That would be very dangerous. You could start a section in the wiki and help us document this. A section in this page:

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Mattias Gaertner
On Mon, 9 Apr 2012 16:59:57 -0300 Marcos Douglas m...@delfire.net wrote: [...] Length = size in bytes UTF8Length = number of code points There is no generic function LengthInGlyphs, because this depends on the font engine and some code points do not have a glyph. In the future, we

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Hans-Peter Diettrich
Mattias Gaertner schrieb: Yes. For Unicode encoding we would need new functions to distinguish between number of bytes and number of (visible) glyphs: LengthInBytes() LengthInGlyphs() It should be mentioned that Unicode allows for different encodings of composed/decomposed characters. E.g.

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Hans-Peter Diettrich
Marcos Douglas schrieb: I still think about: DirectoryExists or DirectoryExistsUTF8 ForceDirectoriesUTF8 or ForceDirectories Pos or UTF8Pos etc Depends what part of code you are... Such problems may (should) go away with the new Unicode- and AnsiString types, where AnsiString contains an

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 5:05 PM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Mon, Apr 9, 2012 at 4:50 PM, Marcos Douglas m...@delfire.net wrote: Agree. But I did not wanted to check every single function if will work or not. That would be very dangerous. You

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 5:43 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Mon, 9 Apr 2012 16:59:57 -0300 Marcos Douglas m...@delfire.net wrote: [...] Length = size in bytes UTF8Length = number of code points There is no generic function LengthInGlyphs, because this depends on

Re: [Lazarus] Unicode on Windows

2012-04-09 Thread Marcos Douglas
On Mon, Apr 9, 2012 at 8:17 PM, Hans-Peter Diettrich drdiettri...@aol.com wrote: Marcos Douglas schrieb: I still think about: DirectoryExists or DirectoryExistsUTF8 ForceDirectoriesUTF8 or ForceDirectories Pos or UTF8Pos etc Depends what part of code you are... Such problems may

[Lazarus] Best practices on using classes for subroutine libraries

2012-04-09 Thread Frank Church
When I need a variation in procedures (standalone, not a class or object procedure) I use across my applications, I often find it more convenient to create a copy the unit into the project folder and make the changes there. Sometimes they get merged back into the shared unit or not at all. I am