Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Péter Gábor
Would it be a serious incompatibility that can break compilation of
project sources? (I never used delphi)

Do you think that a new ComboBox implementation (based on TComboBox)
with copy-pasted TextHint support can be a good solution?
...or it would be better to forget this.

2015-10-07 20:30 keltezéssel, Bart írta:
> It would be Delphi incompatible.
> AFAIK TextHint is introduced in TCustomEdit there.

-- 
Péter Gábor
p...@freemail.hu


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


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Juha Manninen
On Wed, Oct 7, 2015 at 6:47 PM, Péter Gábor  wrote:
> What do you think about moving TextHint related things from TCustomEdit
> to TWinControl to make TextHint available for all TWinControl
> descendants, for example TComboBox.

I don't think it makes sense for all TWinControl derivatives.

> In this case developers may have unified look of controls on a single form.
> Anyway TextHint for ComboBoxes would be welcome.

For TComboBox it would make sense.
It would be an extension and thus not break Delphi compatibility either.
I think it is a good idea.

Juha

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


Re: [Lazarus] Streaming my TODO list

2015-10-08 Thread Graeme Geldenhuys
On 2015-10-07 23:12, Anthony Walter wrote:
> 
> http://www.codebot/org/live

That URL doesn't seem to be working. I get redirected to
[http://www.finditez.com/]


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] debugger create SIGDEV and app terminate

2015-10-08 Thread FreeMan

Hello,
fpc r32922 lazarus r49987 el capitan qt x64

code is:

finally
Screen.Cursor := crDefault;
Background := False;
try
  if Assigned(FRM_) then begin
if FRM_.MEM_.State in[dsEdit, dsInsert]then FRM_.MEM_.Cancel;
FRM_.MEM_.Close;
FreeAndNil(FRM_);
  end;
except
end;
  end;

I get this error and application terminate

Project project1 raised exception class 'External: SIGSEGV'.

In file 'src/Randevu/Appointment.pas' at line 1182:

if FRM_.MEM_.State in[dsEdit, dsInsert]then FRM_.MEM_.Cancel;


This error create if debugger is active. But I can NOT remove debug info 
while compile. Allways debug info adding to compiled application. 
CrossCompile as well.
In  "Project Options --> Debugging --> Generate debugging info for GDB 
(slower / increase exe-size) this checkbox True or False. *NOT* affect


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


Re: [Lazarus] Streaming my TODO list

2015-10-08 Thread Aradeonas
It seems down.

Regards, Ara


-- 
http://www.fastmail.com - IMAP accessible web-mail

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


[Lazarus] combobox can NOT select with mouse click

2015-10-08 Thread FreeMan

Hello,
fpc r32922 lazarus r49987 el capitan qt x64

combobox can NOT select with mouse click. in IDE as well

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


Re: [Lazarus] *SPAM* Re: High-DPI aware LCL ?

2015-10-08 Thread Michael Schnell

On 10/07/2015 06:49 PM, Sven Barth wrote:

(And yes, resources can store arbitrary files)
Sorry. I did not intend implementation details, but just suggest to 
consider if it would be viable at all to support rendering icons in 
vector format at runtime in the LCL to be able to better support any 
need for higher resolution. (Or is that just a silly idea of mine ?)


-Michael

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


Re: [Lazarus] Streaming my TODO list

2015-10-08 Thread Marcos Douglas
On Thu, Oct 8, 2015 at 6:21 AM, Graeme Geldenhuys
 wrote:
>
> That URL doesn't seem to be working. I get redirected to
> [http://www.finditez.com/]

The correct URL is http://www.codebot.org/live

Marcos Douglas

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


Re: [Lazarus] High-DPI aware LCL ?

2015-10-08 Thread Lukasz Sokol
On 07/10/15 22:24, Sven Barth wrote:
> Am 07.10.2015 20:55 schrieb  >:
>> 
>> On 10/07/2015 06:24 AM, Mattias Gaertner wrote:
>>> 
>>> On Wed, 7 Oct 2015 12:52:53 +0300 Juha Manninen
>>> >
>>> wrote:
>>> 
 [...] Who would step in and implement SVG support. I believe
 Sandro would join if there are other people involved.
>>> 
>>> 
>>> There are currently about 400 icons in the IDE. We need
>>> volunteers to create them either as SVG or as higher resolution 
>>> image.
>> 
>> 
>> is there not a conversion tool that can convert them from what they
>> are now (raster??) to SVG format?
>> 
>> a quick look shows there's various ways but it seems that many
>> simply embed the original image within the SVG output... the good
>> ones that work seem to be manual (eg: inkscape, adobe
>> illustrator)...
>> 
> 
> Yes, there are conversion tools, but that does not necessarily mean
> that the resulting images are nicely scaleable. It might work, it
> might not and depending on the algorithms the tool uses it might even
> depend on the source image...
> 
> Regards, Sven

Can't help but think (though I haven't seen the SVG spec), 
does the SVG format have indication of LOD of the elements, and possibly
element class (contour, key, background etc), or scaling factor speed, or 
something like that?
so the creator of the image can indicate when to stop showing certain portions
of the image... one could do creating it large, then downscaling without
loosing the gist of the icon...

Of course it is then on the image creators' head to indicate what needs to stay 
at
different level of details, how 'quickly' the lines should scale relative to 
the resizing...

(sorry for the offtopic)

Lukasz




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


Re: [Lazarus] Streaming my TODO list

2015-10-08 Thread Anthony Walter
http://www.codebot.org/live

Thanks for correcting that URL Marcos, I'll be streaming converting Unity
app indicators (system tray icons) and X11 global hotkey hooks Today.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] *SPAM* Re: High-DPI aware LCL ?

2015-10-08 Thread Sven Barth
Am 08.10.2015 10:46 schrieb "Michael Schnell" :
>
> On 10/07/2015 06:49 PM, Sven Barth wrote:
>>
>> (And yes, resources can store arbitrary files)
>
> Sorry. I did not intend implementation details, but just suggest to
consider if it would be viable at all to support rendering icons in vector
format at runtime in the LCL to be able to better support any need for
higher resolution. (Or is that just a silly idea of mine ?)
>

Looking at this thread it seems not to be simply a silly idea of yours and
yes, it would be viable. The question however is whether it is desireable
(see that link from Lukasz Sokol).

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


[Lazarus] WMEnterSizeMove Messages not firing

2015-10-08 Thread Aradeonas
Hi,

Just tested this code and only WMMove works and WMEnterSizeMove doesn't.
It simply works in Delphi. Why?
> unit Unit1;
>
> {$mode objfpc}{$H+}
>
> interface
>
> uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
> Messages;
>
> type
>
> { TForm1 }
>
> TForm1 = class(TForm)  private  public    procedure
> WMEnterSizeMove(var Message: TMessage); message WM_ENTERSIZEMOVE;
> procedure WMMove(var Message: TMessage); message WM_MOVE;    procedure
> WMExitSizeMove(var Message: TMessage); message WM_EXITSIZEMOVE;  end;
>
> var  Form1: TForm1;
>
> implementation
>
> {$R *.lfm}
>
> { TForm1 }
>
> procedure TForm1.WMEnterSizeMove(var Message: TMessage); begin
> Caption := 'Move / resize started'; end; (*WMEnterSizeMove*)
>
> procedure TForm1.WMMove(var Message: TMessage); begin  Caption :=
> Format('Form is being moved. Client area x: %d, y:%d',
> [TWMMove(Message).XPos, TWMMove(Message).YPos]); end; (*WMMove*)
>
> procedure TForm1.WMExitSizeMove(var Message: TMessage); begin
> ShowMessage('Move / resize complete!'); end; (*WMExitSizeMove*)
>
> end.
>

Regards, Ara

-- 
http://www.fastmail.com - Accessible with your email software
  or over the web

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


Re: [Lazarus] WMEnterSizeMove Messages not firing

2015-10-08 Thread Ondrej Pokorny

On 08.10.2015 16:09, Aradeonas wrote:

Is there any other way to make it work for now?

It depends on what you want to do in WM_ENTERSIZEMOVE.
For most uses you can use a workaround with MouseDown etc.

If you really need WM_ENTERSIZEMOVE, it should be possible to make win32 
widgetset to pass it through but I didn't investigate further and used a 
MouseDown workaround.


Ondrej

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


[Lazarus] Literature about REST

2015-10-08 Thread Koenraad Lelong

Hi,

I would like to know more about web-programming with REST. Can anyone 
recommend books or web-sites to read about it ? I virtually know nothing 
about it.
Searching amazon gives a number of  books, but since those are not 
cheap, I would like to get a good book for my money.


Thanks,

Koenraad.

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


Re: [Lazarus] Streaming my TODO list

2015-10-08 Thread Aradeonas
Cool!


-- 
http://www.fastmail.com - Choose from over 50 domains or use your own

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


Re: [Lazarus] WMEnterSizeMove Messages not firing

2015-10-08 Thread Ondrej Pokorny

On 08.10.2015 16:01, Aradeonas wrote:

Hi,
Just tested this code and only WMMove works and WMEnterSizeMove 
doesn't. It simply works in Delphi.

Why?


http://bugs.freepascal.org/view.php?id=23302

Ondrej

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


Re: [Lazarus] WMEnterSizeMove Messages not firing

2015-10-08 Thread Aradeonas
Is there any other way to make it work for now?

Regards,
Ara


-- 
http://www.fastmail.com - The way an email service should be


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


Re: [Lazarus] WMEnterSizeMove Messages not firing

2015-10-08 Thread Aradeonas
I want to know when resize begin and end and really dont know how work
with win32 widgetset.

Regards,
Ara


-- 
http://www.fastmail.com - Accessible with your email software
  or over the web


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


[Lazarus] TFPGList.Sort

2015-10-08 Thread Andrea Mauri

Dear all,

I am trying to sort a simple TIntegerList defined as:

TIntegerList = specialize TFPGList;

In order to sort I introduced a compare function as:

function CompareInt(const Item1,
  Item2: Integer): Integer;
begin
  if Item1 < Item2 then
Result:= -1
  else if Item2 > Item1 then
Result:= 1
  else
   Result:= 0;
end;

but I did not obtain the expected results.
Here a simple example:
procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  il: TIntegerList;
begin
  il:= TIntegerList.Create;
  il.add(5);
  il.Add(3);
  il.add(8);
  il.Add(2);
  il.add(2);
  il.Add(1);
  ListBox1.Clear;
  for i:= 0 to il.Count - 1 do
ListBox1.Items.Add(IntToStr(il[i]));
  il.Sort(@CompareInt);
  ListBox2.Clear;
  for i:= 0 to il.Count - 1 do
ListBox2.Items.Add(IntToStr(il[i]));
  il.Free;
end;
Starting from a sequence of:
5,3,8,2,2,1
I got as sorted list:
2,2,1,3,5,8

What am I doing wrong?

Andrea

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


Re: [Lazarus] TFPGList.Sort

2015-10-08 Thread Michael Van Canneyt



On Thu, 8 Oct 2015, Andrea Mauri wrote:


Dear all,

I am trying to sort a simple TIntegerList defined as:

TIntegerList = specialize TFPGList;

In order to sort I introduced a compare function as:

function CompareInt(const Item1,
 Item2: Integer): Integer;
begin
 if Item1 < Item2 then
   Result:= -1
 else if Item2 > Item1 then


This is wrong. It is in fact the same condition as your first if.
it should be
  if Item1>Item2 then

Michael.

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


Re: [Lazarus] Literature about REST

2015-10-08 Thread Luiz Americo Pereira Camara
Em 08/10/2015 10:58, "Koenraad Lelong"  escreveu:
>
> Hi,
>
> I would like to know more about web-programming with REST. Can anyone
recommend books or web-sites to read about it ? I virtually know nothing
about it.

I read this book

http://shop.oreilly.com/product/mobile/9780596805838.do

Its a good one, with a few shortcomings:

It uses examples with XML
Has a focus in HATEOAS. Particularly i dont buy HATEOS stuff, so i read
only until the CRUD service chapter.

I have some free books/resources about it. I can send later

Luiz

> Searching amazon gives a number of  books, but since those are not cheap,
I would like to get a good book for my money.
>
> Thanks,
>
> Koenraad.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPGList.Sort

2015-10-08 Thread Maciej Izak
As alternative you can use https://github.com/dathox/generics.collections
(requires FPC 3.0).

You can use TList<> from Generics.Collections, is much simpler in usage:

==code begin==
type
  TIntegerList = specialize TList;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  il: TIntegerList;
begin
  il:= TIntegerList.Create;
  il.add(5);
  il.Add(3);
  il.add(8);
  il.Add(2);
  il.add(2);
  il.Add(1);
  ListBox1.Clear;
  for i:= 0 to il.Count - 1 do
ListBox1.Items.Add(IntToStr(il[i]));
  il.Sort();
  ListBox2.Clear;
  for i:= 0 to il.Count - 1 do
ListBox2.Items.Add(IntToStr(il[i]));
  il.Free;
end;
==code end==
-- 
Best regards,
Maciej Izak
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPGList.Sort

2015-10-08 Thread Andrea Mauri
Thanks and sorry for this stupid mistake.
Il 08/ott/2015 16:47, "Michael Van Canneyt"  ha
scritto:

>
>
> On Thu, 8 Oct 2015, Andrea Mauri wrote:
>
> Dear all,
>>
>> I am trying to sort a simple TIntegerList defined as:
>>
>> TIntegerList = specialize TFPGList;
>>
>> In order to sort I introduced a compare function as:
>>
>> function CompareInt(const Item1,
>>  Item2: Integer): Integer;
>> begin
>>  if Item1 < Item2 then
>>Result:= -1
>>  else if Item2 > Item1 then
>>
>
> This is wrong. It is in fact the same condition as your first if.
> it should be
>   if Item1>Item2 then
>
> Michael.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Ondrej Pokorny

On 08.10.2015 18:37, Juha Manninen wrote:

On Thu, Oct 8, 2015 at 7:22 PM, Bart  wrote:

This is rather more tricky than what we did for TCustomEdit.
Mind you that Delphi has it easy,it simply calls some Windows API to
get this done, but we need to implement this cross-platform (hence we
override RealSetText and RealGetText).
Setting Text in a ComboBox may have other side effects then in a TCustomEdit.

Ok, I don't know the details well.


Isn't is possible to paint the TextHint text manually into the combobox 
/ edit?


Ondrej

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


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Bart
On 10/8/15, Juha Manninen  wrote:

>
> I don't think it makes sense for all TWinControl derivatives.
>
> For TComboBox it would make sense.
> It would be an extension and thus not break Delphi compatibility either.
> I think it is a good idea.

This is rather more tricky than what we did for TCustomEdit.
Mind you that Delphi has it easy,it simply calls some Windows API to
get this done, but we need to implement this cross-platform (hence we
override RealSetText and RealGetText).
Setting Text in a ComboBox may have other side effects then in a TCustomEdit.

Bart

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


Re: [Lazarus] lazcontrols filters

2015-10-08 Thread Juha Manninen
On Thu, Oct 8, 2015 at 7:22 PM, Bart  wrote:
> This is rather more tricky than what we did for TCustomEdit.
> Mind you that Delphi has it easy,it simply calls some Windows API to
> get this done, but we need to implement this cross-platform (hence we
> override RealSetText and RealGetText).
> Setting Text in a ComboBox may have other side effects then in a TCustomEdit.

Ok, I don't know the details well.

Juha

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


Re: [Lazarus] Accessing GPIO on RaspberryPi2 from Lazarus/FPC

2015-10-08 Thread Mark Morgan Lloyd

Bo Berglund wrote:

I have found a description of a unit implementing an interface to the
gpio driver in the Free Pascal documentation. It is here:
http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#5._PiGpio_Low-level_native_pascal_unit_.28GPIO_control_instead_of_wiringPi_c_library.29

However, it specifically lists the BCM2835 chip and not the BCM2836
which is used on the Pi2.

So I wonder if anyone here knows about an updated gpio.pas file which
works on the Pi2?


I have already said elsewhere: exercise the interface using echo to 
/sys/class/gpio etc. first, since I would expect this to be the same 
irrespective of model.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

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


[Lazarus] Accessing GPIO on RaspberryPi2 from Lazarus/FPC

2015-10-08 Thread Bo Berglund
I have found a description of a unit implementing an interface to the
gpio driver in the Free Pascal documentation. It is here:
http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#5._PiGpio_Low-level_native_pascal_unit_.28GPIO_control_instead_of_wiringPi_c_library.29

However, it specifically lists the BCM2835 chip and not the BCM2836
which is used on the Pi2.

So I wonder if anyone here knows about an updated gpio.pas file which
works on the Pi2?


-- 
Bo Berglund
Developer in Sweden


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