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

2016-01-25 Thread silvioprog
On Mon, Jan 25, 2016 at 8:54 AM, Jy V  wrote:

> On Mon, Jan 25, 2016 at 4:59 AM, silvioprog  wrote:
>
>>
>> Yes, it can be easily implemented in TP comps. ASA nghttp2 get a pascal
>> header, BTW with a ng header in hands, you can use this one with any pascal
>> code. :-)
>>
>
> Instead of relying on external libraries such as nghttp2,
>
[...]
>

Hm... I don't understand why many Pascal users hates external libraries,
even when it's written in C, one of the best languages to create fast and
stable libraries, with a lot of users around the world provinding support
for that. :-/

Many units in Free Pascal and Delphi uses C libraries... when aren't using
a C library (an API system call, an third party library call, etc.), are
using assembly, ie, mostly time Pascal is used as a high-level language to
consume some low-level code written in C or assembly.

Just an example, the Embarcadero Delphi provides support for BJSON and
MongoDB, so you can find libraries like `libbson-1.0.dll` and
`libmongoc-1.0.dll` in the Delphi directory, and it was a very nice choice,
because these libraries implements a lot of features and they are
maintained for many programmers. I saw some Pascal libraries for MongoDB,
but they seem have been abandoned by their maintainers before being
concluded.

I use Pascal for high-level logic and sometimes for low-level logic using
pointers, but when I need a feature that Pascal hasn't implemented yet, I
search a C library to solve it, so I don't see a problem in using external
libraries. :-)

--
Silvio Clécio
--
___
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-25 Thread silvioprog
Oops,

On Mon, Jan 25, 2016 at 11:56 AM, silvioprog  wrote:
[...]

> Just an example, the Embarcadero Delphi provides support for BJSON
>

I meant:

"... provides support for BSON ..."

.. so I don't see a problem
>

"... I don't have problem ..."

Sorry. ^^'

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


Re: [Lazarus] How to change Class Completion for Setter methods

2016-01-25 Thread Graeme Geldenhuys
On 2016-01-25 15:19, Sven Barth wrote:
> You are not the first who wants this ;)
> http://bugs.freepascal.org/view.php?id=15922

:-)  Thanks.

Wow, that report is almost 6 years old and still not resolved.

Regards,
  - Graeme -


My public PGP key:  http://tinyurl.com/graeme-pgp

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


Re: [Lazarus] How to change Class Completion for Setter methods

2016-01-25 Thread Sven Barth
Am 25.01.2016 12:16 schrieb "Graeme Geldenhuys" <
mailingli...@geldenhuys.co.uk>:
>
> Hi,
>
> When I do class completion in Lazarus for a property with a setter
> method I get code as follows:
>
>
> procedure TFPCustomMemo.SetAlignment(AValue: TAlignment);
> begin
>   if FAlignment = AValue then Exit;
>   FAlignment := AValue;
> end;
>
>
> How, if at all, do I change that code formatting to his:
>
>
> procedure TFPCustomMemo.SetAlignment(AValue: TAlignment);
> begin
>   if FAlignment = AValue then
> Exit;
>   FAlignment := AValue;
> end;
>
>
>
> Note that the latter example has a line break after the if..then
statement.

You are not the first who wants this ;)
http://bugs.freepascal.org/view.php?id=15922

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


Re: [Lazarus] Raspberry Pi Debug Digital I/O

2016-01-25 Thread Koenraad Lelong

Op 25-01-16 om 09:40 schreef Koenraad Lelong:

First : I'm using pascalio, on a Pi2 model B.

Just modified bcm2708.pas :
   GPIO_BASE = (BCM2708_PERI_BASE + $003F); // GPIO controller
and
   mem_fd := FpOpen('/dev/gpiomem', O_RDWR OR O_SYNC);

Now I can run my app as user 'pi'.

Thanks.


Forget this. I don't know what I did, but this seems not to work 
anymore. Looking at the sources of pascalio, it should not have worked 
anyway.


Koenraad.


--
___
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-25 Thread Michael Van Canneyt



On Mon, 25 Jan 2016, silvioprog wrote:



Many units in Free Pascal and Delphi uses C libraries... when aren't using
a C library (an API system call, an third party library call, etc.), are
using assembly, ie, mostly time Pascal is used as a high-level language to
consume some low-level code written in C or assembly.


There is a simple reason: 
Debugging and bugfixing is a lot easier if all the code is in pascal.


Most libraries are a black box. 
I don't think I've purchased a library/package that didn't contain bugs,

which I had to debug manually and fix.

Old timers as X, libc, pthreads and more such oldtimers will generally be 
bug-free, but there is lots of code out there with a less good track record.


Michael.

--
___
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-25 Thread Michael Van Canneyt



On Mon, 25 Jan 2016, 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
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?

I did not understand the request for a better editor of requirements.
IMO they can be edited very well now.



From my point of view, there are still 2 issues:


First
-

Requirements must still be added one at a time; The requirement dialog shows a 
dropdown.
I usually have lots of requirements. It would be better to have a checklistbox 
where
I can simply check all required packages instead of having to add them one by 
one.

I have easily 10-12 dependencies. Now it is 
- click open the dropdown next to "add"

- select "New requirement"
- Dialog pops up, in dialog select new requirement in combobox.
  There are 180 (!!) packages in the dropdown, it takes a while to select from 
them.
  (lots start with laz, requiring you to type 4 or 5 letters before a 
meaningful choice pops up)
- Click ok.
That's a lot of clicking if you must do this 12 times for a new project and/or 
package.

It would be much easier if, in the dialog, I could select multiple required 
packages
by setting a check mark in a checklistbox. As soon as an item is 
selected/checked, the
min/max version checkboxes/edits can appear enabled to the right of the listbox.



Second
--
If you select a required package in the package dialog, the bottom of the
package dialog shows the min/max required version. This is easy to change it.

In the project dialog, if you select a required package, there is no way to
set the min/max required version. You must delete the requirement, and add
it again, because only during the add you can specify the version.
It would be nice to offer the same functionality as in the package dialog.

As an aside:

I also think it would be nice if the min/max versions were simply shown in
the package tree.

Something like:

laz_fpspreadsheet (>=1.0.0 and <=2.0.0)

But this is a minor issue.

Anyway, I hope the above descriptions are clear. I don't expect these issues
to be addressed in 1.6, but just mention them to say that there is still
lots of room for improvement :-)

Michael.

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


[Lazarus] Bug 28281

2016-01-25 Thread Michael Van Canneyt


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.

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

Michael.

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


Re: [Lazarus] Raspberry Pi Debug Digital I/O

2016-01-25 Thread Marc Santhoff
On Mo, 2016-01-25 at 08:33 +0100, Bo Berglund wrote:
> On Mon, 25 Jan 2016 00:18:50 +0100, Marc Santhoff 
> wrote:
> 
> >> For me it is like this:
> >> pi@rpi2-jessie2:~/dev $ cat /etc/group | grep gpio
> >> gpio:x:997:pi
> >
> >Thje last one wrong, should have been
> >
> >$ ls -lL /sys/class/gpio/gpiochip0
> 
> New test:
> 
> pi@rpi2-jessie2:~/dev $ ls -lL /sys/class/gpio/gpiochip0
> total 0
> -rwxrwx--- 1 root gpio 4096 Jan 17 16:47 base
> drwxr-xr-x 3 root root0 Jan 17 16:47 device
> -rwxrwx--- 1 root gpio 4096 Jan 17 16:47 label
> -rwxrwx--- 1 root gpio 4096 Jan 17 16:47 ngpio
> drwxrwx--- 2 root gpio0 Jan 17 16:47 subsystem
> -rwxrwx--- 1 root gpio 4096 Jan 17 16:47 uevent
> 
> >and
> >
> >$ ls -lL ../../devices/platform/soc/3f20.gpio/gpio/
> 
> This is a relative path and you did not specify where one should be
> located in order to execute it. Cannot perform this command.
> Please supply an absolute path instead.

I know. The user can see from where links are not resolved by reading
the failing command. My point was to help diagnosing why a program
running as user pi did not work. I explained with the changed command,
for checking permissions on the targets of the links, not the links
themselves.

But since you found the cause by your patch differentiating between RPi1
and RPi2 it's obsolete now.

-- 
Marc Santhoff 


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


[Lazarus] Package editor in Lazarus 1.6

2016-01-25 Thread Juha Manninen
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
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?

I did not understand the request for a better editor of requirements.
IMO they can be edited very well now.

Juha

--
___
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-25 Thread Dmitry Boyarintsev
On Mon, Jan 25, 2016 at 3:08 PM, Michael Van Canneyt  wrote:

> On Mon, 25 Jan 2016, silvioprog wrote:
>
>>
>> Many units in Free Pascal and Delphi uses C libraries... when aren't using
>> a C library (an API system call, an third party library call, etc.), are
>> using assembly, ie, mostly time Pascal is used as a high-level language to
>> consume some low-level code written in C or assembly.
>>
>
> There is a simple reason: Debugging and bugfixing is a lot easier if all
> the code is in pascal.
>

Here's another reason - cross-platform availability.
FPC is cross platform. To some extent (Java?) is more cross-platform that C
is.

When using an external library, there might be a risk that the library is
not *easily* available for another platform that is targeted. It's common
for open-source projects, not to provide any binary builds, requiring a
library user to build the library themselves. Luckily, the most common
projects do have some satellite projects that actually provide binaries.

Building C (C++) library could be a real pain for some Pascal users.
(Pascal spoils!)
Building C/C++ library for a desired target platform, could be even more
painful, specifically if some sort of cross-tools required or when building
configuration needs to be changed.

Thus a pure pascal library would be a number one choice for most users.
With though it might be outdated and/or slower than its C-counterpart (i.e.
paszlib vs zlib)

thanks,
Dmitry
--
___
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-25 Thread silvioprog
On Mon, Jan 25, 2016 at 5:08 PM, Michael Van Canneyt  wrote:

> On Mon, 25 Jan 2016, silvioprog wrote:
>>
>> Many units in Free Pascal and Delphi uses C libraries... when aren't using
>> a C library (an API system call, an third party library call, etc.), are
>> using assembly, ie, mostly time Pascal is used as a high-level language to
>> consume some low-level code written in C or assembly.
>>
>
> There is a simple reason: Debugging and bugfixing is a lot easier if all
> the code is in pascal.
>

I agree. Using external libraries has pros and cons.

Most libraries are a black box. I don't think I've purchased a
> library/package that didn't contain bugs,
> which I had to debug manually and fix.
>

Sad but true. :-/

The best advantage is that mostly C libraries have a lot of users and
active maintainers. I'm using three of them, and I got bugs on them, but I
fixed some of them by myself, and others I got help on theirs bugtracker.

Old timers as X, libc, pthreads and more such oldtimers will generally be
> bug-free, but there is lots of code out there with a less good track record.


Yes.

I'm using (and indicating) third party GNU C libraries, but before adopt
them, I check theirs ecosystem, how many programmers are involved on theirs
development, the commit history, how long an issue remains open, and if the
libraries are still active. :-)

-- 
Silvio Clécio
--
___
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-25 Thread Dmitry Boyarintsev
On Mon, Jan 25, 2016 at 5:02 PM, Dmitry Boyarintsev <
skalogryz.li...@gmail.com> wrote:

>  With though it might be outdated ...
>
correction:
* Even though it might be outdated ...

thanks,
Dmitry
--
___
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-25 Thread silvioprog
On Mon, Jan 25, 2016 at 7:02 PM, Dmitry Boyarintsev <
skalogryz.li...@gmail.com> wrote:

> On Mon, Jan 25, 2016 at 3:08 PM, Michael Van Canneyt <
> mich...@freepascal.org> wrote:
>
>> On Mon, 25 Jan 2016, silvioprog wrote:
>>
>>>
>>> Many units in Free Pascal and Delphi uses C libraries... when aren't
>>> using
>>> a C library (an API system call, an third party library call, etc.), are
>>> using assembly, ie, mostly time Pascal is used as a high-level language
>>> to
>>> consume some low-level code written in C or assembly.
>>>
>>
>> There is a simple reason: Debugging and bugfixing is a lot easier if all
>> the code is in pascal.
>>
>
> Here's another reason - cross-platform availability.
> FPC is cross platform. To some extent (Java?) is more cross-platform that
> C is.
>

Indeed. But the one of the basic steps before chosing a library (from any
language) is read its specification, and know if it provides the needed
features, works in the expected SOs, and provides a good documentation with
a stable support. I need to make a device and it need a microcontroller, so
I found that the best choice is a PIC16F64A because its datasheet shows all
the features and the basic hardware that I need.
Well, the mostly C libraries work fine in many OSs. One that I use works in
the popular systems (currently I need it just for Windows and Linux) like
GNU/Linux, FreeBSD, OpenBSD, NetBSD, Android, OS X, Win32/64 and special
systems like Symbian and z/OS, and it's already available in some tools
like apt, yum, npm, maven, pacman... :-) ... (and if I have a chance from
FPC team, I can make it also installable via fppkg tool too! :-D )


> When using an external library, there might be a risk that the library is
> not *easily* available for another platform that is targeted. It's common
> for open-source projects, not to provide any binary builds, requiring a
> library user to build the library themselves. Luckily, the most common
> projects do have some satellite projects that actually provide binaries.
>

That was the main problem that I also had, unfortunatelly. :-(

For example:

https://github.com/libharu/libharu/issues/118

Mostly Pascal programmers don't like C libraries they get boring because of
the bugs like this, and can't fix the problem (lack time; doesn't have a C
environment, or doesn't know C etc.). But, why not try to understand the
problem? Is C so hard that a Pascal programmer can't understand that? I
don't think so, if you already use pointers and played with low-level
programming in standard Pascal, you can learn C too.

Building C (C++) library could be a real pain for some Pascal users.
> (Pascal spoils!)
>

Sad but true. :-(

But they should try to get support from the library list. Some days ago I
fixed a lot a problems in a C library (that's already a FPC/Delphi header)
and now it works like a charm on Windows, Linux and OS X. But first time, I
thought: "oh ktulu, why it doesn't compile plz..." ... but after trying to
fix it by myself, finally I can fix common bugs in any C library, because
complex bugs usually are already fixed by its maintainers.

Building C/C++ library for a desired target platform, could be even more
> painful, specifically if some sort of cross-tools required or when building
> configuration needs to be changed.
>

Well, in mostly cases I just use the ./configure && make && make
install-strip hehehe... On Windows I use MinGW, so I can compile C
libraries easily, and when I got any problem to compiled that, I solve it
easily too, by myself or getting support in the Pascal or C communities. :-)


> Thus a pure pascal library would be a number one choice for most users.
> With though it might be outdated and/or slower than its C-counterpart (i.e.
> paszlib vs zlib)
>

I agree, but I can't find a hard problem that makes a Pascal programmer
(beginner or veteran) not to use a C library even if it has already a
solution that's not implemented in Pascal yet. :-)

These days I took a look at FPC/Laz examples finding some solution to
control keyboard/mouse remotely, something like a VNC, but just the
control, without the server, and I found that, the
components/MouseAndKeyInput package, that uses external libraries. On
Windows and OS X it uses theirs APIs (they are external libraries), on
Linux it uses the libxTst library, and I don't have problem to use this
component just because it's using a third party external GNU library. After
installing it via apt, the only problem that I got was create the library
link on the /lib folder.

But, unfortunatelly, even with this pros, Pascal programmers avoid to use
external libraries, that's a real fact. :-/

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


Re: [Lazarus] Raspberry Pi Debug Digital I/O

2016-01-25 Thread Koenraad Lelong

Op 25-01-16 om 00:18 schreef Marc Santhoff:

On Mo, 2016-01-25 at 00:11 +0100, Bo Berglund wrote:

On Sun, 24 Jan 2016 21:42:06 +0100, Marc Santhoff 
wrote:


My results :

root@raspberrypi:/home/pi# grep gpio /etc/group
gpio:x:997:pi
root@raspberrypi:/home/pi# ls -lL /sys/class/gpio/gpiochip0
totaal 0
-rwxrwx--- 1 root gpio 4096 jan 24 22:10 base
drwxr-xr-x 3 root root0 jan 24 22:10 device
-rwxrwx--- 1 root gpio 4096 jan 24 22:10 label
-rwxrwx--- 1 root gpio 4096 jan 24 22:10 ngpio
drwxrwx--- 2 root gpio0 jan 24 22:10 subsystem
-rwxrwx--- 1 root gpio 4096 jan 24 22:10 uevent
root@raspberrypi:/home/pi# cd /sys/class/gpio/

Application running as user pi :
root@raspberrypi:/sys/class/gpio# ls -lL 
../../devices/platform/soc/3f20.gpio/gpio/

totaal 0
drwxrwx--- 2 root gpio 0 jan 25 08:54 gpio17
drwxrwx--- 2 root gpio 0 jan 25 08:54 gpio18
drwxrwx--- 2 root gpio 0 jan 24 22:10 gpiochip0

Application running as user root :
root@raspberrypi:/sys/class/gpio# ls -lL 
../../devices/platform/soc/3f20.gpio/gpio/

totaal 0
drwxrwx--- 2 root gpio 0 jan 25 08:56 gpio17
drwxrwx--- 2 root gpio 0 jan 25 08:56 gpio18
drwxrwx--- 2 root gpio 0 jan 24 22:10 gpiochip0

I'm going to try that patch of Bo.

I'll report back.

Koenraad.


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


Re: [Lazarus] Raspberry Pi Debug Digital I/O

2016-01-25 Thread Koenraad Lelong

Op 25-01-16 om 09:00 schreef Koenraad Lelong:

Op 25-01-16 om 00:18 schreef Marc Santhoff:
I'm going to try that patch of Bo.

I'll report back.


First : I'm using pascalio, on a Pi2 model B.

Just modified bcm2708.pas :
  GPIO_BASE = (BCM2708_PERI_BASE + $003F); // GPIO controller
and
  mem_fd := FpOpen('/dev/gpiomem', O_RDWR OR O_SYNC);

Now I can run my app as user 'pi'.

Thanks.

According to Bo's post 
(http://lists.lazarus.freepascal.org/pipermail/lazarus/2015-October/094438.html) 
GPIO_BASE depends on where the app runs.
I'm going to look for a way to detect which device the application runs 
on so I can automatically switch the GPIO_BASE.

Suggestions ?

Koenraad.

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


Re: [Lazarus] Raspberry Pi Debug Digital I/O

2016-01-25 Thread Koenraad Lelong

Op 25-01-16 om 09:40 schreef Koenraad Lelong:


According to Bo's post
(http://lists.lazarus.freepascal.org/pipermail/lazarus/2015-October/094438.html)
GPIO_BASE depends on where the app runs.
I'm going to look for a way to detect which device the application runs
on so I can automatically switch the GPIO_BASE.


FWIW, rpi_hal is already testing for which pi it runs on, and sets it's 
GPIO_BASE based on that.


I'm going to try to mimic that in pascalio.

Koenraad.



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


Re: [Lazarus] technical knobs components

2016-01-25 Thread Graeme Geldenhuys
On 2016-01-24 14:38, Marc Santhoff wrote:
> Yes, found it while browsing, and TDigitLed there, too:
> 
> http://breakoutbox.de/pascal/pascal.html


I've also created a 8x5 LED Matrix widget for fpGUI Toolkit, which can
be easily ported to LCL. It supports custom colours and scrolling.

  http://geldenhuys.co.uk/~graemeg/temp/ledmatrix.ogv

NOTE:
The LEDMatrix colour and scroll smoothness is off in the video, and is
not like that in real life. I clearly need practice recording and
encoding videos. ;-)

Regards,
  - Graeme -

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

My public PGP key:  http://tinyurl.com/graeme-pgp

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


[Lazarus] How to change Class Completion for Setter methods

2016-01-25 Thread Graeme Geldenhuys
Hi,

When I do class completion in Lazarus for a property with a setter
method I get code as follows:


procedure TFPCustomMemo.SetAlignment(AValue: TAlignment);
begin
  if FAlignment = AValue then Exit;
  FAlignment := AValue;
end;


How, if at all, do I change that code formatting to his:


procedure TFPCustomMemo.SetAlignment(AValue: TAlignment);
begin
  if FAlignment = AValue then
Exit;
  FAlignment := AValue;
end;



Note that the latter example has a line break after the if..then statement.



Regards,
  - Graeme -

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

My public PGP key:  http://tinyurl.com/graeme-pgp

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


[Lazarus] Unexpected error from intfgraphics.pas when running GPIO test program

2016-01-25 Thread Bo Berglund
I have created a new Lazarus environment on a Raspberry Pi2B by
starting from a new Raspbian Jessie image and installing FPC 3.0.0 and
Lazarus 1.6RC2 from svn sources.
I also installed Indy 10.6.2 into the IDE.
All of that worked fine.

Today I opened an old gpio test project, which worked fine in Lazarus
back in October 2015. It is a really simple project with just 4
buttons, 2 TShape indicators and 1 TMemo to display progress messages
dropped on the standard default form on a new project.
It was stored in version control (CVS).

I have tried to Compile and run and also to Build and run this
program. Both build and compile works OK but the Run command does not.

It gives the following exception messages now:

---
Debugger Exception Notification
Project gpiotest raised exception class 'FPImageException' with
message:
Bitmap with unknown compression (21060)
In file 'intfgraphics.pas' at line 5709
   [Break] [Continue]


Clicking Continue pops up the next error box:


gpiotest
Bitmap with unknown compression (21060)
Press OK to ignore and risk data corruption
Press Cancel to kill the program
  [Cancel]   [OK]
-

And now execution gives up.

I used the find command to find the offending file and it turns out to
be a Lazarus internal file!

pi@rpi2-jessie2:~ $ find ./ -name intfgraphics.pas
./dev/lazarus/1.6RC2/lcl/intfgraphics.pas
./dev/lazarus/1.6RC1/lcl/intfgraphics.pas

I have both Lazarus release candidates loaded, but I am working with
RC2 at the moment.

When I try to open the project options it pops up another dialog:


Read Error
Bitmap with unknown compression (21060)
 [OK]


And when I click OK here Lazarus itself crashes!!!

When I started it again I successfully built the project but when I
hit the green run arrow I get yet another dialog popping up:

-
Debugger Error
Debugger error

Ooops, the debugger entered the error state
Save your work now!
Hit Stop, and hope the best, we're pulling the plug.

The GDB command:
"-gdb-set confirm off"
did not return any result.
[Less] [Stop]
-

I have tried to create a brand new project in Lazarus RC2 and put 4
buttons, 2 shapes and one memo on the form, then I run this and it
works.
So something is fishy in my old proven test program, but how can I
find it when the problem is in a Lazarus internal file???

I created it in an earlier Lazarus and FPC version back in October
2015.

Why does this happen and is there a solution?


-- 
Bo Berglund
Developer in Sweden


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


Re: [Lazarus] Unexpected error from intfgraphics.pas when running GPIO test program

2016-01-25 Thread Bo Berglund
On Mon, 25 Jan 2016 12:26:03 +0100, Bo Berglund
 wrote:

>
>gpiotest
>Bitmap with unknown compression (21060)
>Press OK to ignore and risk data corruption
>Press Cancel to kill the program
>  [Cancel]   [OK]
>-
...
>
>Why does this happen and is there a solution?
>

Found the problem!
There is an .ico file created when the project builds and
this file was corrupted.
I found an old backup on my laptop and that file displayed an image
icon (Lazarus) in Windows Explorer while the non-working file did not.
They differed about 1 KB i size too (both were unimaginably large, 134
KB for an icon!).

When I copied the backup file on top of the faulty one Lazarus was
satisfied. But I tried first to just delete it in the RPi2 project
dir, it still had the same problem. Only replacing it with a good file
solved the problem.

How such an erroneous file can cause the observed results it hard for
me to understand, especially why the actual culprit is not mentioned.

But now my GPIO test program runs fine (as user pi) and I can pull and
release the attached relays.

-- 
Bo Berglund
Developer in Sweden


--
___
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-25 Thread Jy V
On Mon, Jan 25, 2016 at 4:59 AM, silvioprog  wrote:

>
> Yes, it can be easily implemented in TP comps. ASA nghttp2 get a pascal
> header, BTW with a ng header in hands, you can use this one with any pascal
> code. :-)
>

Instead of relying on external libraries such as nghttp2,
is there anyone on this list willing to implement HPACK in pure pascal code
in a single unit from the explicit source code available here:
https://github.com/twitter/hpack/tree/master/hpack/src/main/java/com/twitter/hpack
of course this "translation" from java to pascal would qualify for a bounty,

I hope this would help as a starting point to move forward to a pure pascal
implementation of HTTP2,

anyone feel free to comment directly on the list if some programmers are
ready to help.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Fosdem'16

2016-01-25 Thread Jy V
Is there any FreePascal/Lazarus programmers/users heading to Fosdem this
year ?
if so, it would be nice we try to meetup at Delirium Friday evening or
during the event on ULB site,
in order to expose the current projects we are each other working on,

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