Re: [Lazarus] Event handling example project

2011-01-20 Thread Michael Schnell

On 01/20/2011 08:01 AM, zeljko wrote:

And where is that example project ?

I can send it via email, if you want to have it.

-Michael


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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread michael . vancanneyt



On Wed, 19 Jan 2011, Bo Berglund wrote:


I am investigating Lazarus' capabilities for database work so I  have
made a very simple test application using ODBC and the SQLdb
components.
I am doing this on a Windows XP platform.

The code is a very slightly modified example that I got from the WIKI
here:
http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_and_MSSQL

My problem is that I get an exception on the query.Open line when the
SQL text is something like this:
'EXEC SelectSomeData @Parameter=1234'


Hm. Weird MS syntax.

Why could they not use SELECT * FROM SelectSomeData(1234) like everyone else ?

Can you please give the error message ?

Michael

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


Re: [Lazarus] Where is a list of valid options for lazarus make?

2011-01-20 Thread Mattias Gaertner
On Thu, 20 Jan 2011 08:03:59 +0100
Vincent Snijders vincent.snijd...@gmail.com wrote:

 2011/1/19 Bo Berglund bo.bergl...@gmail.com:
  Was make bigide not supposed to put a lot more components on the tab
  list?
 
 No, just a default set.

.. which is much more than the SQLDB package.

Mattias

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


Re: [Lazarus] Project-Builder.org - GPL packages and project builder for multiple operating systems

2011-01-20 Thread michael . vancanneyt



On Thu, 20 Jan 2011, Michael Joyner wrote:


Anyone had luck using this?

Would it work good for packaging up Lazarus + FPC ?

http://www.project-builder.org/



As far as I can see, it doesn't handle Windows, Mac and OS/2.

Michael.

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


Re: [Lazarus] Help: The system.ppu for this target was not found in the FPC binary directories.

2011-01-20 Thread Frank Church
On 19 January 2011 23:00, Mattias Gaertner nc-gaert...@netcologne.dewrote:

 On Wed, 19 Jan 2011 21:14:40 +
 Frank Church vfcli...@gmail.com wrote:

  I deleted Lazarus and recompiled it again, and when I start it I get this
  error. So far it appears to be working okay.
  What does it mean?

 Maybe you were unlucky and got a buggy IDE svn revision.


  When I recompiled I did not clear the configuration for the previous
  compilation, and it restarted with all the configuration files intact.
 Could
  that have been the issue?

 Try Environment / Rescan FPC source directory.


Thanks, that fixed it.


  The project uses target OS=linux and CPU=i386.
   The system.ppu for this target was not found in the FPC binary
 directories.
  
   Make sure fpc is installed correctly for this target and the fpc.cfg
   contains the right directories.


 Mattias

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




-- 
Frank Church

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


[Lazarus] Event handling example project: results for gtk2 and fpGUI

2011-01-20 Thread Michael Schnell
Some testing results with Lazarus revision 29134 and fpGUI revision as 
of 20110120:


 GTK2   fpGUI
From a Thread======
  Synchronize(*) OK
  PostMessageOK  no function
  SendMessage(**)no function
  Dispatch   (**)(***)
  QueueAsyncCall (*) ()

From a Timer
  Synchronize   impossible
  PostMessageOK  no function
  SendMessageOK  no function
  Dispatch   OK  OK
  QueueAsyncCall OK  (*)


(*) The scheduled Events only are handled in the Main Thread when GUI 
Events for the Form are handled
(**)Forbidden but eventually works, The scheduled Events only are 
handled in the Main Thread when GUI Events for the Form are handled

(***)   Forbidden; works doe some time, then SIGABRT
()  The scheduled Events only are handled in the Main Thread when 
the worker thread is terminated
(*)Very funny: The scheduled Events only are handled in the Main 
Thread when e.g a completely unrelated worker thread is created and then 
terminated



Hope this helps,

-Michael



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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Bo Berglund
On Thu, 20 Jan 2011 09:31:44 +0100 (CET), michael.vancann...@wisa.be
wrote:



On Wed, 19 Jan 2011, Bo Berglund wrote:

 I am investigating Lazarus' capabilities for database work so I  have
 made a very simple test application using ODBC and the SQLdb
 components.
 I am doing this on a Windows XP platform.

 The code is a very slightly modified example that I got from the WIKI
 here:
 http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_and_MSSQL

 My problem is that I get an exception on the query.Open line when the
 SQL text is something like this:

 'EXEC SelectSomeData @Parameter=1234'

Hm. Weird MS syntax.

Not really, this is standard syntax for calling a stored procedure
with a parameter value. I simplified the call for this post to have
only one parameter and gave it a valid name, which is not the actual
name...

Why could they not use SELECT * FROM SelectSomeData(1234) like everyone else ?

Because the SelectSomeData is not a table, it is a stored procedure
and must be called with the EXEC verb.
And there are possibly many different input arguments so the syntax
allows for giving these by name. Parameters not supplied by the call
will be replaced by defaults if the procedure is so programmed.
But it is also possible to use this call syntax:

EXEC SelectSomeData 1234

In this case it is assumed that the supplied parameter value belongs
to the first argument of the stored procedure.

Stored procedures are of two kinds (at least):
- Action procedures perform an action like updating tables according
to the procedure code or such but return nothing.
- Select procedures select data according to a complex scheme built
into the procedure and return them in a dataset similar to what is
returned by a table select sentence.

Both are called with the EXEC verb.

Can you please give the error message ?

Not now, I am at work and the program is located on my home PC.

-- 

Bo Berglund
Developer in Sweden


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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread michael . vancanneyt



On Thu, 20 Jan 2011, Bo Berglund wrote:


On Thu, 20 Jan 2011 09:31:44 +0100 (CET), michael.vancann...@wisa.be
wrote:




On Wed, 19 Jan 2011, Bo Berglund wrote:


I am investigating Lazarus' capabilities for database work so I  have
made a very simple test application using ODBC and the SQLdb
components.
I am doing this on a Windows XP platform.

The code is a very slightly modified example that I got from the WIKI
here:
http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_and_MSSQL

My problem is that I get an exception on the query.Open line when the
SQL text is something like this:

'EXEC SelectSomeData @Parameter=1234'


Hm. Weird MS syntax.


Not really, this is standard syntax for calling a stored procedure
with a parameter value. I simplified the call for this post to have
only one parameter and gave it a valid name, which is not the actual
name...


Why could they not use SELECT * FROM SelectSomeData(1234) like everyone else ?


Because the SelectSomeData is not a table, it is a stored procedure
and must be called with the EXEC verb.


I understand that SelectSomeData is not a table.

But in other engines SELECT * FROM SelectSomeData(1234) does work on a stored 
procedure.
I assumed it was standard.

Michael.

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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Graeme Geldenhuys
Op 2011-01-20 12:38, michael.vancann...@wisa.be het geskryf:

 But in other engines SELECT * FROM SelectSomeData(1234) does work on a
 stored procedure.

That will only work if the stored procedure returns a table-type dataset.

I used to use MS SQL Server years ago, but can't remember if we used
that format (from original poster) to pass parameters. I'll see if I can
find some old delphi code to confirm.



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] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Luca Olivetti

En/na michael.vancann...@wisa.be ha escrit:

Why could they not use SELECT * FROM SelectSomeData(1234) like 
everyone else ?


Because the SelectSomeData is not a table, it is a stored procedure
and must be called with the EXEC verb.


I understand that SelectSomeData is not a table.

But in other engines SELECT * FROM SelectSomeData(1234) does work on a 
stored procedure.

I assumed it was standard.


I never used it (my database needs are quite simple) so I don't know how 
it works, but zeos has a TZStoredProc component, probably meant to 
encapsulate the different way each database has to execute stored 
procedures.


Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004 (Ext.133)  Fax +34 93 5883007

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


Re: [Lazarus] Event handling example project: results for gtk2 and fpGUI

2011-01-20 Thread José Mejuto
Hello Lazarus-List,

Thursday, January 20, 2011, 10:47:41 AM, you wrote:

MS Some testing results with Lazarus revision 29134 and fpGUI revision as
MS of 20110120:
MS   GTK2   fpGUI
MS  From a Thread======
MSSynchronize(*) OK
MSPostMessageOK  no function
MSSendMessage(**)no function
MSDispatch   (**)(***)
MSQueueAsyncCall (*) ()
MS  From a Timer
MSSynchronize   impossible
MSPostMessageOK  no function
MSSendMessageOK  no function
MSDispatch   OK  OK
MSQueueAsyncCall OK  (*)

May you send me the test in order to test PostMessage and SendMessage
at least under LCLfpGUI ? As you know it is very alpha :)

Your test invironmen is Linux or Windows ?

-- 
Best regards,
 José


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


Re: [Lazarus] Event handling example project: results for gtk2 and fpGUI

2011-01-20 Thread Michael Schnell

On 01/20/2011 12:08 PM, José Mejuto wrote:

May you send me the test in order to test PostMessage and SendMessage
at least under LCLfpGUI ?

Done

As you know it is very alpha :)

Of course I know that, so I'm trying to help to improve it.
(But as you see the gtk2 Widget Type does not work perfectly, either ;) )

Your test invironmen is Linux or Windows ?
Linux, but the test program should work with Windows, as well. Here 
additionally, SendThreadMessage should automatically be enabled.


BTW it's an LCL-fpGUI project :).

-Michael


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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Dimitrios Chr. Ioannidis

Στις 20/1/2011 12:38 μμ, ο/η michael.vancann...@wisa.be έγραψε:



On Thu, 20 Jan 2011, Bo Berglund wrote:


On Thu, 20 Jan 2011 09:31:44 +0100 (CET), michael.vancann...@wisa.be
wrote:




On Wed, 19 Jan 2011, Bo Berglund wrote:


I am investigating Lazarus' capabilities for database work so I have
made a very simple test application using ODBC and the SQLdb
components.
I am doing this on a Windows XP platform.

The code is a very slightly modified example that I got from the WIKI
here:
http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_and_MSSQL 



My problem is that I get an exception on the query.Open line when the
SQL text is something like this:

'EXEC SelectSomeData @Parameter=1234'


Hm. Weird MS syntax.


Not really, this is standard syntax for calling a stored procedure
with a parameter value. I simplified the call for this post to have
only one parameter and gave it a valid name, which is not the actual
name...

Why could they not use SELECT * FROM SelectSomeData(1234) like 
everyone else ?


Because the SelectSomeData is not a table, it is a stored procedure
and must be called with the EXEC verb.


I understand that SelectSomeData is not a table.

But in other engines SELECT * FROM SelectSomeData(1234) does work on 
a stored procedure.

I assumed it was standard.



Bo, one trick you can use is :

SELECT * FROM OPENROWSET('SQLOLEDB', 'SERVER=(LOCAL);TRUSTED 
CONNECTION=YES;','SET FMTONLY OFF EXEC MASTER.DBO.SelectSomeData


but because under SQL Server 2005, Ad Hoc Distributed Queries must be 
replaced all sp under MS SQL with User Defined Functions, which return a 
RowSet and can be used in

the SQL statements.

regards,

--
Dimitrios Chr. Ioannidis



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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Dimitrios Chr. Ioannidis


but because under SQL Server 2005, Ad Hoc Distributed Queries must be 
replaced all sp under MS SQL with User Defined Functions, which return 
a RowSet and can be used in

the SQL statements.


but because under SQL Server 2005, Ad Hoc Distributed Queries must be 
on, i replaced all sp under


i meant to write, sorry

regards,
--
Dimitrios Chr. Ioannidis



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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Bo Berglund
On Thu, 20 Jan 2011 12:00:19 +0100, Luca Olivetti l...@wetron.es
wrote:

En/na michael.vancann...@wisa.be ha escrit:

 Why could they not use SELECT * FROM SelectSomeData(1234) like 
 everyone else ?

 Because the SelectSomeData is not a table, it is a stored procedure
 and must be called with the EXEC verb.
 
 I understand that SelectSomeData is not a table.
 
 But in other engines SELECT * FROM SelectSomeData(1234) does work on a 
 stored procedure.
 I assumed it was standard.

I never used it (my database needs are quite simple) so I don't know how 
it works, but zeos has a TZStoredProc component, probably meant to 
encapsulate the different way each database has to execute stored 
procedures.

I might as well use something else than SQLdb even though it would be
a pity since SQLdb seems to be part of the lazarus file set while zeos
is not.

I located this zeos wiki page:
http://wiki.lazarus.freepascal.org/Zeos_tutorial
but it seems VERY old since it refers to the latset stable lazarus
as 0.9.12 and dates are 2005-2006

Of course I am on lazarus 0.9.30_fixes and FPC 2.4.2

Is there some more up-to-date lazarus tutorial for zeos?

-- 

Bo Berglund
Developer in Sweden


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


Re: [Lazarus] Accessing MS SQLServer database from Lazarus/FPC?

2011-01-20 Thread Marcos Douglas
On Wed, Jan 19, 2011 at 7:38 PM, Bo Berglund bo.bergl...@gmail.com wrote:
 On Wed, 19 Jan 2011 19:27:58 +0100, Bo Berglund
 bo.bergl...@gmail.com wrote:

Did this and indeed now I have the SQLdb tab on my lazarus.

 More problems:
 I have created a test application and did a cut-and-paste operation on
 the example on this page:
 http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_and_MSSQL

 After changing the specifics of the database (server, name, user,
 login) in the code I tried to run it in Lazarus debugger.

 After fixing the uses clause so it will compile and after creating a
 datasource pointing to my database I tried running against a real
 MSSQLServer database but it failed miserably with an exception on
 line:
  query.Open;

 The exception text is:
 'Cannot open a non-select statement'

 The database I run against uses stored procedures to select data and I
 have specified a call to such a procedure in the test program as
 follows:

 query.SQL.Text := 'EXEC SelectDongleData @SerialNo=2485';

 This works fine in my Delphi program where I use an ADO connection.
 There the query object is defined as
 qryADO: TADOQuery;

 and the code to get the records is:

  sSql := 'EXEC SelectDongleData @SerialNo=' + IntToStr(KeyNo);
  qryADO.SQL.Text := sSql;
  qryADO.Open;


 What did I do wrong regarding the use of TSQLQuery to get this error?

Use query.ExecSQL instead of query.Open even in Delphi!

Marcos Douglas

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


[Lazarus] Even more radical suggestion regarding Event Queues

2011-01-20 Thread Michael Schnell

After some more thinking about the issue:

Obviously doing Event Queues with the current Linux based Widget Types 
is not easy to do (in the way it is done right now). In some revisions 
PostMessage does not work at all, in some revisions 
TApplication.QueueAsyncCall does not work as expected, in some revisions 
TThread.Synchronize does not work as expected (While TThread.Queue is 
not implemented at all).


As far as I understand, (e.g.) the gtk (2) Widget Set is used by a 
loop (repeated call or callback) that alternately runs the Widget Set 
code and the application program code, while the widget set code 
(additionally) performs callbacks into the application program code when 
a GUI event is fired by the user's interaction.


Now, at some point the code (GUI Thread) needs to go to sleep if nothing 
is to be done. It seems like the Widget Set is done in a way that it 
automatically wakes up the GUI Thread when user interaction is detected 
and thus the appropriate Callback is done and seemingly as a 
consequence, the looped code in the application program is executed, 
too, resulting in execution of all events scheduled up till now.


This results in the problem, that waking up the program whenever an 
event is to be handled that is not generated by the Widget Set, is not 
that easy to do. (Especially regarding that doing too much polling will 
degrade the overall performance.)


With Windows, this problem does not appear, as non-GUI events are 
scheduled by a PostMessage() or PostThreadMessage() API call, that 
automatically wake up the target-thread.


So a more radical way of Event handling with Linux could be worth 
considering.


The Widget Set could be assigned to a dedicated thread, while it's 
callbacks are transferred to the main thread via the application's 
message queue (that is implemented anyway) by Application.QueueAsyncCall().


The Pro being:
 - The Main thread is completely independent of the GUI, the sleeping 
and waking of the main thread can be done with pure Linux means, 
automatically scheduling the GUI- and the non-GUI- events appropriately, 
while the GUI thread does it's work undisturbed by that.
 - no necessity to permanently run (poll) the Widget Set loop, reducing 
the overall CPU time
 - the Widget Set code (running in another thread) can run on another 
CPU in an SMP system (very common nowadays), thus providing more 
performance both for the GUI and for the application itself.


The obvious Cons being:
 - much work for developing the code and testing it
 - adding another level of complexity to the code for the LCL's GUI 
controls due to inter-thread data transfer when calling GUI functions 
and when taking GUI callbacks.


-Michael

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


Re: [Lazarus] Even more radical suggestion regarding Event Queues

2011-01-20 Thread michael . vancanneyt



On Thu, 20 Jan 2011, Michael Schnell wrote:


After some more thinking about the issue:

Obviously doing Event Queues with the current Linux based Widget Types is not 
easy to do (in the way it is done right now). In some revisions PostMessage 
does not work at all, in some revisions TApplication.QueueAsyncCall does not 
work as expected, in some revisions TThread.Synchronize does not work as 
expected (While TThread.Queue is not implemented at all).


As far as I understand, (e.g.) the gtk (2) Widget Set is used by a loop 
(repeated call or callback) that alternately runs the Widget Set code and the 
application program code, while the widget set code (additionally) performs 
callbacks into the application program code when a GUI event is fired by the 
user's interaction.


Now, at some point the code (GUI Thread) needs to go to sleep if nothing is 
to be done. It seems like the Widget Set is done in a way that it 
automatically wakes up the GUI Thread when user interaction is detected and 
thus the appropriate Callback is done and seemingly as a consequence, the 
looped code in the application program is executed, too, resulting in 
execution of all events scheduled up till now.


This results in the problem, that waking up the program whenever an event is 
to be handled that is not generated by the Widget Set, is not that easy to 
do. (Especially regarding that doing too much polling will degrade the 
overall performance.)


With Windows, this problem does not appear, as non-GUI events are scheduled 
by a PostMessage() or PostThreadMessage() API call, that automatically wake 
up the target-thread.


So a more radical way of Event handling with Linux could be worth 
considering.


The Widget Set could be assigned to a dedicated thread, while it's callbacks 
are transferred to the main thread via the application's message queue (that 
is implemented anyway) by Application.QueueAsyncCall().


The Pro being:
- The Main thread is completely independent of the GUI, the sleeping and 
waking of the main thread can be done with pure Linux means, automatically 
scheduling the GUI- and the non-GUI- events appropriately, while the GUI 
thread does it's work undisturbed by that.
- no necessity to permanently run (poll) the Widget Set loop, reducing the 
overall CPU time


That's wrong. The thread would then run the widget set loop, since that must
be run in every scenario. And Poll() does not consume any CPU.

I would never use a widget set with the structure you describe. Threading
problems are extremely difficult to debug, doubly so in an event based
system. What's more, X11 is not thread-safe at all.

Michael.

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


Re: [Lazarus] SQLdb not able to retrieve data from stored procedures?

2011-01-20 Thread Bo Berglund
On Thu, 20 Jan 2011 12:57:28 +0100, Bo Berglund
bo.bergl...@gmail.com wrote:


Is there some more up-to-date lazarus tutorial for zeos?

I might add that I followed the link on the wiki page to the Zeoslib
own webpage: http://zeos.firmos.at/

Here is a download link in the left panel that goes to:
http://zeos.firmos.at/downloads.php

Finally on this page is a link to Releases that ends up at an EMPTY
PAGE, only the site headers are shown...

But thanks to Google:
If one wants to test the Zeoslib 6.6.6 stable release (pre unicode)
from 2009, then here is where it can be downloaded:
http://sourceforge.net/projects/zeoslib/

-- 

Bo Berglund
Developer in Sweden


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


Re: [Lazarus] Even more radical suggestion regarding Event Queues

2011-01-20 Thread Henry Vermaak
On 20 January 2011 11:59, Michael Schnell mschn...@lumino.de wrote:
 After some more thinking about the issue:

 Obviously doing Event Queues with the current Linux based Widget Types is
 not easy to do (in the way it is done right now). In some revisions
 PostMessage does not work at all, in some revisions
 TApplication.QueueAsyncCall does not work as expected, in some revisions
 TThread.Synchronize does not work as expected (While TThread.Queue is not
 implemented at all).

 As far as I understand, (e.g.) the gtk (2) Widget Set is used by a loop
 (repeated call or callback) that alternately runs the Widget Set code and
 the application program code, while the widget set code (additionally)
 performs callbacks into the application program code when a GUI event is
 fired by the user's interaction.

 Now, at some point the code (GUI Thread) needs to go to sleep if nothing is
 to be done. It seems like the Widget Set is done in a way that it
 automatically wakes up the GUI Thread when user interaction is detected and
 thus the appropriate Callback is done and seemingly as a consequence, the
 looped code in the application program is executed, too, resulting in
 execution of all events scheduled up till now.

 This results in the problem, that waking up the program whenever an event is
 to be handled that is not generated by the Widget Set, is not that easy to
 do. (Especially regarding that doing too much polling will degrade the
 overall performance.)

No, it's very easy to do.  At least gtk and qt has dedicated functions
to do just this (g_main_context_wakeup() and QEventLoop::wakeUp()).
Lazarus just has to do this after QueueAsyncCall (I do this manually
myself for the moment).

Henry

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


Re: [Lazarus] Where is a list of valid options for lazarus make?

2011-01-20 Thread Mattias Gaertner
On Thu, 20 Jan 2011 11:08:55 +0100
Marc Weustink marc.weust...@cuperus.nl wrote:

 Mattias Gaertner wrote:
  For all others:
  When you want to install a package like sqldb, use the IDE for that. The
  'make' commands can only install two fixed sets of standard packages -
  the minimal (default) and the one used by the official binaries (bigide).
 
  Once you installed the package, you can use the make and lazbuild
  commands to recompile.
 
 ehm, there used to be a pkgide or idepkg make target for this.

Yes, but they are only part of the magic. They are called by lazbuild.

 How to use lazbuild to recompile laz with installed packages ?

./lazbuild --build-ide=

See ./lazabuild -h

dream
It would be nice if lazbuild would not require the LCL any more. Then
we don't need the Makefiles anymore. Only one to build lazbuild and
one for compatibility, which simply calls lazbuild.
/dream

Mattias

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


[Lazarus] portability directives and syntax highlighting

2011-01-20 Thread Graeme Geldenhuys
Hi,

Are portability directives like 'platform', 'deprecated' and 'library'
supposed to be syntax highlighted like reserved words?  I know they are
not reserved works, but I think it would make sense (for syntax
highlighting) to treat them as such.

See attached screenshot.


I'm using Lazarus 0.9.29 r28985M FPC 2.4.3 x86_64-linux-gtk 2


Regards,
  - Graeme -

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

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


Re: [Lazarus] Where is a list of valid options for lazarus make?

2011-01-20 Thread Vincent Snijders
2011/1/20 Mattias Gaertner nc-gaert...@netcologne.de:
 dream
 It would be nice if lazbuild would not require the LCL any more. Then
 we don't need the Makefiles anymore. Only one to build lazbuild and
 one for compatibility, which simply calls lazbuild.
 /dream

I have been thinking about that too, when I tried to make nogui obsolete.

Maybe we have to split the LCL in a widgetset dependent part (forms
and dialogs) and a widgetset independant part (e.g. lclproc and
fileutil).
Then lazbuild should only ide units that don't depend on the forms and
dialogs unit.

Vincent

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


Re: [Lazarus] fpGUI

2011-01-20 Thread Graeme Geldenhuys
Op 2011-01-20 15:17, Sven Barth het geskryf:
 
 But it isn't that easy if you don't want to outsource something, but
 need a new employee in the company...

I worked for a long time as a fulltime employee for a small company (20
employees), yet I lived in a different country. I didn't see a problem
with that, neither did the company. That same company had developers
based in Canada, UK, South Africa and Thailand. The owner of that
company thought it was GREAT, because that meant he had 24hrs a day,
developers working on the projects. So turn-around time for anything was
really quick! Client reports a bug at 15:00, company schedules the task
for the employee where the sun is rising and by 08:00 the next morning,
the client has the bug solved. :)



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] portability directives and syntax highlighting

2011-01-20 Thread Martin

On 20/01/2011 12:45, Graeme Geldenhuys wrote:

Hi,

Are portability directives like 'platform', 'deprecated' and 'library'
supposed to be syntax highlighted like reserved words?  I know they are
not reserved works, but I think it would make sense (for syntax
highlighting) to treat them as such.


They are in most contexts...


See attached screenshot.
You seem to have found one of the few (or maybe even the one ?) 
example where they are not:

After the end of a structured type declaration

You should fill in a bug report...

Martin


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


Re: [Lazarus] portability directives and syntax highlighting

2011-01-20 Thread Martin

On 20/01/2011 13:25, Martin wrote:

On 20/01/2011 12:45, Graeme Geldenhuys wrote:

Hi,

Are portability directives like 'platform', 'deprecated' and 'library'
supposed to be syntax highlighted like reserved words?  I know they are
not reserved works, but I think it would make sense (for syntax
highlighting) to treat them as such.



You should fill in a bug report...

or use revision 29140

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


Re: [Lazarus] portability directives and syntax highlighting

2011-01-20 Thread Graeme Geldenhuys
Op 2011-01-20 15:57, Martin het geskryf:

 You should fill in a bug report...
 or use revision 29140

:-) Thanks!  I'll push my luck and add that revision as a back-port
request to 0.9.30.


Here I found another one, though not a directive, but a method name.


Regards,
  - Graeme -

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

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


Re: [Lazarus] fpGUI

2011-01-20 Thread Felipe Monteiro de Carvalho
On Thu, Jan 20, 2011 at 2:17 PM, Sven Barth pascaldra...@googlemail.com wrote:
 But it isn't that easy if you don't want to outsource something, but need a
 new employee in the company...

A good developer can learn the appropriate language. It should be easy
for C and C++ developers to migrate to Object Pascal because the
paradigm is similar, just Pascal is easier to read.

-- 
Felipe Monteiro de Carvalho

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


Re: [Lazarus] fpGUI

2011-01-20 Thread Sven Barth

Am 20.01.2011 15:31, schrieb Felipe Monteiro de Carvalho:

On Thu, Jan 20, 2011 at 2:17 PM, Sven Barthpascaldra...@googlemail.com  wrote:

But it isn't that easy if you don't want to outsource something, but need a
new employee in the company...


A good developer can learn the appropriate language. It should be easy
for C and C++ developers to migrate to Object Pascal because the
paradigm is similar, just Pascal is easier to read.



But if the company searches for Delphi developers then nearly no one 
will answer... sigh... (well... I'm still working on a Windows Mobile 
application using Lazarus at work, so it will take some time till I'm 
not getting money for developing Pascal anymore :P )


Regards,
Sven

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


Re: [Lazarus] fpGUI

2011-01-20 Thread Felipe Monteiro de Carvalho
On Thu, Jan 20, 2011 at 4:00 PM, Sven Barth pascaldra...@googlemail.com wrote:
 But if the company searches for Delphi developers then nearly no one will
 answer... sigh... (well... I'm still working on a Windows Mobile application
 using Lazarus at work, so it will take some time till I'm not getting money
 for developing Pascal anymore :P )

They can hire someone who is good at C/C++ and then train the guy to
use Object Pascal. When searching for a developer they should make it
clear that they accept people with experience in C/C++ if they are
willing to learn Object Pascal. In other words they should search for
a developer.

-- 
Felipe Monteiro de Carvalho

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


Re: [Lazarus] portability directives and syntax highlighting

2011-01-20 Thread Martin

On 20/01/2011 14:27, Graeme Geldenhuys wrote:

Op 2011-01-20 15:57, Martin het geskryf:

You should fill in a bug report...

or use revision 29140

:-) Thanks!  I'll push my luck and add that revision as a back-port
request to 0.9.30.


Here I found another one, though not a directive, but a method name.

There are probably lots of those

Haven't got the time to write the tests for each of them now...

checked something in for final *seems* to work

r29141

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


Re: [Lazarus] Project-Builder.org - GPL packages and project builder for multiple operating systems

2011-01-20 Thread Michael Joyner
On Thu, Jan 20, 2011 at 3:45 AM, michael.vancann...@wisa.be wrote:



 On Thu, 20 Jan 2011, Michael Joyner wrote:

  Anyone had luck using this?

 Would it work good for packaging up Lazarus + FPC ?

 http://www.project-builder.org/


 As far as I can see, it doesn't handle Windows, Mac and OS/2.


So the existing process handles all platforms including the different linux
variants?
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fpGUI

2011-01-20 Thread Sven Barth

Am 20.01.2011 16:16, schrieb Felipe Monteiro de Carvalho:

On Thu, Jan 20, 2011 at 4:00 PM, Sven Barthpascaldra...@googlemail.com  wrote:

But if the company searches for Delphi developers then nearly no one will
answer... sigh... (well... I'm still working on a Windows Mobile application
using Lazarus at work, so it will take some time till I'm not getting money
for developing Pascal anymore :P )


They can hire someone who is good at C/C++ and then train the guy to
use Object Pascal. When searching for a developer they should make it
clear that they accept people with experience in C/C++ if they are
willing to learn Object Pascal. In other words they should search for
a developer.



could, should, might...

The decision was done and part of our development team is happy about 
that move (myself not included). So this says it all...


Regards,
Sven

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


Re: [Lazarus] Accessing MS SQLServer database from Lazarus/FPC?

2011-01-20 Thread Bo Berglund
On Thu, 20 Jan 2011 09:58:14 -0200, Marcos Douglas m...@delfire.net
wrote:


 What did I do wrong regarding the use of TSQLQuery to get this error?

Use query.ExecSQL instead of query.Open even in Delphi!


Not if the stored procedure returns a recordset


-- 
Bo Berglund
Developer in Sweden


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


Re: [Lazarus] Lazarus fails to start with TWinControl.CreateWnd: The nogui widgetset does not support visual controls.

2011-01-20 Thread Mattias Gaertner
On Wed, 19 Jan 2011 18:25:04 +
Frank Church vfcli...@gmail.com wrote:

 On 19 January 2011 16:43, Frank Church vfcli...@gmail.com wrote:
 
 
 
  On 19 January 2011 06:14, Vincent Snijders 
  vincent.snijd...@gmail.comwrote:
 
  2011/1/19 Mattias Gaertner nc-gaert...@netcologne.de:
   Are there some steps the additional steps required in the Build All
  that I
   may have missed?
  
   You have to choose the nogui widgetset in the project's compiler
   options and of course you must not use any unit that uses the gtk.
 
  Build all builds also the IDE with the nogui widgetset, that is not
  what you want and what is supported, the IDE needs a GUI. Building
  just the LCL with nogui is good and then you can try to compile your
  project.
 
  --
  ___
  Lazarus mailing list
  Lazarus@lists.lazarus.freepascal.org
  http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
 
 
 
  I set NoGUI alone in the project options and it worked.
 
  Thanks.
 
 
 
 
 As a side question - what does the NoGUI widgetset do, how does it work?

It sets up enough empty methods to make the LCL compile.

 
 Does it send all GUI related objects down some blackhole, or is the
 programmer supposed to ensure that no Forms and items placed on forms are
 included in the program?

You can include forms, you can even create some of them, but you can not
create Handles.


Mattias

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


Re: [Lazarus] Accessing MS SQLServer database from Lazarus/FPC?

2011-01-20 Thread Graeme Geldenhuys
On 20 January 2011 20:28, Bo Berglund bo.bergl...@gmail.com wrote:

Use query.ExecSQL instead of query.Open even in Delphi!

 Not if the stored procedure returns a recordset

And with this whole mess I would end by saying:  And that is why you
will not see me ever use a Stored Procedure! 99.99% of the time they
contain business logic, which doesn't belong in the data layer of your
application in any case - you can't unit test that business logic.

Just my 2¢ worth...


-- 
Regards,
  - Graeme -


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

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