Re: [Lazarus] Lazarus on Linux, which desktop environment?

2021-11-21 Thread Michael Van Canneyt via lazarus



On Sun, 21 Nov 2021, Juha Manninen via lazarus wrote:


On Sun, Nov 21, 2021 at 10:33 AM Michael Van Canneyt via lazarus <
lazarus@lists.lazarus-ide.org> wrote:


You can install KDE, but then installing Lazarus will most likely add the
GTK libraries as a dependency.



With KDE I recommend Lazarus with LCL-QT5 bindings.
KDE itself is based on QT5.
LCL-QT5 works better than LCL-GTK2 now IMO.


I am not commenting on the relative merits/stability of the widgetsets, 
but if OP will install using the system package manager, then the gtk 
version of Lazarus is most likely what will be installed on an ubuntu based system.


Keeping that in mind, I'm simply recommending to follow the path of least 
resistance.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus on Linux, which desktop environment?

2021-11-21 Thread Michael Van Canneyt via lazarus



On Sun, 21 Nov 2021, Bo Berglund via lazarus wrote:


On Sun, 21 Nov 2021 02:53:35 +0300, Mehmet Erol Sanliturk via lazarus
 wrote:


It is possible to use  KUbuntu ( KDE with Ubuntu ) . My choice is Fedora
because I find it more easily usable and with respect to their *.rpm
repository quality .


Thanks,
but my server is *already* installed and running (using Ubuntu Server 20.04.3)
and I am only wanting to *add* a light-weight desktop environment to be able to
use some graphics tools for administration work on the server (such as Gparted
etc).
And of course to use Lazarus directly on this server to build some Linux tools
etc. But it will be accessed using VNC from my Windows box.

My question is asked from my worry that Lazarus itself will add dependencies on
the desktop environment, which do not match the target system environments

So I am looking for a *desktop environment* to be installed on a server
currently *without* a desktop so Lazarus can be used to create apps that will
work universally on Linux.


It does not matter what environment you install.

The only thing that matters is that the final environment has the necessary
libraries for the widgetset with which you compile your application.
Currently that is by default gtk2.

You can install KDE, but then installing Lazarus will most likely add the
GTK libraries as a dependency.


So the easiest is to install something that is GTK based, like MATE as used
in linux mint.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Asteroids in Pascal

2021-11-09 Thread Michael Van Canneyt via lazarus



On Tue, 9 Nov 2021, Anthony Walter via lazarus wrote:


As one of several demos of my vector graphics library for Free Pascal, I've
recreated an arcade game.

I've included a copy of the entire game logic code. Check it out here:

https://www.getlazarus.org/videos/physics/asteroids/



Boy, does that bring back memories. 
One of my favourites in the arcade hall...


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Freepascal for web

2021-09-25 Thread Michael Van Canneyt via lazarus



On Sat, 25 Sep 2021, Santiago A. via lazarus wrote:

Not sure if this question should go for fpc-freepascal list or 
fpc-others list.


I'm starting a new project, a simple accounting system, with the data in 
a server in internet. It is an experimental pet project, just to try new 
technologies (new for me). Although it is just an experimental pet 
project, I want to use technologies that allow to scale in the web.


I don't want to do it in PHP (I got enough of it years ago), so I want 
to consider a more advanced language.
First, I thought about something with a python backend, but I've read 
that it doesn't scale well because it doesn't support multithreads.


I am almost decided to node.js in the backend and vue.js in the 
frontend. Node.js is what almost everybody uses and has a lot of 
libraries/modules and future. And vue.js looks powerful and simple with 
a nice learning curve.


But I'm not still happy. Why can't I use a native compiled program for 
the backend?, it should faster, and more robust that any script, 
dynamic, JIT language. Pascal for this is my first thought as it was my 
first love. I'm thinking about a freepascal backend  and vue.js frontend 
, or even a three-tier with json messages between frontend in vue.js and 
server.


Have you any experience in freepascal for web?



I've been doing FPC back-ends for 12 years now. 
This is not a problem, everything is available.


The question is: what do you need ?

FPC has RPC-JSON for RPC mechanisms. You have SQLDBRestbridge to create a
REST backend on top of SQLDB. It can be used as-is, no code required for
simple cases.

FCL-Web allows you to write a service as a standalone executable, fastcgi,
cgi, apache module. You have advanced routing.

There is also the 'Brook' framework written on top of fcl-web. 
I'm not sure how well it is maintained.


And you can use pascal client-side as well.

Since 2 years I also do the front-end in pascal: pas2js allows you to write
your client-side logic in pascal as well. I have several sites running like
this for our clients. There is a series of components available.

If all goes well, we expect to have design-time functionality in the Lazarus 
IDE to create web-applications that render, design and run in the browser 
within a year (fingers crossed) - using the abovementioned components.


Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Playing with debuggers

2021-09-14 Thread Michael Van Canneyt via lazarus



On Tue, 14 Sep 2021, Joost van der Sluis via lazarus wrote:




Op 14-09-2021 om 14:26 schreef Michael Van Canneyt via lazarus:



On Tue, 14 Sep 2021, Joost van der Sluis via lazarus wrote:


Hi all,

I'm playing with several debuging-concepts. And I want to share this 
one with you.


I've created a new Lazarus-debugger LazDabDebugger that can work with 
FpdServer. It depends on a package (LazDebugExtensionIntf) that adds 
another way of showing debugging variables inside Lazarus.


I can write tons of texts about the background and possibilities. But 
for now I'm just curious at your input.


Look at the screencast or install the debugger, and share your 
opinion(s).


Impressive job...

Looking at the screencast, I think changing the current interface with the
one presented in the screencast would be a definite improvement; 
regardless of the backend used...


Yes, but that needs work on the backends. And I think we can better 
improve and fine-tune the interface first. At this moment this is easily 
done. Once there are multiple backends, that becomes more work.


I think you indeed better fine-tune first. It could be that the fine-tuning
necessitates changes in the API, so better to do this with 1 backend. Once
the API is stable, expand to other backends.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Playing with debuggers

2021-09-14 Thread Michael Van Canneyt via lazarus



On Tue, 14 Sep 2021, Joost van der Sluis via lazarus wrote:


Hi all,

I'm playing with several debuging-concepts. And I want to share this one 
with you.


I've created a new Lazarus-debugger LazDabDebugger that can work with 
FpdServer. It depends on a package (LazDebugExtensionIntf) that adds 
another way of showing debugging variables inside Lazarus.


I can write tons of texts about the background and possibilities. But 
for now I'm just curious at your input.


Look at the screencast or install the debugger, and share your opinion(s).


Impressive job...

Looking at the screencast, I think changing the current interface with the
one presented in the screencast would be a definite improvement; 
regardless of the backend used...


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] GTK3 Status?

2021-09-10 Thread Michael Van Canneyt via lazarus



On Fri, 10 Sep 2021, Anthony Walter via lazarus wrote:


After a small bit of research, it looks like most of the information
related to the LCL GTK3 can be found on this page. I am unsure how up to
date the issues are as the README.txt file was last updated 8 years ago.

https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/lcl/interfaces/gtk3


The FPC/Lazarus foundation follows up on GTK3 development, Mattias Gaertner
reports on it.

My understanding is that GTK is being worked on, and it becomes more important 
to have a working version, since GTK2 is on it's way out in most distros.


Mattias is on a holiday, so we'll have to wait for his return for more
detailed info.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FCL-Web updates/extensions

2021-09-01 Thread Michael Van Canneyt via lazarus



On Wed, 1 Sep 2021, Luca Olivetti via lazarus wrote:


El 1/9/21 a les 13:06, Michael Van Canneyt via lazarus ha escrit:


- The websocket protocol support can be attached to the HTTP server. That
   means you can initiate a websocket connection on the same port as the 
HTTP

   server is listening; the HTTP server will hand off the connection to the
   websocket server using the upgrade mechanism. A server demo is 
included as well.


Having not seen the implementation, my questions are:

1) existing code will still work unmodified?


Yes.

2) specifically the hack for server-sent events I mentioned here 
https://lists.lazarus-ide.org/pipermail/lazarus/2020-June/238089.html 
will still work?


The pastebin link is down ?



1) I suppose is a given ;-), 2) I ask because you only mentioned 
websockets and not server-sent events.


Server events are normally done using HTTP/2, and this is planned.

I can't promise your code will still run, but since the server was modified 
to keep connections alive indefinitely, I suppose that you should now be 
able to handle server events even easier with the upgrade mechanism;


It's just a matter of deciding to 'upgrade' depending on the URL & headers
in the initial request. In case you try to take a shot at it and you 
need help implementing it, let me know...


Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FCL-Web updates/extensions

2021-09-01 Thread Michael Van Canneyt via lazarus


Hello,

Thanks to the efforts of Ondrej Pokorny and some sponsored work by the
FPC/Lazarus foundation, FCL-Web has received some updates:

- Improvements in fcl-net, basically a Select() call has been added to the
  socket stream, on all platforms that support this.

- Possibility to keep connections open in the HTTP Server (keep-alive).

- A HTTP client connection pool, for parallel downloading.

- HTTP Client Downloads can now be canceled.

- New threading model for the FPC HTTP server:
  - No threading
  - One thread per request/connection
  - Thread pool, distributing requests over available threads.

- The thread pool functionality is in a separate unit, available for other 
things as
  well...

- Interceptors in the HTTP router:
  In the HTTP router you can now register interceptors.
  These will be run before/after the request is dispatched to the correct 
handler.

  Interceptors can cancel further handling of a request:
  This allows you to implement e.g. authentication, logging etc. in an
  orthogonal manner to normal request handling.

- The FPC HTTP server can now handle Connection: upgrade using registered
  upgrade handlers. This can be used for websocket (see below) and later
  HTTP/2 handling.

- FPC has now native support for the websocket protocol: both client and
  server are supported. Native chat client/server demos are included,
  and a pas2js client for use in the browser is also available.
  (SSL support is there but still needs testing)

- The websocket protocol support can be attached to the HTTP server. That
  means you can initiate a websocket connection on the same port as the HTTP
  server is listening; the HTTP server will hand off the connection to the
  websocket server using the upgrade mechanism. A server demo is included as 
well.

Attached a small screenshot of the websocket-based chat program in pas2js.

Enjoy,

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Mantis vs GitLab issue tracker

2021-08-16 Thread Michael Van Canneyt via lazarus



On Mon, 16 Aug 2021, LacaK via lazarus wrote:


An example: Mantis has "Reported by me".


You can find this in your 'issues' list?


It is my impression too.
I would like to see panels (like in 
https://gitlab.com/groups/freepascal.org/-/boards):

- Reported by me (filter Author="my account")
- Assigned to me (filter Asignee="my account")
- Unassigned (filter Asignee=None)
- (Resolved); here is sufficient for me list of recently changed 
issues as is there already
In other words : is there way how to add custom boards based on above 
filters?


I can create new boards, but not with the filters you want. There is 
no 'active user' filter. (i.e. "me" or so)


I can create lists filtered on label, assignee or milestone.


Ok I understand.
If there is no straight forward, simple way then IMO no need to 
complicate things.

I am here as pure user and I am asking for simple solutions ;-)
I only shared impression that GitLab issue tracker is for me also less 
intuitive and practical compared to Mantis.


It's a different system, with different possibilities.
I find the filter system very easy to use compared to Mantis, so I won't miss 
the old one.

One can lament the demise of the old system, but in time I suspect most will 
adapt to the new one.

As said, I'm looking at creating a frontpage for a mantis-like overview.
With pas2js it should be easy to do.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Mantis vs GitLab issue tracker

2021-08-16 Thread Michael Van Canneyt via lazarus



On Mon, 16 Aug 2021, Martin Frb via lazarus wrote:


On 16/08/2021 09:13, Michael Van Canneyt via lazarus wrote:


On Mon, 16 Aug 2021, LacaK via lazarus wrote:

An example: Mantis has "Reported by me".


You can find this in your 'issues' list?



See my last mail.
See "My reactions"


It is my impression too.
I would like to see panels (like in 
https://gitlab.com/groups/freepascal.org/-/boards):

- Reported by me (filter Author="my account")
- Assigned to me (filter Asignee="my account")
- Unassigned (filter Asignee=None)
- (Resolved); here is sufficient for me list of recently changed 
issues as is there already
In other words : is there way how to add custom boards based on above 
filters?


I can create new boards, but not with the filters you want. There is 
no 'active user' filter. (i.e. "me" or so)


I can create lists filtered on label, assignee or milestone.


Ideally each boards has only filters by the same kind.

Because if you have a board, with lists:
- label = x
- milestone = y

Then you can drag and drop issues between the boards.
But drag and drop means to remove/add the label/milestone.

So the current board, with diff milestones is ok. because you can mave 
issues from one milsestone to another


I've been looking at https://github.com/jdalrymple/gitbeaker

Using pas2js it should be relatively easy to make a small webpage that
recreates the mantis view. All it would need is a token or oauth key.

Such a page can be hosted on the FPC webserver. The browser would do all
other requests directly to gitlab, so this puts no load on the FPC
webserver except of the initial page request.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Mantis vs GitLab issue tracker

2021-08-16 Thread Michael Van Canneyt via lazarus



On Mon, 16 Aug 2021, LacaK via lazarus wrote:





is it just my impression that Mantis was more feature rich an had better 

layout?

An example: Mantis has "Reported by me".


You can find this in your 'issues' list?


It is my impression too.
I would like to see panels (like in 
https://gitlab.com/groups/freepascal.org/-/boards):

- Reported by me (filter Author="my account")
- Assigned to me (filter Asignee="my account")
- Unassigned (filter Asignee=None)
- (Resolved); here is sufficient for me list of recently changed issues 
as is there already
In other words : is there way how to add custom boards based on above 
filters?


I can create new boards, but not with the filters you want. 
There is no 'active user' filter. (i.e. "me" or so)


I can create lists filtered on label, assignee or milestone.

I could create a label 'unassigned' to filter on. but then we would need to 
apply that to
all new issues. This can be automated. Then I could use it to add an 'unassigned' list. 
The label would need to be removed when a user is assigned to an issue. This

can probably also be automated.

They are working on a named filter system. When that exists, more things
will be possible:
https://gitlab.com/gitlab-org/gitlab/-/issues/14512

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FPC move to mantis completed

2021-08-08 Thread Michael Van Canneyt via lazarus


Hello,

After several technical issues (8 tries were needed to convert the FPC
sources to git), the move from svn/mantis to gitlab has been completed.

The FPC sources are now available at

https://gitlab.com/freepascal.org/fpc/source

All FPC git repositories are available at:

https://gitlab.com/freepascal.org/fpc

This is also where bugs can be reported from now on:

All Mantis issues have been converted to Gitlab issues.

Depending on where you report an issue, the Gitlab system will ask you to
select a project under which to report a bug.

Note that e.g. documentation bugs should be reported in the documentation
repository:

https://gitlab.com/freepascal.org/fpc/documentation

etc.

A redirect has been put in place for the old bug system, if possible the
system will redirect you to the correct issue in Gitlab.
A similar redirect will be put in place for the viewvc repository view tool.

The "development" page has been updated with the necessary instructions to
connect with Git:
https://www.freepascal.org/develop.html

More information about git has been placed in the WIKI:

https://wiki.freepascal.org/FPC_git

The lazarus team also placed a version at

https://wiki.freepascal.org/SVN_to_GIT_Cheatsheet

If you see places where we overlooked updating the SVN to git or mantis to
gitlab information, please let us know...

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Planed work (moving to git) on the weekend 23rd - 26th

2021-07-22 Thread Michael Van Canneyt via lazarus



On Thu, 22 Jul 2021, Martin Frb via lazarus wrote:


On the upcoming weekend (starting Friday night) we will be moving to GitLab.

During this time, there may be interruptions to some of our services.

- SVN will become read-only.


Correction: SVN will become unavailable.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] The "Use" button in Component List

2021-06-28 Thread Michael Van Canneyt via lazarus



On Mon, 28 Jun 2021, Juha Manninen via lazarus wrote:


The list opens with Ctrl-Alt-P and is an alternative to the Component
Palette.
Is the "Use" button somehow useful?
A component can be added by selecting it and clicking on designer, or by
double-clicking it.
The behavior was slightly changed in r64929, issue:
https://bugs.freepascal.org/view.php?id=38706
Now the "Use" button inserts a component at coord(0,0) right away, which is
the double-click behavior.
Should the button be removed?


I don't think you should remove it. 
The fact that you can/must double click is not immediatly clear. 
A button has a clear meaning.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus for writing 3D Desktop Environment/Window manager for Linux?

2021-06-24 Thread Michael Van Canneyt via lazarus



On Thu, 24 Jun 2021, Chavoux Luyt via lazarus wrote:


Hi

Background:
I have played a bit with Lazarus over the years, but have never used it to
write any big or commercial projects (I have used both older versions of
Delphi, C++ Builder and Visual Studio with C# for that). However, it seems
to me as if modern Lazarus has everything and more than Delphi (although it
would have been nice if Lazarus could add packages like Delphi without
needing to recompile the whole IDE - compile the package to a .dll or .so
and simply link into it from the IDE?). KDE (Plasma), XFCE and Fluxbox (MX
Linux versions) are my current favourite desktop environments, but I am
feeling increasingly frustrated with especially the larger desktop
environments (including Windows 10) and want to replace it with an
interface that makes use of the 3D capabilities of most (all?) modern
computers. The idea is a "game-like" first-person shooter interface where
instead of a desktop with various virtual desktops or a start menu, you
have a house (or a castle or whatever) in which you move, open different
doors with different rooms, like e.g. an office (where all your typical
office programs (and files in filing cabinet) would be stored, a
entertainment room (with your music and video software and files), etc.
This interface will also be more future-proof than the current desktop
metaphor, allowing for e.g. virtual reality displays instead of a screen as
your computer-human interface.

I really like object Pascal as a language (and Lazarus in particular)...

Questions:

  1. Is it possible to write a 3D desktop environment (with similar
  functionality to KDE/Gnome) in Lazarus?
  2. Is Lazarus a good tool for writing such a desktop environment?
  Why/why not?
  3. Are there better alternatives that can use OpenGL (or a game engine
  using OpenGL) that can be used for writing such a Desktop Environment (if
  Lazarus is not a good tool)?
  4. I have installed (but never used) Castle Game Engine (using
  aptitude... but I don't see it in Lazarus). Does anyone here have
  experience using it? Could it be used as the basis of writing a 3D "desktop
  environment"?


I think the castle game engine is your best shot at achieving success with
this project.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPC & Lazarus moving to gitlab

2021-06-22 Thread Michael Van Canneyt via lazarus



On Tue, 22 Jun 2021, Zoë Peterson via lazarus wrote:


On 6/22/2021 11:05 AM, Michael Van Canneyt via lazarus wrote:

The conversion program will attempt to convert existing bugs using the
account of the new gitlab user. To map your gitlab user name (or ID) 
to the

mantis user, we ask that you file an issue in the mantis project of the
current bugtracker, assign it the category gitlab, and set the summary of
the bugreport to your gitlab account name or ID number (not both!). 



I have two Mantis accounts on bugs.freepascal.org, stemming from when I 
changed my name.  If I make two bug reports, one with each account, both 
listing the same GitLab account, will that work or mess something up?


That will work.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FPC & Lazarus moving to gitlab

2021-06-22 Thread Michael Van Canneyt via lazarus


Hello All,

The Free Pascal and Lazarus teams are in the process of switching to 
Gitlab to manage their source code and issue reports.


In order to lower maintenance of their own infrastructure, a hosted solution
has been chosen, and an open source license was granted to the teams.

You can see the current progress at:

https://gitlab.com/freepascal.org

2 subgroups have been made:

https://gitlab.com/freepascal.org/fpc
https://gitlab.com/freepascal.org/lazarus-ide

Several testconversions of the SVN history to a Git repository have been
done, with ever improving results. All repositories will be switched to git.

A program has been written to convert Mantis bug reports to Gitlab issues;
it is very complete, and all available info will be converted.
You can see (partial) conversion results on the above projects.

The date for the final conversion has been established as the weekend of
17/18 july. People that wish to report bugs after that will have to create a
gitlab account in order to do so. (Those with a github account can normally
also use that account to log in with gitlab, see the gitlab login page.)

The conversion program will attempt to convert existing bugs using the
account of the new gitlab user. To map your gitlab user name (or ID) to the
mantis user, we ask that you file an issue in the mantis project of the
current bugtracker, assign it the category gitlab, and set the summary of
the bugreport to your gitlab account name or ID number (not both!).

All accounts that can be collected in this manner by 17 july will be used in 
the final conversion.

All necessary information to connect to gitlab will be collected in the FPC &
Lazarus Wiki. Several pages have already been set up:

https://wiki.freepascal.org/FPC_git
https://wiki.freepascal.org/FPC_git_concepts
https://wiki.freepascal.org/SVN_to_GIT_Cheatsheet

These pages will be updated with the correct URLS when the final conversion happens. 
The FPC & Lazarus websites will also be adapted with new instructions.


For the FPC & Lazarus teams,

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Registering a TFrame to component palette

2021-06-13 Thread Michael Van Canneyt via lazarus



On Sun, 13 Jun 2021, Sven Barth wrote:


Michael Van Canneyt  schrieb am So., 13. Juni 2021,
13:53:




On Sun, 13 Jun 2021, Sven Barth via lazarus wrote:


Am 11.06.2021 um 23:48 schrieb Juha Manninen via lazarus:

Regarding issue : https://bugs.freepascal.org/view.php?id=28450


The parameter passed to function RegisterComponents() is

TComponentClass

which means "class of TComponent". It is only type information and does

not

carry information about sub-components.
Could somebody please explain how it works in Delphi. Does this really

work

:
  RegisterComponents('Sample', [TMyFrame]);


Yes, it does work this way. I don't know what you mean with "information
about sub-components". The VMT vFieldTable entry contains all published
fields of the class and thus all the sub controls that are visible

through

the RTTI and thus for the designer. If the IDE does not use that yet,

then it

definitly should.


I added a comment to the report but it is old and the reporter may not

read

it.
Maybe there should be a new function RegisterFrame() or similar?


There is no need to add anything, because the necessary information is
already there. It's just that the IDE doesn't use it yet.


In Delphi, the above also does not work, you need special handling for
frames, just as for forms.



You think I didn't test it before writing? I created a frame, added it to a
package, added a Register procedure, installed the package, started a new
VCL application and added that frame to the form from the component
palette. I had added a button and a combo box and both were visible in the
designer.


I think there was a misunderstanding. You want to place a frame on a
form, just like a component.

I confused this with actually creating custom forms.

I have always used (since D7) a special designer call for this.

With (BorlandIDEServices As IOTAModuleServices) Do
  CreateModule(TMKFormWizardModuleCreator.Create(FBaseClass, 
FClause,FUseInherited) As IOTACreator);

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Registering a TFrame to component palette

2021-06-13 Thread Michael Van Canneyt via lazarus



On Sun, 13 Jun 2021, Sven Barth via lazarus wrote:


Am 11.06.2021 um 23:48 schrieb Juha Manninen via lazarus:
Regarding issue : https://bugs.freepascal.org/view.php?id=28450 



The parameter passed to function RegisterComponents() is TComponentClass 
which means "class of TComponent". It is only type information and does not 
carry information about sub-components.
Could somebody please explain how it works in Delphi. Does this really work 
:

  RegisterComponents('Sample', [TMyFrame]);


Yes, it does work this way. I don't know what you mean with "information 
about sub-components". The VMT vFieldTable entry contains all published 
fields of the class and thus all the sub controls that are visible through 
the RTTI and thus for the designer. If the IDE does not use that yet, then it 
definitly should.


I added a comment to the report but it is old and the reporter may not read 
it.

Maybe there should be a new function RegisterFrame() or similar?


There is no need to add anything, because the necessary information is 
already there. It's just that the IDE doesn't use it yet.


In Delphi, the above also does not work, you need special handling for
frames, just as for forms.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is there a global timezone-independent time available?

2021-05-03 Thread Michael Van Canneyt via lazarus



On Mon, 3 May 2021, Denis Kozlov via lazarus wrote:

You can use LazSysUtils.NowUTC, and then there is also PascalTZ package 
if you want to convert between timezones.


There is a ticket with a patch for adding a similar function to FPC, but 
it needs some attention:
https://bugs.freepascal.org/view.php?id=30394 



I'm terribly sorry, I totally forgot about this bugreport :/

But Ondrej Pokorny has meanwhile implemented NowUTC and other related functions 
that
allow more flexibility regarding the timezone.

So, Mr. Berglund, with FPC trunk, your problem will be solved.
I'm not sure it will be in 3.2.2, because it is rather sensitive.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Mustache templates implementation

2021-04-20 Thread Michael Van Canneyt via lazarus


Hello ,

For my job I needed a Mustache templates library in pascal.

Since dmustache (part of mORMot) fails the official mustache tests and did not 
work
on the platform I needed it for, I wrote my own implementation.

The result has been committed to packages/fcl-mustache, in case someone else
has a need for it.

Basic Features:
- TMustache Component, can be dropped on a form.
- Compiles the template, so repeated output should be fast.
- Passes all official testcases (including weird whitespace rules).
- JSON data input by default.
- Output easily configurable.

Extra:
- Integration with FPExprPars engine for expressions: {{[age + 2]}} will work.
- You can use datasets as source of data.
- Written to be easily extendable with other features.
- Unit tested.

Demos available, there is a complete usable command-line program that has all 
features
enabled.

Enjoy,

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Clipboard Data Goes Away

2021-04-01 Thread Michael Van Canneyt via lazarus



On Thu, 1 Apr 2021, Anthony Walter via lazarus wrote:


Perhaps there is a Linux service that can be used by applications to hand
over and take ownership of clipboard data, and applications such as those I
mentioned are using it in order to solve the problem I am describing?



See my earlier reply for some links.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Clipboard Data Goes Away

2021-04-01 Thread Michael Van Canneyt via lazarus



On Thu, 1 Apr 2021, Anthony Walter via lazarus wrote:


I noticed a recent discussion touching on this problem posted by Bo
Berglund on November 20, 2020 to this same mailing list.

Andreas Schneider replied in that thread, 'Pasting basically asks the
application that "copied" it to get the content. If that app is gone in the
meantime, there's nothing to paste anymore.'

Also, Colin Western replied this is how Linux applications work, 'the data
is kept with the source program, so goes when the program closes'.

I disagree.

I've tested several Gtk2 applications, including older versions of Gimp
and  Geany. Both these programs have clipboard copy functions and the data
on the clipboard from those applications my tests show their clipboard data
persists after they have been closed. So it would seem that Gtk2 the
clipboard works correctly and handles persisting data after an application
has exited.

I stepped through the LCL source and it looks like the clipboard code is
using some Gtk clipboard functions, and not using X windows functions,
thereby introducing a possible problem, but I am unsure if the LCL is using
the Gtk clipboard correctly. That is, the LCL might be using some Gtk
clipboard functions which seem to work well, but exhibit the problematic
behaviour I've described.


I think the programs you tested use some extra functions, because as these
2 persons already said: under X11, the selection is owned by the program,
not by X11.

See e.g.

https://www.uninformativ.de/blog/postings/2017-04-02/0/POSTING-en.html
https://wiki.ubuntu.com/ClipboardPersistence

for an explanation.

Basically: if you don't communicate with a persistent clipboard app, then
nothing will happen to persist your selection.

Michael.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] unit Masks vs. unit FPMasks

2021-02-23 Thread Michael Van Canneyt via lazarus



On Tue, 23 Feb 2021, Juha Manninen via lazarus wrote:


Hello

LazUtils has unit Masks with classes TMask and TMaskList.
FPC's packages/fpindexer has unit FPMasks also with classes TMask
and TMaskList.
A comment in FPMasks says "Moved here from LCL".
Revision control shows it was added 9 years ago in 2012. Since 2.5 years
ago it supports Unicode by using UTF8string for all strings.

LCL has a related MaskEdit. It was first added in 2002 by Mattias with
comment
"added TMaskEdit from Tony"
I don't know who Tony is.
Unit Masks was first added to LCL in 2007 by tombo with comment
"LCL: implemented TMask, MatchesMask, added Masks docs"
I don't know who Tombo is either.
In 2011 Masks was moved to LazUtils by Felipe.
Masks and MaskEdit have some identical code. IMO MaskEdit should reuse
some code from Masks.
MaskEdit is maintained by Bart but he didn't know details of the history.

Masks in LazUtils has a slow implementation.
I planned to optimize it but now I realize we may have overlapping code.
Q: Are Masks (LazUtils) and FPMasks (fpindexer) compatible?
If they are, we should dump the LazUtils Masks and use code from FPC's libs.


Since it comes from Lazarus in the first place, they are supposed to be
compatible, yes. If not, then the unit in FPC can be updated to add missing
things.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] MSSQL howto catch a TMSSQLConnection Error without Messagebox?

2021-01-27 Thread Michael Van Canneyt via lazarus



If you don't do a re-raise, I don't understand where the dialog box comes
from, since you're catching all exceptions...

Michael.

On Wed, 27 Jan 2021, Andreas Frieß via lazarus wrote:


Hi Michael,

no, i did not re-raise there.

I want only a silent flag. This should done by the Result:= false in the
calling function.

regards

Andreas

Am 27.01.2021 um 12:46 schrieb Michael Van Canneyt:



On Wed, 27 Jan 2021, Andreas Frieß via lazarus wrote:


On my Raspi/Debian i got on a TMSSQLConnection a messagebox if the
server is not reachable. The connection is not my problem, but i am not
able to cach this exeption silent without poping up this messagebox.

The problem is, the messagebox pops up and want an OK or ABORT.
In my code i catch the exception, set a flag and reraise

try
  if IsOk then AConnection.Connected := true;
 except
  on E : Exception do begin
    IsOk:=false;
    raise;
  end;
 end;

The calling function does this
Quote
  Result := false;
  try
    (IsOk);
    Result := true;
  except
    on E : Exception do begin
     .


Do you also re-raise here ?



    end;
  end;

So the exception should silent catched and i can handle if a connection
is ok or not.

How can i avoid the unwanted box ?


Normally catching the exception is enough.

Michael.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] MSSQL howto catch a TMSSQLConnection Error without Messagebox?

2021-01-27 Thread Michael Van Canneyt via lazarus



On Wed, 27 Jan 2021, Andreas Frieß via lazarus wrote:


On my Raspi/Debian i got on a TMSSQLConnection a messagebox if the
server is not reachable. The connection is not my problem, but i am not
able to cach this exeption silent without poping up this messagebox.

The problem is, the messagebox pops up and want an OK or ABORT.
In my code i catch the exception, set a flag and reraise

try
  if IsOk then AConnection.Connected := true;
 except
  on E : Exception do begin
    IsOk:=false;
    raise;
  end;
 end;

The calling function does this
Quote
  Result := false;
  try
    (IsOk);
    Result := true;
  except
    on E : Exception do begin
     .


Do you also re-raise here ?



    end;
  end;

So the exception should silent catched and i can handle if a connection
is ok or not.

How can i avoid the unwanted box ?


Normally catching the exception is enough.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Bump issue

2021-01-22 Thread Michael Van Canneyt via lazarus



On Fri, 22 Jan 2021, Marco van de Voort via lazarus wrote:



Op 2021-01-22 om 22:56 schreef Michael Van Canneyt via lazarus:



I have some time this weekend, I will commit it.


Is it really a good idea to accept msec=1000 for TryEncodeTimeInterval 
in a general unit like Dateutils?


I didn't say I would commit as-is :)

I was not aware of this bugreport.
The lazarus devs should move the issue to FPC if they see it's an FPC issue.
(supposing they can, at least)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Bump issue

2021-01-22 Thread Michael Van Canneyt via lazarus


Hi,

I have some time this weekend, I will commit it.

Michael.

On Fri, 22 Jan 2021, R.Smith via lazarus wrote:


Hi all,

I would like to know how to bump an issue in the bug tracker and I'm 
asking here because I don't wish to irritate the devs.


Essentially the issue has been solved last year October already, but not 
getting committed and closed, and I'm worried it won't make it into the 
next release, and I really need it. (I've patched locally for now but 
will revert to trunk on next release).


https://bugs.freepascal.org/view.php?id=37849

LacaK found the solution and proposed a patch, and Juha Manninen asked 
that someone with commit rights to FPC commit it. The FPC committers 
probably do not read the Lazarus bugs, so it has not been done and closed.


I wish to gently remind the FPC devs to please not forget to apply this.
What is the optimal/correct way to do this?


Thank you kindly,
Ryan


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] debugging a CGI

2021-01-20 Thread Michael Van Canneyt via lazarus



On Wed, 20 Jan 2021, Bo Berglund via lazarus wrote:


On Tue, 19 Jan 2021 23:31:27 +0100 (CET), Michael Van Canneyt via lazarus
 wrote:


Start a 'HTTP server application' in lazarus, add your web module unit to it
and run it. (you may need to add some more units or packages, in essence the
same oneas as in your CGI application).


This is interesting to me too, but when I go to Project/New Project...
then the list does *not* contain an entry "HTTP Server Application"

So how exactly do I "start" such project in Lazarus?

I have tested this with Lazarus 2.0.10/Fpc 3.2.0 on Windows 10 but I really need
it on a Linux platform (Raspberry Pi).


Do you have the weblaz package installed ?

The "New project" type for 'HTTP server Application' is only available if you 
have that
package installed.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] debugging a CGI

2021-01-19 Thread Michael Van Canneyt via lazarus



On Tue, 19 Jan 2021, duilio foschi via lazarus wrote:


How can I trace the code then?


It's a normal Lazarus application. 
You can just debug the application like any other.


Start a 'HTTP server application' in lazarus, add your web module unit to it
and run it. (you may need to add some more units or packages, in essence the
same oneas as in your CGI application).

Once done with debugging, you can simply compile the CGI and deploy it.

Michael.




On Tue, Jan 19, 2021, 22:11 Michael Van Canneyt via lazarus <
lazarus@lists.lazarus-ide.org> wrote:




On Tue, 19 Jan 2021, duilio foschi via lazarus wrote:


I would like to debug a CGI by tracing it in Lazarus IDE as a console
application in windows.

Is there a way to have the CGI read from standard input at start time?


I recommend to host your webmodule in a http server app, this will make
debugging it a lot easier.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus




--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] debugging a CGI

2021-01-19 Thread Michael Van Canneyt via lazarus



On Tue, 19 Jan 2021, duilio foschi via lazarus wrote:


I would like to debug a CGI by tracing it in Lazarus IDE as a console
application in windows.

Is there a way to have the CGI read from standard input at start time?


I recommend to host your webmodule in a http server app, this will make
debugging it a lot easier.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-07 Thread Michael Van Canneyt via lazarus



On Thu, 7 Jan 2021, Santiago A. via lazarus wrote:


El 05/01/2021 a las 10:47, Michael Van Canneyt via lazarus escribió:


Because people are naturally lazy and prefer easy & simple over strict 
& rich.




But we could chose a language that is easy & simple for when you want to 
do simple things (90% time) and rich when you need to do complex things.
Asciidoc is very easy, but more standarized, and very rich if you need 
to to do complex things.


if markdown is to be used, it should be specified which flavor, not just 
"markdown"

https://github.com/commonmark/commonmark-spec/wiki/Markdown-Flavors

if we are going for markdown (wouldn't be my first choice) I would go 
for Github flavor

https://docs.github.com/en/free-pro-team@latest/github/writing-on-github

Once again, I would prefer Asciidoc


Anyone is free to propose an FPDoc importer for AsciiDoc, MarkDown (insert 
flavour of the
month), ReStructuredText.

All it needs to do is convert the given format to fpdoc format, which will
then be processed by fpdoc in the usual manner.

As I said, I do not plan to switch the existing documentation format to markdown 
or any other format. The idea is simply to make writing documentation easier for

other users.

I mentioned Markdown because I need it myself for work, so if I decide to work 
on it,
it will be markdown. In the original "Gruber" format, since that is what mkdocs 
uses,
and from first glances the used Python parser is very simple, straightforward 
and
extensible. The best I've seen yet.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-05 Thread Michael Van Canneyt via lazarus



On Wed, 6 Jan 2021, Graeme Geldenhuys via lazarus wrote:


On 02/01/2021 2:31 pm, Michael Van Canneyt via lazarus wrote:
material theme: 
https://www.freepascal.org/~michael/docs-demo/material/system/tobject.dispatch/


There seems to be an issue generating constants and values with a underscore
in the name.

You can see that here:

 https://www.freepascal.org/~michael/docs-demo/material/baseunix/arg_max/


const
  ARG\_MAX = UnixType.ARG\_MAX

instead of

const
 ARG_MAX = UnixType.ARG_MAX


Hm. I'll need to check that. Seems I forgot to disable quoting for code
blocks. Thanks !.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-05 Thread Michael Van Canneyt via lazarus



On Wed, 6 Jan 2021, Graeme Geldenhuys via lazarus wrote:


On 02/01/2021 2:31 pm, Michael Van Canneyt via lazarus wrote:

Compare the official page for TObject.Dispatch:


Looking at another class with more detail... Did you explicitly enable
the functionality to generate Private, Protected fields and methods?
Or does the Markdown writer possibly not check if those were meant to
be hidden from the output.


The latter.

Thanks for pinting it out.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-05 Thread Michael Van Canneyt via lazarus



On Tue, 5 Jan 2021, Graeme Geldenhuys via lazarus wrote:


On 03/01/2021 7:48 pm, Don Siders via lazarus wrote:

I've been looking at allowing markdown for the description files (they would
be less verbose then), but there seems to be no decent markdown parser available
for pascal. If somone cares to contribute one...

Oh boy. I guess it is inevitable, but I don't think it's a
particularly good idea.

I have no aversion to XML tagging. I don't mind its rigid nature
because it guarantees consistent, predictable input.

Markdown is anarchy in my opinion, and you can't impose order on
anarchy. Markdown is great for readme or FAQ files. Not so great for a



Agreed. Markdown and FPDoc's description syntax suffer the same problems. The
syntax isn't rich enough, and thus falls back to using embedded HTML syntax
(officially or unofficially) and mostly assumes that HTML with be the
final generated format. This is not always the case.

On the other hand AsciiDoc has a MUCH richer syntax and is equally
intuitive to write because it too looks like plain text emails you
would normally write. But it also has a much richer syntax that covers
everything you need for documentation or technical articles (excluding
formulas). Things like comments in syntax, include files, an actual
specification, less "derived alternatives" (eg: Github Markdown, original
Gruber markdown etc).


Apart from AsciiDoc being equally intuitive, I agree with your statements.


There are many articles on the Internet going in much more detail
describing the issues of Markdown. Yet like Windows, it seem still so
popular. I have no idea why.


Because people are naturally lazy and prefer easy & simple over strict & rich.

Add to that time pressure imposed by deadlines, and there you have all the
reasons why markdown is popular: great for quickly "mashing" some things 
together...
Many of github README.md files are not even worth the trouble of writing them
for all the use they offer.

Basically the same reasons why my cat prefers the awful can food I give her 
over going
out to hunt for her breakfast ;-)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-04 Thread Michael Van Canneyt via lazarus



On Sun, 3 Jan 2021, Don Siders via lazarus wrote:


> I would rather see sectioning added to the FPDoc tags/content model:
>
> 
>  
>Using the Control
>Lorem ipsum sic dolor amet.
>  
> 

And what would this do in terms ouf output ?


In general, it would make FPDoc more usable for non-reference type
material. Grouping related content. If  has a name, it could
provide another level of navigation in the TOC. It provides a standard
way to tag a Formal Para, instead of emulating it it with:

 
   Using the Control
 
 
   Lorem ipsum sic dolor amet.
 

In specific,  could render like the HTML equivalent (as a
biock).  renders like the HTML H4 tag. The rest of the content
model renders just like the current usage.


You do know that topics can be nested ?

I can add 'section', but it will be below the  node, as IMO it makes no
sense to do this below the topic node because of the nesting.

Michael.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-03 Thread Michael Van Canneyt via lazarus



On Sun, 3 Jan 2021, Don Siders via lazarus wrote:


Hello !

I didn't make it quite in time for the new year, but still:

The fpdoc engine (what is used to document the FPC & Lazarus units)
is now capable of outputting the documentation in markdown.

This can be used as input for mkdocs or another engine such as sphinx.
As a first engine, I tackled mkdocs.
...


Happy New Year, Michael.


Thank you :-)



I'm glad to see that FPDoc is getting some "love". I applaud any
effort to improve or modernize the help.


Well, most 'love' has been going into the source parser in the last years.

For my day job I came into contact with mkdocs and sphinx, and was impressed
by some of the output it can generate. So the idea was born to leverage that
in fpdoc.




I've been looking at allowing markdown for the description files (they would
be less verbose then), but there seems to be no decent markdown parser available
for pascal. If somone cares to contribute one...


Oh boy. I guess it is inevitable, but I don't think it's a
particularly good idea.


Personally, I don't plan to use Markdown as input for fpdoc.




I have no aversion to XML tagging. I don't mind its rigid nature
because it guarantees consistent, predictable input.


I agree fully with this point of view, but not everyone may agree :-).

Times change, and I can imagine that people prefer a more 'free' format.
I'm just hoping to attract more users and possibly contributors...



Markdown is anarchy in my opinion, and you can't impose order on
anarchy. Markdown is great for readme or FAQ files. Not so great for a
large, structured documentation project. I would never choose to
author reference topics using markdown.


Personally, I agree :-)



I would rather see sectioning added to the FPDoc tags/content model:


 
   Using the Control
   Lorem ipsum sic dolor amet.
 



And what would this do in terms ouf output ?



I'd like to see PDF output from FPDoc too.


Currently PDF is generated through LaTeX. 
The LaTeX typesetting engine is difficult to beat. 
Hyphenation, page breaks: you get all that for free.


Both sphinx and mkdocs can also generate PDFs from the markdown.

Using the fpPDF support of FPC it should of course be possible to create PDF 
output
directly.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FPDoc now with Markdown support

2021-01-03 Thread Michael Van Canneyt via lazarus



On Sun, 3 Jan 2021, Соболь Андрей Евгеньевич via lazarus wrote:


I've been looking at allowing markdown for the description files (they would
be less verbose then), but there seems to be no decent markdown parser available
for pascal. If somone cares to contribute one...


For "overview pages" (unit, class, package) I think need to move a
"description section" to up and set it above a "uses section", because
"description" is more useful information than list of units.  Especially
for the case when the list of files is big.  I think that need to do for a
html version also.


Good points. I am planning some small changes in the Markdown support. 
I already moved the description up (after declaration, before members).


The uses section can indeed be moved down for units. I plan to add links to
the const/classes/types sections, because the menu may not always be very
accessible.

I am currently refactoring the HTML version so the layout can be changed
more easily, and descendents can be made. Once that is done, changes can be
implemented.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FPDoc now with Markdown support

2021-01-02 Thread Michael Van Canneyt via lazarus


Hello !

I didn't make it quite in time for the new year, but still:

The fpdoc engine (what is used to document the FPC & Lazarus units) 
is now capable of outputting the documentation in markdown.


This can be used as input for mkdocs or another engine such as sphinx.
As a first engine, I tackled mkdocs.

Compare the official page for TObject.Dispatch:

https://www.freepascal.org/docs-html/current/rtl/system/tobject.dispatch.html

With the following pages:

They are all the same documentation page, but just use a different theme for 
mkdocs:

gitbook theme:
https://www.freepascal.org/~michael/docs-demo/gitbook/system/tobject.dispatch/

ivory theme:
https://www.freepascal.org/~michael/docs-demo/ivory/system/tobject.dispatch/

windmill theme: (seems broken)
https://www.freepascal.org/~michael/docs-demo/windmill/system/tobject.dispatch/

windmill dark theme: (seems broken)
https://www.freepascal.org/~michael/docs-demo/windmill-dark/system/tobject.dispatch/

docskimmer theme:
https://www.freepascal.org/~michael/docs-demo/docskimmer/system/tobject.dispatch/

default (mkdocs) theme: 
https://www.freepascal.org/~michael/docs-demo/windmill-dark/system/tobject.dispatch/


readthedocs theme: 
https://www.freepascal.org/~michael/docs-demo/readthedocs/system/tobject.dispatch/


material theme: 
https://www.freepascal.org/~michael/docs-demo/material/system/tobject.dispatch/


Some themes work better than others.

Fun fact:
Generating the documentation in HTML with fpdoc takes a couple of seconds.
Depending on the theme, generating the docs with mkdocs (written in Python)
takes 3-7 minutes.

Just shows that Pascal code is very efficient, I suppose... ;-)

I've been looking at allowing markdown for the description files (they would
be less verbose then), but there seems to be no decent markdown parser available 
for pascal. If somone cares to contribute one...


Enjoy,

Michael.


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Package requirement dialog & OLPM ?

2020-12-12 Thread Michael Van Canneyt via lazarus


Hi,

On my Mac, the "new package requirement" dialog shows the IDEIntf package as an 
online
package (see attached screenshot req.png). As a result, I can't select it 
without
'installing' it first, which is of course total nonsense as it is already
installed. The lazarus on my Mac is a 2.0.10, no modifications except it was
recompiled with some extra packages...

I tried with the original 2.0.10 binary, same behaviour.

On Linux, where I use trunk Lazarus and where I have not installed the 
online package manager, I can select the IDEIntf package (see attached reqlinux.png)


But when I uninstall the OLPM on the Mac, I can no longer select the IDEIntf
package at all, despite that it is in the packagefiles.xml file.
(which looks quite the same as the one on my Linux machine)

How can this be, and how can I fix this silly Lazarus behaviour on the Mac ?

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Using Chrome API in Lazarus - possible on Linux?

2020-12-06 Thread Michael Van Canneyt via lazarus



On Sun, 6 Dec 2020, Don Siders via lazarus wrote:


Is there someone here who has used the Chrome API with
Lazarus for anything video related and is willing to share?



I never managed to get the Chrome API to work on linux,
but an effort is currently underway to make the chromium
browser available in Lazarus on all supported platforms.


@Michael:

Is that effort some how related to CEF (Chromium Embedded Framework)?


Yes.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Using Chrome API in Lazarus - possible on Linux?

2020-12-06 Thread Michael Van Canneyt via lazarus



On Sun, 6 Dec 2020, Bo Berglund via lazarus wrote:


I have been looking for ways to create a video downloader for myself
using FPC/Lazarus. I already created a video editor using PasLibVlc
and ffmpeg and it works pretty well for what I want to do. It needs
VLC to be installed in order to show videos and adjust playback speed
and audio sync etc.

I also would like to make a video downloader with functions not found
in programs like for example youtube-dl, specifically being able to
download from a streaming site starting from past times.

But it clearly should be possible since the browsers (both Chrome and
Firefox) have the ability of moving backwards inside the stream and
view stuff that was played say a couple of hours ago.

Now I have seen a project on-line which uses C# and apparently the
Chrome API (since it is a requirement to have Chrome installed).
But the author has not published any sources so I cannot see *how* it
is being done...
And I cannot use that product because I need the downloader to be
running on Linux.

Is there someone here who has used the Chrome API with Lazarus for
anything video related and is willing to share?


I never managed to get the Chrome API to work on linux, but an effort is
currently underway to make the chromium browser available in Lazarus on all
supported platforms.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] CDDB access

2020-12-01 Thread Michael Van Canneyt via lazarus



On Wed, 2 Dec 2020, Teresa Williams via lazarus wrote:


Hi

I need to access CDDB (and also MusicBrainz would be nice) on Linux.  I found 
https://wiki.freepascal.org/CDDB but as that page suggests, the download link 
is defunct.

Are there any other such?  In the past I have done this by spawning two bash 
scripts which use CDDB and write text files.  Ugly. Slw. Error-prone (the 
format of the results is a bit variable).

I'm not too proud to do that again, but is there a more elegant way?


FPC comes with such units since ages:

https://www.freepascal.org/daily/packages/cdrom/index.html

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Daily docs

2020-11-28 Thread Michael Van Canneyt via lazarus


Hello,

I finally decided to tackle something which was on my TODO list for many
years.

From now on we generate daily documentation updates.

They are accessible from this page:

https://www.freepascal.org/daily/daily.html

This is not only the FPC documentation as generated from the sources, 
but also the total list of units (packages) that FPC distributes.


The former allows you to check the latest docs (useful in case of fixes).

For the latter, there is of course no documentation text, but you do get a list 
of
all packages and all units that FPC distributes, you can find there all
identifiers and so on. If a package fails to be parsed, it's not included
in the list, so it can happen that a package "disappears"...

The total size of the generated documentation is 1.3 Gb, roughly 280.000
files, so a lot of identifiers.

As side effects of this effort, the fpmake tool now can generate a fpdoc
project, and fpdoc itself has been extended so it can parse all sources in
the packages.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus totally destroyed... :(

2020-11-20 Thread Michael Van Canneyt via lazarus



On Fri, 20 Nov 2020, Bart via lazarus wrote:


On Fri, Nov 20, 2020 at 1:09 PM Michael Van Canneyt via lazarus
 wrote:





- The IDE does not handle missing ~/.lazarus any more.

I tried using startlazarus, but this gives the same issue.



FWIW:
I just did a make clean bigide on a fresh checkout and this all went OK.
I stated Lazarus with an empty config dir:  no problems.
Rebuilt Lazarus from with IDE: no problems.

Iḿ using fpc 3.2.0-64
All this on Linux Mint 18.2


It took me a while, but meanwhile I also managed to fix it, but I had to start 
from zero.

- Fresh checkout of lazarus
- Remove .lazarus in home dir.
- Start newly built IDE
- redo all settings, install all needed packages.

Seems stable.

Looks like something hanging from older version in source/config dir prevented 
the IDE from
starting.

I sent my .lazarus to Mattias so he can have a look.

I'll treat it as a major cleaning operation :)

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus totally destroyed... :(

2020-11-20 Thread Michael Van Canneyt via lazarus



On Fri, 20 Nov 2020, Mattias Gaertner via lazarus wrote:


On Fri, 20 Nov 2020 11:32:49 +0100 (CET)
Michael Van Canneyt via lazarus  wrote:


Hello,


- Updated Lazarus from SVN. 
- Lazarus no longer compiles (FPC 3.2)


It compiles here.


Well:

home:~/lazarus>  svn status -q
home:~/lazarus> delp -r .
DelPascal Version 1.3
Copyright (c) 1999-2012 by the Free Pascal Development Team

 - Removed 67 *.compiled (32.215 Bytes)
 - Removed  2 *.o (20.664 Bytes)
 - Removed  2 *.ppu (5.374 Bytes)
 - Total 58.253 Bytes Freed
home:~/lazarus> make ide PP=ppcx64-3.2.0
make -C ide ide
make[1]: Entering directory '/home/michael/projects/lazarus/ide'
/bin/mkdir -p ../units/x86_64-linux/gtk2
make -C ../tools svn2revisioninc OS_TARGET=linux CPU_TARGET=x86_64 OPT=''
make[2]: Entering directory '/home/michael/projects/lazarus/tools'
Makefile:2956: warning: overriding recipe for target '.'
Makefile:2954: warning: ignoring old recipe for target '.'
ppcx64-3.2.0 -gl -Fu. -Fu../components/lazutils/lib/x86_64-linux 
-Fu../lcl/units/x86_64-linux -Fu../lcl/units/x86_64-linux/nogui 
-Fu/usr/local/lib/fpc/3.2.0/units/x86_64-linux/rtl -FE. -FU. -Cg 
-Fl/usr/lib/gcc/x86_64-linux-gnu/7 -Flinclude -Fl/etc/ld.so.conf.d/*.conf 
-dx86_64 svn2revisioninc.pas
svn2revisioninc.pas(62,3) Fatal: Can't find unit FileUtil used by 
Svn2RevisionInc
Fatal: Compilation aborted
Makefile:2967: recipe for target 'svn2revisioninc' failed
make[2]: *** [svn2revisioninc] Error 1
make[2]: Leaving directory '/home/michael/projects/lazarus/tools'
Makefile:5098: recipe for target 'revisioninc' failed
make[1]: *** [revisioninc] Error 2
make[1]: Leaving directory '/home/michael/projects/lazarus/ide'
Makefile:3610: recipe for target 'ide' failed
make: *** [ide] Error 2

As you can see, no modified files, no stray .ppu or .o.
But it does not compile.

I did then a completely new checkout of the IDE, then I can compile it on the 
command-line.

If I then start the new binary and ask to build from inside the IDE, the error 
with LazControlDsgn
again pops up. After I fix that, it compiles.

However, when restarting, I get attached layout. Not really nice.

If I remove the config dir ~/.lazarus (I know of no other way to fix the
layout thing), again: crash:

home:~/lazarus> ./lazarus

(lazarus:12619): Gtk-WARNING **: 13:08:24.335: Unable to locate theme engine in 
module_path: "adwaita",
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] 
PrimaryConfigPath="/home/michael/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] 
SecondaryConfigPath="/etc/lazarus"
[TIDEProtocol.Load]  error reading "/home/michael/.lazarus/protocol.xml": 
Access violation
[TEnvironmentOptions.Load]  error reading 
"/home/michael/.lazarus/environmentoptions.xml": Access violation
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $004408D0  SYSGETMEM_FIXED,  line 963 of ../inc/heap.inc
  $00440C25  SYSGETMEM,  line 1082 of ../inc/heap.inc
  $004414F7  SYSREALLOCMEM,  line 1478 of ../inc/heap.inc
  $0043F732  REALLOCMEM,  line 350 of ../inc/heap.inc
  $00C46607  ADD,  line 548 of idetranslations.pas
  $00C44D04  COLLECTTRANSLATIONS,  line 189 of idetranslations.pas
  $00C4626B  TRANSLATERESOURCESTRINGS,  line 504 of idetranslations.pas
  $004B77CE  LOADGLOBALOPTIONS,  line 1251 of main.pp
  $004B9112  CREATE,  line 1528 of main.pp
  $004208D6  main,  line 141 of lazarus.pp
  $0044C910  SYSENTRY,  line 141 of system.pp
TApplication.HandleException: EAccessViolation



So, seems to me there is a combination of things happening:

- Some old config files in my lazarus tree prevent compiling - fixed by
  doing a new checkout.

- Clearly not everything is cleaned regarding compile files:
  see LazControlDsgn issue (this is in the new checkout).

- When upgrading an 'old' lazarus config, some things seem to go awry when 
restoring window positions.

- The IDE does not handle missing ~/.lazarus any more.

I tried using startlazarus, but this gives the same issue.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus totally destroyed... :(

2020-11-20 Thread Michael Van Canneyt via lazarus



On Fri, 20 Nov 2020, Juha Manninen via lazarus wrote:


On Fri, Nov 20, 2020 at 12:32 PM Michael Van Canneyt via lazarus <
lazarus@lists.lazarus-ide.org> wrote:


- Updated Lazarus from SVN.
- Lazarus no longer compiles (FPC 3.2)

- Managed to fix that:

home:~/lazarus> svn diff ide/ideoptionsdlg.pas
Index: ide/ideoptionsdlg.pas
===
--- ide/ideoptionsdlg.pas   (revision 64150)
+++ ide/ideoptionsdlg.pas   (working copy)
@@ -36,7 +36,7 @@
ExtCtrls, StdCtrls, Dialogs,
// LazControls
TreeFilterEdit,
-  LazControlDsgn, // move this to lazarus.lpr
+   // LazControlDsgn, // move this to lazarus.lpr
// IdeIntf
IDEWindowIntf, IDEOptionsIntf, IDEOptEditorIntf, IDECommands,
IDEHelpIntf,
ProjectIntf, IDEImagesIntf,



I remember that LazControlDsgn required some tweaking but it was a long
time ago.
No recent changes have affected it.
I just today built Lazarus without problems. I don't know what is causing
your errors.


What happens if you start it without config directory ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Lazarus totally destroyed... :(

2020-11-20 Thread Michael Van Canneyt via lazarus


Hello,


- Updated Lazarus from SVN. 
- Lazarus no longer compiles (FPC 3.2)


- Managed to fix that:

home:~/lazarus> svn diff ide/ideoptionsdlg.pas
Index: ide/ideoptionsdlg.pas
===
--- ide/ideoptionsdlg.pas   (revision 64150)
+++ ide/ideoptionsdlg.pas   (working copy)
@@ -36,7 +36,7 @@
   ExtCtrls, StdCtrls, Dialogs,
   // LazControls
   TreeFilterEdit,
-  LazControlDsgn, // move this to lazarus.lpr
+   // LazControlDsgn, // move this to lazarus.lpr
   // IdeIntf
   IDEWindowIntf, IDEOptionsIntf, IDEOptEditorIntf, IDECommands, IDEHelpIntf,
   ProjectIntf, IDEImagesIntf,

- Lazarus no longer starts. See below for stacktrace.
- Removed protocol.xml and environmentoptions.xml : No change, crash
- Removed .lazarus dir completely: Crash.

- Attempt to compile on command-line with FPC 3.2.0

home:~/lazarus> make all PP=ppcx64-3.2.0
make -C packager/registration
make[1]: Entering directory 
'/home/michael/projects/lazarus/packager/registration'
/bin/rm -f ../units/x86_64-linux/fcllaz.ppu
/bin/mkdir -p ../units/x86_64-linux
ppcx64-3.2.0 -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Fu. 
-Fu/usr/local/lib/fpc/3.2.0/units/x86_64-linux/rtl -FE. 
-FU../units/x86_64-linux -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/7 -dx86_64 
fcllaz.pas
Hint: (11030) Start of reading config file /home/michael/.fpc.cfg
Hint: (11031) End of reading config file /home/michael/.fpc.cfg
Free Pascal Compiler version 3.2.0 [2020/05/04] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling fcllaz.pas
(3104) Compiling lazaruspackageintf.pas
(1008) 124 lines compiled, 0.1 sec
(1022) 2 hint(s) issued
/bin/cp -f Makefile.compiled ../units/x86_64-linux/FCL.compiled
/bin/cp: cannot stat 'Makefile.compiled': No such file or directory
Makefile:3588: recipe for target 'compiled' failed
make[1]: *** [compiled] Error 1
make[1]: Leaving directory 
'/home/michael/projects/lazarus/packager/registration'
Makefile:3587: recipe for target 'registration' failed
make: *** [registration] Error 2


Left with no way to create/start lazarus.

Me no happy and very stuck pinguin.

Suggestions ?

Michael.



Stack trace with existing .lazarus dir, protocol.xml and environmentopionsxml 
removed:


home:~> lazarus

(lazarus:4983): Gtk-WARNING **: 11:15:25.003: Unable to locate theme engine in 
module_path: "adwaita",
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] 
PrimaryConfigPath="/home/michael/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] 
SecondaryConfigPath="/etc/lazarus"
[TIDEProtocol.Load]  error reading "/home/michael/.lazarus/protocol.xml": 
Access violation
[TEnvironmentOptions.Load]  error reading 
"/home/michael/.lazarus/environmentoptions.xml": Access violation
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $004408D0  SYSGETMEM_FIXED,  line 963 of ../inc/heap.inc
  $00440C25  SYSGETMEM,  line 1082 of ../inc/heap.inc
  $004414F7  SYSREALLOCMEM,  line 1478 of ../inc/heap.inc
  $0043F732  REALLOCMEM,  line 350 of ../inc/heap.inc
  $0042F6EF  fpc_ansistr_setlength,  line 792 of ../inc/astrings.inc
  $0042E589  fpc_ansistr_concat,  line 266 of ../inc/astrings.inc
  $00466FCD  FORMAT,  line 257 of ../objpas/sysutils/sysformt.inc
  $004684A8  FORMAT,  line 1098 of ../objpas/sysutils/sysstr.inc
  $00A6120E  TRANSLATEUNITRESOURCESTRINGS,  line 634 of translations.pas
  $00C461C0  TRANSLATERESOURCESTRINGS,  line 518 of idetranslations.pas
  $004B77CE  LOADGLOBALOPTIONS,  line 1251 of main.pp
  $004B9112  CREATE,  line 1528 of main.pp
  $004208D6  main,  line 141 of lazarus.pp
  $0044C910  SYSENTRY,  line 141 of system.pp
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $004408D0  SYSGETMEM_FIXED,  line 963 of ../inc/heap.inc
  $00440C25  SYSGETMEM,  line 1082 of ../inc/heap.inc
  $004414F7  SYSREALLOCMEM,  line 1478 of ../inc/heap.inc
  $0043F732  REALLOCMEM,  line 350 of ../inc/heap.inc
  $0042F6EF  fpc_ansistr_setlength,  line 792 of ../inc/astrings.inc
  $0042E589  fpc_ansistr_concat,  line 266 of ../inc/astrings.inc
  $00466FCD  FORMAT,  line 257 of ../objpas/sysutils/sysformt.inc
  $004684A8  FORMAT,  line 1098 of ../objpas/sysutils/sysstr.inc
  $00A6120E  TRANSLATEUNITRESOURCESTRINGS,  line 634 of translations.pas
  $00C461C0  TRANSLATERESOURCESTRINGS,  line 518 of idetranslations.pas
  $004B77CE  LOADGLOBALOPTIONS,  line 1251 of main.pp
  $004B9112  CREATE,  line 1528 of main.pp
  $004208D6  main,  line 141 of lazarus.pp
  $0044C910  SYSENTRY,  line 141 of system.pp
[FORMS.PP] ExceptionOccurred 
[FORMS.PP] Except

Re: [Lazarus] Default project ?

2020-11-19 Thread Michael Van Canneyt via lazarus



On Thu, 19 Nov 2020, Bo Berglund via lazarus wrote:


On Thu, 19 Nov 2020 12:17:11 +0100, Bart via lazarus
 wrote:


Can we now get back to the original question this thread was about?



I agree that it would be nice to have a setting in Lazarus to define
*what type of project* it will autogenerate in absence of a previous
project to load.

But it is not that difficult really to configure Lazarus to not load
the previous project and then when the default pops up go to
Project/New... and select the wanted type.
So a setting for "Default project type" might help...

The issue here might be to avoid loading a massive project
un-necessarily when one wants to start a new project.

If the checkbox at
Tools/Options/Environment/Open_Last_Project_And_Packages_At_Start

is unchecked it acts the same as if the start command contains the
argument --skip-last-project, so it is easier to manage this way.


No, I want it actually to create a 'Simple program' as that is what I do in
90% of cases. The 9 other percent is 'Console application' and maybe 1%
'Application' (the current default).

I'll post a feature request in the bugtracker.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Default project ?

2020-11-18 Thread Michael Van Canneyt via lazarus



On Wed, 18 Nov 2020, Bo Berglund via lazarus wrote:



Because it needs a project. It cannot work without one, so it creates one.

So if the hypothetical option -np would be implemented, you would definitely be
presented with the same 'project wizard' dialog you get when you close the 
project
with "Project - Close Project".



OK, so if the last project opened is seriously flawed (for this
Lazarus) and crashes Lazarus, how can one ever remedy that?


At this moment not without changing the config files manually, I think.

But you could have a command-line option that allows to start Lazarus simply
with an empty project instead of the last one.

And that 'empty project' is what I want to have configurable... :-)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Default project ?

2020-11-18 Thread Michael Van Canneyt via lazarus



On Wed, 18 Nov 2020, Bo Berglund via lazarus wrote:


On Wed, 18 Nov 2020 08:43:00 +0100 (CET), Michael Van Canneyt via
lazarus  wrote:


Is there a way to change the default project generated when the IDE starts ?


Why is Lazarus creating an empty project on startup in the first
place?


Because it needs a project. It cannot work without one, so it creates one.

So if the hypothetical option -np would be implemented, you would definitely be
presented with the same 'project wizard' dialog you get when you close the 
project
with "Project - Close Project".

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Default project ?

2020-11-18 Thread Michael Van Canneyt via lazarus



On Wed, 18 Nov 2020, Bart via lazarus wrote:


On Wed, Nov 18, 2020 at 8:43 AM Michael Van Canneyt via lazarus
 wrote:


If you tell the IDE not to reload the last project when starting, it creates
a default GUI application. Since 99,99% of my programs are console programs,


And it would be nice if you could define default compiler settings for
console programs that differ from those used for GUI applications.
ATM my debug settings for GUI applications depend on the LazUtils
package, so that won't (be default) compile with console programs.


I'm curious: How can settings depend on a package for your program ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Default project ?

2020-11-17 Thread Michael Van Canneyt via lazarus


Hi,

Is there a way to change the default project generated when the IDE starts ?

If you tell the IDE not to reload the last project when starting, it creates
a default GUI application. Since 99,99% of my programs are console programs, 
I looked for a setting to change this, but did not find one.


If there is none, is it possible to add such a setting (I imagine yes :)) ?

If so, should I post a feature request ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] AutoCommit

2020-11-14 Thread Michael Van Canneyt via lazarus



On Sat, 14 Nov 2020, Sven Barth via lazarus wrote:


Michael Van Canneyt via lazarus  schrieb am
Fr., 13. Nov. 2020, 22:37:




On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:


Usually we try to use the "default" feature of the newly added

properties so

that they are streamed only when really set and used. When they are not

used,

the LFM can still be loaded in a legacy version of Lazarus because the

new

properties are not streamed.


I set defaults on all boolean properties of sqlscript, rev. 47412

Strange, I thought that boolean properties were not streamed if they had
value 'false'.



No, cause their intended default value could be True. Thus no special
handling for them.


You can of course say the same for all other types for which an implicit 
'default'
is implemented. The more so because a class is initialized with 0 in which
case every enumerated and boolean will be ord(0) unless otherwise
initialized in the constructor.

So I don't see why this rule is not applied to all properties, I don't think
it is logical.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] AutoCommit

2020-11-14 Thread Michael Van Canneyt via lazarus



On Sat, 14 Nov 2020, Ondrej Pokorny wrote:


On 13.11.2020 22:37, Michael Van Canneyt via lazarus wrote:

On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:
Usually we try to use the "default" feature of the newly added properties 
so that they are streamed only when really set and used. When they are not 
used, the LFM can still be loaded in a legacy version of Lazarus because 
the new properties are not streamed.


I set defaults on all boolean properties of sqlscript, rev. 47412

Strange, I thought that boolean properties were not streamed if they had 
value 'false'.
The FPC documentation is spot on about the stored/default modifiers: 
https://www.freepascal.org/docs-html/ref/refsu38.html


Only "/String, floating-point and pointer properties have 
implicitdefault//value of empty string, 0 or nil, respectively. Ordinal 
and set properties have no implicit//default//value./"


Indeed.



I polished the docs section in r1777 a little bit.


Well done, thank you !



Then I saw the next chapter "Overriding properties". It wrongly described 
redeclaring of properties as overriding. I fixed that as well in r1778.


I think the difference is rather artificial, but if you think this is
better: great.

Thank you for your efforts !

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] AutoCommit

2020-11-13 Thread Michael Van Canneyt via lazarus



On Fri, 13 Nov 2020, Ondrej Pokorny via lazarus wrote:

Usually we try to use the "default" feature of the newly added properties so 
that they are streamed only when really set and used. When they are not used, 
the LFM can still be loaded in a legacy version of Lazarus because the new 
properties are not streamed.


I set defaults on all boolean properties of sqlscript, rev. 47412

Strange, I thought that boolean properties were not streamed if they had
value 'false'.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] AutoCommit

2020-11-13 Thread Michael Van Canneyt via lazarus


Yes, but that's always so when properties are added to components.

Michael.

On Fri, 13 Nov 2020, Larry Dalton wrote:


So we lose some backwards portability?

Sent from my iPhone


On Nov 13, 2020, at 11:06, Michael Van Canneyt  wrote:


Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not 
in 2.0.6.
I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.

A lot of new properties appeared between 3.0.4 and 3.2.0.

Michael.


On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:

I forgot to add that it compiles correctly, but then I get the runtime error
Sent from my iPhone


On Nov 13, 2020, at 11:02, Larry Dalton  wrote:

This is only when I try to compile on Lazarus 2.0.6 on Windows. The project 
works fine on 2.0.10 on Linux. Any ideas?
Sent from my iPhone

On Nov 13, 2020, at 10:58, Larry Dalton  wrote:
Error code “Project ** raised exception class ‘EReadError with unknown 
property ‘AutoCommit’
Sent from my iPhone

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] AutoCommit

2020-11-13 Thread Michael Van Canneyt via lazarus


Your .lfm file contains a property "autocommit" that exists in 2.0.10 but not 
in 2.0.6.
I think 2.0.10 is based on FPC 3.2.0 and 2.0.6 was still based on 3.0.4.

A lot of new properties appeared between 3.0.4 and 3.2.0.

Michael.

On Fri, 13 Nov 2020, Larry Dalton via lazarus wrote:

I forgot to add that it compiles correctly, but then I get the runtime error 


Sent from my iPhone


On Nov 13, 2020, at 11:02, Larry Dalton  wrote:

This is only when I try to compile on Lazarus 2.0.6 on Windows. The project 
works fine on 2.0.10 on Linux. Any ideas?

Sent from my iPhone


On Nov 13, 2020, at 10:58, Larry Dalton  wrote:

Error code “Project ** raised exception class ‘EReadError with unknown 
property ‘AutoCommit’

Sent from my iPhone

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] libmysql.dll

2020-11-04 Thread Michael Van Canneyt via lazarus



On Wed, 4 Nov 2020, Larry Dalton wrote:


I think so. I removed all versions of libmysql from my computer, and
replaced them with the version that downloaded with the new Mysql install.
Is there any way I can check all the installations  to be sure they are all
64bit?


Not that I am aware of.

Last time I had to install MySQL on a windows (< 6 months ago), 
I ended up installing 32-bit 5.7, because I could not get it to work with the V8 installs.


So if you manage it, I'll be glad to know how you did it.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] libmysql.dll

2020-11-04 Thread Michael Van Canneyt via lazarus



On Wed, 4 Nov 2020, Larry Dalton via lazarus wrote:


Not the answer in this case. I am using MySQL 8.0 on my linux laptop, and
have no issues with it. I do have to set the 'skiplibraryversioncheck' to
TRUE, and it works just fine. I have eliminated that possibility.


Correct architecture (32/64 bit) ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] libmysql.dll

2020-11-03 Thread Michael Van Canneyt via lazarus



On Tue, 3 Nov 2020, Larry Dalton via lazarus wrote:


I have done a complete overhaul on my computer, installing a new version of
mysql, phpmyadmin, apache, and lazarus. Here are the current versions:
Windows 10
Lazarus 2.0.10
Wamperserver 3.2.3.3
Apache/2.4.46(Win64)
phpmyadmin 5.0.2
MySQL 8.0.21-MySql Community Server-GPL.
Microsoft Visual C++2015-2019.

I am getting the old "can't load libmysql.dll". I have manually copied it
to C:\Windows\System32,
C:\Windows\SysWOW64, and the application target: C:\(my directory)Money..

What else do I need to do to make this work?


An older version of the mysql.dll client library. Version 8 is not supported. 
5.7 is the latest supported version.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Michael Van Canneyt via lazarus



On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote:


On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via
lazarus  wrote:


QUESTION:
Is there a way in code to check if Forms is used?
So it can be used instead of {$IFDEF NOGUI}


normally

{$IF DECLARED(Forms)}
or
{$IF DECLARED(TForm)}

should do the trick for you.



I created this command line program:

program Test;

begin
 Writeln('I will test the TForm check now:');
 {$IF DECLARED(TForm)}
   Writeln('TForm is declared...');
 {$ELSE}
   Writeln('Apparently TForm not declared');
 {$ENDIF}
 Writeln('I will test the Forms check now:');
 {$IF DECLARED(Forms)}
   Writeln('Forms is declared...');
 {$ELSE}
   Writeln('Apparently Forms not declared');
 {$ENDIF}

end.

When I run it in a console:

$ ./Test
I will test the TForm check now:
Apparently TForm not declared
I will test the Forms check now:
Apparently Forms not declared

However in the Lazarus code editor the lines inside the {$ELSE}
clauses are shown as disabled even though these are the ones actually
present and running in the build...


Well, then the IDE codetools have an issue.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Michael Van Canneyt via lazarus



On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote:


should do the trick for you.


A quick test:
It seems like there is a problem with this...
I added this to the end of a random function:

 {$IF DECLARED(TForm)}
   Application.ProcessMessages;
 {$ENDIF}

Even though the project does not use Forms (Search/Find in Files in
all project files does not find it) the code within the block is
marked enabled and a quick compile succeeds.

No file in the project declares Forms as a used unit.
Same thing happens if I check for Forms in the code above...

If I try to use the right-click/FindDeclarationOf on Processmessages
pops up an error:
class_SSRemoteServer.pas(530,5) Error: identifier not found:
Application

However, the app builds...
So maybe this is a problem with the Lazarus code editor not being able
to parse the {$IF DECLARED(TForm/Forms)} item?


I can't comment on this.



To really check this I need to create a test app and run it in the
debugger, I guess..
In a command line program it should not generate code, right?


Yes.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Michael Van Canneyt via lazarus



On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote:


procedure AppProcessMessages; virtual; abstract; (no implementation)

And ProcessAsyncCallQueue seems to be doing the job with pretty
intricate code inside a CriticalSection shield.

QUESTION:
Is there a way in code to check if Forms is used?
So it can be used instead of {$IFDEF NOGUI}


normally

{$IF DECLARED(Forms)}
or
{$IF DECLARED(TForm)}

should do the trick for you.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus 2.0.10 corrupted by Win 10 crash, how to repair?

2020-10-29 Thread Michael Van Canneyt via lazarus



On Thu, 29 Oct 2020, Bo Berglund via lazarus wrote:


Yesterday I was working on an application using Lazarus 2.0.20/fpc
3.2.0 on a Windows 10 notebook.
Suddenly Win10 decided to crash with a memory fault and restarted
itself.

But now Lazarus no longer works and when I inspected the config dir I
found that two files had been hosed (filled with NUL characters):

environmentoptions.xml
inputhistory.xml

All other files seem to be OK, so now I wonder what I can do to repair
my Lazarus installation?

Unlike on Linux this installation is created using the official
windows installer for Lazarus 2.0.10 so I do not really know how the
two files were created. On Linux I always install from SVN sources
using a script I created years ago and then I can backtrack there...

I tried to use files from my 2.0.8 installation after editing the
items pointing to locations in the 2.0.8 tree to instead point to
2.0.10, but that was not successful.

Grateful for any suggestions on how to fix this.

(I do not really want to start over from scratch after spending time
installing extra packages and customizations and the like).


The packages should be OK. But as the names indicate, your input history is
lost, and the environment options (essentially what you entered in tools -
options) also.

Just delete those 2 files.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-28 Thread Michael Van Canneyt via lazarus



On Wed, 28 Oct 2020, Bo Berglund via lazarus wrote:


On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via
lazarus  wrote:




On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote:


Now I wonder if I could put something else into the loops so that the
main object of Application.Processmessages will be handled, namely to
let event functions run as needed.
Can I for example use CheckSynchronize in these loops?

I.e. Application.Processmessages ==> CheckSynchronize?


Based on your description, that is all you need to do.

But I would create a routine

Procedure HandleMainLoop;

begin
{$IFDEF NOGUI}
  CheckSynchronize;
{$ELSE}
  Application.ProcessMessages;
{$ENDIF}
end;

And call that both in GUI and NOGUI.



Is NOGUI defined also when *not* using the nogui widgetset? I.e. in a
simple program?


As far as I know you must define this yourself.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-28 Thread Michael Van Canneyt via lazarus



On Tue, 27 Oct 2020, Mattias Gaertner via lazarus wrote:


On Mon, 26 Oct 2020 13:00:26 +0100 (CET)
Michael Van Canneyt via lazarus  wrote:


[...]
Procedure HandleMainLoop;

begin
{$IFDEF NOGUI}
   CheckSynchronize;
{$ELSE}
   Application.ProcessMessages;
{$ENDIF}
end;

And call that both in GUI and NOGUI.


Application.ProcessMessages calls CheckSynchronize in NoGUI.


NOGUI does not mean 'use nogui LCL'

He does not use the LCL in that mode, so Application is not available.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-26 Thread Michael Van Canneyt via lazarus



On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote:


Now I wonder if I could put something else into the loops so that the
main object of Application.Processmessages will be handled, namely to
let event functions run as needed.
Can I for example use CheckSynchronize in these loops?

I.e. Application.Processmessages ==> CheckSynchronize?


Based on your description, that is all you need to do.

But I would create a routine

Procedure HandleMainLoop;

begin
{$IFDEF NOGUI}
  CheckSynchronize;
{$ELSE}
  Application.ProcessMessages;
{$ENDIF}
end;

And call that both in GUI and NOGUI.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to start Lazarus on Mac ?

2020-10-04 Thread Michael Van Canneyt via lazarus



On Sun, 4 Oct 2020, Mattias Gaertner via lazarus wrote:


On Sun, 4 Oct 2020 15:52:27 +0200 (CEST)
Michael Van Canneyt via lazarus  wrote:


[...]
Should not the system installed version  detect the 'local' version
and start that ?


Sounds like:
https://bugs.freepascal.org/view.php?id=37753


I think the correct solution is indeed to let the installed "Lazarus.app" start
the startlazarus binary. That will then take care of the rest.

Any idea how I can accomplish this myself ? 
I tried setting the symbolic link 'lazarus' in /Application/Lazarus.app/Contents/MacOS 
to ../../../startlazarus, but that does not seem to be enough.


I get strange effects, that's the least I can say :-)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] How to start Lazarus on Mac ?

2020-10-04 Thread Michael Van Canneyt via lazarus


Hi,

After installing Lazarus and recompiling it with the packages I need, it
restarts and I see the packages I want.

Then I stop lazarus and start it again through Launchpad.

In this case, I get the originally installed Lazarus. No sign of the new
packages. I look in the packages list, and it says e.g. 
'pas2js selected for install, but not installed' 
(or something similar).


If I start Lazarus through the ~/.lazarus/bin/lazarus.app icon, then it
works. (I made a link on the desktop, so I can start it).

But, here is the question:

How can I make sure the icon in Launchpad starts the correct (i.e. newly
compiled) Lazarus ?

Should not the system installed version  detect the 'local' version and start 
that ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugging in Lazarus, cannot inspect values at breakpoints...

2020-09-30 Thread Michael Van Canneyt via lazarus



On Wed, 30 Sep 2020, Ondrej Pokorny via lazarus wrote:


On 30.09.2020 10:55, Michael Van Canneyt via lazarus wrote:

Does Lazarus offer the functionality Delphi has (since quite some time, I
might add):  custom debug info visualizers ?

See

http://docwiki.embarcadero.com/RADStudio/Sydney/en/Debugger_Visualizers

Seems like a useful addition. Don't know if it is technically 
feasible, though.


Yes, I implemented them, IIRC. Don't remember the details, though. I 
added TDate, TDateTime and TTime formatters. It was quite a simple 
addon, should be easy to find in the sources.


Good news :-)

How to activate them ? Because everywhere I tried, a TDateTime is still
displayed as a float: 44104.47848875 does not look like a date/time I can
recognize...  :-)

I tried tooltip evaluation, evaluate/modifiy, inspect, local variables,
watches. None of them seems to use this.



The problem of object-based visualizers like a visualizer for TStrings 
is that your Lazarus IDE has to be compiled with the same FPC 
version/codebase that you also use for the debugged program. In Delphi 
this is usually the case (if you don't fiddle with RTL sources to fix 
bugs). In FPC/Lazarus this doesn't need to apply. I usually build 
Lazarus IDE less frequently than I update and build FPC trunk. Or you 
can build Lazarus with FPC stable but develop applications with FPC 
trunk. In that case such additions are unsafe.


I understand this need to keep versions aligned, but for the average 
user who simply installs Lazarus, this will always be the case: 
they get lazarus/FPC bundled.


In this matter the Laz/FPC developers are the exception.
(one could think "it's their own fault that they make it difficult" ;-) )

So with this caveat in mind, I think support for object-based visualizers
should definitely be added. Lazarus can easily enough detect that the version
of FPC it uses for a project differs from the FPC version the IDE was compiled
with, and disable the object-based visualizers.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugging in Lazarus, cannot inspect values at breakpoints...

2020-09-30 Thread Michael Van Canneyt via lazarus



On Tue, 29 Sep 2020, Martin Frb via lazarus wrote:


On 29/09/2020 18:22, Martin Frb via lazarus wrote:

On 29/09/2020 17:49, Bo Berglund via lazarus wrote:

When I reach this breakpoint and I hover the mouse over Body.Text or
Body.Count Lazarus shows a message saying:

Body.Text = Type TSTRINGS has no component named TEXT
and
Body.Count = Type TSTRINGS has no component named COUNT

What is that?


Its a property, and calls a getter function.


For a Stringlist, you can inspect individual "items".

Using the "debug inspector" you can click through (mylist.FLIST)^[0].FSTRING

GDB may not be able to do this (not sure, but faint memory)
FpDebug can do this (at least in trunk)


Does Lazarus offer the functionality Delphi has (since quite some time, I
might add):  custom debug info visualizers ?

See

http://docwiki.embarcadero.com/RADStudio/Sydney/en/Debugger_Visualizers

Seems like a useful addition. 
Don't know if it is technically feasible, though.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FileUtil.FindAllFiles - case-sensitive on Unix

2020-09-20 Thread Michael Van Canneyt via lazarus



On Mon, 21 Sep 2020, AlexeyT via lazarus wrote:


procedure FindAllFiles(AList: TStrings; const SearchPath: String;

?? Searcher.Search(SearchPath, SearchMask, SearchSubDirs);

Here we miss parameter "CaseSensitive=False". So on Linux it is False 
and function does case-insens search. It is slower! Why not to add param 
True for Unix. Not sure about macOS.


Did you try setting the list to case sensitive ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to move installed component package sources?

2020-09-19 Thread Michael Van Canneyt via lazarus



On Fri, 18 Sep 2020, Bo Berglund via lazarus wrote:


I have installed a custom component package on the palette of Lazarus.
Now I realize that I did it the wrong way since the package sources
are inside a project tree of many apps and other things.

I want to have the sources moved to my Lazarus installation into the
config dir below lazarus like for instance packages retrieved from
OLPM are.

Is there a simpler way to redirect Lazarus for the package location or
do I have to this:
- Uninstall the component package
- Rebuild Lazarus without the package
- Install the package based on sources in the right place
- Rebuild Lazarus again to include the package

It takes a really long time to build Lazarus on these machines so I'd
rather not do that if at all possible...
I have Lazarus on several machines (Windows, Linux)...


AFAIK:

Normally you can just open the package file in its new location.
Next time when the IDE needs to be recompiled it will find the package.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TSql57 replacement

2020-09-17 Thread Michael Van Canneyt via lazarus


Use the ODBC connector.

Michael.

On Thu, 17 Sep 2020, larrydalton71 wrote:



Is there another way to connect now? I don't want to install Mysql 57.Sent from 
my Verizon, Samsung Galaxy smartphone
 Original message From: Michael Van Canneyt via lazarus 
 Date: 9/17/20  07:14  (GMT-05:00) To: larrydalton71 via lazarus 
 Cc: Michael Van Canneyt  Subject: 
Re: [Lazarus] TSql57 replacement On Thu, 17 Sep 2020, larrydalton71 via lazarus wrote:>> Are 
there any plans to replace the T57SqlConnection? I have done a complete update on a laptop with Lazarus 
Mint 20, Lazarus 2.0.10, and Mysql 8.0, and need to access my sql databasesSent from my Verizon, 
Samsung Galaxy smartphoneThese plans exist, but no date is determined yet.And it will not be 'replace' 
but 'add a new connection'.Michael.-- ___lazarus mailing 
listlazarus@lists.lazarus-ide.orghttps://lists.lazarus-ide.org/listinfo/lazarus

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TSql57 replacement

2020-09-17 Thread Michael Van Canneyt via lazarus



On Thu, 17 Sep 2020, larrydalton71 via lazarus wrote:



Are there any plans to replace the T57SqlConnection? I have done a complete 
update on a laptop with Lazarus Mint 20, Lazarus 2.0.10, and Mysql 8.0, and 
need to access my sql databasesSent from my Verizon, Samsung Galaxy smartphone


These plans exist, but no date is determined yet.
And it will not be 'replace' but 'add a new connection'.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] JCF2 patch in trunk

2020-09-11 Thread Michael Van Canneyt via lazarus



On Fri, 11 Sep 2020, Mattias Gaertner via lazarus wrote:


On Fri, 11 Sep 2020 13:14:59 +0300
"Alexey Tor. via lazarus"  wrote:


https://github.com/graemeg/lazarus/commit/f4ffd5e0640948e9c396e1ef1b2aacd90512ac77

    if StartsText('{$include',pcToken.SourceCode)=true then
   lPos:=10
     else if StartsStr('{$I',pcToken.SourceCode)=true then


a) $include is searched case-insens? why no space after "$include" to 
avoid incorrect include?


b) $I is searched case-insens? seems no! why no space after $I to
avoid other directive?


Are these trick questions?
Simply reading the code and using Find Declaration answers both
questions in less time, than it takes to write this mail.


I think he tries to point out there is a discrepancy in case-sensitiveness
treatment, and that it is safer to add ' ' after the directive to prevent
false positives.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How many timers available on Linux (Raspberry Pi)?

2020-07-22 Thread Michael Van Canneyt via lazarus



On Thu, 23 Jul 2020, Bo Berglund via lazarus wrote:


On Wed, 22 Jul 2020 13:23:43 +0200 (CEST), Michael Van Canneyt via
lazarus  wrote:


The lazserial seems to be a wrapper around lazsynaser, which I assume is from 
synapse.

You should be OK just using directly lazsynaser.

It has no GUI dependencies. The drawback is probably that you must create
the component in code instead of dropping it on a datamodule.


I am anyway creating everything in code in a console application...

The reason I went with LazSerial is that it was the closest in
functionality I could find to the serial port component I used in the
source Delphi program I am porting.

For example I need the event model for retrieving the incoming data
and the transmit must not be blocking.


Lazserial is simply a wrapper that allows you to set properties in the
designer. It adds no functionality, so you will not lose anything..

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How many timers available on Linux (Raspberry Pi)?

2020-07-22 Thread Michael Van Canneyt via lazarus



On Wed, 22 Jul 2020, Bo Berglund via lazarus wrote:


On Wed, 22 Jul 2020 12:23:42 +0200, Bo Berglund via lazarus
 wrote:


On Wed, 22 Jul 2020 11:55:27 +0200, Bo Berglund via lazarus
 wrote:


Then while chasing a strange error concerning wsmenus I changed from
what it was in the beginning to nogui.

Now I do not know how to cancel that change and get back to what it
was before (it needs to be a console app and dual platform).

There 13 different "widgets" offered and I do not remember what it was
in the beginning. So which do I choose for a dual platform
(Linux/Windows) application?


Never mind, I created a new project and had a look.
It seems like what I need to do in the dialog is to delete the
widgetset setting...


And after this was done I could build the app and run it without the
exceptions appearing.

OTOH it does not start the TCP server by the looks of it, but that is
another problem that belongs to the normal tracing of the
functionality.
I wonder if the TTimers are working or if I should change to TfpTimer
as suggested? I cannot tell right now.


TTimer does not work in nogui or console applications.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How many timers available on Linux (Raspberry Pi)?

2020-07-22 Thread Michael Van Canneyt via lazarus



On Wed, 22 Jul 2020, Bo Berglund via lazarus wrote:


On Wed, 22 Jul 2020 12:34:34 +0200 (CEST), Michael Van Canneyt via
lazarus  wrote:


Then while chasing a strange error concerning wsmenus I changed from
what it was in the beginning to nogui.


It means you have somewhere a reference to a LCL/VCL unit.

Probably your use of TTimer caused this.



No, it was caused by package LazSerial...
It brings in a number of units I would not use in any console app like
this:

SysUtils, lazsynaser,  LResources, Forms, Controls, Graphics, Dialogs;

The "solution" (after googling a lot) was to add "interfaces" just
before lazserial in the uses clause of the unit that handles the
serial comm stuff:

 {$IFDEF FPC}
   interfaces, //Needed for LazSerial to work in a Console program
   LazSerial,
 {$ELSE} //Delphi

Then these linker only errors went away (compile phase worked just
fine before I did this).


The lazserial seems to be a wrapper around lazsynaser, which I assume is from 
synapse.

You should be OK just using directly lazsynaser.

It has no GUI dependencies. The drawback is probably that you must create
the component in code instead of dropping it on a datamodule.

I would suggest to the maintainers of lazserial to

a) Really clean up the uses clause.
   There is no need for  LResources, Forms, Controls, Graphics, Dialogs in the 
uses clause.

b) *always* put the registration of a component in a separate unit,
   never in the unit itself. It creates unwanted dependencies.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How many timers available on Linux (Raspberry Pi)?

2020-07-22 Thread Michael Van Canneyt via lazarus



On Wed, 22 Jul 2020, Bo Berglund via lazarus wrote:


OK,
so I created this program as a simple program with no template.
In Delphi it was a TService descendant, but now i want it to just be a
normal console program, which I can run as a service under Systemd on
Linux.

Then while chasing a strange error concerning wsmenus I changed from
what it was in the beginning to nogui.


It means you have somewhere a reference to a LCL/VCL unit.

Probably your use of TTimer caused this.



Now I do not know how to cancel that change and get back to what it
was before (it needs to be a console app and dual platform).

There 13 different "widgets" offered and I do not remember what it was
in the beginning. So which do I choose for a dual platform
(Linux/Windows) application?


You don't need to set a widget for a console application.


Concerning timers the old application I am porting makes heavy use of
TTimer objects, there are probably a lot more than the 4 I have in
this constructor.

So I should change the timer class from TTimer to TfpTimer or some
such?

I assume that is cross-platform, right?


Yes.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How many timers available on Linux (Raspberry Pi)?

2020-07-22 Thread Michael Van Canneyt via lazarus



On Wed, 22 Jul 2020, Bo Berglund via lazarus wrote:


On Wed, 22 Jul 2020 11:21:07 +0200 (CEST), Michael Van Canneyt via
lazarus  wrote:

PS. 
Please change the lazarus mailing list address you use to 

It seems you're still using the old laza...@lists.lazarus.freepascal.org
People doing a reply and don't pay attention will send the reply twice,
since the laza...@lists.lazarus.freepascal.org is put in CC.


Well, I am not using my email client to interface to this list,
instead I use the NNTP mirror at news.gmane.io

So my action is to post to the news server and it in turn sends it on
to the mail list...
I don't know how to change how that is being done.


Probably the NNTP mirror is still using the old address in that case. 
Unfortunately, I don't know who maintains it...


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How many timers available on Linux (Raspberry Pi)?

2020-07-22 Thread Michael Van Canneyt via lazarus



On Wed, 22 Jul 2020, Bo Berglund via lazarus wrote:


On Wed, 22 Jul 2020 08:09:08 +0300, "Alexey Tor. via lazarus"
 wrote:


On gtk2 it calls TGtk2WidgetSet.CreateTimer, which calls gtk_timeout_add()
I cannot find in inet, about max number of 'timeouts' in gtk2.

Alexey


I am using:
LCLWidgetType:=nogui

This is a console program, which I guess I should have stated in my
thread subject...


The NoGUI widgetset does not support timers:

function TNoGUIWidgetSet.CreateTimer(Interval: integer; TimerFunc: TWSTimerProc
  ): THandle;
begin
  Result:=0;
end;

function TNoGUIWidgetSet.DestroyTimer(TimerHandle: THandle): boolean;
begin
  Result:=false;
end;

As I stated many times before: DO NOT use the nogui widgetset.
It is a basically flawed concept.

Create a normal console appliation instead and use the fpTimer unit if you
need a timer.

Michael.

PS. 
Please change the lazarus mailing list address you use to 

It seems you're still using the old laza...@lists.lazarus.freepascal.org
People doing a reply and don't pay attention will send the reply twice,
since the laza...@lists.lazarus.freepascal.org is put in CC.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugging the rtl/fcl - segfault in sdfdataset

2020-07-17 Thread Michael Van Canneyt via lazarus



On Fri, 17 Jul 2020, Luca Olivetti via lazarus wrote:


El 17/7/20 a les 11:46, Luca Olivetti via lazarus ha escrit:



In fact, if you look at the bug report, it's enough to use the old 
version of Fielddefs.Add (i.e. the one without the encoding) to "fix" 
the problem, but it's not because of the default (I changed it to 
'utf-8', or maybe it's actually 'utf-8' that causes the problem).


Yes, setting it to '437' or 'iso8859-1' avoids the segfault.


Haha... The mystery is unraveling :-)

Note that these are single-byte codepages.
Are you using fixed-length of CSV ? Because in the case of fixed-length,
UTF8 makes no sense...

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugging the rtl/fcl - segfault in sdfdataset

2020-07-17 Thread Michael Van Canneyt via lazarus



On Fri, 17 Jul 2020, Luca Olivetti wrote:


El 17/7/20 a les 9:51, Michael Van Canneyt ha escrit:


I reported it here

https://bugs.freepascal.org/view.php?id=37370


I found that reverting

https://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=43245 


(in fact I just took sdfdata.pp from 3.0.4)

fixes the segfault.

Michael, what do you think?


Seems like a bug somewhere. I'll need to look at it. Probably has something
to do with the default codepage: Lazarus changes that.


What worries me is the fact that it is so easy to mess up the heap. What 
other dragons are lurking ahead in 3.2.0?


Looking at the bugtracker, there could be several. 
I think we may need to release a 3.2.2 after a relatively short amount of time.


For the record, I tried to set the codepage of the component to 'utf-8' and 
it still segfaults, so I don't think it's because of the default codepage.


We'll see. 
This is the only relevant change in the component, so that is the most likely candidate.

What is more puzzling is that it only happens in Lazarus.

Also the fact that some of the TFieldDefs.Add are procedure and some 
functions doesn't seem right.


They are simply overloaded versions, but all boil down to the same. 
Some of these exist for Delphi compatibility. I doubt this is the cause.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugging the rtl/fcl - segfault in sdfdataset

2020-07-17 Thread Michael Van Canneyt via lazarus



On Thu, 16 Jul 2020, Luca Olivetti wrote:


El 16/7/20 a les 8:55, Luca Olivetti via lazarus ha escrit:

El 15/7/20 a les 18:26, Luca Olivetti via lazarus ha escrit:


For the record, the segfault happens here


#0 SYSGETMEM_FIXED(544) at ../inc/heap.inc:963


The memory is hosed, I still don't know why.
I managed to reproduce the problem with a simple lazarus program, however 
a plain pascal program  that does the same doesn't trigger the it.


I'm attaching the lazarus project as well as the simple pascal program if 
somebody could look into it...



I reported it here

https://bugs.freepascal.org/view.php?id=37370


I found that reverting

https://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=43245

(in fact I just took sdfdata.pp from 3.0.4)

fixes the segfault.

Michael, what do you think?


Seems like a bug somewhere. I'll need to look at it. Probably has something
to do with the default codepage: Lazarus changes that.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cannot compile console application, why?

2020-07-06 Thread Michael Van Canneyt via lazarus



On Mon, 6 Jul 2020, Bo Berglund via lazarus wrote:


On Mon, 6 Jul 2020 07:20:08 +0200 (CEST), Michael Van Canneyt via
lazarus  wrote:

I suggest to remove indylaz from the uses clause. 
It pulls in some GUI related code, probably some design-time stuff.



So I have done this:
- deleted the uses indylaz in the lpr file
- removed the LCLbase from project required packages

Still the same behaviour. LCLbase was not there to begin with, I added
it as a wild guess but it did nothing so is now removed.

Next I started removing uses clauses one by one in the
remoteserver.pas unit where the indy functionality is located and when
I had removed these two it did build!

 //StdCtrls,
 //IdBaseComponent,


StdCtrls :-)

That's what I said, you have GUI dependencies in your code...



QUESTION:
-
What is the correct way to start a new project that is just a console
no GUI type program intended to be run as a systemd service on Linux?
There are several types of programs to choose from and I have not
understood the difference between:
- Simple Program
- Program
- Console application


They are exactly the same functionally, they just differ in terms of what start 
code is
generated.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cannot compile console application, why?

2020-07-05 Thread Michael Van Canneyt via lazarus



On Mon, 6 Jul 2020, Bo Berglund via lazarus wrote:


I have created a test application using Lazarus 2.0.8 and fpc 3.0.4 on
Windows 10.

The purpose is to check some Indy10 TCP communications items before
putting them into the main project.

So I have created a new project as a console application and
implemented my test Indy code.

When I use "Run/Quick compile" it reports no errors so then I tried to
use "Run/Compile" in order to get an executable but now it shows a
large number of errors of this kind:

IndyTest.lpr(76,1) Error: Undefined symbol: WSRegisterMenuItem


Looks like you have some GUI related code somewhere.


program IndyTest;

{$mode objfpc}{$H+}

uses
 {$IFDEF UNIX}
 cthreads,
 {$ENDIF}
 Classes, SysUtils, CustApp,
 { you can add units after this }
 crt, //to check keypresses
 remoteserver, //where the main action happens
 indylaz;


I suggest to remove indylaz from the uses clause. 
It pulls in some GUI related code, probably some design-time stuff.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Proposal: Allow Umlaute and Accented Characters in Identifiers

2020-07-04 Thread Michael Van Canneyt via lazarus



On Sat, 4 Jul 2020, Special via lazarus wrote:


Am 03.07.2020 um 16:13 schrieb Martin Frb via lazarus:

On 03/07/2020 14:55, Péter Gábor via lazarus wrote:

Hi!

Then you must allow Cyrillic,d Arabic and so Chinese and other national
and special characters to be used in identifiers.
Worse, the same source may then compile or fail to compile depending on the 
locale.


Pascal is case insensitive.
var I: integer; // upper i
...
for i := 0 to x do ...;

compiles today.

But when compiling, using Turkish locale, this would fail.
In Turkish there is a dotted and a dotless i, both upper and lower.
So I and i are different letters.
https://en.wikipedia.org/wiki/Dotted_and_dotless_I


Hi,

if Lazarus had an option "Allow accented Latin characters and Umlauts in 
identifiers", then Cyrillic, Arabic and Chinese and other special national 
charcters and dotted characters like the Turkish "I." were not included 
('Dotted' is not 'Accented').  So we could enjoy the benefits of this 
proposal without the drawbacks.


Sorry, I don't think this is right.

Why should Russian, Chinese or Arabic or any non-latin alphabet students 
be disadvantaged compared to western students ?


Either you allow them all (with all that implies) or none (as it is now).

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Proposal: Allow Umlaute and Accented Characters in Identifiers

2020-07-03 Thread Michael Van Canneyt via lazarus



On Fri, 3 Jul 2020, Martin Frb via lazarus wrote:


On 03/07/2020 16:21, Péter Gábor via lazarus wrote:

Hi!

I hope that you did not misread my words/sentences.
Your example if perfect to illustrate the reason why I don't want
international characters in the language itself (and identifiers).

Yes, that was my understanding.

You gave reasons why it would be a bad idea. I added a reason, that I 
think would make the idea even worse.

In other words, I supported the current a-z0-1_ set.


I did a quick test in Delphi:

program doti;

{$APPTYPE CONSOLE}

Var
  i: Integer; // lowercase dotted i in turkish

begin
  for İ :=0 to 10 do // uppercase dotted I in turkish
writeln(i);
end.

Results in

[dcc32 Error] doti.dpr(9): E2003 Undeclared identifier: 'İ'

Same for German:

program doti;

{$APPTYPE CONSOLE}

Var
  ẞ: Integer;

begin
  for ß :=0 to 10 do
writeln(ß);
end.

[dcc32 Error] doti.dpr(9): E2003 Undeclared identifier: 'ß'

So indeed, case-insensitivity is lost. Even in German.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Wrong Duplicate Identifier error message?

2020-07-02 Thread Michael Van Canneyt via lazarus



On Thu, 2 Jul 2020, Special via lazarus wrote:


Am 01.07.2020 um 20:36 schrieb Mattias Gaertner via lazarus:

On Wed, 1 Jul 2020 20:15:45 +0200
Special via lazarus  wrote:


[...]
the following unit throws an (I think wrong) compile error "Duplicate
identifier 'Connection'". This happens Lazarus with 2.0.8 under Win
10 (64). According to Nicklaus Wirth and Kathleen Jensen ('Pascal
User Manual and Report') there is no duplicate  identifier in this
unit, since 'Connection' in procedure Proc ist strictly local and
does not interfere with Identfiers outside this procedure.

You are aware, that this manual was way before Object Pascal?



Code:

unit DoubleDefinition;
{$mode objfpc}{$H+}

$mode objfpc is more strict on duplicates.
FPC supports other modes like $mode Delphi, which allows this
duplicate.

Mattias


Here there is no Duplicate Identifier error message:

program Duplicate;
{$mode objfpc}{$H+}

var TestVar: string;

procedure Proc;
var TestVar: string;
begin
  TestVar:= 'zwei';
  writeln (TestVar)
end;

begin
  TestVar:= 'eins';
  writeln (TestVar);
  Proc
end.

Why this inconsistency?


There is no inconsistency: there is no object.

An object in some way represents a single scope of identifiers. 
In that sense, it makes sense to forbid duplicates. It's a thin line.


In practice, I find that the objfpc mode is less error prone 
than the Delphi mode. I had some nasty surprises in the past in

Delphi with duplicate names in methods and properties.

Michael.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb: Pseudo Transaction?

2020-07-01 Thread Michael Van Canneyt via lazarus



On Wed, 1 Jul 2020, Luca Olivetti via lazarus wrote:


El 1/7/20 a les 0:40, R.Smith via lazarus ha escrit:

On 2020/06/30 22:52, Special via lazarus wrote:

Hi, Ryan,

I followed your advice and removed XTransaction and all references to 
it from TestButtonClick. But now I get an exception with the message 
"Transaction not set". Any hint?

Regards --  Joe


I'm sorry, the previous problem was SQLite-related, which I'm 
initimately familiar with, but this one seems to be a Lazarus DB 
component requirement which I'm not so much familiar with, but probably 
has an easy solution someone here might know about.


The question becomes:  How to execute a query, without a transaction 
being set, using SQLdb in Lazarus?


I use zeos instead of sqldb. Most probably it's my fault and it could be 
solved by doing what Michael said (use stoUseImplicit), but when I tried 
to use sqldb with sqlite, as long as I kept the dataset open (to show 
the data in a dbgrid) the table was locked and couldn't be modified by a 
different thread/process.


The stoUseImplicit is one way to solve this.

An alternative was to disable the need to keep an active transaction using
TSQLQuery.Options : add sqoKeepOpenOnCommit.

see
https://www.freepascal.org/docs-html/current/fcl/sqldb/tsqlqueryoptions.html

Then you can do

Dataset.open;
MyTransaction.Commit;

And the table will not be locked.

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb: Pseudo Transaction?

2020-06-30 Thread Michael Van Canneyt via lazarus



On Tue, 30 Jun 2020, Special via lazarus wrote:


Hi, Ryan,

I followed your advice and removed XTransaction and all references to it 
from TestButtonClick. But now I get an exception with the message 
"Transaction not set". Any hint?


With SQLDB you always need a transaction component.

What you can do is set stoUseImplicit in the Transaction.Options:

https://www.freepascal.org/docs-html/current/fcl/sqldb/tsqltransaction.options.html

In that case the implicit transaction handling of the DB engine (SQLite in
this case) will be used, no explicit transaction statements will be emitted.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] We are planning the next release: Lazarus 2.0.10

2020-06-23 Thread Michael Van Canneyt via lazarus



On Tue, 23 Jun 2020, Anthony Walter via lazarus wrote:


Alexey,

So Cocoa actually is stable now? That's great news! I'll be sure to test it
out.


I've been using it for some time now: I run the 64-bit lazarus 2.0.8 on Mac
OS Catalina, and that is cocoa only AFAIK.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Making a Linux systemd service, how does one handle the shutdown?

2020-06-21 Thread Michael Van Canneyt via lazarus



On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote:


I have read that a systemd service on Linux will be taken down by the
service manager using kill -TERM, i.e. the application is given a
chance for a clean shutdown.

So my question is:
How/where do I implement a handler for the terminate message in a
FreePascal console application (no GUI or form available)?


https://www.freepascal.org/docs-html/current/rtl/sysutils/hooksignal.html

or

https://www.freepascal.org/docs-html/current/rtl/baseunix/fpsigaction.html
You should install handlers for SIGQUIT/SIGTERM/SIGINT

The hooksignal internally uses fpsigaction, by the way.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to?

2020-06-21 Thread Michael Van Canneyt via lazarus



On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote:


On Sun, 21 Jun 2020 11:12:17 +0200 (CEST), Michael Van Canneyt via
lazarus  wrote:


This is so, but it does not have to be a problem: you must not recompile
lazarus itself using such a secondary copy.


Since Lazarus recompiles itself when one installs a new package, how
can I deal with that?


Always make sure you do this with the default.



The compiler executable was set in Lazarus to "fpc" i.e. no path at
all.
I changed it to /home/pi/dev/fpc/3.2.0/compiler/ppcarm
Is this the correct way to do it?


Yes.



Lazarus help/about still says FPC is version 3.0.4 (I guess it knows
which version compiled it)..


Yes.



Is there a way I can verify if the settings are modified correctly and
the new fpc is in use for this Lazarus invocation?


Compile a program

begin
writeln({$I %FPCVERSION});
end.

and check the output.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to?

2020-06-21 Thread Michael Van Canneyt via lazarus




Now you can start 2 instances of lazarus, with a different setting for the
compiler version.

I have 4 or 5 such versions.


Thanks, that seems simple enough. :)


It is.



Just a follow-up:
After downloading the 3.2.0 sources via svn I went into the new 3.2.0
dir and did (I am using an RPi4 computer with 4GB RAM):

$ time make all FPC=/home/pi/bin/ppcarm OPT=-dFPC_ARMHF

So I did not do a "make install"...

I also did:
$ cp .lazarus_2.0.8 ./.lazarus_2.0.8_3.2

Is the above OK for using the compiler as outlined above pointing the
shortcut to to the new dir as you outlined?


You need to do the "make install". 
How else will the compiler find the units when compiling ?




Beware though
-
I have fallen into the trap of copying the pcp dir when installing a
new version of Lazarus before. Then unbeknown to me Lazarua used
installed components where the paths pointed to the *previous*
version.
That resulted in both Lazarus versions sharing the exact same files
including generated binaries


This is so, but it does not have to be a problem: you must not recompile
lazarus itself using such a secondary copy.

I only recompile lazarus using the configuration with the official released FPC.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Switching Lazarus between fpc 3.2.0 and 3.0.4 - how to?

2020-06-21 Thread Michael Van Canneyt via lazarus



On Sun, 21 Jun 2020, Bo Berglund via lazarus wrote:


Is it possible to switch Lazarus between using fpc 3.0.4 and 3.2.0 so
as to compare the two easily?


Yes.

Just install the new FPC alongside the old one.

The simplest is then to copy the lazarus settings directory, 
and create a shortcut where you start lazarus with --pcp=/path/to/copy


In this, under Tools-Options dialog, page Environment-Files set 
- the correct compiler binary in 'Compiler Executable',

- and the correct path to the 3.2.0 sources in 'FPC Source directory'

That's it.

Now you can start 2 instances of lazarus, with a different setting for the
compiler version.

I have 4 or 5 such versions.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] fpWeb and server-sent events

2020-06-04 Thread Michael Van Canneyt via lazarus



On Thu, 4 Jun 2020, Luca Olivetti via lazarus wrote:


     FServer.Port:=8080;
     FServer.Threaded:=true;
     FServer.Run;
   except
     on E:Exception do
     begin
   writeln(E.Message);
   sleep(1000);
   FServer.Free;
     end;
   end;


Oh, and I had to do some more overriding so that the response could have 
a reference to the calling thread (needed if I want to use synchronize).


That seems a bit strange, since you can do synchronize without needing
access to the thread object using a class method of TThread ?

Can you send me the changes you had to do ?

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


<    1   2   3   4   5   6   7   8   9   10   >