Re: [Lazarus] components\aggpas\gpc - non-commercial use only

2016-05-17 Thread Mattias Gaertner
On Tue, 17 May 2016 23:07:38 +0300
Denis Kozlov <dez...@gmail.com> wrote:

> On 17 May 2016 at 16:34, Mattias Gaertner <nc-gaert...@netcologne.de> wrote:
> 
> >
> > For Debian maintainers and other third party bundles we should gather
> > the abbreviated license information in the components/readme.txt, so
> > they can easier pick the cherries.
> >
> 
> It's not a bad idea.
> 
> Maybe we can go even a step further, to avoid duplication and introduce
> some consistency:
> 
> 1) Document licensing terms in *.lpk files of each package (making it
> mandatory for all future packages).

It always was. If a lpk is missing its license, please report the bug.

> 2) Use 2 licensing attributes/nodes in *.lpk files:
> A) License Title (e.g. "GPL", "LGPL", "MPL", "MIT", "BSD" ... "Custom"
> - so that it can be easily enumerated and summarized);

What about double licensing (e.g. "GPL2 or higher", "MPL or LGPL2 with
liking exception") or part (e.g. "LGPL-2, except gpc.pas which has
custom license")?

> B) License Description (i.e. this can be the full license text, in case
> of "Custom" licensing terms)
> 3) Create IDE tools to summarize licensing terms of:
>A) Currently installed packages,
>B) All available packages,

This info can be shown in "Package Graph" and "Install Packages" in the
memo. Read this: you don't need a new dialog for this.

>C) Packages used in the current project (if possible)

This info can be shown in the Project Inspector. Read this: you don't
need a new dialog for this.


> If this is suitable, I volunteer to analyze licensing terms of existing
> packages and implement the work above.

Thanks.

Mattias

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


Re: [Lazarus] components\aggpas\gpc - non-commercial use only

2016-05-17 Thread Mattias Gaertner
On Tue, 17 May 2016 16:14:01 +0300
Denis Kozlov  wrote:

>[...]it is not natural to require developer to check *every
> component or part* for licensing terms, which can be hundreds or even
> thousands of individual parts.

Hundreds? You only need to check one per package.

 
> That is why I thought it could be clearer if most of Lazarus/FPC code base
> is under the same licensing schema, while everything that falls outside of
> it could be easily discovered (this is where an idea of placing such code
> into a dedicated folder came about). This kind of approach would
> drastically simply code base slicing based on licensing terms, that is what
> Debian packagers have to do with Lazarus and many other packages.

For Debian maintainers and other third party bundles we should gather
the abbreviated license information in the components/readme.txt, so
they can easier pick the cherries.

Mattias

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


Re: [Lazarus] components\aggpas\gpc - non-commercial use only

2016-05-17 Thread Mattias Gaertner
On Tue, 17 May 2016 11:01:35 +0300
Denis Kozlov  wrote:

>[...]
> Does it make sense to include NON-free components in Lazarus distribution?

It depends on how you define "NON-free".

The gpc.pas may be freely copied, modified, and redistributed
provided that the copyright notice is preserved on all copies.
You may not distribute this software, in whole or in part, as
part of any commercial product without the express consent of
the author.

 
> Similarly, many icons were recently removed from Lazarus because they were
> NON-free, even though optional to use.
> 
> This breaks the paradigm and consistency that FPC, Lazarus and LCL are
> licensed under modified LGPL .
> It puts developer into a tricky situation - does one needs to check every
> source code file to ensure it can be included in their code base?

Developers must at least read the readme of each package they use.
The aggpas readme.txt mentions the gpc exception. 
And Lazarus has GPL packages, which do not allow use in closed source
applications.

Mattias

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


Re: [Lazarus] How to play audio from memory.

2016-05-17 Thread Mattias Gaertner
On Tue, 17 May 2016 08:13:11 +0100
Graeme Geldenhuys  wrote:

>[...]
> > the code tree that references those units.  Do you know if Lazarus has a 
> > way to show the units used when a compilation fails?

You might want to increase the compiler verbosity. Project / Project
Options / Compiler Options / Verbosity

 
> Do a Build All instead of a standard Compile.Then right click in the
> IDE's Messages window and select "Copy -> Copy All Messages". Paste the
> clipboard to some text editor and review all the units compiled.
> 
> It would be nice if Lazarus IDE has an option to show unfiltered output
> in the Messages window, but I haven't figured out if this is possible or
> now. Older versions of Lazarus use do do that.

Right Click / Filter*


Mattias

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


Re: [Lazarus] HEAPTRACE IFDEF

2016-05-03 Thread Mattias Gaertner
On Tue, 03 May 2016 06:49:42 -0700
Aradeonas  wrote:

> > AFAIK, it's because it's not technically possible.
> As an amateur can I ask why?
> > Use {$IF DECLARED(useheaptrace)} in your main project file (just like
> > lazarus.pp uses it).
> Very interesting! I didnt know this ability,Thanks. How it works? what
> key names it has?

UseHeapTrace is a variable in unit heaptrc, which is silently used
when compiling with -gh.

> But it has a problem, if you use this define IDE wont color it properly
> like you use normal defines, it that case it if define is not true it
> will pale.

$IF DECLARED is not supported by codetools.

Mattias

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


Re: [Lazarus] Missing components in Lazarus 1.6 DEB

2016-04-29 Thread Mattias Gaertner
On Fri, 29 Apr 2016 17:20:54 +0100
Denis Kozlov  wrote:

> Nobody else noticed randomly missing files from Lazarus 1.6 distribution
> for Linux?

Debian ships its own version of Lazarus .deb packages.
They are split into many small packages.
We need to create a debian bug report for the missing .lpk files.

The sourceforge site of Lazarus itself contains a single Lazarus
package, which does contain the .lpk files.
It also contains a package for fpc and the fpc sources.
You might want to install these three packages instead.

Mattias

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


Re: [Lazarus] Problem with non-ascii chars fpc-3.0.0 vs fpc-3.1.1 under Windows

2016-04-27 Thread Mattias Gaertner
On Wed, 27 Apr 2016 20:30:43 +0200
zeljko  wrote:

> Hi,
> Just run into problem with fpc-3.0.0, OS Windows-10 64bit, 32bit 
> application, lazarus trunk qtlcl and win32 ws both have same problem.
> 
> fpc-3.1.1 (18.01.2016) is correct - both running from lazarus or as 
> standalone.
> 
> fpc-3.0.0 is not correct in both cases (even worse if running from 
> lazarus, then GetEnvironmentVariableUTF8 returns garbage instead of
> letter Ž.
> 
> fpc-2.6.4 - works just fine.
> 
> 
> My project doesn't use anything special - pure empty project with one 
> form and TMemo - no extra settings like -FcUTF8 or similar, using mode 
> delphi 
> 
> Problematic part is line with CACHEDIR= (see screenshoots) which is 
> correct with 3.1.1 and it returns correct path from this function:
> 
> function GetCacheDir_: String;
> {$IFDEF MSWINDOWS}
> var
>s: string;
>s1: string;
> {$ENDIF}
> begin
>{$IFDEF UNIX}
>Result := GetEnvironmentVariable('HOME') + PathDelim + '.holobit';
>{$ELSE}
>// fpc-3.1.1 returns correct values here, while fpc-3.0.0 NOT
>// if environmentvariable contains non-ascii chars
>s := GetEnvironmentVariable('HOMEDRIVE');
>// added s := s+ to fit into mail ...
>s := s + GetEnvironmentVariable('HOMEPATH')+PathDelim+'.holobit';
>SetLength(s1, length(s));
>OEMToAnsiBuff(@S[1], @S1[1], length(S1));

OEMToAnsiBuff expects a string in DOS codepage and returns a string in
Windows codepage.
GetEnvironmentVariableUTF8 returns an UTF-8 encoded string.

What encoding do you need for the function result?

>Result := S1;
>{$ENDIF}
> end;
> 
> So, my question would be: is it known bug in 3.0.0 and will be fixed in 
> 3.0.2 or it's already merged in fixes_3_0 or I can sit and cry...or I'm 
> missing something ?

Mattias

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


Re: [Lazarus] Fatal: Cannot find IdMappedPortTCP used by xxxx

2016-04-23 Thread Mattias Gaertner
On Sat, 23 Apr 2016 11:38:28 +0200
Bo Berglund  wrote:

>[...]
> >> I have googled and looked at old list messages but to no avail. The
> >> closest I got was someone telling me that Lazarus will handle this
> >> fine if only the lpk file is opened once. So I selected File/Open and
> >> navigated to the Indy10 installation dir and opened the IndyLaz.lpk
> >> file and then closed it. No difference at all! The used unit cannot be
> >> found
> >
> >Open it once, so the IDE knows how to resolve a package name (and
> >version) to the location on your disk.
> 
> Well, that was what I did to start with, but it did not help. Compile
> still complains.

Yes, as I explained, opening it once allows the IDE to resolve a package
name, e.g. "IndyLaz". After that you can use the package name in your
project, which is needed for compile.
The package knows the needed compiler flags including the search paths.

 
> So what I ended up doing was to go into the Project Options and in
> Paths added into "Compiler Options/Paths/Other unit files" the
> following:
> ../../dev/indy10/Core;../../dev/indy10/Protocols;../../dev/indy10/System
> 
> Now the project builds but with this warning:
> Warning: other unit files search path (aka unit path) of "MapPort"
> contains "/home/pi/dev/indy10/Core", which belongs to package
> "indylaz"

Either add the package, or add flags manually. Don't do both.

 
> So it seems like for some reason Lazarus now thinks there are two ways
> to the Indy10 files...

There are.


> So I removed the entry in the project options shown above and then I
> compiled again. Now working without me understanding the logic behind
> it all.

Maybe it is not your fault. AFAIK the IndyLaz package is notorious for
fail to compile, because the compiler has sometimes trouble resolving
its unit dependencies. I will try to get a copy.

Mattias

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


Re: [Lazarus] Fatal: Cannot find IdMappedPortTCP used by xxxx

2016-04-23 Thread Mattias Gaertner
On Sat, 23 Apr 2016 10:12:33 +0200
Bo Berglund  wrote:

>[...]
> I have googled and looked at old list messages but to no avail. The
> closest I got was someone telling me that Lazarus will handle this
> fine if only the lpk file is opened once. So I selected File/Open and
> navigated to the Indy10 installation dir and opened the IndyLaz.lpk
> file and then closed it. No difference at all! The used unit cannot be
> found

Open it once, so the IDE knows how to resolve a package name (and
version) to the location on your disk.

The IDE does not add every known package to every project. Every
project has its own list of package requirements. Open the package and
click on "Use / Add to project". Or use the Project Inspector to edit
the package list.

> So it seems like if one creates a non-GUI application in Lazarus then
> the packages installed in Lazarus are not available anymore. :(

When you drop a component onto a designer form, the IDE automatically
adds the package to the project's package list. In a non-GUI project
you have to do this step yourself.

> Note:
> the Indy10 components are all non-GUI in the first place and I usually
> always create them in code.
> 
> How to solve this?

Mattias

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


Re: [Lazarus] where do I put project wide conditional define?

2016-04-19 Thread Mattias Gaertner
On Tue, 19 Apr 2016 19:17:05 +0800
Dennis  wrote:

> I some of my units, I have :
> 
> uses classes,
> {$IFDEF  USE_XYZ}
> certain_unitXYZ
> {$ENDIF};
> 
> 
> Where do I put
> {$DEFINE USE_XYZ}
> 
> so that when I rebuild the project, fpc will see USE_XYZ is defined.
> 
> Putting in in the project .lpr  does not work

Add -dUse_XYZ to 
Project / Project Options / Compiler Options / Custom Options

Mattias

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


Re: [Lazarus] cannot show Code Explorer in new Lazarus 1.7

2016-04-14 Thread Mattias Gaertner
On Thu, 14 Apr 2016 18:21:54 +0800
Dennis  wrote:

> I have some silly questions.
> I recently upgraded to FPC 3 + Lazarus 1.7 but the interface is 
> different from Lazarus 1.4.
> 1) now, there is only 1 window instead of separate window for Editor, 
> inspector , Code Explorer, etc. Can I change it back to the old style?

If you have anchordockingdsgn installed, uninstall it.

> 2) I cannot show the Code Explorer. Clicking Menu->View->Code Explorer 
> has no effect.

Maybe it is on another screen. Check Window / Center a lost Window.

> 3) Menu->Source->JEDI Code Format (Formatter) is missing. How can I get 
> it back?

Install the package jcfidelazarus.

Mattias

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


Re: [Lazarus] wiki page "Better_Unicode_Support_in_Lazarus"

2016-04-13 Thread Mattias Gaertner
On Wed, 13 Apr 2016 12:53:49 +0200
Michael Schnell  wrote:

> On 04/13/2016 11:08 AM, Sven Barth wrote:
> >
> > The code pages that are relevant here are only single byte code pages 
> > (e.g. CP1252) or UTF-8, *never* UTF-16 as a AnsiString can not store 
> > UTF-16 data.
> >
> 
> StringCodePage(s) with an unqualified String return 0 (which is 
> "CP_ACP", and seemingly means "Default").

It means DefaultSystemCodePage.

> But how to determine what encoding this default is, if (as we found) it 
> can't be DefaultSystemCodePage and can be UTF16,

Why do you think that?

> which is dynamic, while 
> the default for unqualified strings is static and *never* UTF-16 ?


Mattias

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


Re: [Lazarus] wiki page "Better_Unicode_Support_in_Lazarus"

2016-04-13 Thread Mattias Gaertner
On Wed, 13 Apr 2016 09:59:33 +0200
Michael Schnell  wrote:

>[...]
> http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus

Good page.


> Now I did some test and asked ob that list and found that the default 
> code page for the type "String" and with that the definition of  of 
> TStrings and with that the working of TStringList.Add and friends 
> depends on the setting of "DefaultSystemcodepage".

The "type" of String does not change.

> I understand that 
> DefaultSystemcodepage is set when compiling the compiler (e.g. to UTF-8 
> on Linux and (supposedly) to UTF-16 in Windows).

No. DefaultSystemcodepage is set at runtime. By the RTL and the
widestring manager.
Lazarus unit LazUTF8 sets it to CP_UTF8.
 
Mattias

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


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-11 Thread Mattias Gaertner
On Mon, 11 Apr 2016 11:56:38 +0100
Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote:

> On 2016-04-11 11:50, Mattias Gaertner wrote:
> >> > Currently with the wiki, rubbish can be added and no review is done! 
> > You could say the same for the fpdoc files.
> 
> Uh? I don't believe that anybody takes a patch from Mantis and applies
> it blindly without actually looking at the patch. If they do, that is
> very sad news for the Lazarus project.

No one is applying blindly patches and no one adds stuff blindly to the
wiki. 
I meant that the developers are humans. They are not experts on all
topics. Buggy patches has been applied.
The more people look over it the better. This is true for both fpdoc
and wiki.
 
> Patches via Mantis has infinitely more chance of being reviewed (at
> minimum glanced over once by a trusted expert) than the 10's or 100's of
> changes made in the Wiki every day.

I doubt these numbers. Especially since infinitely is not a number. ;)

Mattias

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


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-11 Thread Mattias Gaertner
On Mon, 11 Apr 2016 11:18:25 +0100
Graeme Geldenhuys  wrote:

>[...]
> Currently with the wiki, rubbish can be added and no review is done! 

You could say the same for the fpdoc files.

IMO review means someone else reads it and reports/fixes errors. This is
done for both though in different form.
The Wiki has a problem with spammers though.

Mattias

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


Re: [Lazarus] Lazarus Digest, Vol 99, Issue 32

2016-04-11 Thread Mattias Gaertner
On Mon, 11 Apr 2016 10:26:40 +0100
Graeme Geldenhuys  wrote:

>[...]
> Yes, it's called "fpdoc" and have been around for years! It takes a
> minute or two to generate your own help in whatever format you prefer -
> HTML, CHM, INF, TXT etc. Users can contribute by supplying documentation
> patches. It also solves all the above mentioned wiki problems.

There is a simple fpdoc editor built-in the IDE for identifiers
(View / FPDoc Editor). It allows even lazy programmers to easily add
a sentence about an identifier. Just place the source editor cursor on
an identifier, write a short explanation in the fpdoc editor - done.
It also allows to create fpdoc entries for your own projects/packages
with a simple click.

For topics and examples you can use LazDE.

See here:

http://wiki.freepascal.org/FPDoc_Editor

Mattias

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


Re: [Lazarus] TScrollbar users

2016-04-10 Thread Mattias Gaertner
On Sun, 10 Apr 2016 19:24:31 +0200
Zeljko  wrote:

> Hi all,
> Today I've fixed longstanding bug with TScrollbar and max allowed 
> position of thumb. http://bugs.freepascal.org/view.php?id=20127
> Now , gtk2 (gtk lib >= 2.14), qt and win32 have unified behaviour.
> Pls. test against lazarus trunk >= r52156 and see if there's some 
> regression or problem since I want to merge those fixes into 1.6.2.
> 
> P.S: Carbon users feedback is badly needed (haven't touch anything on 
> osx yet ... too far away from my mac machine till next sunday)

Seems to work.
I don't see a difference. There are no up/down arrows on my Mac.

Mattias

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


Re: [Lazarus] Cant compile the IDE with the most recent fpc (3.1.1)

2016-04-07 Thread Mattias Gaertner
On Thu, 07 Apr 2016 16:25:26 +0200
Michael Schnell <mschn...@lumino.de> wrote:

> On 04/07/2016 04:19 PM, Mattias Gaertner wrote:
> > What -Fu paths do you have in your fpc.cfg?
> I did suppose something like this.
> 
> Am I supposed to manually edit this file even for the unmodified svn d/l ?

FPC does not care where the sources are coming from.
You need a valid fpc.cfg, usually /etc/fpc.cfg .

Mattias

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


Re: [Lazarus] Cant compile the IDE with the most recent fpc (3.1.1)

2016-04-07 Thread Mattias Gaertner
On Wed, 06 Apr 2016 09:47:34 +0200
Michael Schnell  wrote:

> It happened to me (again) :(.
> 
> After upgrading fpc to the latest svn version, I can't compile the 
> latest svn version of Lazarus.
> 
> The problem (first) occurs with RegisterFCL.
> 
> (Currently the error is "Can't find unit db used by RegisterFCL", but 
> there had been other units before it did not find. For a test I moved 
> two of the to the dir it in fact searches for fpc units: 
> -Fu/usr/lib/fpc/3.1.1/units/i386-linux/rtl  )
> 
> 
> Seemingly a unit search dir for some of the fpc stuff is missing.
> 
> How to tell the Lazarus make process about those  ?

What -Fu paths do you have in your fpc.cfg?

Mattias

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


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-07 Thread Mattias Gaertner
On Wed, 6 Apr 2016 22:53:43 +0100
Graeme Geldenhuys  wrote:

>[...]
> I see the same thing here with Lazarus v1.7. It is annoying for the SCM,
> but I think I figured out the reasoning for that line. Lazarus packages
> have somewhere a setting that says the unit managing the package must
> (or mustn't) be added to the program using that package. I guess it
> helps with forcing FPC to compile all units in question. I always delete
> that, as I like my uses clause clean.

You are confusing things here.
A package needs a unit, that has a uses clause to let the compiler
compile all units of the package. A design time package also needs to
register its Register procedures.
By default this is done by an auto generated unit. You can do this
with an unit of your own if you prefer.
This unit can also be added automatically to the program, to make sure
that all initialization sections of the package are called.
This is what you mean with "the unit managing the package must (or
mustn't) be added to the program using that package". By default
this is not done and this setting has nothing to do whether the unit is
compiled aka the $warn.

 
>[...]
> Project templates and macros in settings have simplified my life a lot.
> My hard drives have plenty of space for non-shared [between projects]
> compiled units too. 

Sharing ppu can be done easily with macros too and packages can
compile ppu for each project as well. You are missing the point of
packages.
The purpose of packages is to make sharing code easier by separating
the compilation of program and package sources. For example you can add,
rename directories in a package without affecting all programs. You can
play around with compiler flags in your program with less worrying that
packages are affected.
Using macros requires good knowledge of every package you use. As far
as I know you, Graeme, created or maintain all packages you use. In that
case packages are indeed just shared directories of your own sources
and macros might be the better solution.


> Lazarus simply has too many "automated functionality" these days that simply 
> annoy.

... and always lacking this particular feature I need. ;)

Mattias

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


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-07 Thread Mattias Gaertner
On Wed, 6 Apr 2016 23:31:32 +0200
Werner Pamler  wrote:

> Since some time, the TurtoiseSVN overlay icons of some of the packages 
> which I loaded from svn have become practically useless. It is always 
> the autogenerated package unit which is marked by a red overlay icon as 
> being out of date. When I open the unit I see that the line
> 
> {$warn 5023 off : no warning about unused units}

The IDE automatically adds this line to the auto generated package unit.

I changed it now, so it if this $warn is the only difference it does not
update the file.

 
> has been added to the unit header. Deleting the unit, updating it from 
> the svn repository fixes it for the moment,

Hint: You can use the TortoiseSVN 'revert' function for that.


Mattias

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


Re: [Lazarus] German umlauts in component names

2016-04-05 Thread Mattias Gaertner
On Tue, 5 Apr 2016 11:22:21 +0200
JuuS  wrote:

>[...]
> Use a label with custom draw/paint and make your own "buttons" using
> whatever characters you like and use the label's onclick to get where
> you need to go.

No need to. TButton.Caption supports Unicode.

Mattias

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


Re: [Lazarus] Makedeb - how to lower the dependencies

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 15:03:02 -0300
Alexsander Rosa  wrote:

> I would like to allow the resulting .deb to be installed on older Linux
> distros.
> 
> Example on Ubuntu 12.04:
> 
> # dpkg -i rnge3_16.03-i386.deb
> (...)
> dpkg: problemas de dependência impedem a configuração de rnge3:
>  rnge3 depende de libatk1.0-0 (>= *2.10.0*); porém:
>   Versão de libatk1.0-0 no sistema é *2.4.0*-0ubuntu1.
>  rnge3 depende de libgdk-pixbuf2.0-0 (>= *2.30.7*); porém:
>   Versão de libgdk-pixbuf2.0-0 no sistema é *2.26.1*-1.
>  rnge3 depende de libglib2.0-0 (>= *2.40.2*); porém:
>   Versão de libglib2.0-0 no sistema é *2.32.3*-0ubuntu1.
>  rnge3 depende de libgtk2.0-0 (>= *2.24.23*); porém:
>   Versão de libgtk2.0-0 no sistema é *2.24.10*-0ubuntu6.
> 
> If we copy the "rnge3" binary to the older system it works.

Where is the "rnge3" coming from?

Mattias

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


Re: [Lazarus] German umlauts in component names

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 11:45:02 +0200
Sven Barth  wrote:

> Am 04.04.2016 11:40 schrieb "Special" :
> > What problems, Denis? We use component names like "SchließenButton" since
> many years with Delphi in training programs for german pupils. And in code
> for the international community, we don't use it.
> 
> *You* might do this, but others might not, they might publish projects on
> GitHub containing Chinese identifiers.

This is an English mailing list, so naturally you will find many
thinking the same here.
But many people want to use non English words as identifiers. They need
non English letters.

> As funny as the idea of using emojis for identifiers sound as scary it is.
> So I don't really support this.

I share your concerns about non English keywords. For identifiers I
see some gain.

Do the linker, assembler, debugger support UTF encoded identifiers? At
least on Win, Linux, Mac?

Mattias

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


Re: [Lazarus] German umlauts in component names

2016-04-02 Thread Mattias Gaertner
On Sat, 2 Apr 2016 10:14:24 +0200
Special  wrote:

> How can I use names with German Umlauts and 'ß' in the Name Field of 
> TButton components? For instance, I try to set MyButton.Name to 
> "Schließenbutton" and get an error message "Komponentenname 
> Schließenbutton ist kein gültiger Bezeichner".
> 
> This happens with Lazarus 1.6 and FPC 3.0.0 under Win 10 (64) and under 
> Raspian on a Pi3.
> We have many Delphi Programs with German Umlauts in component names and 
> would like to go to Lazarus with them.
> Any hints?

This is not supported by FPC yet.
You have to rename them.

Mattias

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


Re: [Lazarus] Can some fix this "make" issue? Pi related.

2016-04-01 Thread Mattias Gaertner
On Fri, 1 Apr 2016 03:25:47 -0400
Anthony Walter  wrote:

> Calling the compiler directly works on most any project/program. I am not
> sure how to build Lazarus (with my preferred packages) using lazbuild or
> fpc. The "make useride" command fails exactly like I described in my
> original post.

make useride calls "lazbuild --build-ide=", which calls the compiler.
You can call "./lazbuild --build-ide= --max-process-count=1" directly
to avoid calling make and use at most one process.

Make sure to strip lazbuild to avoid loading debugging and compile it
with optimizations to use less memory.

Have you tried building lazbuild with cmem?

If this does not suffice, call the compiler directly using the command
shown by lazbuild.

Is it possible to add virtual memory to the Pi?

Mattias

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


Re: [Lazarus] Can some fix this "make" issue? Pi related.

2016-04-01 Thread Mattias Gaertner
On Fri, 1 Apr 2016 00:39:15 -0400
Anthony Walter  wrote:

>[...]
> My question is can someone look into this issue so that building Lazarus in
> environments where free memory is than 700MB does not result in Lazarus
> build failures?

Does it compile when you directly call the compiler?

Mattias

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


Re: [Lazarus] Is there some way to build a package for all widgsets in one go like the IDE's Build Many option?

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 22:17:20 +0100
"vfclists ."  wrote:

>[...]
> I suppose that this depends on using building a project with the right
> widgetset? My thoughts where more along the line of using the Compile
> button on the package to compile for all the chosen widgetsets in one go.

With "chosen" I guess you mean build modes.
You can use "Run / Build many Modes ..." to compile for all the chosen
widgetsets in one go.

Mattias

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


Re: [Lazarus] Is there some way to build a package for all widgsets in one go like the IDE's Build Many option?

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 21:38:46 +0100
"vfclists ."  wrote:

> Is there some way to build a package for all widgsets in one go like the
> IDE's Build Many option?
> 
> Changing widgetsets results in a recompile of a lot of GUI packages and
> wonder whether that can be avoided. Adding the LCLWidget to the output path
> of packages doesn't seem to work.

Adding the LCLWidgetType to the output directory allows to compile
for each widgetset only once. The Lazarus sources use that too.

 
Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 15:25:03 +0200
Bart <bartjun...@gmail.com> wrote:

> On 3/31/16, Mattias Gaertner <nc-gaert...@netcologne.de> wrote:
> 
> >> Will all this mess go away if we would go the Delphi way
> >> (String=UnicodeString)?
> >> (I know *nix users are going to hate me now)
> >
> > Which mess do you mean?
> > As long as you have to consider codepages, you can get a mess.
> 
> When you use UnicodeString everywhere and no AnsiString anywhere, then
> the only confusion left is Endianess,or am I (as one of the Universes
> idiots) oversimplifying here.

No, you are right. If you somehow(TM) achieve to work only with
UnicodeString you avoid the mess. The same if only use UTF-8 strings. Or
if you only work in system codepage like in TP 3.0 times.

The problem is that you often has to work with
databases/files/libs/etc in other encodings.
So there is always a little bit of mess.

Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 14:32:27 +0200
Bart <bartjun...@gmail.com> wrote:

> On 3/31/16, Mattias Gaertner <nc-gaert...@netcologne.de> wrote:
>[...]
> So, when my usecase for string constants with diacritics in real life
> most of the time is just captions for buttons/menu's etc., the extra
> overhead will not really be something to worry about I guess,and in
> this scenario adding {$codepage utf8} may be the wise thing to do: it
> eliminates all confusion about the intended encoding of the string
> constant.

Well, I'm not so sure about the "eliminates all confusion" as Rick Cook
said:
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying
to build bigger and better idiots. So far, the universe is winning."

 
> So, my current intended approach for GUI applications will be:
> - declare all strings as just String
> - have stringconstants with unicode character all in one file and add
> {$codepage utf8) to that file, and then don't use -FcUTF8 anymore
> (which is what I'm doing ATM),
> 
> That should be rather safe then I guess.

Yes. 
If you avoid PChar(Literal), invalid UTF-8 and #0.

 
> Will all this mess go away if we would go the Delphi way 
> (String=UnicodeString)?
> (I know *nix users are going to hate me now)

Which mess do you mean?
As long as you have to consider codepages, you can get a mess.

Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-31 Thread Mattias Gaertner
On Wed, 30 Mar 2016 18:16:32 +0200
Bart  wrote:

>[...]
> > Any valid UTF-8 string should work, including diacritics.
> Without the codepage identier?

Yes, if you use LazUTF8.
If you don't use LazUTF8 and assign a literal to a UnicodeString you
need the codepage.

 
> Quote from http://wiki.freepascal.org/FPC_Unicode_support#String_constants:
> "Normally, a string constant is interpreted according to the source
> file codepage. If the source file codepage is CP_ACP, a default is
> used instead: in that case, during conversions the constant strings
> are assumed to have code page 28591 (ISO 8859-1 Latin 1; Western
> European). "

AFAIK this is not entirely correct. The string literals are assumed
to be system codepage, which does not need to be code page 28591.
I will ask on the fpc list.


> ...
> "From the above it follows that to ensure predictable interpretation
> of string constants in your source code, it is best to either include
> an explicit {$codepage xxx} directive (or use the equivalent -Fc
> command line option), or to save the source code in UTF-8 with a BOM.
> "
> 
> AFAIK the IDE does not save the file with a BOM, so the compiler may
> very well decide that my sourcefile has ACP codepage?

Yes and no.
When the compiler assumes ACP, it treats the string special. It does
not convert it and stores it as byte copy. At runtime the string has
CP_ACP and its codepage is defined by the variable
DefaultSystemCodePage. LazUTF8 sets this to CP_UTF8, so the string is
treated as UTF-8. Note that it does that without any conversion.

OTOH when you tell the compiler that the source is UTF-8, it converts
the literal to UTF-16. At runtime it converts the string back to UTF-8.
It does that everytime you assign the literal.

So, with both you get an UTF-8 string, but the latter has a bit more
overhead. Also the latter needs special care when typecasting (e.g.
PChar).


>[...] Consider this test sourcefile (encoded as UTF8 without BOM):
>[...]
> DefaultSystemcodePage = 1252
>[...]
> I would say that this experiment contradicts the statement in
> http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus#String_Literals
> ?

No contradiction, because this wiki page is about DefaultSystemcodePage
= CP_UTF8. 

Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 00:16:13 +0200
"Michael W. Vogel"  wrote:

>[...]
> I've tested the example too and I got different results with different 
> options. The test was:
> - BOM / no BOM at the beginning of the sourcefile
> - {$codepage UTF8} or not

The compiler understands -FcUTF8, {$codepage utf8}
and BOM. All three sets UTF-8. See here:
http://wiki.freepascal.org/FPC_Unicode_support#Source_file_codepage

BOM has the advantage that it is understood by other text editors as
well and the disadvantage that it is hidden, so that people unaware
of encodings are easily confused.

-FcUTF8 has the advantage of applying it to all sources in the
project/package and it can easily be turned off. You can unset it for a
single unit via {$modeswitch systemcodepage}.


> - fpc -MObjFPC *-Sh* test.pas (with / without -Sh (use reference counted 
> strings))

And this is where the confusion starts. Mixing multiple string
types is asking for troubles. FPC has an impressive (aka frightening)
list of string types and consequently a vast net of combinations that
only graph theorists can appreciate.

> So it is realy more complex as I thought...

Yes. 
And you have not yet explored the difficulties in code supporting
both FPC 2.6.4 and 3+ and LCL 1.4 and 1.6.

Although Lazarus recommends to "simply" use UTF-8,
technically it recommends AnsiString, DefaultSystemCodepage CP_UTF8, no
explicit codepage, and the UTF-8 functions in LazUtils.
If you need to use other string types in an unit you might want to add
an explicit codepage. Maybe a paragraph should be added to the wiki
about using non AnsiString with the "Lazarus UTF-8".

 
Mattias

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


Re: [Lazarus] Using libjpeg

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 09:49:44 +0200 (CEST)
Michael Van Canneyt  wrote:

> 
> 
> On Wed, 30 Mar 2016, Aradeonas wrote:
> 
> > Hi,
> >
> > I want use libjpeg and I found pasjpeg package in fpc that contains
> > jpeglib.pas unit 

Unit jpeglib does not use libjpeg.


> > but I coudnt find a working demo to know how load a
> > jpeg file and show it.
> > Can anyone point me to a better direction?
> 
> pasjpeg is very low-level. Why not use tfpimage ? 
> use the fpimage unit, see the example converter program.

fpreadjpeg, which is using fpimage, is an example for loading a jpeg
using jpeglib.
And this in turn is used by the LCL.
So, a short LCL example loading and showing a jpeg using jpeglib is:

Put a TImage onto the form and add to FormCreate:

  Image1.Picture.LoadFromFile('example.jpg');


Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 01:20:14 +0200
Bart  wrote:

>[...]
> I was wondering why DefaultSystemCodepage would return CP_ACP on
> Graemes FreeBsd with an UTF8 locale?

The problem only exists on Windows (more exact: OS with system
codepage<>CP_UTF8).

Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 00:26:44 +0200
Bart  wrote:

> On 3/30/16, Juha Manninen  wrote:
>[...]
> I think the statement in the wiki that {$codepage utf8} is not needed is 
> wrong.

You can use UTF-8 without the {$codepage utf8}. But there are cases
where it is needed. Maybe the wording can be improved.

Mattias

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


Re: [Lazarus] Feature Request: Insert {codepage UTF8} per default

2016-03-30 Thread Mattias Gaertner

> "Michael W. Vogel"  hat am 29. März 2016 um 23:20
> geschrieben:
>[...]
>  I'm thinking about the thread here
> http://forum.lazarus.freepascal.org/index.php/topic,31939.msg206688.html#msg206688[...]
>  In the most cases the string magic works without a defined {$codepage utf8},
> but not if you want to assign a const to a Predefined String or Unicodestring.
> 

You have to distinguish between with CP_UTF8 as default and with CP_ACP as
default.
Both have cases where some string combinations fail.

LCL applications nowadays use CP_UTF8 as default. We (laz team) tested adding
-FcUTF8 and it failed in too many cases. Also it adds some overhead. So we
decided to *not* add it by default.

 
>  Offtopic: In the added project: Why is a const 'abc' with {$codepage UTF8} a
> Unicodestring (Windows7, 64bit, Lazarus 1.7 r52077M FPC 3.1.1
> i386-win32-win32/win64 on FPC 3.1.1 r33371)? 

There is no compile-time flag to tell the compiler what codepage the system is
using at runtime. So it assumes current Windows codepage. Any string literal not
in this codepage is stored as UTF-16.

Mattias

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


Re: [Lazarus] Feature Request: Disable/clear the "Recent files" and "Recent projects" lists

2016-03-28 Thread Mattias Gaertner

> Ondrej Pokorny  hat am 28. März 2016 um 20:25 geschrieben:
> 
> On 28.03.2016 18:14, max.lemradt2 wrote:
> 
> > I'd like to be able to disable or clear the "Recent files" and "Recent
> > projects" lists, e. g. for privacy reasons.
> 
> I will probably never use it but if you need it, feel free to create 
> such a function and send a patch to mantis. A good place would be to 
> create a button in Options -> Environment -> Files.

I guess he needs a button to wipe out all history lists. Not just projects and
files.

Mattias

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


Re: [Lazarus] Feature Request: Disable/clear the "Recent files" and "Recent projects" lists

2016-03-28 Thread Mattias Gaertner

> "max.lemradt2"  hat am 28. März 2016 um 18:14
> geschrieben:
> 
> Hello,
> 
> I'd like to be able to disable or clear the "Recent files" and "Recent
> projects" lists, e. g. for privacy reasons.

One solution:
Start the IDE, configure it to your liking.
Close it and remove the  element in ~/.lazarus/environmentoptions.xml
and any other option you don't want to publish.
Copy the environmentoptions.xml and editoroptions.xml files to /etc/lazarus/.
These are the templates used when the IDE starts.

After closing the IDE or before you log out delete the ~/.lazarus directory.

Mattias

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


Re: [Lazarus] Lazarus 1.6 crash

2016-03-27 Thread Mattias Gaertner

> Евгений Поликутин  hat am 27. März 2016 um 03:35
> geschrieben:
> 
> Hi!
> I am using Lazarus 1.6 with FPC 3.0.0. I have found out that when I
> have some code like:
> "var test: test;"
> and I put my mouse pointer over any of two "test" identifiers and wait
> for about 500ms, then, instead of showing me some kind of hint message
> Lazarus will crash, and the only message I get is "Lazarus has stopped
> working".

Please create a bug report.

Mattias

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


Re: [Lazarus] How to recover from Fatal: Invalid PPU-File entry 121

2016-03-19 Thread Mattias Gaertner
On Sat, 19 Mar 2016 18:27:01 -0400
Donald Ziesig  wrote:

> Hi All!
> 
> I've been happily coding away all day on my Raspberry Pi 2B+, when all 
> at once I got the error:
> 
> Compile package LCL 1.7 : Exit code 256, Errors 1
> Fatal: Invalid PPU-File entry 121

It means either you have a broken ppu file, or you spotted a bug in the
compiler.
First try to build clean.
If this does not work, try to find the broken ppu file by compiling
with -vut.

Mattias

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


Re: [Lazarus] Compiling on Odroid / RaspberryPi

2016-03-15 Thread Mattias Gaertner
On Tue, 15 Mar 2016 21:44:18 +1030
steveg  wrote:

> Thanks Mattias -
> 
> I dont seem to have a /etc/fpc.cfg - possibly I didnt install fpc 
> correctly ?
> I svn'd fpc,
> then make clean all / make install

In order to to do that you need a starting fpc. How did you install the
first fpc on the system?

"make install" does everything, except making it the default compiler.
This way "make install" can be used to install a second compiler. I
wonder if there is a simple command to do a complete install as the
main compiler.
To create a config you can use on Linux (Maybe it works on Odroid too):

./compiler/utils/samplecfg /usr/local/lib/fpc/3.1.1 /etc

 
> Should I use a copy of another fpc.cfg and install it to /etc
> (and do I need to modify it at all)

That's possible too.

Mattias

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


Re: [Lazarus] Compiling on Odroid / RaspberryPi

2016-03-15 Thread Mattias Gaertner
On Tue, 15 Mar 2016 21:12:03 +1030
steveg  wrote:

> I am trying to compile Laz on an Odroid Arm system (running Lubuntu 
> 14.04 - LXDE)
> I have fpc 3.1.1 compiled and installed ok (I believe)
> 
> Compiling the latest svn of Laz is giving the following error - (cant 
> find unit)
> process.ppu and friends are in 
> /usr/local/lib/fpc/3.1.1/units/arm-linux/fcl-process
> 
> as far as I can tell, the make script seems to only scan within the base 
> and rtl dirs ? - therefore not seeing process.ppu and others.

Check that your /etc/fpc.cfg contains the -Fu paths to the fpc units.

 
Mattias

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


Re: [Lazarus] Default keymapping adapted to OS X

2016-03-14 Thread Mattias Gaertner
On Mon, 14 Mar 2016 09:13:08 -0400
Dmitry Boyarintsev <skalogryz.li...@gmail.com> wrote:

> On Mon, Mar 14, 2016 at 7:03 AM, Mattias Gaertner <nc-gaert...@netcologne.de
> > wrote:
> 
> > I don't know anyone who wants the Windows/Linux (Lazarus default)
> > scheme under OS X without Ctrl-Meta mapping.
> >
> 
> Count me in.
> I typically start by going to OSX preferences and disabling OSX defaults
> not to interfere with the IDE.
> Can't use Lazarus without Windows/Linux scheme (quite a torture).

The Windows/Linux scheme was not available til yesterday. How did you
use it?

Mattias

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


Re: [Lazarus] Bug in FPC 3.0 discovered

2016-03-11 Thread Mattias Gaertner
On Fri, 11 Mar 2016 14:12:41 +0100 (CET)
Michael Van Canneyt <mich...@freepascal.org> wrote:

> 
> 
> On Fri, 11 Mar 2016, Mattias Gaertner wrote:
> 
> > On Fri, 11 Mar 2016 13:57:02 +0100
> > LacaK <la...@zoznam.sk> wrote:
> >
> >> [...]
> >> There was discovered bug in FPC 3.0 (already fixed in trunk) when
> >> currency and double data types are involved in mathematical operations
> >> like addition or multiplication.
> >
> > Is this bug http://bugs.freepascal.org/view.php?id=29760 ?
> 
> Yes.

Is it already fixed in 3.0.1 and 3.1.1?

Mattias

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


Re: [Lazarus] Bug in FPC 3.0 discovered

2016-03-11 Thread Mattias Gaertner
On Fri, 11 Mar 2016 13:57:02 +0100
LacaK  wrote:

>[...]
> There was discovered bug in FPC 3.0 (already fixed in trunk) when 
> currency and double data types are involved in mathematical operations 
> like addition or multiplication.

Is this bug http://bugs.freepascal.org/view.php?id=29760 ?

Mattias

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


Re: [Lazarus] clean installation

2016-03-10 Thread Mattias Gaertner
On Thu, 10 Mar 2016 18:59:59 -0500
Richard Medina  wrote:

> Hello,
> I followed all your steps but when I call
> 
> rmedinac@rmedinac-desktop ~/dev/lazarus/1.6 $ make bigide
> 
> make -C packager/registration
> make[1]: Entering directory
> `/home/rmedinac/dev/lazarus/1.6/packager/registration'
> /bin/rm -f ../units/x86_64-linux/fcllaz.ppu
> /usr/bin/ppcx64 -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Fu.
> -Fu/usr/lib/fpc/3.0.0/units/x86_64-linux/rtl -FE. -FU../units/x86_64-linux
> -Cg -dx86_64 fcllaz.pas
> Hint: (11030) Start of reading config file /home/rmedinac/.fpc.cfg
> Hint: (11031) End of reading config file /home/rmedinac/.fpc.cfg

Maybe your .fpc.cfg has wrong -Fu paths?


> Fatal: (10022) Can't find unit process used by RegisterFCL
>[...]

Mattias

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


Re: [Lazarus] clean installation

2016-03-09 Thread Mattias Gaertner
On Wed, 9 Mar 2016 16:21:06 -0500
Richard Medina  wrote:

> I am having problems to install the last version of Lazarus.
> Please anyone can help me?
> I am using linux mint (ubuntu).
> I already donwloaded the last version Lazarus 1.6 with fpc3.0.0. and fpc
> source 3.0.0.

What error message do you get?

Mattias

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


Re: [Lazarus] Windows API calls and german Umlauts

2016-03-09 Thread Mattias Gaertner
On Wed, 9 Mar 2016 13:04:50 +0100
"John Landmesser"  wrote:

> Hi,
>  
> if i call a windows API function for special folder, like:
>  
> uses 
> ...
> shlobj;
>  
> var
>   AppDataPath: Array[0..MaxPathLen] of Char;
> begin
>   SHGetSpecialFolderPath(0,AppDataPath,CSIDL_STARTUP,false);
> end;
>  
> I get on a german localized Windows XP a path containing  
> "Startmenü", but the "ü" is "?" in the resulting string.
>  
> Howto convert  the chars in AppDataPath to get the "Umlauts" correct?

According to msdn SHGetSpecialFolderPath is not supported by Microsoft.
Instead, use ShGetFolderPath.

Unit LazFileUtils has already a more sophisticated implementation
for UTF8. I added 
function SHGetFolderPathUTF8(ID :  Integer) : String;

Mattias

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


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Mattias Gaertner
On Tue, 8 Mar 2016 15:01:10 +0100
Ondrej Pokorny  wrote:

>[...]To reduce confusion I can enhance the 
> dialog with a local/class target combobox - people could than map the 
> more interactive shortcut to ctrl+shift+c and use only one shortcut for 
> both class/local target if they want. What do you think?

+1

The less interactive should do a common completion, the more
interactive shows a dialog to choose. This is easy to remember and can
be used for future completions.
For example the interactive completion on a property could give
options to add Getter, Setter or add code for an array property.

 
> If I create a special shortcut for every option of CodeCreation, they 
> could easily blow up (like shortcut for add to private, public etc, 
> maybe more in the future).

Yes, that would be stupid.

Mattias

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


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Mattias Gaertner
On Tue, 8 Mar 2016 14:05:18 +0100
Reimar Grabowski  wrote:

>[...]
> > > Then better 2 shortcut keys:
> > > ctrl-shift-X = create using default set in options.
> > > ctrl-alt-X or ctrl-shift-alt-X = create and force dialog.
> > > Or something similar.  
>[...]
> ctrl-shift-x -> ctrl-shift-alt-x
> ctrl-shift-space -> ctrl-shift-alt-space
> etc.
> 
> (btw those are some ugly short-cuts)

Code completion is ctrl+shift+c. I thought Michael's X was a typo or
placeholder.

Mattias

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


Re: [Lazarus] Ann: class code creation

2016-03-08 Thread Mattias Gaertner
On Tue, 8 Mar 2016 09:49:45 +0100 (CET)
Michael Van Canneyt  wrote:

>[...]
> No, this kind of behaviour is very confusing. Then better 2 shortcut keys:
> ctrl-shift-X = create using default set in options.
> ctrl-alt-X or ctrl-shift-alt-X = create and force dialog.
> Or something similar.

+1
One for less interactive and one for more interactive.
Many code completions can be enhanced with dialogs.

Or a flag button (e.g. speedbutton) to enable/disable the interactivity.

Mattias

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


Re: [Lazarus] Aarch64 as CPU target for RPi3 with Linux as OS

2016-03-03 Thread Mattias Gaertner
On Thu, 03 Mar 2016 06:47:24 +
Alfred  wrote:

>[...]
> How to setup Lazarus to compile for Aarch64 ??
> Fpc does NOT know what to do with -Pa64.
> Fpc does know what to do with -Paarch64.

Fixed. I replaced a64 with aarch64 in the IDE.

Mattias

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


Re: [Lazarus] Project Groups error - "Invalid floating point operation"

2016-02-25 Thread Mattias Gaertner
On Thu, 25 Feb 2016 15:06:35 +
Graeme Geldenhuys  wrote:

>[...]
> Anybody else see this error yet?

Yes. There seems to be a bug in the IDE menu merging code. It happens
only with some combinations of installed packages.


Mattias

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


Re: [Lazarus] Image Copy and Load Fail.

2016-02-25 Thread Mattias Gaertner
On Thu, 25 Feb 2016 19:28:57 +0900 (KST)
최경식  wrote:

>[...]
> procedure TForm1.Button3Click(Sender: TObject);
> var
>   ImagetoSave : TImage;
> begin
>   ImagetoSave := TImage.Create(Self);

A TImage is a visual control that uses a graphic (e.g. a TBitmap) to
paint.
If you only need a memory image use TBitmap directly instead.

This copies pixels (not attributes):

var
  ImagetoSave : TBitmap;
begin
  ImagetoSave := TBitmap.Create(Self);
  with ImagetoSave do
  begin
PixelFormat := pf32bit;
SetSize(Image1.Width,Image1.Height);
Canvas.CopyRect(Rect(0,0,Image1.Width,Image1.Height),
Image1.Picture.Bitmap.Canvas,
Rect(0,0,Image1.Width,Image1.Height));
  end;
  ImagetoSave.SaveToFile('/home/user/Image/copycreate.bmp');
  FileListBox1.UpdateFileList;
end;


> procedure TForm1.FileListBox1Change(Sender: TObject);
> begin
>   if FileListBox1.ItemIndex  -1 then
>   begin
> //Loading
> Image3.Picture.bitmap.TransParentColor := clGreen; //Valuable!

Hint:
If you also want to copy attributes like TransparentColor, use

ImagetoSave.Assign(Image1.Picture.Bitmap);

Mattias

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


Re: [Lazarus] Feature request: Project Groups

2016-02-25 Thread Mattias Gaertner
On Thu, 25 Feb 2016 10:19:15 +
Graeme Geldenhuys  wrote:

>[...]
> One suggestion though. Can the "current project" be highlighted in Bold.
> At the moment there is no way of seeing which project in the project
> group window is the active project.

It's already on my todo list.

 
> Also, what is the point of the "removed targets" tree node? 

As an Undo. The user does not need to confirm the deletion.

> I'm assuming
> when you remove a project from the group it appears under the "removed
> targets" node. But why would you want a removed project to still hang
> around in the project group window? You removed it for a reason right?
> If you want to undo an accidental remove, doesn't simply not saving the
> group, or Ctrl-Z, or your SCM system handle that for you? It seems we
> already have plenty of "undo" choice, and the "removed targets" is just
> overkill.

Ctrl-Z is not implemented. The "removed targets" allow to easily spot
accidental deletions and to examine the removed target.

Mattias

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


Re: [Lazarus] Problem with lazarus 1.6?

2016-02-25 Thread Mattias Gaertner
On Mon, 22 Feb 2016 19:35:55 +0100
Frans  wrote:

> Hi.
> 
> A few days ago I installed lazarus 1.6. After adding some packages I use it 
> works fine but for 2 
> projects.
> I can't close these two projects without a crash of Lazarus, showing the 
> message 'Access violation' 
>[...]
> Anyone an idea where to look?

Can you create a stacktrace?

Mattias

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


Re: [Lazarus] Problem with lazarus 1.6?

2016-02-25 Thread Mattias Gaertner
On Mon, 22 Feb 2016 19:35:55 +0100
Frans  wrote:

> Hi.
> 
> A few days ago I installed lazarus 1.6. After adding some packages I use it 
> works fine but for 2 
> projects.
> I can't close these two projects without a crash of Lazarus, showing the 
> message 'Access violation' 
> twice in a dlg with the title 'Readerror'. One project is the example 
> htmhelpsample (in 
> $(Lazarus)\examples\htmlhelp_ipro).

Please create a bug report.

Mattias

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


Re: [Lazarus] Microsoft Acquires Xamarin

2016-02-24 Thread Mattias Gaertner
On Wed, 24 Feb 2016 15:59:06 -0500
Dmitry Boyarintsev  wrote:

> On Wed, Feb 24, 2016 at 3:16 PM, Anthony Walter  wrote:
> 
> > I expect their price to come down, maybe even into the free price range,
> > as a result of this acquisition.
> >
> 
> Skepticism: what software became better after acquisition by Microsoft?

This is quickly going off-topic.
If you want to answer this question please use fpc-other.

Mattias

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


Re: [Lazarus] Lazarus Release 1.6

2016-02-24 Thread Mattias Gaertner
On Wed, 24 Feb 2016 11:46:05 +0200 (EET)
Kamen Ketev  wrote:

> In which modul are
>  WinCPToUTF8 or CP1251ToUTF8? (   Error: Identifier not found "WinCPToUTF8")  

WinCPToUTF8 from unit LazUTF8 or CP1251ToUTF8 from unit LConvEncoding

 
> I want to make my application both on Windows and Linux.

The encoding of text files depends on what program you used to create
it. Windows applications usually create either system code page or
UTF-8, sometimes UTF-16 LE. Linux apps mostly UTF-8.
Maybe the function GuessEncoding from LConvEncoding can help.

> In Linux can I use the same functions or have any other? 
>  
> Is SysToUtf8 works on Linux? If I use encoding UTF-8 for the fail it works. 

You can use WinCPToUTF8 under Linux too. It simply keeps the UTF-8
there.

Mattias

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


Re: [Lazarus] Clean and build as sudo?

2016-02-24 Thread Mattias Gaertner
On Wed, 24 Feb 2016 07:00:28 +
Pedro Albuquerque  wrote:

> Hi,
> 
> first post here, no coding for the last 25 years, first time with
> Lazarus. Forgive me any inconvenience, please.
> 
> While building an application, I got this error:
> 
> mainwindow.pas(27,22) Error: Cannot find FileUtil used by MainWindow,
> incompatible
> ppu=/usr/share/lazarus/1.4.4/components/lazutils/lib/i386-linux/fileutil.ppu, 
> package LazUtils

Probably your installed compiler (Free Pascal) and the Lazarus binaries
do not match.
How did you install Lazarus?


> Should I run Lazarus as sudo? What are the risks?

Running and testing self written programs is risky, doing it as root
can do havoc to your system.

> Lazarus v.1.4.4
> Ubuntu 14.04 LTS

We provide newer Ubuntu packages (DEB) for FPC and Lazarus:
https://sourceforge.net/projects/lazarus/files/?source=navbar

Mattias

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


Re: [Lazarus] Lazarus Release 1.6

2016-02-24 Thread Mattias Gaertner
On Wed, 24 Feb 2016 08:39:40 +0200 (EET)
Kamen Ketev  wrote:

> 
> "What encoding has the text file? CP1251?"
> ANSI. Only this encoding worked with Lazarus 1.4. 
> "What function do you use for converting the strings to UTF-8?"
> SysToUtf8(s) 

SysToUTF8 was changed, because in the majority of cases it was used for
talking to the RTL.

You can use WinCPToUTF8 or CP1251ToUTF8 instead.

Mattias

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


Re: [Lazarus] Warning about integer constant and expression

2016-02-23 Thread Mattias Gaertner
On Tue, 23 Feb 2016 18:28:29 +0100
Jürgen Hestermann  wrote:

> WIth this definition:
> 
> var  i64 : Int64;
> 
> and this code:
> 
> if i64>High(SizeInt) then
> 
> I get:
> "Warning: Comparison might be always false due to range of constant and 
> expression"
> And even more strange, if I convert the constant to int64 as in
> 
> if i64>int64(High(SizeInt)) then
> 
> I still get this warning.
> Why?

Because on a 64bit system SizeInt = int64.

Mattias

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


Re: [Lazarus] Lazarus Release 1.6

2016-02-23 Thread Mattias Gaertner
On Tue, 23 Feb 2016 14:25:01 +0200 (EET)
Kamen Ketev  wrote:

> Windows 7 64bit. Lazarus 1.6 32bit. 
>[...]
> > I have ComboBox which 
> > takes information about filling from a text file. On Lazarus 1.6 cyrillic 
> > symbols are like this:?-??, . How can I correct this? In 
> > Lazarus 1.4 they was correct. 

What encoding has the text file? CP1251?
What function do you use for converting the strings to UTF-8?


Mattias

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


Re: [Lazarus] Lazarus Release 1.6

2016-02-23 Thread Mattias Gaertner
On Tue, 23 Feb 2016 14:10:25 +0200 (EET)
Kamen Ketev  wrote:

> 
> I have ComboBox which
> takes information about filling from a text file. On Lazarus 1.6 cyrillic 
> symbols are like this:?-??, . How can I correct this? In 
> Lazarus 1.4 they was correct. 

What platform?

Mattias

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


Re: [Lazarus] Additional FPC syntax mode choices

2016-02-19 Thread Mattias Gaertner
On Fri, 19 Feb 2016 08:55:42 +
Alfred  wrote:

> Hello,
> 
> Would it be possible to add
> {$MODE} DELPHIUNICODE (and perhaps also ISO / EXTENDEDPASCAL)
> to the syntax mode choices of the Lazarus (1.7) parsing options ?

I added delphiunicode and iso.

Mattias

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


[Lazarus] Lazarus Release 1.6

2016-02-18 Thread Mattias Gaertner
The Lazarus team is glad to announce the release of Lazarus 1.6.

This release was built with FPC 3.0.0.
The previous release Lazarus 1.4.4 was built with FPC 2.6.4.

Here is the list of changes for Lazarus and Free Pascal:
http://wiki.lazarus.freepascal.org/Lazarus_1.6.0_release_notes
http://wiki.lazarus.freepascal.org/User_Changes_3.0.0

The release is available for download on SourceForge:
http://sourceforge.net/projects/lazarus/files/

Choose your CPU, OS, distro and then the "Lazarus 1.6" directory.

Checksums for the SourceForge files:
http://www.lazarus-ide.org/index.php?page=checksums#1_6

Minimum requirements:

Windows:
  98, 2000, XP, Vista, 7, 8/8.1, 10, 32 or 64 bit.   
  Win98 and WinNT IDE needs FPC 2.6.4 and building with flag
-dWIN9XPLATFORM. 

FreeBSD/Linux:
  gtk 2.8 or qt4.5, 32 or 64bit.

Mac OS X:
  10.5 to 10.11, LCL only 32bit, non LCL apps can be 64bit.

The svn tag is
http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_6

Here is the list of fixes for Lazarus 1.6:
http://wiki.freepascal.org/Lazarus_1.6_fixes_branch

For people who are blocked by SF, the Lazarus releases from SourceForge
are mirrored at: 
ftp://freepascal.dfmk.hu/pub/lazarus/releases/
and later at (after some time for synchronization)
http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
and
http://mirrors.iwi.me/lazarus/

Mattias

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


Re: [Lazarus] TApplication.UpdateMainForm

2016-02-18 Thread Mattias Gaertner
On Wed, 17 Feb 2016 23:09:45 -0200
Fabio Luis Girardi <fluisgira...@gmail.com> wrote:

> Em 17 de fev de 2016 18:41, "Mattias Gaertner" <nc-gaert...@netcologne.de>
> escreveu:
> 
> > No.
> > Why can't you derive from TForm?
> 
> Because TForm publishes some properties that I want keep in protected
> section.

Why do you need a MainForm?

Mattias

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


Re: [Lazarus] TApplication.UpdateMainForm

2016-02-17 Thread Mattias Gaertner
On Wed, 17 Feb 2016 18:25:47 -0200
Fabio Luis Girardi  wrote:

>[...]
> My question is: The parameter AForm should be of type TCustomForm instead
> of TForm?

No. 
Why can't you derive from TForm?

Mattias


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


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-17 Thread Mattias Gaertner
On Wed, 17 Feb 2016 18:03:52 +
Denis Kozlov  wrote:

> It would be useful to have a built-in option to regenerate base PO file
> (and update translated PO files) for a project.
> 
> This could involve:
> 1) Removing all existing LRT, LRJ, RST, RSJ.

This can do that:
Run / Clean up and build

> 2) Forcing project to be recompiled to reprocess resourcestrings and
> produce RSJ

See above.

Mattias

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


Re: [Lazarus] Lazarus application crash. Is PostMessage thread safe?

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 14:53:29 +0100
Michael Schnell  wrote:

> On 02/10/2016 10:12 PM, C Western wrote:
> >
> > My understanding is Application.ProcessMessages has to be reentrant ...
> 
> As calling Application.ProcessMessages is only allowed from the main 
> thread it does not need to be reentrant = thread-save.

IMHO, Michael, you should not redefine words. It confuses people.
Reentrant means it can be called again, while it is still running. It
does not need to be thread-safe. And a thread-safe function does not
need to be reentrant.
Application.ProcessMessages itself is reentrant, but it is not
thread-safe. In fact, as already noted by Michael, it must only be
called by the main thread.
But Application.ProcessMessages can call almost any event
handler, which might not support changing certain properties while
executing.

 
> Of course it can be called recursively and it hence is reentrant in that 
> meaning.

True.

Mattias

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


Re: [Lazarus] non Unicodode application

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 15:38:49 +0200
Juha Manninen  wrote:

> On Fri, Feb 12, 2016 at 3:25 PM, Michael Schnell  wrote:
> > Any automatic type conversion would kill the application.
> > [...]
> > will this be possible with future versions of Lazarus ,as well ?
> 
> I guess you mean automatic encoding conversion for strings. (?)
> The automatic conversion is NOT a feature of Lazarus. It is a feature
> of FPC 3.0+.
> If you don't want it then you can continue using FPC 2.6.4. It is a
> valid choice in some cases, thus Lazarus will support FPC 2.6.4 for
> some time to come.

True, although the wording might be misleading.
FPC 3.0+ does not arbitrarily change encoding of strings.
That's why the LCL can use UTF-8 in AnsiStrings even without the new
UTF-8 mode.
It then works pretty similar to FPC 2.6.4.

Mattias

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


Re: [Lazarus] RFC : "Resolved View"

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 15:25:11 +0100 (CET)
Michael Van Canneyt  wrote:

>[...]
> > What about include files used twice in a unit?
> 
> Yes, that happens in the RTL as a kind of poor-mans generics.

That's no problem when the file compiles. But while typing a directive
the unit structure falls apart. That's no easy problem for a source
editor.


>[...]
> Luckily we have a SuperMattias on board. Now to get that globe to spin
> backwards... ;)

Actually Superman traveled back in time, not the globe. The film was
wrong.

Mattias

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


Re: [Lazarus] non Unicodode application

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 16:41:23 +0100
Michael Schnell  wrote:

> On 02/12/2016 03:54 PM, Juha Manninen wrote:
> > Sure there is hope. See the new UTF-8 support:
> >http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus
> >
> This page says:
> 
> "This page covers Unicode support in Lazarus programs (console or 
> server, no GUI) and applications (GUI with LCL) using features of FPC 
> 3.0+. "
> "RTL with default codepage UTF-8"
> 
> That would mean that the type "String" is 8 Bit  ?

Yes, 8bit per Char.

 
> That would mean that 8 bit Strings are used in TStrings and hence in 
> TStringList ?

Yes.

 
> That would mean that (e.g.) storing 8 bit "String"s in a TStringList 
> would not do any conversion at all ?

Yes.

 
> And it would mean that pos() and friends work on 8 bit Strings (and wist 
> simple byte-positions and length)   ?

Yes.

 
> If string constants and strings coming from and going to the GUI are 
> implicitly converted, I suppose this is manageable.

Without UTF-8 mode you are responsible to convert the LCL UTF-8 strings
to whatever needed (probably system code page, UTF8ToSyS).

With UTF-8 mode all strings are by default UTF-8 and implicitely
converted when using functions like FileExists or
TStrings.LoadFromFile. If you want to work in system code page you have
to convert back and forth between RTL+LCL and your code. 

When converting a Delphi 7 application it depends on what charset(s) the
application supports to decide which mode is easier/better.

Just saying "uncoded strings in TCP/IP" is not enough information.
That can be done in both modes.
 
> Is all this is here to stay, I think my friend could use Lazarus and fpc 
> for his task.

Mattias

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


Re: [Lazarus] non Unicodode application

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 17:16:29 +0100 (CET)
Michael Van Canneyt  wrote:

>[...]
> >> {$define String:=RawByteString}
>[...]
> Type
>T = Type Ansistring(850);

AFAIK this was introduced with Delphi 2009. Not available in Delphi 7.

Mattias

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


Re: [Lazarus] non Unicodode application

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 15:16:38 +0100 (CET)
Michael Van Canneyt  wrote:

>[...]
> {$define String:=RawByteString}
> 
> and you are done.

Won't compile when calling RTL functions with var parameters.

I fail to see why RawByteString should do less conversions than using
AnsiString, when porting a Delphi 7 application. Can you give an
example?

Mattias

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


Re: [Lazarus] non Unicodode application

2016-02-12 Thread Mattias Gaertner
On Fri, 12 Feb 2016 16:53:12 +0100
Michael Schnell  wrote:

>[...]
> > even without the new UTF-8 mode.
> How to set this mode  when compiling with Lazarus  ?

See here
http://wiki.freepascal.org/Lazarus_with_FPC3.0_without_UTF-8_mode

> What mode do you think is more appropriate when most work is done on 
> strings that just have no or an unknown encoding ?

If your strings don't have an encoding the compiler treats them as
default encoding and so the mode does not matter.
Your friend's application won't pass such strings to the GUI, so no
problem with the LCL.
You just have to be careful when mixing strings and widestrings (just
like Delphi), or strings with non default codepage (AFAIK Delphi 7 does
not have them, but maybe you use a package that does).

If your friend use string literals in Delphi they are encoded in system
code page. Here might be some traps.

Mattias

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


Re: [Lazarus] How to set defines for a project? Lazarus crashes...

2016-02-11 Thread Mattias Gaertner
On Tue, 9 Feb 2016 15:21:30 -0500
Dmitry Boyarintsev <skalogryz.li...@gmail.com> wrote:

> On Mon, Feb 8, 2016 at 6:22 PM, Mattias Gaertner <nc-gaert...@netcologne.de>
> wrote:
>[...]
> Is it true to say that there are only 2 ways in IDE to set defines.
> 1) Project Options/Custom Options
> 2) Project Options/Additions and Overrides (+ Custom Option)

3) Packages have their own custom options and can add custom options to
the project.

Mattias

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


Re: [Lazarus] Exclude components from localization by path or text

2016-02-09 Thread Mattias Gaertner
>[...]
> I hope this could be merged into either 1.4 or 1.6 as it's an extremely 
> useful feature for i18n.

Sorry, only bug fixes can go to 1.6.

Mattias

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


Re: [Lazarus] How to set defines for a project? Lazarus crashes...

2016-02-08 Thread Mattias Gaertner
> Bo Berglund  hat am 8. Februar 2016 um 20:24
> geschrieben:
> 
> I tried setting the conditional "UseCThreads" for my test project but
> even though I can reach the place where this apparently is set:
> Menu: Project/Project_Options/Custom_Options/Defines
> it seems not to work!

Do you mean you added -dUseCThreads in Project/Project_Options/Custom_Options,
but it is not appended to options passed to FPC?

 
> When I use this dialog to enter the symbol UseCThreads the effect is
> invisible when I hit OK

Did you enable the checkbox of the define?

>, nothing gets added to the list of
> defines/options and when I OK on the main options window anyway
> Lazarus locks up completely!!!

It works here on OS X/carbon. Maybe the bug only appears on your platform.


>[...] Only way out seems to be to reboot the machine!
> I have not fond any way to open a menu or interact with the Lazarus
> IDE any other way after this happened so now my option is to restart
> the operating system.
> It IS still possible to move the Lazarus windows around on the desktop
> but not to close Lazarus or interact in any other way. :(

Maybe the focus is captured.
 
> Is it not supposed to be possible to use this dialog that clearly
> offers to add a define to actually do this?
> 
> In Delphi this is available in a dialog along with the path settings,
> which is very convenient to use...
> 
> I am using Lazarus 1.6RC2 and FPC 3.0.0 on Raspbian Jessie.

Mattias

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


Re: [Lazarus] Tutorial Video: Getting Started

2016-02-01 Thread Mattias Gaertner
On Mon, 1 Feb 2016 05:43:15 -0500
Anthony Walter  wrote:

> I've posted a tutorial video, which is the first in a series, titled
> "Getting Started". It's available for viewing here:
> 
> http://www.getlazarus.org/learn/tutorials/start/
> 
> Additional tutorial videos with progressively more advanced subject matter
> will be posted to the tutorials section regularly. Up next will be a brief
> introduction to the Lazarus IDE.

It says "Lazarus Learing Center" in the title.

Mattias

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


Re: [Lazarus] Debian (Sid): fpc 3.0.0+dfsg-2 cannot compile lazarus trunc

2016-02-01 Thread Mattias Gaertner
On Mon, 1 Feb 2016 18:20:59 +0100
John Landmesser  wrote:

> Does anybody else has issues with Debians  fpc 3.0.0+dfsg-2

Is this the new FPC 3.0.0 from Debian unstable?

> fpc 3.0.0+dfsg-2 hangs on ..linking

Mattias

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


Re: [Lazarus] bad luck

2016-01-29 Thread Mattias Gaertner
On Fri, 29 Jan 2016 22:54:00 +0100
Marc Santhoff  wrote:

>[...]
> What I asked for is help locating and understanding Lazarus' file
> handling. Some standard errors like unneccessarily holding files open
> when not in use can be avoided easily.

The IDE does not hold files open.

There was a bug some days ago, that could cause the backup to erase the
file even when the file is not written, resulting in an empty file.

Mattias

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


Re: [Lazarus] Package editor in Lazarus 1.6

2016-01-28 Thread Mattias Gaertner
On Thu, 28 Jan 2016 14:34:25 +0200
Juha Manninen <juha.mannine...@gmail.com> wrote:

> On Thu, Jan 28, 2016 at 12:06 AM, Mattias Gaertner
> <nc-gaert...@netcologne.de> wrote:
> > And what was the bug?
> > It does not sound like a bugfix, so I'm a bit worried that it went to
> > 1.6RC2.
> 
> Most changes were made before 1.6 was branched.

Ok. I was just a bit worried when you wrote it is in RC2 instead of
writing it is "in 1.6" and that it wasn't documented.


> Many usability issues were fixed.

Usability is a broad term. If something is unusable then it needs a
fix. If it only "improves" usability, then it is not a bug fix.


> Only the last one was merged to 1.6,
> others happened before it.
> IMO the package editor is now smooth and nice.

Good.
Just keep in mind that "smooth and nice" includes documentation. :)

Mattias

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


Re: [Lazarus] Treeview example(s) needed

2016-01-28 Thread Mattias Gaertner
On Thu, 28 Jan 2016 01:23:36 +0100
"Joe Shepherd"  wrote:

> Thanks, but that's hardly the way (with standalone buttons) anyone would use 
> a treeview.

It demonstrates adding, deleting and selecting nodes.


> Surely the TV's own events (onClick, onChange...) are preferable?

Do you mean you search general examples/documentation for the TV's
events like? Or do you need some help with specific events?


> Apart from some terse words about lack of information on StackExchange, I see 
> nothing on-line about them

Several examples use TTreeView. Use 'Find in Files' to search for
'TTreeView' in the 'lazarus/examples' directory.
For instance xmlreader/testxmlreder.lpi


Mattias

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


Re: [Lazarus] Package editor in Lazarus 1.6

2016-01-27 Thread Mattias Gaertner
On Wed, 27 Jan 2016 22:12:59 +0200
Juha Manninen <juha.mannine...@gmail.com> wrote:

> On Wed, Jan 27, 2016 at 7:44 PM, Mattias Gaertner
> <nc-gaert...@netcologne.de> wrote:
> > What bug was fixed with this patch?
> > ...
> > Changes should be documented:
> > http://wiki.lazarus.freepascal.org/Lazarus_1.6.0_release_notes#IDE_Changes
> 
> Ok, I added a "Package editor" section there.
> Reducing two "Add" buttons to one button was the biggest visible change.
> There were many other changes to make it smooth to use. Yes, it uses
> my new ModifySilently concept which conflicts with your earlier
> concept. Some method names should be fixed but otherwise I still feel
> it is an easy and clean way to do it. You should look at it sometime
> later.

And what was the bug?
It does not sound like a bugfix, so I'm a bit worried that it went to
1.6RC2.

 
> > http://wiki.lazarus.freepascal.org/IDE_Window:_Package_Editor
> 
> Uhhh, that needs more updating. The screenshot must be updated for sure.
> I will look at it tomorrow.

Thanks.

Mattias


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


Re: [Lazarus] Package editor in Lazarus 1.6

2016-01-27 Thread Mattias Gaertner
On Mon, 25 Jan 2016 18:41:42 +0200
Juha Manninen  wrote:

> Forgot to write earlier...
> 
> The package editor has been improved in RC2.
> See this + its related issues :
>   http://bugs.freepascal.org/view.php?id=28097

What bug was fixed with this patch?

> The changes were partly inspired by ideas from Michael Van Canneyt and others.
> See this mail thread :
>  
> http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Package-dialog-tt4041400.html#none
> [^]
> 
> Opinions?

Changes should be documented:

http://wiki.lazarus.freepascal.org/Lazarus_1.6.0_release_notes#IDE_Changes

http://wiki.lazarus.freepascal.org/IDE_Window:_Package_Editor


Mattias

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


Re: [Lazarus] Treeview example(s) needed

2016-01-27 Thread Mattias Gaertner
On Wed, 27 Jan 2016 06:01:24 +0100
"Joe Shepherd"  wrote:

>[...]
>newnode := tv.items.addchild(nil, 'A');
>newnode := tv.items.addchild(nil, 'B');
>newnode := tv.items.addchild(newnode, 'B1');
>newnode := tv.items.addchild(newnode, 'B12');
>newnode := tv.items.addchild(newnode, 'B123');  
>[...]
> If the treeview option tvoAutoExpand is True, I get the whole tree and can 
> click about the tree and select nodes. But if tvoAutoExpand is False, the 
> tree is (correctly) drawn collapsed, and  clicking to expand (eg node B), or 
> on a node with no children (eg Node A) both result in a SigSegV in 
> include/treeview.inc at line 1590 which is the indicated line here:

Clicking on nodes should not create AV, unless you have some more code
than just the above 5 lines.
The method GetLevel is not called by the LCL, so I guess you use it
somewhere.
Use the debugger to create a backtrace of the AV to find out what
causes the AV.

Mattias

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


Re: [Lazarus] Treeview example(s) needed

2016-01-27 Thread Mattias Gaertner
On Wed, 27 Jan 2016 09:16:12 +0100
Marc Santhoff  wrote:

> On Mi, 2016-01-27 at 06:01 +0100, Joe Shepherd wrote:
> >  
> > Obvioiusly I'm missing a lot but I cannot find any example to dispel
> > the fog. Anyone got one?
> 
> Not really. Some information can be found there:
> 
> http://wiki.lazarus.freepascal.org/XML_Tutorial#Populating_a_TreeView_with_XML
> 
> But I cannot say if that helps you. The main page in the wiki is this
> one:
> 
> http://wiki.lazarus.freepascal.org/VirtualTreeview

VirtualTreeView <> TTreeView

Mattias

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


Re: [Lazarus] Code completion question

2016-01-26 Thread Mattias Gaertner
On Tue, 26 Jan 2016 21:50:43 +0100 (CET)
Michael Van Canneyt  wrote:

> [...]
> do the codetools refuse to show identifiers with less restricted visibility ?
> (so in a protected section, I will not get public)
> 
> Is this intentional ?
> 
> I can imagine it is confusing to the beginner and experienced dev alike...

Please report the bug.

Mattias

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


Re: [Lazarus] Code completion question

2016-01-26 Thread Mattias Gaertner
On Tue, 26 Jan 2016 23:12:51 +0100
Vojtěch Čihák  wrote:

> Hi,
>  
> It is a bug? I know this behaviour for a long time and I always believed it 
> is by design.

FPC gives a warning, so it is bad coding, but it is not forbidden.

Maybe it would be better to show them in the completion box with
some warning marker.

Mattias

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


Re: [Lazarus] [PATCH] components/turbopower_ipro: added the Iphttpbroker and its example

2016-01-26 Thread Mattias Gaertner
On Tue, 26 Jan 2016 10:17:36 -0200
Fabrício Srdic  wrote:

>[...]Three
> months after, your project's requirements changes. The new requirement is
> that your code shall run on Linux. However, that external library runs only
> on windows. So, your code are constrained by this limitation. Now, you need
> to find an alternative solution. Sometimes, none of them are feasible and
> this fact can lead your project to fail.

True, although this is an argument for using only cross platform open
source libs. Not specially for using only Pascal libs. Not all Pascal
libs run on all platforms.

Mattias

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


Re: [Lazarus] Bug 28281

2016-01-26 Thread Mattias Gaertner
On Mon, 25 Jan 2016 21:37:16 +0100 (CET)
Michael Van Canneyt  wrote:

> 
> Hi,
> 
> Any news on bug 29281 ?
> 
> http://bugs.freepascal.org/view.php?id=28281
> 
> I can add the following extra info:
> 
> if compilation fails, it quite often never detects this and fails to show the 
> compiler error.
> I need to do a recompile, "abort" the previous build, and then it sometimes 
> shows the actual error.

I wonder why it happens only on your platform. Perhaps it is only
triggered by specific stdout/stderr content length and error IDs. This
would explain, why a recompile works, where the output is shorter than
a full compile.

 
> Also, I get a 100% failure rate when I press ctrl-F9 when the project
> inspector is the active dialog.

I have no idea, how the project inspector could influence the external
tools. I hope it is not some memory corruption.

Mattias

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


Re: [Lazarus] New menu designer

2016-01-21 Thread Mattias Gaertner
On Thu, 21 Jan 2016 13:21:57 +
Howard Page-Clark  wrote:

>[...]
> I don't know anything about the translation process, or at what stage in 
> the IDE initialization captions are replaced with translated 
> resourcestrings.
> Is there a standard notification, or other means to respond to a 
> different-length translated string and force a repaint?

It is not only translated strings, but other themes as well.
In general all labels should use AutoSize:=true.
See here:
http://wiki.lazarus.freepascal.org/LCL_AutoSizing

Mattias

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


Re: [Lazarus] Can I build a Lazarus GUI program only with fpc installed?

2016-01-21 Thread Mattias Gaertner
On Thu, 21 Jan 2016 10:14:33 +0100
Michael Schnell  wrote:

> On 01/21/2016 09:51 AM, Bo Berglund wrote:
> >   ditch the platforms that would not
> > allow me to install Lazarus...
> 
> It should be possible to link a project against the LCL without 
> completely installing Lazarus or  using Lazarus on that platform

If you want to build GUI programs the needed external libraries of the
IDE are the same as for any LCL application.
You don't need gdb, nor a working window manager to build a GUI
application though.

Mattias

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


Re: [Lazarus] How to install LNet package in Lazarus 1.6RC2?

2016-01-21 Thread Mattias Gaertner
On Thu, 21 Jan 2016 14:29:14 +0100
Bo Berglund  wrote:

>[...]
> 2) Next I am supposed to open the lnetvisual.lpk package file in
> Lazarus "Component/Open", but there is no such "Component" menu
> command in my Lazarus!
> The closest I get is "Package/Open package file", so I tried that.

Yes. It was renamed some years ago. I updated the wiki.

 
> 3) Next step is "Click on Install", but there exists no such button or
> function!

It's under "Use".

 
Mattias

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


Re: [Lazarus] Get Lazarus January 2016 Update

2016-01-21 Thread Mattias Gaertner
On Thu, 21 Jan 2016 15:32:39 -0500
Donald Ziesig  wrote:

>[...]
> I did try make clean bigide and make bigide and the response was that it 
> could not find target 'clean' or target 'bigide'.

What platform?

You need to change to the lazarus directory before calling make.

Mattias

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


Re: [Lazarus] How to use RTTICtrls

2016-01-19 Thread Mattias Gaertner
On Tue, 19 Jan 2016 19:33:46 +0800
Dennis  wrote:

> I now how to use TIPropertyGrid but I don't know how to use RTTICtrls 
> e.g. TTIEdit.
> In TIPropertyGrid, there is a property called TIObject to which I just 
> assigned my object reference and everything is working.
> 
> For TTIEdit, there isn't such a property.
> 
> I want to use RTTICtrls to let end users edit some properties of my object.
> 
> I searched the net but found nothing useful.

See the 'Link' property.

Mattias

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


Re: [Lazarus] Opening non existing files and (not) adding them to the project

2016-01-18 Thread Mattias Gaertner
On Mon, 18 Jan 2016 14:58:35 +0200
Juha Manninen <juha.mannine...@gmail.com> wrote:

> On Mon, Jan 18, 2016 at 1:32 PM, Mattias Gaertner
> <nc-gaert...@netcologne.de> wrote:
> > It works here on GTK2/Ubuntu. I can choose a non existing file.
> 
> I guess you mean you can type a name of a non existing file.
> You cannot choose it because by definition it does not exist.

Yes.

Mattias

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


Re: [Lazarus] New menu designer. which style do you prefer?

2016-01-18 Thread Mattias Gaertner
On Mon, 18 Jan 2016 11:36:57 +0100
Ondrej Pokorny  wrote:

> On 18.01.2016 10:42, Lukasz Sokol wrote:
> > Then maybe make the 'No' answer default here?
> 
> No. If I hit delete, I want to delete the button. The prompt is OK there 
> but the default action should always be what you want to do -> "yes".

Actually the default button depends on the OS/widgetset. For example on
OS X the default for a destructive action should be "No".
On Windows the default is typically Yes/Ok.
Same for button order.

> Don't assume that people are dumb :)

People are creatures of habit.

Mattias

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


  1   2   3   4   5   6   7   8   9   10   >