[Lazarus] ListView.OnSelectItem - which LCL backend is correct?

2015-05-15 Thread Graeme Geldenhuys
Hi,

I found a bug in LCL's TListView. The OnSelectItem event. When you
select an item in the Listview, that event is triggered twice. Once with
the Selected = True (indicating the new selection) and once with the
Selected = False (indicating the old selection).

But the order of those events are reversed between LCL-Win32/64 and
LCL-GTK2. I haven't tried other LCL backends, so don't know the order
of them.

So which backend has the correct behaviour, so I can file a bug report
for the other one. Seeing has LCL by design is very Windows centric, I'm
assuming the LCL-Win32/64 is the correct behaviour?

Unfortunately the documentation doesn't specify the expected behaviour.
http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tcustomlistview.onselectitem.html

Also, it seems that under LCL-GTK2 the first time you select a new item,
it generates this event more times than under LCL-Win32/64.

Regards,
  - Graeme -

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

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


Re: [Lazarus] Lazarus Qt support and Wiki

2015-05-15 Thread zeljko

On 05/14/2015 06:04 PM, Giuliano Colla wrote:

I'm afraid that such a situation can discourage a number of potential
user from using Qt, while a wider usage would generate a better and
deeper testing, thus helping ironing out what's left to iron out.

Is it ok if, whenever I stumble into a Wiki page which is outdated with
respect of Qt support, I do edit it to reflect the current status of
things?
Any objections?


Of course that there's no objections. Just do it.

zeljko

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


Re: [Lazarus] Keyboard handling messed up in LCL (recent change)

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, Giuliano Colla wrote:


Il 14/05/2015 23:31, Toan Pham ha scritto:

This bug also exists in Ubuntu 15, vivid.  I am not sure of the
root-cause (not just settings related), it could be in GTK+.


You could rule out GTK by compiling the IDE with Qt WS, and switching to KDE 
desktop (which is Qt based).

If it's just a GTK issue, you wouldn't have anything GTK related in the way.


I had the problem too, on KDE. I just disabled ibus.

Michael.

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


Re: [Lazarus] Google APIs

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, markbass72 wrote:

I'm experimenting with the calendar demo and I have problems with updating an 
event

I created this thread on forum

http://forum.lazarus.freepascal.org/index.php/topic,28431.0.html


Better ask questions here. I don't use the forum, I'm old school.
But I have answered on the forum.

Michael.

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


Re: [Lazarus] CHM Maker not working

2015-05-15 Thread Richard Mace
Hi,
I was just suggesting that the demo may need to be adjusted for the
distribution of Lazarus, as all I did was load it and then run it?

Richard
On 15 May 2015 08:24, leledumbo leledumbo_c...@yahoo.co.id wrote:

  Any ideas?

 Show screenshot of that See on the bottom of the dialog. You're likely to
 set it wrong since you're on windows but trying to execute xterm as a
 launching application. The path is even clear: /usr/X11R6/bin/xterm, would
 that ever exist on windows?



 --
 View this message in context:
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-CHM-Maker-not-working-tp4042211p4042214.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

 --
 ___
 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] Google APIs

2015-05-15 Thread markbass72

On 15/05/2015 10:22, Michael Van Canneyt wrote:


Better ask questions here. I don't use the forum, I'm old school.
But I have answered on the forum.



from forum:
you can set the  webclient.logfile to some valid filename and examine the resulting 

file after the request. It should contain the complete response of google

Note that you  better use the Patch method if you're just changing some 
properties.



Following the response for:
FCalendarAPI.EventsResource.Update(FCurrentCalendar.ID, entry.id, Entry);

that is the same (except for 1st line where response begins with 
Request : PATCH https://...;) for:

FCalendarAPI.EventsResource.Patch(FCurrentCalendar.ID, entry.id, Entry);

maybe missing headers?

thanks




Request : PUT 
https://www.googleapis.com/calendar/v3/calendars/account...@gmail.com/events/f8umj295ncoahohqh2o8rjrsbc

Headers:
Authorization: Bearer 
ya29.dAGRj9MlacyM-TxfnKGMKjpAQNhL2U61xxrMjzk05LbLHPFqYNVg6llBTpL_jj0DrxLx9TVCDBfAjw

Body:
{ description : bla bla bla[modified] }

Response : 400 : Bad Request
Headers:
HTTP/1.0 400 Bad Request
Vary: X-Origin
Content-Type: application/json; charset=UTF-8
Date: Fri, 15 May 2015 09:12:07 GMT
Expires: Fri, 15 May 2015 09:12:07 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=1
Accept-Ranges: none
Vary: Origin,Accept-Encoding

Body:
{
 error: {
  errors: [
   {
domain: global,
reason: badContent,
message: Unsupported content with type: text/html
   }
  ],
  code: 400,
  message: Unsupported content with type: text/html
 }
}




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


Re: [Lazarus] Google APIs

2015-05-15 Thread markbass72
I'm experimenting with the calendar demo and I have problems with 
updating an event

I created this thread on forum

http://forum.lazarus.freepascal.org/index.php/topic,28431.0.html


nomorelogic

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


Re: [Lazarus] Google APIs

2015-05-15 Thread markbass72

On 15/05/2015 12:48, Michael Van Canneyt wrote:


I checked, I had indeed another version of googleservice.pp with the 
fix in it.

I commited the fix, rev. 30859.

Michael.


Now it works!
Thanks

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


Re: [Lazarus] Google APIs

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, markbass72 wrote:


On 15/05/2015 12:48, Michael Van Canneyt wrote:


I checked, I had indeed another version of googleservice.pp with the fix in 
it.

I commited the fix, rev. 30859.

Michael.


Now it works!


Great, because I almost got a heart attack :)

Michael.

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


Re: [Lazarus] ListView.OnSelectItem - which LCL backend is correct?

2015-05-15 Thread Bart
On 5/15/15, Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote:

 But the order of those events are reversed between LCL-Win32/64 and
 LCL-GTK2. I haven't tried other LCL backends, so don't know the order
 of them.

Without looking into it, I would expect that the order is unselect, then select.

 Also, it seems that under LCL-GTK2 the first time you select a new item,
 it generates this event more times than under LCL-Win32/64.

This is a known issue:
http://bugs.freepascal.org/view.php?id=23813

I tried to find the root cause of it, but failed miserably.

Bart

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


Re: [Lazarus] ListView.OnSelectItem - which LCL backend is correct?

2015-05-15 Thread Graeme Geldenhuys
On 2015-05-15 13:16, Bart wrote:
 
 Without looking into it, I would expect that the order is unselect, then 
 select.

I would have expected that behaviour too. It is like that when using
LCL-Win32/64, but the reverse order with LCL-GTK2.


 This is a known issue:
 http://bugs.freepascal.org/view.php?id=23813
 
 I tried to find the root cause of it, but failed miserably.

An old bug. The report mentions only ShellListView. I'm assuming
ShellListView is a descendant of TListView then.  Thanks for trying to
look into this.


Regards,
  - Graeme -

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

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


Re: [Lazarus] Google APIs

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, markbass72 wrote:


On 15/05/2015 10:22, Michael Van Canneyt wrote:


Better ask questions here. I don't use the forum, I'm old school.
But I have answered on the forum.



from forum:
you can set the  webclient.logfile to some valid filename and examine the 
resulting 

file after the request. It should contain the complete response of google
Note that you  better use the Patch method if you're just changing some 
properties.



Following the response for:
FCalendarAPI.EventsResource.Update(FCurrentCalendar.ID, entry.id, Entry);

that is the same (except for 1st line where response begins with Request : 
PATCH https://...;) for:

FCalendarAPI.EventsResource.Patch(FCurrentCalendar.ID, entry.id, Entry);

maybe missing headers?


Looks like it, a header 'Content-type: application/javascript' should be added.

Look in googleservice.pp, line 522

Req.SetContentFromString(AInput);

There add a
  if (AMethod'GET') then
Req.Headers.Add('Content-Type: application/json');

Strange.

I have created a calendar sync app which does both POST and PATCH.
Probably I have forgotten to copy some changes to the FPC repo.

Please test and report, if this helps, I'll update the API.
(I need to do some other changes anyway)

Michael.

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


Re: [Lazarus] Google APIs

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, Michael Van Canneyt wrote:




On Fri, 15 May 2015, markbass72 wrote:


On 15/05/2015 10:22, Michael Van Canneyt wrote:


Better ask questions here. I don't use the forum, I'm old school.
But I have answered on the forum.



from forum:
you can set the  webclient.logfile to some valid filename and examine the 
resulting 

file after the request. It should contain the complete response of google
Note that you  better use the Patch method if you're just changing some 
properties.



Following the response for:
FCalendarAPI.EventsResource.Update(FCurrentCalendar.ID, entry.id, Entry);

that is the same (except for 1st line where response begins with Request : 
PATCH https://...;) for:

FCalendarAPI.EventsResource.Patch(FCurrentCalendar.ID, entry.id, Entry);

maybe missing headers?


Looks like it, a header 'Content-type: application/javascript' should be 
added.


I checked, I had indeed another version of googleservice.pp with the fix in it.
I commited the fix, rev. 30859.

Michael.

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


[Lazarus] IDE unable to load form due to missing property

2015-05-15 Thread Graeme Geldenhuys
Hi,

I'm referring to this change.

[svn r46263]==
commit 53ca8b6c866480b5accbaa24049e5485f840a03d
Author: juha juha@4005530d-fff6-0310-9dd1-cebe43e6787f
Date:   Sat Sep 20 09:21:20 2014 +

LCL: remove unused TDateEdit.DialogTitle. Issue #1278

git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@46263
4005530d-fff6-0310-9dd1-cebe43e6787f
==


Probably my limited use of LCL, but any idea what the error below means
or how to resolve it? I now get a runtime error in my application when
this specific form is being loaded.

==
2015-05-15 13:55:12 9504 Error Handled exception type EReadError,
message Error reading EDatum.DialogTitle: Unknown property: DialogTitle
...snip...
2015-05-15 13:55:12 9504 Error Backtrace:   $005F2246 line 86 of
gui/frmberekendetoets.pp
2015-05-15 13:55:12 9504 Error Backtrace:   $005FC1C4 line 1155
of gui/frmpunten.pp
2015-05-15 13:55:12 9504 Error Backtrace:   $005F8CAC line 282
of gui/frmpunten.pp
==


While in Lazarus IDE, I tried loading the form in question using the
form designer, but then Lazarus gives me the following error:
==
Stream=TBerekendeToetsForm: Root=:TBerekendeToetsForm
Component Class: TDateEdit
Error reading EDatum.DialogTitle: Unknown property: DialogTitle
Stream position: 4096
==

Selecting Continue Loading shows the form, but closing it and opening
it, I get the same error again.

I take it a previously known property doesn't exist any more? But how do
I resolve this in my application and allow Lazarus IDE to load the form?

I'm using Lazarus 1.5 r48959 FPC 2.6.4 x86_64-linux-gtk 2.


Regards,
  - Graeme -

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

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


Re: [Lazarus] IDE unable to load form due to missing property

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, Tony Whyman wrote:


Open the problem form in the designer.

Ignore the missing property error and continue loading


Shouldn't choosing 'ignore' mark the form as modified ?

Michael.

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


Re: [Lazarus] IDE unable to load form due to missing property

2015-05-15 Thread Graeme Geldenhuys
On 2015-05-15 14:16, Tony Whyman wrote:
 Do something to change the form. e.g. move it

Ah, I just closed the form (same thinking as Michael did). Moving it and
then saving seems to have solved the problem. Many thanks.

Regards,
  - Graeme -

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

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


Re: [Lazarus] IDE unable to load form due to missing property

2015-05-15 Thread Tony Whyman
It probably should - but I see this error all the time when modifying 
components and you do need to do something more than just ignore the 
error. Maybe a bug report is needed.


Another thought - at run time an unknown property error might be better 
reported as a warning rather than as an error.


Tony W

On 15/05/15 14:19, Michael Van Canneyt wrote:



On Fri, 15 May 2015, Tony Whyman wrote:


Open the problem form in the designer.

Ignore the missing property error and continue loading


Shouldn't choosing 'ignore' mark the form as modified ?

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] IDE unable to load form due to missing property

2015-05-15 Thread Tony Whyman

Open the problem form in the designer.

Ignore the missing property error and continue loading

Do something to change the form. e.g. move it

Save the form.

now re-compile

On 15/05/15 14:13, Graeme Geldenhuys wrote:

Hi,

I'm referring to this change.

[svn r46263]==
commit 53ca8b6c866480b5accbaa24049e5485f840a03d
Author: juha juha@4005530d-fff6-0310-9dd1-cebe43e6787f
Date:   Sat Sep 20 09:21:20 2014 +

 LCL: remove unused TDateEdit.DialogTitle. Issue #1278

 git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@46263
4005530d-fff6-0310-9dd1-cebe43e6787f
==


Probably my limited use of LCL, but any idea what the error below means
or how to resolve it? I now get a runtime error in my application when
this specific form is being loaded.

==
2015-05-15 13:55:12 9504 Error Handled exception type EReadError,
message Error reading EDatum.DialogTitle: Unknown property: DialogTitle
...snip...
2015-05-15 13:55:12 9504 Error Backtrace:   $005F2246 line 86 of
gui/frmberekendetoets.pp
2015-05-15 13:55:12 9504 Error Backtrace:   $005FC1C4 line 1155
of gui/frmpunten.pp
2015-05-15 13:55:12 9504 Error Backtrace:   $005F8CAC line 282
of gui/frmpunten.pp
==


While in Lazarus IDE, I tried loading the form in question using the
form designer, but then Lazarus gives me the following error:
==
Stream=TBerekendeToetsForm: Root=:TBerekendeToetsForm
Component Class: TDateEdit
Error reading EDatum.DialogTitle: Unknown property: DialogTitle
Stream position: 4096
==

Selecting Continue Loading shows the form, but closing it and opening
it, I get the same error again.

I take it a previously known property doesn't exist any more? But how do
I resolve this in my application and allow Lazarus IDE to load the form?

I'm using Lazarus 1.5 r48959 FPC 2.6.4 x86_64-linux-gtk 2.


Regards,
   - Graeme -




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


Re: [Lazarus] Inserting enum type into Postgresql

2015-05-15 Thread Michael Van Canneyt



On Fri, 15 May 2015, Leonardo M. Ramé wrote:

Hi, I need to insert a value into a custom type column in a PostgreSql 
database.


The type was created using this:

create type doc_type as enum('pdf', 'rtf', 'html', 'doc', 'docx', 'xls', 
'xlsx', 'txt');


To insert a field into a table with one column of that type, I use:

var
 lQuery: TSqlQuery;

begin
 ...
 lQuery.Sql.Text := 'insert into documents(document_name, document_type) 
values(:name, :type)';

 lQuery.ParamByName('type').AsString := 'txt';
 ...

I get Primary Error: column document_type is of type doc_type but 
expression is of type text. How can I cast this?.


I would think
insert into documents(document_name, document_type)  values(:name, 
(:type)::doc_type )';
?

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


Re: [Lazarus] Inserting enum type into Postgresql

2015-05-15 Thread Leonardo M. Ramé

El 15/05/15 a las 12:26, Michael Van Canneyt escibió:



On Fri, 15 May 2015, Leonardo M. Ramé wrote:


Hi, I need to insert a value into a custom type column in a PostgreSql
database.

The type was created using this:

create type doc_type as enum('pdf', 'rtf', 'html', 'doc', 'docx',
'xls', 'xlsx', 'txt');

To insert a field into a table with one column of that type, I use:

var
 lQuery: TSqlQuery;

begin
 ...
 lQuery.Sql.Text := 'insert into documents(document_name,
document_type) values(:name, :type)';
 lQuery.ParamByName('type').AsString := 'txt';
 ...

I get Primary Error: column document_type is of type doc_type but
expression is of type text. How can I cast this?.


I would think
insert into documents(document_name, document_type)  values(:name,
(:type)::doc_type )';
?

Michael.




Yes, that was the solution.

Leonardo.

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


[Lazarus] Inserting enum type into Postgresql

2015-05-15 Thread Leonardo M. Ramé
Hi, I need to insert a value into a custom type column in a PostgreSql 
database.


The type was created using this:

create type doc_type as enum('pdf', 'rtf', 'html', 'doc', 'docx', 'xls', 
'xlsx', 'txt');


To insert a field into a table with one column of that type, I use:

var
  lQuery: TSqlQuery;

begin
  ...
  lQuery.Sql.Text := 'insert into documents(document_name, 
document_type) values(:name, :type)';

  lQuery.ParamByName('type').AsString := 'txt';
  ...

I get Primary Error: column document_type is of type doc_type but 
expression is of type text. How can I cast this?.


Regards,
--
Leonardo M. Ramé
http://leonardorame.blogspot.com

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