Re: [Lazarus] Lazarus make clean fails...

2023-12-07 Thread Giuliano Colla via lazarus


  
  
Il 04/12/23 17:48, Michael Van Canneyt via lazarus ha scritto:


  Is that switch
also available for startlazarus? 
So it can be specified inside the desktop file for the GUI menu?


Like this: 
Exec=/home/bosse/devtools/lazarus/2.2.4/startlazarus
PP=$HOME/bin/ppcarm 
--pcp=/home/bosse/.lazarus_2.2.4 %f 
  
  
  Since in the config files in  home/bosse/.lazarus_2.2.4 there is
  already a compiler 
  specified, it would be useless to be able to specify it again. 

In my experience lazarus doesn't always honor the compiler
  settings in the config files.
My Mac supports both the aarch64 native architecture and the
  x86_64 architecture (via Rosetta) and you may specify in compiler
  options the target architecture for the applications. But it works
  only for the target application.

You cannot rebuild lazarus for an architecture different from the
  one of your lazarus binary. It will properly compile all the
  required package for the target architecture you specified, but
  when it comes to compiling lazarus itself, instead of calling fpc,
  it will call directly the ppca64 or ppcx64 compiler for the
  current architecture of Lazarus, which of course will reject the
  PP= option!
The only way is to rebuild Lazarus from command line (make clean
  useride ..etc) specifying both OPT="-Paarchwhatever .." and
  PP=ppcwhatever. OPT= makes the makefile scripts happy,
  while PP= force the usage of the good compiler instead of the
  default one.
Just my two cents.
Giuliano

-- 
Do not do to others as you would have them do to you.They might have different tastes.
  

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


Re: [Lazarus] Lazarus make clean fails...

2023-12-03 Thread Giuliano Colla via lazarus
I’m not familiar with your environment, but I’ve never seen a lazarus directory 
which is not named “lazarus”. Therefore I’d cd one step further:
cd ~/devtools/lazarus/2.2.6/lazarus
Sorry for top posting. iPhone does it!
Giuliano

Inviato da iPhone

> Il giorno 2 dic 2023, alle ore 19:03, Bo Berglund via lazarus 
>  ha scritto:
> 
> I have installed Lazarus 2.2.6 from sources on my RPi4B using fpc 3.2.0.
> This works fine.
> 
> Then I compiled fpc 3.2.2 to get to a later version and did a make 
> install/make
> sourceinstall on that version of fpc.
> 
> Then I wanted to rebuild Lazarus with the new fpc so I first tried with a
> Lazarus rebuild from within Lazarus but that failed so I decied to do a clean
> build instead.
> Enter command line and:
> 
> ~/devtools/lazarus/2.2.6 $ make clean
> make: -iVSPTPSOTO: No such file or directory
> Makefile:234: *** The Makefile doesn't support target -, please run fpcmake
> first.  Stop.
> 
> Google does not know about VSPTPSOTO...
> 
> So I did as suggested:
> 
> ~/devtools/lazarus/2.2.6 $ fpcmake
> Processing Makefile.fpc
> Error: Target "linux", package "rtl" not found
> 
> Then I expanded the lazarus sources into a clean directory and tried make 
> clean
> in that but with the same result.
> 
> And concerning the compiler:
> 
> $ which fpc
> /home/bosse/bin/fpc
> 
> $ which ppcarm
> /home/bosse/bin/ppcarm
> 
> $ fpc
> Free Pascal Compiler version 3.2.2 [2023/11/29] for arm
> 
> $ ppcarm
> Free Pascal Compiler version 3.2.2 [2023/11/29] for arm
> 
> What can I do now?
> 
> 
> --
> Bo Berglund
> Developer in Sweden
> 
> --
> ___
> 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


[Lazarus] Help request to Mac users

2023-09-09 Thread Giuliano Colla via lazarus
Recent upgrades of Lazarus have broken the automatic language detection 
on Lazarus.


A solution has been proposed, but it's been tested on a single M1 
platform. It would be helpful if some other Mac user could test it and 
provide feedback.


Patches both for the fixes_3_0 branch and for the main branch are 
available at github issue #40495 



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


Re: [Lazarus] Where is lazarus 3.0 RC2?

2023-09-04 Thread Giuliano Colla via lazarus

Il 04/09/23 18:17, Maxim Ganetsky via lazarus ha scritto:


04.09.2023 19:16, Giuliano Colla via lazarus пишет:
I'd like to test lazarus 3.0 RC2, but I'm unable to locate on github 
the proper branch/tag. Where is it?


The tag has not been created yet.

Branch is `fixes_3_0`.


Thanks a lot. Spasiba.

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


[Lazarus] Where is lazarus 3.0 RC2?

2023-09-04 Thread Giuliano Colla via lazarus
I'd like to test lazarus 3.0 RC2, but I'm unable to locate on github the 
proper branch/tag. Where is it?


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Lazarus trunk version number

2023-06-30 Thread Giuliano Colla via lazarus

  
  
Il 01/07/23 00:49, Maxim Ganetsky via lazarus ha scritto:

2. clDark
  is deprecated on 23.11.2008 with a bunch of other CLX colors. All
  these colors are NOT present in Delphi. Your code emitted warnings
  at least for 10 years!
Just for clarity, CLX is part of Delphi. It is the
  cross-platform component library which has been alive at least up
  to Delphi 7. Why force to modify user code, be it 10 years ago or
  last year, when those colors are just constants which become a
  number in code?  What's the gain?
Giuliano

-- 
Do not do to others as you would have them do to you.They might have different tastes.
  

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


Re: [Lazarus] Lazarus trunk version number

2023-06-30 Thread Giuliano Colla via lazarus


Il 30/06/23 19:40, Mattias Gaertner via lazarus ha scritto:

Michael Van Canneyt via lazarus  wrote:


[...]
Honestly: I'll settle for actually managing to get a release out.

+1000


+1000 me too.



If the brilliant minds which have elaborated a new numbering scheme had 
spent their time in something more productive, such as making life a 
little bit easier to developers, I believe that the Lazarus community 
would have appreciated much more!


For instance, there is the bad habit to "deprecate" without considering 
what happens to developers which must maintain their programs. I found 
it rather frustrating to replace all occurrences of clDark with 
clDkGray, just because clDark had been deprecated, instead of simply 
replacing the definition wit a line in types clDark = clDkGray.


I've been taught that the golden rule to make code reusable is to hide 
the implementation and expose only the feature. Who cares how a color is 
implemented, provided that it shows the same? The same holds true for a 
lot of deprecations, which could be easily hidden without any adverse 
effect.




Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Qt5 IDE fails to build on Linux

2023-06-12 Thread Giuliano Colla via lazarus
Attempting to build latest Lazarus trunk on Linux CentOs7 with Qt5 fails 
with error:


/home/colla/Applicazioni/lazarus_main/lcl/interfaces//qt5/qtobject.inc:44: 
undefined reference to `QGuiApplication_setFallbackSessionManagementEnabled'


It succeeds setting

{$DEFINE QT_NO_SESSIONMANAGER}

in qtdefines.inc

My cbindings outdated or bug?

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Hi-DPI tweak of components

2023-06-08 Thread Giuliano Colla via lazarus

Il 08/06/23 18:40, Ondrej Pokorny via lazarus ha scritto:

And because it is so much fun, I wrote a completely general program to 
test it.



Well you've shown that it isn't so bad. But there's another detail to 
consider, when resizing: font size. Font size can (and should be) 
specified in typographic points, in order to ensure that text is both 
readable and not too large. i.e. in units which are 1/72". Resizing when 
text size is specified in inches, i.e. in its actual, system 
independent, size, while width and height are specified in pixels i.e. 
in system dependent units is the best way to create the mess which is 
there since the early times of Delphi.


Giuliano


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


Re: [Lazarus] Hi-DPI tweak of components

2023-06-08 Thread Giuliano Colla via lazarus

Il 08/06/23 12:39, Jean SUZINEAU via lazarus ha scritto:


I think you can't use integer value for mm or inches.


Of course you can't. But you can use integer values for hundredth of mm 
(that's the resolution of high quality photo-composition) or for 
thousandth of inch (slightly worse but still acceptable), which in a 
64bit long integer would give enough space to fit a screen much wider 
than the Solar system!


Giuliano


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


Re: [Lazarus] Hi-DPI tweak of components

2023-06-08 Thread Giuliano Colla via lazarus



Il 08/06/23 11:58, Ondrej Pokorny via lazarus ha scritto:

All in all, an over-complicated approach with little gain.


The gain would be that you do not add up rounding errors. We can't have 
fractional pixels, of course, but we may have the exact actual size at 
design/creation time, and for each different DPI the best approximation 
to the actual size. If you switch back and forth between two monitors 
with different DPI the rounding errors remain constant, they don't add up.


Giuliano


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


Re: [Lazarus] Hi-DPI tweak of components

2023-06-08 Thread Giuliano Colla via lazarus

Il 08/06/2023 11:34, Giuliano Colla via lazarus ha scritto:


Il 08/06/2023 08:08, Ondrej Pokorny via lazarus ha scritto:

Check TCustomColorBox how it handles FColorRectWidth as an example 
(it uses a default value and if the user overwrites it, it gets 
scaled in DoAutoAdjustLayout().


I believe that scaling for different DPI has been implemented with a 
shortsighted approach.
IMHO the general approach should have been (or should be if someone is 
willing to face it) to have *two* parameters for width and height: a 
pixel value and a linear value (in mm, inches, whatever).
If the designer or user sets the pixel value, this value is taken and 
used, but the linear value is  calculated.
If the designer or user sets the linear value, the pixel value is 
calculated using the current DPI, and is used to paint the control.
A new DPI will cause all pixel values to be updated from the linear 
values.
I don't know if there are some cases where the pixel value should be 
retained even for a significant DPI change. A FixedPixel boolean or a 
zero value in the linear value might override the resizing.


I understand that this would require a revision of all TControl 
descendants, by exposing the new properties, but I believe it to be 
the only way to make the DPI handling user friendly and mainly 
transparent to the users.


Giuliano



An afterthought. A simpler way (or a first step) could be to keep the 
linear value hidden. This wouldn't require a deep LCL revision, and 
would make fully transparent the DPI handling. The designer sets the 
desired width/height to the current screen, but the linear value is 
stored and used whenever the DPI changes.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Hi-DPI tweak of components

2023-06-08 Thread Giuliano Colla via lazarus

Il 08/06/2023 08:08, Ondrej Pokorny via lazarus ha scritto:

Check TCustomColorBox how it handles FColorRectWidth as an example (it 
uses a default value and if the user overwrites it, it gets scaled in 
DoAutoAdjustLayout().


I believe that scaling for different DPI has been implemented with a 
shortsighted approach.
IMHO the general approach should have been (or should be if someone is 
willing to face it) to have *two* parameters for width and height: a 
pixel value and a linear value (in mm, inches, whatever).
If the designer or user sets the pixel value, this value is taken and 
used, but the linear value is  calculated.
If the designer or user sets the linear value, the pixel value is 
calculated using the current DPI, and is used to paint the control.

A new DPI will cause all pixel values to be updated from the linear values.
I don't know if there are some cases where the pixel value should be 
retained even for a significant DPI change. A FixedPixel boolean or a 
zero value in the linear value might override the resizing.


I understand that this would require a revision of all TControl 
descendants, by exposing the new properties, but I believe it to be the 
only way to make the DPI handling user friendly and mainly transparent 
to the users.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Output directories

2023-06-07 Thread Giuliano Colla via lazarus

Il 07/06/23 11:43, Michael Van Canneyt via lazarus ha scritto:



Hello,

There is a problem when installing Lazarus through the package manager on
Linux, and when you try to install/recompile additional packages:

Error: (lazarus) unable to create package output directory 
"/usr/share/lazarus/2.2.4/components/fpweb/lib/x86_64-linux" of 
package "weblaz 1.0"


I suspect that the IDE tries to create the output directories of 
packages,

but of course it has no write permission in /usr/share.

Should this not be detected and the output put in 
~/.local/share/lazarus/... instead ?


Michael.


There's a number of such bugs.

When you're rebuilding Lazarus with source code in a write protected 
folder, your local copy is created in a local ~/.lazarus folder. 
Everything should be written there and the write protected folder should 
be left  untouched. But whenever a subfolder is needed, there is a check 
that it does exist in the write protected area, even if it will not be 
used, and an error is flagged if the folder doesn't exist and can't be 
created.


It occurred to me with qt ws. Just sudo mkdir the missing directory in 
the lazarus tree, the folder is left empty, but the IDE compiles properly.


Giuliano

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


[Lazarus] Build IDE "forgets" Target CPU

2023-05-17 Thread Giuliano Colla via lazarus
Recent Macs support both X86_64 and aarm64 binaries, and if you wish to 
compile your app one way or the other you may just select it in Project 
Options. You may be forced to select x86_64 if you wish to use Qt5 
because Qt provides Qt5 only for x86. But if you wish to build the IDE 
for a different Target CPU than the one currently used, build will fail.


It will build all the units required for the selected target CPU, until 
it comes to build the IDE itself. It tries to compile it not using fpc, 
but the ppcxx of the current IDE configuration.


The error shown is:

Error: (11059) Unsupported target architecture -Px86_64, invoke the "fpc" 
compiler driver instead.
Error: /usr/local/bin/ppca64 returned an error exitcode

You succeed in building if you invoke make with an extra PP= such as:

make useride LCL_PLATFORM=cocoa OPT="-Px86_64" PP=ppcx64

Can this be fixed, following the suggestion of the error message, 
invoking fpc instead?


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


[Lazarus] Macro not defined: "Target_OS".

2023-05-16 Thread Giuliano Colla via lazarus

When launching Lazarus from console I see a number of warnings like this:

Warning: (lazarus) Macro not defined: "Target_OS".

It's there since the dawn of times (from Lazarus 1.8 up to the latest 
Lazarus trunk).


Is it something to worry about?

Giuliano

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


Re: [Lazarus] Cannot use bookmarks in code window - why?

2023-04-24 Thread Giuliano Colla via lazarus

Il 23/04/23 20:28, Bo Berglund via lazarus ha scritto:


Thanks, that worked fine!

Any timetable for Lazarus 2.4.0 release?



If you are impatient, you can get (via fpcupdeluxe or via git 
repository) the trunk version of Lazarus, where the problem has been 
fixed, and you'll get the popup menu you were used to!


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


Re: [Lazarus] Is there a setting to include debug symbols when starting from Lazarus only?

2023-04-19 Thread Giuliano Colla via lazarus

Il 19/04/2023 18:34, Bo Berglund via lazarus ha scritto:


Result:
When I use Release the symbols are not added and when using Debug, then the
symbols are added*and*  the executable name is changed to originalname.dbg.
This is of course on Linux, what happens on Windows I don't know.
originalname.exe.dbg would not work of course...


No, you have misunderstood. The executable name is unchanged. 
Originalname.dbg is *added*. It contains only the debug symbols. If you 
check you'll see that both originalname and originalname.dbg have 
exactly the same timestamp.


You have an option in Project->Options->Debugging, named "Use external 
debug symbols file".
If checked you get two files: originalname and originalname.dbg. If you 
uncheck it you get only originalname, but much larger.


With the external debug symbols file you may, if you want, deploy the 
debug version by releasing just originalname. It will be larger and less 
optimized than a release version, but it will be identical to the one 
you have debugged. The choice is yours.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)

2023-04-19 Thread Giuliano Colla via lazarus

Il 19/04/2023 18:24, Bo Berglund via lazarus ha scritto:


On Mon, 17 Apr 2023 10:32:51 +0200, Mattias Gaertner via lazarus
 wrote:


On Mon, 17 Apr 2023 10:11:28 +0200
Giuliano Colla via lazarus  wrote:


Il 17/04/2023 08:15, Bo Berglund via lazarus ha scritto:


You never stop learning!

Another thing I have learned with experience, is that sometimes the
cleanup isn't perfect and leaves some dangling ppu which creates a
problem like the one you had. It occurred to me when attempting to
rebuild Lazarus, and I was getting an unexpected "undefined
reference".

Can happen when some unit is moved to another package.


I was trying to build a normal IDE, so I tried to build a
"debug IDE" instead. With different compilation flags it was forced
to rebuild everything, and it worked fine. Then I tried again a
"normal IDE", and this time it went OK.

That's why there is "Clean all" radiobutton on the configure build
lazarus dialog. It building fails, try that.

  

Please can you describe where exactly I can find this on Lazarus 2.2.6?

I don't know where I find "Configure build", is it a project option or a global
settings (Below menu Project or Tools)?

If I look at the Run menu I see very far down "Configure Build+Run File...", but
that does not sound like what you are discussing, right?




It is under Tools. The last two line are about rebuilding Lazarus and 
changing the build options (different widgetset, different modes, etc.)
The Run menu contains just options for the current project. No relation 
with rebuilding Lazarus.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)

2023-04-18 Thread Giuliano Colla via lazarus

Il 18/04/2023 12:33, Mattias Gaertner ha scritto:


Tools / Configure Build Lazarus / page Build / groupbox Clean up /
Clean all

https://wiki.lazarus.freepascal.org/IDE_Window:_Configure_Build_Lazarus#Buttons

Mattias


I've found why the radio buttons aren't visible anymore in my setup. My 
installation is standard for Linux: lazarus in /usr/lib64 owned by root, 
build occurs in my local .lazarus folder. But there's some mix-up 
between source directory (read-only) and target directory (writable)

In buildlazdialog.pas you find:

procedure TConfigureBuildLazarusDlg.ShowHideCleanup(aShow: Boolean); 
// When target directory is read-only, hide Radiobuttons and show a 
single checkbox. begin CleanAutoRadioButton.Visible:=aShow; 
CleanCommonRadioButton.Visible:=aShow; 
CleanAllRadioButton.Visible:=aShow; CleanOnceCheckBox.Visible:=aShow; 
CleanCommonCheckBox.Visible:=not aShow; end;


I just changed the ownership of /usr/lib64/lazarus, from root to me and 
the radiobuttons do show.


The same mix-up occurs with the QT5 directory. When attempting to build 
a QT5 version it complains that it cannot create the QT5 directory in 
the /usr/lib64/etc directory, when actually it needs only to build in 
the local .lazarus directory.

I'll investigate further.

Giuliano
--

Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)

2023-04-18 Thread Giuliano Colla via lazarus

Il 17/04/2023 10:32, Mattias Gaertner via lazarus ha scritto:


That's why there is "Clean all" radiobutton on the configure build
lazarus dialog. It building fails, try that.
I did look in vain for that radiobutton. The only one available (Lazarus 
2.2.6) is "clean common files":




Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Strange linker messages "undefined reference" when building on RPi4 - CompileLog_2022-04-15.log (0/1)

2023-04-17 Thread Giuliano Colla via lazarus

Il 17/04/2023 08:15, Bo Berglund via lazarus ha scritto:


You never stop learning!


Another thing I have learned with experience, is that sometimes the 
cleanup isn't perfect and leaves some dangling ppu which creates a 
problem like the one you had. It occurred to me when attempting to 
rebuild Lazarus, and I was getting an unexpected "undefined reference". 
I was trying to build a normal IDE, so I tried to build a "debug IDE" 
instead. With different compilation flags it was forced to rebuild 
everything, and it worked fine. Then I tried again a "normal IDE", and 
this time it went OK.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Lazarus 2.2.6/Fpc 3.2.2 Win-32 - Cannot add desktops, why?

2023-04-10 Thread Giuliano Colla via lazarus

Il 10/04/2023 16:53, Bo Berglund via lazarus ha scritto:


I was following my notes on how to configure a newly installed Lazauus to my
liking when I stumbled across an item I have not seen AFAICT:

Normally I configure different desktops to use for different types of
application, for example the one for standard GUI applications is different from
what I use for console type programs.

So I installed the 32 bit Lazarus on a Windows 10 x64 workstation using
fpcupdeluxe (the reason for 32 bit is because I need that to be able to
cross-compile for Raspberry Pi arm devices).
I also installed the cross-compiler for arm-linux (the cross to Win64 was
already installed when I installed the main Lazarus-32).


When I now headed towards the desktop dialog (Tools/Desktops) it does not have
an option to add new desktops! The only functions available on the "Manage
Desktops" dialog are:

- Save active desktop as..
- Set active (disabled)
- Toggle as debug desktop
- Rename
- Delete (disabled)
- Move up (disabled)
- Move down
- Auto save active desktop checkbox is checked by default.

I am used to getting into a dialog where one can add new desktops and name them
whatever, then set one active and configure the desktop as needed and save it,
then move to the next desktop and repeat.

But this is not possible here! What am I missing?




Just use "save active desktop as" This will create a new entry named as 
you like. You may do it as many times as you want, and then you may edit 
each one to your taste.


Giuliano


--

Do not do to others as you would have them do to you.They might have different 
tastes.

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


[Lazarus] IDE rebuild failure on MAC OS

2023-04-05 Thread Giuliano Colla via lazarus

I have updated Lazarus to 2.2.6 on Mac OS (Apple Silicon M1 processor).

As I'm using some extra packages, I needed to rebuild the IDE in order 
to install those packages. But to my dismay, building of the normal IDE, 
without touching the original settings, failed with a rather unexpected 
error:


(9022) Compiling resource 
/Applications/Lazarus/units/x86_64-darwin/cocoa/lazarus.or
Warning: (9011) Object lazaruspackageintf.o not found, Linking may fail !
(9015) Linking ../lazarus
ld: file not found: lazaruspackageintf.o
make[2]: *** [lazarus] Error 1
make[1]: *** [idepkg] Error 2
make: *** [idepkg] Error 2
An error occurred while linking

After some fiddling trying to make it find lazaruspackageintf, I tried 
to rebuild in a different setup, i.e. debug IDE. It worked just fine. 
Then I tried to build again as normal IDE, and this time it did work. 
Notice that I didn't touch neither the settings for normal IDE, nor 
those for the debug IDE. Some invisible parameter which has been reset 
switching from normal to debug and back? A strange hiccup of Mac?


There is another strange issue. While fighting with the IDE rebuild I 
had tampered with the Project Options of the project which was open, 
because I had seen in the past that sometimes the current Project 
Options have an influence on the IDE build. I had deleted the dependency 
from LCL, which made impossible to compile, of course. But when trying 
to add the dependency, I discovered that I was unable to enter upper 
case characters. My upper case LCL was entered as a lower case lcl. The 
only way has been to add an LCL file to the project, and confirm that I 
wanted all the package and not just one file. Any idea of how to solve 
that issue?


Giuliano

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


Re: [Lazarus] Simple ipc server fatal error on start - 0xc000007b

2023-04-01 Thread Giuliano Colla via lazarus

Il 01/04/2023 14:50, Jean SUZINEAU via lazarus ha scritto:

You can uses pipes too, basically just two files no need of 
networking, one for reading (delphi to freepascal), one for 
writing(freepascal to delphi).


I made last year a small app to communicate with Audacity 
(https://www.audacityteam.org/) using a specific plugin 
(https://manual.audacityteam.org/man/scripting.html).


You can find there the unit/class which manages the communication:
https://github.com/jsuzineau/pascal_o_r_mapping/blob/TjsDataContexte/tools/jsAudacity/uAudacity.pas 



In my case I used pipes already created by Audacity.
For your problem I think it would be more appropriate to use FpPipe 
(although I personnaly never used it):


https://www.freepascal.org/docs-html/rtl/baseunix/fppipe.html

I think you will find something similar on Delphi 7 side.




I'm afraid that Jean Suzineau is right, except for the reference to 
FpPipe which is Unix specific.


Named pipes (or FIFO's) may be the simplest solution, in place of a 
bloated Indi10, useful if you need something quite complex, such as a 
securized web server , or of the tcp/ip sockets of NetChat.
Just a file you write on one side and read the on the other side. Two 
named pipes for bidirectional communication, if necessary.


You'll find a lot of examples just looking for Delphi pipes or Delphi 
named pipes on the web.

https://github.com/Poznamenany/Named_Pipes_in_Delphi
is just one for Delphi side (but it's ok also for Lazarus).

You may find useful the discussion here, to avoid common pitfalls:
https://forum.lazarus.freepascal.org/index.php?topic=44251.0

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Simple ipc server fatal error on start - 0xc000007b

2023-04-01 Thread Giuliano Colla via lazarus

Il 01/04/2023 10:53, Bo Berglund via lazarus ha scritto:


And I can use Indy10 sockets rather than the now since long deprecated
TTcpClient and TTcpServer components.

I guess I will save myself a lot of time doing this...
If I were you I'd take ten minutes to give it a try. Just compile, 
launch two instances, and type in one and see the message in the other. 
Then decide which way to go. AFAIK all the Internet servers and clients 
around the world are using tcp/ip and none of them Indi10
If Windows wants to connect reliably to Internet must provide a good 
implementation of the tcp/ip protocol, which is just exploited by the 
TTcpClient and TTcpServer components.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Simple ipc server fatal error on start - 0xc000007b

2023-04-01 Thread Giuliano Colla via lazarus

Il 01/04/2023 09:37, Bo Berglund via lazarus ha scritto:


Where are the "internet examples of Delphi 7" located?
Inside the Delphi7 installation or where? I can't find any.

By the name you write it looks to me (without having found the example) that it
is a*network*  application using TCP/IP sockets or the like.
I know this is a possibility but seems to be problematic since it implies that
the communication is via the LAN. What about situations when there is no network
connection?

The IPC as described seems to use internal messaging channels on the Windows
computer it runs on and not the network...


-- Bo Berglund Developer in Sweden


I have found it on the Kylix installation. But I did a quick search of 
Delphi NetChat and I found it immediately. It should be in the Demos 
folder. Demos->Internet->NetChat. You may also download it from 
Internet, where a Brazilian guy has made it available:

http://simbolussi.ddns.com.br:8088/TESTE%20DELPHI%207/Delphi7/Delphi7/Demos/Internet/NetChat/

Yes it is a network app, but it can be used locally, just by connecting 
both sides via localhost (i.e. 127.0.0.1), the loopback interface, which 
can be used whenever you want to connect TCP/IP server-client on the 
same machine. It's fundamental to test network apps locally before 
deploying it.
Just search for "windows localhost", and you'll get the Microsoft 
documentation about it:

https://learn.microsoft.com/en-us/windows/iot-core/develop-your-app/loopback
and other contributions which may be useful.

That way you'll be using tools which are widely used and tested, and not 
very special ones which may fail outside a particular environment.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Simple ipc server fatal error on start - 0xc000007b

2023-03-31 Thread Giuliano Colla via lazarus
Among the internet examples of Delphi 7 you should find a small app named 
netchat, which provides a basic IPC. It’s quite simple and bullet-proof. I’ve 
converted to Lazarus on Linux, and used as a base for my needs of IPC. But 
converting on the same Windows environment should be very simple, just using 
the Lazarus facilities. You may test it just as it is, and then adapt it to 
your needs. 
Giuliano 

Inviato da iPhone

> Il giorno 31 mar 2023, alle ore 18:39, Bo Berglund via lazarus 
>  ha scritto:
> 
> I am investigating the possibilities to use IPC between a Lazarus and a 
> Delphi7
> application running on Windows. I was discussing this on the Lazarus forum 
> where
> I got a tip to use SimpleIPC, which apparently is delivered with the Fpc
> compiler itself.
> 
> The tip was given in this post:
> https://forum.lazarus.freepascal.org/index.php/topic,62867.msg475663.html#msg475663
> 
> In that post is a link to a GitHub project which simplifies ipc usage by
> creating a dll packaging everything needed so that the dll could be used from
> other applications developed in other languages too. Sounds good to me.
> Here is the GitHub project url:
> https://github.com/z505/SimpleIPC-lib
> 
> So I downloaded this and using Lazarus 2.2.4 and Fpc 3.2.2 on Windows 10 x64 I
> did this:
> 1) opened the dll project and compiled the dll itself.
> 2) Opened the demo-lazarus\ipcclient project and compiled it
> 3) Opened the demo-lazarus\ipcserver project and compiled it
> 
> So now I could start the ipcclient app and it shows its form with a button to
> send data to the server. When I used it there was an error message about "not
> finding the server". To be expected, since I had not started the server...
> 
> So I next tried to start the server app, but it immediately shows an error box
> with the text:
> ---
> Application error
> The application was unable to start correctly (0xc07b).
> Click OK to close the application.
>   [OK]
> ---
> 
> I have tried various things like changing target for the dll and both
> applications to win32 (I have the cross for Win32 installed), but the exact 
> same
> happens.
> 
> And I have no idea whatsoever on where to look for a reason for this to 
> happen.
> 
> I have even put a breakpoint into the server code at the earliest point I 
> could
> find and started it from Lazarus, but get the same error dialog and no
> breakpoint reached...
> 
> I tried reading https://wiki.freepascal.org/SimpleIPC but got no idea from 
> that
> either...
> 
> What to do now?
> I am not clever enough to figure out if there is some error in the GitHub
> project. Not used to windows communications at all.
> 
> 
> What I want to do is to create an ipc link to a Delphi7 server app from a
> Lazarus/fpc client app to use the D7 app to read a hardware device on command
> and send the data to the Lazarus app.
> It is not possible to compile the D7 app on Lazarus because there is a device
> manufacturer's obj file involved and it is apparently of the wrong format for
> Lazarus/Fpc to use. It can be linked to in Delphi7 but not in Lazarus/Fpc.
> 
> Hence the D7<=ipc=>Lazarus IPC communication...
> 
> I really do hope this can be fixed so I can get the ipc comm line to the D7
> interfacing app working!
> 
> 
> -- 
> Bo Berglund
> Developer in Sweden
> 
> -- 
> ___
> 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] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Giuliano Colla via lazarus

Il 27/03/23 09:46, Luca Olivetti via lazarus ha scritto:

Hello,

I'd like to show a splash screen with an animation during a lengthy 
operation.
I cannot rely on a timer to show the animation since the message loop 
isn't running, so I'm using a thread to directly paint over the form, 
i.e.:



WaitForm.Show;
Application.ProcessMessages;

...

procedure TWaitForm.FormShow(Sender: TObject);
begin
  FUpdateThread:=TUpdateThread.Create(self);
end;

...

procedure TUpdateThread.Execute;
begin
  while not Terminated do
  begin
    FWaitForm.ShowProgress;
    Sleep(30);
  end;
end;

...

procedure TWaitForm.ShowProgress;
begin
  PaintBox1.Canvas.Clear;
  //WaitAnimation is an image list
  WaitAnimation.Draw(PaintBox1.Canvas,0,0,FImageIndex);
  FImageIndex:=FImageIndex+1;
  if FImageIndex>=WaitAnimation.Count then
    FImageIndex:=0;
end;


This works wonderfully under windows (which is my intended target, so 
no problem here), but under Linux it doesn't work (tested with gtk2, 
gtk3 and qt5). In fact, even the "Show; Application.ProcessMessages" 
is erratic, sometimes it shows the form, sometimes it doesn't.


Lazarus 2.2.6/fpc 3.2.2

Any idea?

Bye



Yes, it's a known issue.

The difference between Windows and Unix is that Windows generates 
frequently useless mouse events to all windows, which wake up the main 
thread of Delphi/Lazarus, while Unix/X11/Wayland is well behaved and 
sends a mouse event only to the appropriate window, and only if there's 
been a physical mouse event to send.


You may verify if such is the case by moving the mouse over your splash 
screen window. You move the mouse and the image is updated, you stop 
moving and the image freezes.


In a similar scenario my solution has been that of an horrible hack. 
It's a hack, but it works. I've put in a corner of my window a label of 
just one character, and, with a frequent timer (200 ms in my case) I 
update the caption. I'm using a sequence of "-" "\" " |" "/" "-" to 
display a rotating bar. Usually users do not even notice, but if they do 
it's harmless. This way I trigger an event which will force a paint 
operation, and all pending graphic updates are performed.


Maybe this works also for you. You should just tune the timer to the 
speed of your animation.


Hope that it helps,

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Lazarus Release 2.2.6

2023-03-26 Thread Giuliano Colla via lazarus

Il 26/03/2023 14:42, Bo Berglund via lazarus ha scritto:


Thanks for your input!
On Windows I have been using the installer for Lazarus which can be downloaded
from SourceForge and this isolates the Lazarus and Fpc into its own "sandbox"
such that these probnlems do not appear.

My real problems are occurring on Linux...
Since there is no good installers to find I have created my own shellscript to
install from sources (Lazarus and Fpc separately). And on Linux I do not want
anything done as root and installed outside of $HOME so my script makes sure
everything is located within $HOME.
But there I have the interference problem between the Fpc versions...


Regarding fpcupdeluxe, I have now tried it on Windows and after a bit of
trial-and-error I have got the knack of how it works for a couple of Lazarus
installs of different versions etc.
Seems that the result is kept inside an isolated sandbox more or less like the
SF install exe does for Lazarus and Fpc.

But the advantage here is that with fpcupdeluxe one can modify the installation
after it has been installed, which is very good.

I do not yet understand how to get cross-compile installed properly though...
(I would like to be able to build for RaspberryPi4 (and 3) on my Windows PC if
possible. RPi uses ARM cpu of course...

Anyway, a question for you:

Is it possible to use fpcupdeluxe on the following Linux platforms and if so how
is it done there?
- Ubuntu 20.04.6 LTS (using AMD CPU)
- Ubuntu 22.04.2 LTS (using AMD CPU)
- RaspberryPi4 with Raspbian Buster and Bullseye (ARM CPU)
   I can attach to these RPi devices using VNC and PuTTY

And thanks for bringing up fpcupdeluxe, I had a look 3-4 years back and did not
then really get the advantage.

Finally:

fpcupdeluxe shows as candidates for install Lazarus 2.3.0 and Fpc 3.2.4 both of
which releases seem not to exist yet...

What is the deal here?


-- Bo Berglund Developer in Sweden
fpcupdeluxe does exactly what you're looking for also in Linux/Unix 
environment. It keeps both Lazarus and fpc confined in the folder you 
select, which can of course be in your $HOME directory. The trick for 
Lazarus is quite simple, the icon it puts in your desktop just invokes 
the startlazarus in the folder, with pcp= a configuration file within 
the same folder. The trick for fpc is a bit a hack. As Lazarus requires 
that the name begins with fpc, it passes to Lazarus as fpc compiler an 
fpc.sh script, which sets the fpc configuration and the fpc executable 
in the folder. You'll see it in Tools->Options->Environment.


On Linux I never tried to install in Ubuntu, but I did install in many 
CentOs, Fedora, and Avahi environments. No reason why it should not work 
with Ubuntu. On Raspberry I did install without any problem. Just 
downloaded the appropriate tpcupdeluxe arm version. I installed also on 
the newest Mac with Apple Silicon M1 processor. As it doesn't use 
neither rpm nor apt-get, but just gets the files from svn or git 
repository, the target environment is irrelevant, provided the processor 
architecture is supported.


For cross-compiling you will need to pick up the appropriate options in 
the "cross" tab, after setting the basic options in the "Basic" one. I 
have done it a couple of years ago, to compile and test under Linux and 
then execute on Raspberry, but I don't remember the details. As far as I 
remember it was quite straightforward, with just some Raspberry 
libraries which had to be copied to Linux, in order to link them properly.


The reason for it to propose Lazarus 2.3.0 and Fpc 3.2.4 is that 
fpcupdeluxe doesn't care only about releases, it makes reference to git 
branches and tags. So if you select a released version, or the "Stable" 
one (which is the last release) you get a copy of a stable situation. If 
you select a "work in progress" release, you get the latest snapshot of 
that release. "Trunk" is the most recent one, for both, "Stable"


Giuliano



--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Lazarus Release 2.2.6

2023-03-16 Thread Giuliano Colla via lazarus

Il 16/03/2023 18:46, Bo Berglund via lazarus ha scritto:


I have a number of Lazarus releases installed where 3.0.4 is the fpc used.
So they all used the same and there was no problem.
(This is on Ubuntu Linux 22.04 btw and I install everything from sources)


I have a similar problem, needing to give assistance to customers with 
different Lazarus versions.
It's very annoying to maintain a program developed with an older 
version, and to make a minor correction, to be obliged to update a lot 
of other things which have been deprecated in the time between.
My solution has been to use fpcupdeluxe. It provides a fully self 
contained set of Lazarus + fpc, which doesn't clash with anything else. 
Both Lazarus config and all of fpc config are contained in a specific 
folder, Lazarus launch icons on the screen are named from the folder you 
decided to use for that version, and you can have as many as you have 
space on your disk. Currently I have 7 different Lazarus/fpc sets to 
select from, from a Lazarus 1.6 to a Lazarus 2.2.6, plus a couple of 
Lazarus Trunk (one using trunk fpc, the other using stable fpc). Give it 
a try. It will not disturb anything of your current installations.

It takes a minimum to understand how it works, but then it's a paradise.

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux

2023-02-09 Thread Giuliano Colla via lazarus

Il 09/02/23 14:37, Bo Berglund via lazarus ha scritto:


On Thu, 9 Feb 2023 11:50:25 +0100, John Landmesser via lazarus
 wrote:


   git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus


So I have found that this is a path forward:

FPCTAG=release_3_2_2
FPCVER=3.2.2
LAZTAG=lazarus_2_2_4
LAZVER=2.2.4

...

cd $HOME/devel/fpc
wget
https://gitlab.com/freepascal.org/fpc/source/-/archive/$FPCTAG/source-$FPCTAG.tar.gz
tar -xvf source-$FPCTAG.tar.gz
mv source-$FPCTAG $FPCVER
rm source-$FPCTAG.tar.gz

cd $HOME/devel/lazarus
wget
https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/$LAZTAG/lazarus-$LAZTAG.tar.gz
tar xvf lazarus-$LAZTAG.tar.gz
mv lazarus-$LAZTAG 2.2.4
rm lazarus-$LAZTAG.tar.gz

This brings over just the sourcefiles for fpc and lazarus into the correct
directories with no extra stuff.

Then the remainder of my install script should work (not yet done though).




The best way I've found to solve this sort of problems is to use 
fpcupdeluxe, or at least the fpcupdeluxe technique. It just builds a 
fully isolated tree for each different Lazarus/fpc combinations you 
want. The trick for Lazarus is very simple, just a startup script 
pointing to the local Lazarus executable and configuration. For fpc, the 
fpc executable is just a fpc.sh which starts the local fpc with the 
local fpc config. On Linux I have two Lazarus 1.8 (one gtk2, the other 
Qt) with their fpc to support old applications, one Lazarus stable+fixes 
and one Lazarus trunk. On Mac Os the same. Give it a try.


Giuliano

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


Re: [Lazarus] ***SPAM*** Re: ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura

2022-12-05 Thread Giuliano Colla via lazarus



Il 28/11/2022 08:18, zeljko ha scritto:



On 27. 11. 2022. 23:47, Giuliano Colla wrote:

Il 26/11/22 09:20, zeljko ha scritto:




On 25. 11. 2022. 23:01, Giuliano Colla wrote:

Il 25/11/2022 21:58, zeljko ha scritto:




On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote:
I tried to install QT5 version 5.6.2 on my Mac, following the 
wiki instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails 
with this error message:


  ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are 
for arm64 and not x86_64-darwin as expected.


Any hint?


Never tried build on arm64 (have intel macbook pro). Can you try 
with Qt6 ?


z.
I didn't find a place from where download open source Qt6. Do you 
have a reliable link?


https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg 





In the meantime I'll give a try with 5.6.11.

However all Lazarus is compiled for x86_64 architecture, and runs 
in arm64 architecture via Rosetta. Intel version of Qt would be 
just fine, if qmake didn't decide to make for the arm64 
architecture. Any idea of how to tell qmake the right architecture?


You have to read qmake manual:
https://doc.qt.io/qt-6/qmake-manual.html

zeljko


Two issues:

First issue is that it appears that you can't call qmake from command 
line.


Either there's a bug somewhere on the Mac Ventura, or I'm missing 
some detail. I tried to build the Qt5Pas library by submitting 
Qt5Pas.pro to Qt Designer. It generated correct x86_64 objects, and 
the generated framework contains a:


Qt5Pas: Mach-O 64-bit dynamically linked shared library x86_64

Just to understand what was going on, I then tried again with the 
command line options, passing qmake exactly the same parameters which 
Qt Designer used, and the result was the same error as before, with 
the tmp folder populated with arm64 object files. It would appear 
that qmake ignores the x86_64 switch when called from command line. 
If this is confirmed it would be good to update the wiki page.


Second issue.

Lazarus does not build with Qt. I have set the appropriate symlink in 
the /Library/Frameworks folder, but build of Lazarus fails with the 
error message:


ld: framework not found Qt5Pas

I have added /Library/Frameworks to the compiler paths 
(-FI/Library/Frameworks). Should I tell something to the linker too?



1. I had problem on intel mac when installed qt6.2 (qt5.15 was already 
installed) , but make clean and removing .qmake_stash and .qcmake_xx 
files manually from cbindings directory helped me a lot. So maybe you 
should remove such files and then start qmake-6 again (for arm).


2.On newer macs Library/Frameworks is not in path by default, I've 
found that symlinking Qt5Pas to Library/Frameworks and 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks 
fixed problem for make bigide.


3.You should add "-k -F/Library/Frameworks" to the configure "Build 
Lazarus" dialog if you want to rebuild lazarus for Qt5, or for your 
projects in Project Options check "Pass options with linker with "k" 
" -F/Library/Frameworks and then it should work



zeljko
Following your guidelines I've been able to build a number of 
Lazarus-Qt5 with different Lazarus versions (2.0.12 - 2.2.4 -2.2.5) but 
the results are disappointing. While all of them work perfectly with 
cocoa WS, Qt5 rises a number of weird issues.
Editor window font treated wrongly in 2.0.12 and 2.2.4 (the font 
displayed is different from the one selected, with font gliphs and font 
spacing not matching), and in all versions weird behaviour of main title 
bar and drop down menus.
The title bar shows the menu entries only if focus is in the main 
Lazarus window, and they disappear if focus is on any other window, and 
the menus are scrambled. Lazarus ->preferences opens "Configure build 
Lazarus", the last line of the submenus is missing, some entries are 
translated, some are not. Most keyboard entries aren't recognized, etc.
Apparently the interaction between Qt bindings and Rosetta, plus a Qt 
version not well supported by Ventura makes a mess.


I've reached the conclusion that the best approach would be to switch to 
a native arm64 build and use Qt6 which is the one supported with M1 
processor. I've rebuilt Lazarus 2.2.4-cocoa in arm64 and everything 
works fine. I've seen in the forum that you're testing Qt6. If you could 
let me have what is required, I could integrate your tests with my test 
on arm64 architecture. Would it be possible?


Thank you,

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] How to list available serial orts on Ubuuntu?

2022-11-29 Thread Giuliano Colla via lazarus

Il 29/11/2022 11:52, wkitty42--- via lazarus ha scritto:

would you believe you asked almost this very same question back in 
2015, 2018, 2020, and here again in 2022 :)

:-):-):-)

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] How to list available serial orts on Ubuuntu?

2022-11-28 Thread Giuliano Colla via lazarus
Inviato da iPhone

> Il giorno 28 nov 2022, alle ore 17:00, Bo Berglund via lazarus 
>  ha scritto:
> 
> On Mon, 28 Nov 2022 14:48:20 +0100, Giuliano Colla via lazarus
>  wrote:
> 
>> /dev/tty* is pretty much useless. It's there for historical reasons. 
>> /dev/ttyS* is the one for actual serial adapters, and, unless you 
>> override with a command line parameter on boot, it is limited to 0..3 in 
>> modern kernels.
>> 
> Here is what I get on Ubuntu 20.04.5 LTS:
> 
> $ ll /dev/ttyS*
> crw-rw 1 root dialout 4, 64 2022-11-26 08:47 /dev/ttyS0
> crw-rw 1 root dialout 4, 65 2022-11-26 08:47 /dev/ttyS1
> crw-rw 1 root dialout 4, 74 2022-11-26 08:47 /dev/ttyS10
> crw-rw 1 root dialout 4, 75 2022-11-26 08:47 /dev/ttyS11
> crw-rw 1 root dialout 4, 76 2022-11-26 08:47 /dev/ttyS12
> crw-rw 1 root dialout 4, 77 2022-11-26 08:47 /dev/ttyS13
> crw-rw 1 root dialout 4, 78 2022-11-26 08:47 /dev/ttyS14
> crw-rw 1 root dialout 4, 79 2022-11-26 08:47 /dev/ttyS15
> crw-rw 1 root dialout 4, 80 2022-11-26 08:47 /dev/ttyS16
> crw-rw 1 root dialout 4, 81 2022-11-26 08:47 /dev/ttyS17
> crw-rw 1 root dialout 4, 82 2022-11-26 08:47 /dev/ttyS18
> crw-rw 1 root dialout 4, 83 2022-11-26 08:47 /dev/ttyS19
> crw-rw 1 root dialout 4, 66 2022-11-26 08:47 /dev/ttyS2
> crw-rw 1 root dialout 4, 84 2022-11-26 08:47 /dev/ttyS20
> crw-rw 1 root dialout 4, 85 2022-11-26 08:47 /dev/ttyS21
> crw-rw 1 root dialout 4, 86 2022-11-26 08:47 /dev/ttyS22
> crw-rw 1 root dialout 4, 87 2022-11-26 08:47 /dev/ttyS23
> crw-rw 1 root dialout 4, 88 2022-11-26 08:47 /dev/ttyS24
> crw-rw 1 root dialout 4, 89 2022-11-26 08:47 /dev/ttyS25
> crw-rw 1 root dialout 4, 90 2022-11-26 08:47 /dev/ttyS26
> crw-rw 1 root dialout 4, 91 2022-11-26 08:47 /dev/ttyS27
> crw-rw 1 root dialout 4, 92 2022-11-26 08:47 /dev/ttyS28
> crw-rw 1 root dialout 4, 93 2022-11-26 08:47 /dev/ttyS29
> crw-rw 1 root dialout 4, 67 2022-11-26 08:47 /dev/ttyS3
> crw-rw 1 root dialout 4, 94 2022-11-26 08:47 /dev/ttyS30
> crw-rw 1 root dialout 4, 95 2022-11-26 08:47 /dev/ttyS31
> crw-rw 1 root dialout 4, 68 2022-11-26 08:47 /dev/ttyS4
> crw-rw 1 root dialout 4, 69 2022-11-26 08:47 /dev/ttyS5
> crw-rw 1 root dialout 4, 70 2022-11-26 08:47 /dev/ttyS6
> crw-rw 1 root dialout 4, 71 2022-11-26 08:47 /dev/ttyS7
> crw-rw 1 root dialout 4, 72 2022-11-26 08:47 /dev/ttyS8
> crw-rw 1 root dialout 4, 73 2022-11-26 08:47 /dev/ttyS9
> 
> 32 in all...
> 
> -- 
> Bo Berglund
> Developer in Sweden
> 
> -- 
> ___
> lazarus mailing list
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus

Yes they’re there but they’re not enabled. If you search for ttyS* in the boot 
log you’ll see how many are probed for. Typically from ttyS0 to ttyS3. Maybe 
less, it depends on which ones are enabled in BIOS. I know because I had in a 
project an extra PCI board with four more ports, and I had to modify the boot 
parameters to have them properly initialized. Otherways they were completely 
non existing. Just a dummy entry in the /dev folder. 
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to list available serial orts on Ubuuntu?

2022-11-28 Thread Giuliano Colla via lazarus

Il 28/11/22 14:08, Bo Berglund via lazarus ha scritto:

On Mon, 28 Nov 2022 13:31:12 +0100, Giuliano Colla via lazarus
 wrote:


Hope that it helps,

Thanks, it does.

I had thought of this but it looked like an overly complicated way given that
the list of tty* ports using ls -l /dev/tty* on my system comprises no less than
98 hits

So I am now limiting the program to use USB connected serial adapters USB0..USB3
and on start I populate the list of ports by checking that /dev/USBx eists where
x is 0..3.

After all this is the most common use nowadays with USB serial devices in
connection with developing IoT devices.


/dev/tty* is pretty much useless. It's there for historical reasons. 
/dev/ttyS* is the one for actual serial adapters, and, unless you 
override with a command line parameter on boot, it is limited to 0..3 in 
modern kernels.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] ***SPAM*** Re: Install of Qt5 widgetset fails on Mac Ventura

2022-11-27 Thread Giuliano Colla via lazarus

Il 26/11/22 09:20, zeljko ha scritto:




On 25. 11. 2022. 23:01, Giuliano Colla wrote:

Il 25/11/2022 21:58, zeljko ha scritto:




On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote:
I tried to install QT5 version 5.6.2 on my Mac, following the wiki 
instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails 
with this error message:


  ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are for 
arm64 and not x86_64-darwin as expected.


Any hint?


Never tried build on arm64 (have intel macbook pro). Can you try 
with Qt6 ?


z.
I didn't find a place from where download open source Qt6. Do you 
have a reliable link?


https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg 





In the meantime I'll give a try with 5.6.11.

However all Lazarus is compiled for x86_64 architecture, and runs in 
arm64 architecture via Rosetta. Intel version of Qt would be just 
fine, if qmake didn't decide to make for the arm64 architecture. Any 
idea of how to tell qmake the right architecture?


You have to read qmake manual:
https://doc.qt.io/qt-6/qmake-manual.html

zeljko


Two issues:

First issue is that it appears that you can't call qmake from command line.

Either there's a bug somewhere on the Mac Ventura, or I'm missing some 
detail. I tried to build the Qt5Pas library by submitting Qt5Pas.pro to 
Qt Designer. It generated correct x86_64 objects, and the generated 
framework contains a:


Qt5Pas: Mach-O 64-bit dynamically linked shared library x86_64

Just to understand what was going on, I then tried again with the 
command line options, passing qmake exactly the same parameters which Qt 
Designer used, and the result was the same error as before, with the tmp 
folder populated with arm64 object files. It would appear that qmake 
ignores the x86_64 switch when called from command line. If this is 
confirmed it would be good to update the wiki page.


Second issue.

Lazarus does not build with Qt. I have set the appropriate symlink in 
the /Library/Frameworks folder, but build of Lazarus fails with the 
error message:


ld: framework not found Qt5Pas

I have added /Library/Frameworks to the compiler paths 
(-FI/Library/Frameworks). Should I tell something to the linker too?


Thanks for any hint.

Giuliano


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


Re: [Lazarus] Install of Qt5 widgetset fails on Mac Ventura

2022-11-25 Thread Giuliano Colla via lazarus

Il 25/11/2022 21:58, zeljko ha scritto:




On 25. 11. 2022. 19:29, Giuliano Colla via lazarus wrote:
I tried to install QT5 version 5.6.2 on my Mac, following the wiki 
instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails with 
this error message:


  ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are for 
arm64 and not x86_64-darwin as expected.


Any hint?


Never tried build on arm64 (have intel macbook pro). Can you try with 
Qt6 ?


z.
I didn't find a place from where download open source Qt6. Do you have a 
reliable link?


In the meantime I'll give a try with 5.6.11.

However all Lazarus is compiled for x86_64 architecture, and runs in 
arm64 architecture via Rosetta. Intel version of Qt would be just fine, 
if qmake didn't decide to make for the arm64 architecture. Any idea of 
how to tell qmake the right architecture?


Thanks,

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


[Lazarus] Install of Qt5 widgetset fails on Mac Ventura

2022-11-25 Thread Giuliano Colla via lazarus
I tried to install QT5 version 5.6.2 on my Mac, following the wiki 
instructions but installation fails.


qmake executes properly and generates a Makefile, but make fails with 
this error message:


 ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)

make: *** [Qt5Pas.framework/Qt5Pas] Error 1

Actally all the object files generated in the tmp directory are for 
arm64 and not x86_64-darwin as expected.


Any hint?

Thanks.

Giuliano


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


Re: [Lazarus] Debug issue on Mac Ventura

2022-11-12 Thread Giuliano Colla via lazarus

Sorry for the noise. My fault.

I had inadvertently made some operation with Xcode before moving it from 
the Download folder to the Applications folder, so that it was left a 
path pointing to the Download folder. An xcode-select -p told me the 
full story. Now I must find how to have the debugger window not being 
hidden behind the editor window, but I'll sort it out, I hope!


Giuliano


Il 12/11/2022 22:00, Giuliano Colla via lazarus ha scritto:

Hi folks,

I just installed Lazarus (2.2.4) on my new MacBook pro 16", which runs 
the Ventura Os. Everything is ok, except the debugger. I followed the  
instructions on the wiki page, selected the LLDB debugger, but both 
with "Enable Dwarf 3 (-gw3)" and "Enable Dwarf2 with sets" the 
debugger crashes on start.


Is it happening because Ventura Os is quite new and they must still 
iron out some bugs, or I'm missing some point? Any hint is welcome.


Thanks in advance,

Giuliano



--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


[Lazarus] Debug issue on Mac Ventura

2022-11-12 Thread Giuliano Colla via lazarus

Hi folks,

I just installed Lazarus (2.2.4) on my new MacBook pro 16", which runs 
the Ventura Os. Everything is ok, except the debugger. I followed the  
instructions on the wiki page, selected the LLDB debugger, but both with 
"Enable Dwarf 3 (-gw3)" and "Enable Dwarf2 with sets" the debugger 
crashes on start.


Is it happening because Ventura Os is quite new and they must still iron 
out some bugs, or I'm missing some point? Any hint is welcome.


Thanks in advance,

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Help! Lazarus compile fails.

2020-05-09 Thread Giuliano Colla via lazarus

Il 08/05/2020 15:17, Bo Berglund via lazarus ha scritto:


So whatever you do, do*not*  copy the entire config dir to a new name
and use it with the new Lazarus!!!
Instead create a new*empty*  dir to use instead and if needed copy the
editoroptions.xml file and perhaps some other settings file you use
after you have run Lazarus the first time with this pcp target.
Thank you for the hint. Actually I did reuse and old path, and I didn't 
take care to erase everything, just to avoid to reconfigure mi custom 
settings. In the past it did work, but perhaps the jump was too big! 
Maybe that's the reason of my problem. I'll try that.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Help! Lazarus compile fails.

2020-05-08 Thread Giuliano Colla via lazarus

Il 07/05/2020 13:55, Bo Berglund via lazarus ha scritto:

I would not "upgrade" an installation, rather I would install a new
version along side of the existing one.
And I always install fpc/lazarus inside of the home dir instead of
using a global installation.


I just gave a quick information. I do exactly the same as you, and I 
still have all my versions around. But whatever I do,I succeed 
installing  Lazarus, but I fail rebuilding it. I'm afraid my environment 
has become too old, but I'd been glad to learn that is not the case, and 
there's a simpler way, than switching to CentOs 7 or something.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


[Lazarus] Help! Lazarus compile fails.

2020-05-07 Thread Giuliano Colla via lazarus

Hi folks,

I've been stuck for a long time to lazarus 1.8 in order to maintain 
installed applications. Now, before starting a new development I tried 
to upgrade to 2.0.8 but lazarus rebuild to install my custom packages 
fails. Platform is Linux, OS is CentOs 6.


The error reported after the usual warning "did you forget -T" is:

/usr/bin/ld: warning: /home/colla/.lazarus/bin/link.res contains output 
sections; did you forget -T?
/usr/bin/ld: BFD version 2.20.51.0.2-5.48.el6_10.1 20100205 internal 
error, aborting at reloc.c line 443 in bfd_get_reloc_size


/usr/bin/ld: Please report this bug.

Is it because the ld of my distro is too old and I should upgrade it, or 
there is some other reason I fail to see?


Any help is welcome!

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Cross-compile on Windows for Linux Raspbian (Raspberry Pi) - what are the requirements?

2019-11-24 Thread Giuliano Colla via lazarus

Il 24/11/2019 10:08, Bo Berglund via lazarus ha scritto:


Since I never ever created an environment for cross-compiling on
Lazarus I really need a simple to follow byt full description on how
to accomplish the task. Is it even possible for RPi?


I can't help you as far as Windows is concerned, because we learned from 
experience to carefully avoid using Windows for any purpose other than 
testing applications which must run under Windows. But I can provide our 
experience with RPI3.


We installed Lazarus and fpc on Raspberry by using fpcupdeluxe. A few 
troubles if not using the latest version of fpcup, but then everything 
working just fine. We can develop natively; no lockups or whatever 
annoyance.


We did set up a cross environment on Linux (again taking advantage of 
fpcupdeluxe) and after a few struggling with the proper setting for the 
specific ARM flavour, again no troubles.


But as it is an annoyance sending back and forth binaries, we ended up 
with using a git repository in our server, thus sharing sources between 
Linux and RPI, and compiling natively on Linux for preliminary testing, 
and on RPI for final tests and production.


Hope that it helps.

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Cross-compile for Linux strange behaviour with floating point constants

2019-11-24 Thread Giuliano Colla via lazarus

Il 24/11/2019 11:48, Florian Klämpfl via lazarus ha scritto:

What to do with extended constants and their handling in the compiler 
if the target platform has it but the target platform does not support 
it? 


Maybe an AND condition? Use extended type only if both platforms support it?

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Cross-compile for Linux strange behaviour with floating point constants

2019-11-24 Thread Giuliano Colla via lazarus

Il 24/11/2019 01:17, Sven Barth via lazarus ha scritto:

There is the plan to add software floating point support for Extended 
to the compiler for platforms like Win64, but it's not a trivial 
endeavour.


Maybe a silly question, but wouldn't it much simpler to have the 
compiler not use the Extended type on platforms which do not support it?


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Cross-compile for Linux strange behaviour with floating point constants

2019-11-23 Thread Giuliano Colla via lazarus

Il 20/11/2019 19:19, R Smith via lazarus ha scritto:

The problem I've run into is a simple program (made in Lazarus) where 
I use floating point constants. It compiles and runs perfectly on 
Windows, but when cross-compiling for Linux, it fails for specific 
floating point values.


I realise immediately that, if this is a bug, it's probably an FPC bug 
and not Lazarus specific, but the problem is so obviously wrong, I'm 
thinking it cannot possibly be a compiler bug, and since I am 
cross-compiling from Lazarus, figured I would start asking here and 
rule out the obvious things first.


I tested your program by compiling natively in Linux, (Lazarus 1.8 and 
fpc 3.04) and it works just fine. Output is:

Setting Variable: x := 0.5;
FloatToStr( x )    --> 0.5
FloatToStr( 0.5 )  --> 0.5

Setting Variable: x := 0.35;
FloatToStr( x )    --> 0.35
FloatToStr( 0.35 ) --> 0.35
As with the given code Lazarus does pretty much nothing, and all the job 
is done by the fpc compiler,

it must be an fpc cross-compiler specific issue.
Target processor "Default" is the right choice? Maybe a more specific 
choice will tell the cross-compiler to pick up the right choice for fp 
math. Just a guess.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Separation of source code and compiled units

2019-11-02 Thread Giuliano Colla via lazarus

Il 02/11/2019 11:26, Karl-Michael Schindler via lazarus ha scritto:


I am working on the package description for lazarus for MacPorts and are 
struggling with the following: $PREFIX/share/lazarus contains the source code 
as well as the compiled units. In case lazarus is recompiled the directory 
$PREFIX/share/lazarus needs to be writable by all users. At least this is as 
far as I got. Is there a way to keep the source files readonly and place the 
compiled files somewhere separate? How has this been dealt with for linux?


As Sven pointed, in Linux when the $PREFIX/lazarus directory is not 
writable, the compiled files and the executable are put into the user's 
home directory under ~/.lazarus (which is also the default path for user 
configuration files). Executable in ~/.lazarus/bin, compiled units in 
~/.lazarus/lib and ~/.lazarus/units.
That's the default behaviour, but you may also select a different target 
directory for your recompiled copy from Tools->Configure "Build 
Lazarus"->Target directory.


Moreover, startlazarus will check if the lazarus copy in $PREFIX/lazarus 
is newer than your local recompiled lazarus, which happens if you update 
to a new version. In that case it will ask you which one you want to start.


If you make $PREFIX/lazarus writable, you will always have only one copy 
of Lazarus. If you don't, you will have two copies: the original one, 
and your recompiled one.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] how to show hourglass on windows 10 with touch screen?

2019-01-25 Thread Giuliano Colla via lazarus

Il 24/01/2019 20:52, Sven Barth via lazarus ha scritto:
I take it those are resistive touch screens? For those calibration is 
sometimes necessary (especially older ones as you said). For 
capacitive touch panels (be it smartphone or tablet) I haven't found 
the need for that. 



Yes they are. In a harsh industrial environment where dirt and dust are 
unavoidable I'm told they're preferable, also because you may use them 
with gloves or with any kind of stylus you happen to have available.


However we rely on the choices of our industrial PC supplier. It's a 
small Italian manufacturer, but selling all over the world. We 
considered that if US Railways and US Cost Guard come to Italy to buy 
their PC's there must be a reason!


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] how to show hourglass on windows 10 with touch screen?

2019-01-25 Thread Giuliano Colla via lazarus

Il 24/01/2019 21:42, Luca Olivetti via lazarus ha scritto:

@Giuliano, in my case it just manages the UI, but I didn't decide the OS.



That's the reason why, some decades ago, tired of being conditioned by 
technical decisions taken by non-technical people, me and two other guys 
with a similar problem did put together all our savings and started our 
own company.


As we're still kicking and alive, even if rather old, while our 
competitors, handled with just finance in mind, have collapsed since a 
long time, I infer that our decision was not so bad, and I would 
encourage anybody in a similar position to do the same!


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] how to show hourglass on windows 10 with touch screen?

2019-01-24 Thread Giuliano Colla via lazarus

Il 24/01/2019 14:34, Sven Barth via lazarus ha scritto:
No, Windows 10 hides the cursor if no input device (mouse, touchpad) 
besides a touchscreen is detected. Cause in that case a cursor "makes 
no sense". Note: this does not mean I agree with that, only that 
Microsoft thinks that.




Just for the record. In our company we manufacture control systems for 
automatic machines, and we provide a touch-screen industrial computer, 
for easy operator interaction.


In the operating instructions we write:

"If you have difficulties with touch screen, please touch anywhere on 
the screen and watch the cursor position, If it happens not to be 
exactly at the location you touched, please perform the touch screen 
calibration procedure explained below"


Of course we're not using Windows, but rather Linux for a lot of 
reasons, the main one being that we need real-time responsiveness. 
However this one adds one more reason to the list.


To be honest I must admit that industrial grade touch screens have 
dramatically improved during the years, and nowadays the recalibration 
is seldom required, nonetheless...


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] how to show hourglass on windows 10 with touch screen?

2019-01-24 Thread Giuliano Colla via lazarus

Il 23/01/2019 15:49, Luca Olivetti via lazarus ha scritto:


This isn't strictly a lazarus issue, but my google fu is failing me.
It turns out that windows 10 with a touch screen hides the mouse 
cursor, so Screen.Cursor=crHourGlass does nothing. 


Did you try taking advantage of such Windows API's as ClipCursor() and 
SetCursorPos()?
Maybe the cursor is hidden just because of the way the clipping area is 
defined in presence of a touch screen, or because the cursor position is 
set outside the screen coordinates.

Just an idea, I never tried myself.

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Giuliano Colla via lazarus

Il 04/01/2019 14:27, Florian Klämpfl via lazarus ha scritto:

If there had been one (seems Ubuntu and derivatives removed 
hibernation (!!, remember, we are in 2018, not 1998) in 18.04, I 
didn't ask about this feature.


With a good distro I didn't mean Ubuntu, which is the opposite of what a 
software developer needs. It is intended for non-technical end users. It 
makes it very easy to get multimedia software, and very hard to 
administer the system, and tune it to your needs. It's the best choice 
for my wife, but my current choice is CentOs. I don't know what will 
happen in future, with IBM having bought Red Hat (for 34 billion $!!!).


However if you want to enable hibernate in Ubuntu 18.04, you may find 
useful help here:

http://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Auto session store etc.

2019-01-04 Thread Giuliano Colla via lazarus

Il 04/01/2019 12:08, Florian Klämpfl via lazarus ha scritto:

Is there any possibility that lazarus auto stores the current session 
(project file, source files, session information etc.) every  s?


Background is that I am starting another trial to use linux as desktop 
system but within in a few days I have already lost changes because 
lazarus was just killed on shutdown (well, actually I would prefer to 
have linux just hibernating instead of shutdown, but this is another 
story).


Furthermore, is there any option to store the green bars which 
indicate changed sources between different runs of lazarus?


I'm using linux as my desktop (and laptop) system since a very long time.
Basically I never use shutdown, except for a kernel or libc update. I 
just leave my desktop linux running, and either suspend or hibernate my 
laptop.
Depending of the combination of your platform, your distro, and the 
Desktop you're using, you may have available both a "suspend to ram" 
(only if it is a laptop with battery) and a "hibernate" (=suspend to 
disk). But you must pick up a good distro, within the distro select a 
stable and tested version (the latest version is always a lottery), and 
select a good Desktop.
Or you may resort to command-line, which is less subject to Desktop 
environment bugs: depending on distro and kernel you may have available 
/pm-suspend/ and /pm-hibernate/ or /systemctl suspend/ and /systemctl 
hibernate. /If it doesn't wake up properly, you may need to google to 
find out the quirks required for your specific hardware.


As far as Lazarus is concerned, everything relevant is saved each time 
you compile (or attempt to compile) your application. Just hit F9 and 
you're done.
You may easily check and tune your behaviour: if, when trying to quit 
Lazarus, a dialogue shows "Save changes to project ?" it means that 
some changes will be lost by a kill, if it doesn't show, it means that 
all relevant changes have already been saved, and that a kill wouldn't 
do any harm.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Crowdfunding to speed up the development of pas2js in Lazarus Widgetset and fpDebug to FPC

2018-12-21 Thread Giuliano Colla via lazarus

Il 21/12/2018 19:15, Michael Van Canneyt via lazarus ha scritto:

If we decide on using a crowdfunding platform, I would rather go for 
one of the sites mentioned here: 


Given the amount of funds raised and the number of projects involved, I 
believe that a simple grid in an html page, showing the figures of how 
much has been raised, how much is spent in each project, and how much 
remains at the end, updated weekly or monthly or quarterly depending on 
what happens, would be enough.
It would cost an effort significantly smaller than what has costed 
discussing fund raising with a snake oil salesman, and be more effective 
than paying a fee for a crowdfunding platform.
It would stop the complaints about lack of transparency, and everybody 
would be happy.
The last is not true, of course, because whatever you do, there will 
always be someone complaining.
But complaints, and time lost to react to complaints could be 
significantly reduced.


Just my 2 cents

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Lazarus installation problem on Raspberry Pi (localized to Swedish)

2018-11-22 Thread Giuliano Colla via lazarus
Easy way to check:
Launch the script using a different locale. E. G. :
LANG=C ; whatever.sh
If successful it is a matter of localization. 
If it fails, a matter of environment, such as missing binutils, or something of 
this kind. 

Giuliano

Inviato da iPhone

> Il giorno 22 nov 2018, alle ore 12:28, Bo Berglund via lazarus 
>  ha scritto:
> 
> I have been asked to advice on a problem occurring when installing
> FPC/Lazarus on a Raspberry Pi device using a script I have published
> on-line. The script retrieves all sources via svn and also sets up the
> development environment using apt-get.
> It also downloads the seed fpc compiler ver 3.0.0 to use during the
> process.
> 
> The user shows a part of the screen output when the failure happens
> during make bigide inside the source dir:
> 
> (9009) Assembling main
> 
> /home/pi/dev/lazarus/1.6/ide/lazarus.pp(71,5) Hint: (5023) Unit
> “FPCUnitTestRunner” not used in Lazarus
> 
> (9009) Assembling lazarus
> 
> /home/pi/dev/lazarus/1.6/ide/lazarus.pp(150,42) Error: (9008) Can’t
> call the assembler, error -1 switching to external assembling
> 
> /home/pi/dev/lazarus/1.6/ide/lazarus.pp(150,42) Fatal: (10026) There
> were 2 errors compiling module, stopping
> 
> Fatal: (1018) Compilation aborted
> Makefile:4004: receptet för målet ”lazarus” misslyckades
> 
> Since this has worked for many users now I am wondering what could be
> the cause?
> 
> One observation I did is that the messages include Swedish in the
> output, so clearly this box is localized to Sweden, which I have never
> tested.
> Could such a localization affect some aspect of the installation from
> sources?
> 
> 
> -- 
> Bo Berglund
> Developer in Sweden
> 
> -- 
> ___
> 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


[Lazarus] Raw TBitmap objects vs LCL TBitmap properties inconsistencies

2018-09-12 Thread Giuliano Colla via Lazarus

Hi Lazarus experts,

I have noticed a number of apparent inconsistencies which make life a 
bit complicate if you need to play with visual properties of LCL components.


If you need a different canvas brush, you need to change a button glyph, 
or to dynamically change a TImage (just to make a few examples), you 
create your TBitmap, and with a simple assignment instruction you pass 
it to the component. It works and it's Ok.


But then you're faced with a problem: what to do with the TBimap object 
you have created?


Coming from Delphi I had assumed that a TBitmap is not copied on another 
one, but just the pointer to the underlying Handle is copied. This means 
that you should never free a TBitmap after copying.


But if you use heaptrc you discover that a number of your TBitmaps are 
still there after closing all the forms.


On the other hand, in some cases if you FreeAndNil a TBitmap which has 
just been copied to an LCL component you get a crash with an AV.


Up to now my solution has been to enable heap trace, let heaptrc tell me 
what I need to free, and do it just for those bitmaps.


Is there a better way? i.e. what is the logic behind some LCL components 
just taking the pointer of a TBitmap and some to create their own 
internal bitmap leaving the original TBitmap untouched?


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Usage of Serial in a testing program?

2018-09-10 Thread Giuliano Colla via Lazarus

Il 10/09/2018 17:30, Bo Berglund via Lazarus ha scritto:


I hope that it helps.

Yes it does, but it would have been even better if not full of HTML
tags and stuff. I have edited out most but I guess there are some
still left...
For example inside the code there may be some things like  rather
than >

Sorry, I forced HTML for better readability.
But you may easily extract the clean text (without  and such) by 
creating an empty html file (whatever.html), and opening it with 
LibreOffice or OpenOffice. Then you may copy and paste into it the text 
from the e-mail, and finally save it as a pure text fle (whatever.txt). 
It is much faster and safer than manual editing.


Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Usage of Serial in a testing program?

2018-09-10 Thread Giuliano Colla via Lazarus

Il 10/09/2018 17:30, Bo Berglund via Lazarus ha scritto:

Unfortunately not possible in the real case because the file transfer
protocol of the device only sends a header with the count of the data
to follow and then streams all of the bytes


I don't know how your application is built, but if the origin is an ftp 
transfer, then data are sent in small packets. It would appear that you 
somehow get the ftp data and send them to a serial line. It is at that 
point of the processs that you should create your records to send them 
individually via the serial line.


--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Usage of Serial in a testing program?

2018-09-10 Thread Giuliano Colla via Lazarus

Il 10/09/2018 17:30, Bo Berglund via Lazarus ha scritto:


This seems only to deal with ports 1..9, what about the higher
numbered ports 10..255?
And would it not be a long execution time for testing all 255 possible
com ports on Windows?
In my experience both Linux and Windows if you connect a new serial 
device do set a port number just higher than the previous one already there.
This means that you'll have to deal with higher numbers only if you have 
more than 9 serial lines in your platform, which is a bit unlikely. Not 
to consider the likelihood of a platform with 200 serial lines!


--
Do not do to others as you would have them do to you.They might have different 
tastes.

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


Re: [Lazarus] Usage of Serial in a testing program?

2018-09-10 Thread Giuliano Colla via Lazarus

  
  
Il 09/09/2018 13:33, Bo Berglund via
  Lazarus ha scritto:


  I am writing a testing application for checking out a TCP to Serial
bridge component. I am using Lazarus 1.8.0 and fpc 3.0.4 on Windows 7

For the serial port handling I found the "built-in" Serial unit
described here:
http://wiki.freepascal.org/Hardware_Access#FPC_built_in_Serial_unit

Now I have a few questions about its usage:

1) Serial port name
---
When opening the port the example does this:

str(ComPortNr,tmpstr);
ComPortName:= 'COM'+tmpstr+':';
serialhandle := SerOpen(ComPortName);

So for say port 29 this results in ComPortName 'COM29:'
Is this always the case? I have a hunch that for port numbers 1..9 the
Windows port naming is different than for higher port numbers...

And if I want to port this to Linux, I guess thta the name is
completely different, but no hint is given.


Here is the procedure I'm using to fill up a combo box with the
names of the existing serial devices on the platform. Please note
the different naming conventions in Linux and Windows. Also note
that to report a serial port as existing a test is made to open it
(using the fpc serial function), and avoid "phantom" ports.
procedure TForm1.btnScanPortClick(Sender: TObject);
var
 PortNr: Integer;
 PortName: String;
 PortHandle: TSerialHandle;
begin
  cbSelPort.Items.Clear;
  cbSelPort.Text:= '';
{$IFDEF MSWINDOWS}
  for PortNr := 1 to 9 do begin
PortName := 'COM' + IntToStr(PortNr);
PortHandle := SerOpen('\\.\'+PortName);
if PortHandle > 0 then begin
  cbSelPort.Items.Add(PortName);
  SerClose(PortHandle);
  if cbSelPort.Text = '' then begin
cbSelPort.Text:=PortName;
PortSel.Caption:= PortName;
end;
  end;
end;
{$ELSE}
  for PortNr := 0 to 9 do begin
PortName := '/dev/ttyS' + IntToStr(PortNr);
PortHandle := SerOpen(PortName);
if PortHandle > 0 then begin
  if cbSelPort.Text = '' then begin
cbSelPort.Text:=PortName;
PortSel.Caption:= PortName;
end;
  cbSelPort.Items.Add(PortName);
  SerClose(PortHandle);
  end;
end;
  for PortNr := 0 to 9 do begin
PortName := '/dev/ttyUSB' + IntToStr(PortNr);
PortHandle := SerOpen(PortName);
if PortHandle > 0 then begin
  if cbSelPort.Text = '' then begin
cbSelPort.Text:=PortName;
PortSel.Caption:= PortName;
end;
  cbSelPort.Items.Add(PortName);
  SerClose(PortHandle);
  end;
end;
{$ENDIF}
end;



  
2) Blocking send?
--
Is this port blocking for sending?

The example has this:

status := SerWrite(serialhandle, s[1], writecount );

where s is a string holding the text to send (I will actually need to
use a TBytes array instead) and writecount returns the bytes actually
sent.

If I want to send an array of say 100 kbytes at 9600 baud, will the
call return only when the data have been completely sent or earlier?
It will take about 100 seconds to send that array...


Yes, SerWrite is blocking. I hope you don't plan to send 100 kbytes
in a single write on a serial line. The probability of an error in
between is near to 100%!
What I'm doing in such cases is to create a dedicated thread to
handle send and receive, without blocking the main thread, which
remains responsive, and split the send in many small blocks (and
getting some sort of ACK/NAK from remote receiver), which makes it
possible to show a progress bar or whatever visual feedback you
like.

  
3) Receiving data

For data reception I see this:

s:='';
ComIn:='';
while (Length(Comin)<10) and (status>=0) and not keypressed do 
begin
   status:= SerRead(serialhandle, s[1], 10);
   ...

Since the call parameters are the receive buffer and the count to read
I do not understand how this can work. s has been emptied (length = 0)
just before the call so how can SerRead stuff any data into the buffer
starting at s[1], which should not even exist???

I would like to have a way to read incoming data asynchronously so I
also could handle the user feedback and the TCP connection which is
sending the data that ultimately will arrive on the serial line...

Any suggestions on how to do this?




I never use SerRead, but rather SerReadTimeout (from the same
  unit) which gives a much better control of what is going on. Of
  course in that case your receiving buffer must be large enough to
  accommodate the largest block you expect. (This replies also to
  your further questions).



I hope that it helps.


Giuliano

-- 
Do not do to others as you would have them do to you.They might have different tastes.

  

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


Re: [Lazarus] How to use two different versions of FPC

2018-05-10 Thread Giuliano Colla via Lazarus

Il 09/05/2018 12:34, Joost van der Sluis via Lazarus ha scritto:

That's more a hack then a solution


I fail to grasp why startlazarus should be a feature, and fpc.sh should 
be a hack.


Having multiple fpc.cfg files, as it may be required by multiple fpc 
installations requires invoking the compiler with the appropriate 
parameters. A script is just the most comfortable way to achieve this 
result.


Launching an executable via another program or a script which sets up 
the appropriate environment according the user needs is a standard well 
established practice, since the dawn of Unix.


Giuliano


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


Re: [Lazarus] How to use two different versions of FPC

2018-05-08 Thread Giuliano Colla via Lazarus

  
  
Il 07/05/2018 16:54, Gabor Boros via
  Lazarus ha scritto:

Hi All,
  
  
  My main development toolset is FPC 3.0.4 and Lazarus fixes_1_8.
  Sometimes I try some things with Lazarus trunk also. It is easy.
  
  But now build up a new development machine from scratch with RHEL
  7.5 on it and try to utilize FPC trunk too (with Lazarus trunk). I
  use "--primary-config-path" option always, so Lazarus config
  placement is not a problem. But the two FPC versions coexist. I
  found a solution from 2012 on the forum (see the link below). Is
  BigChimp's suggestion (1.-6.) a good starting point nowadays or
  something changed meanwhile in this topic. I will build everything
  (Lazarus fixes_1_8 and trunk, FPC trunk) from source except the
  actual stable FPC (now 3.0.4).
  
  
https://forum.lazarus.freepascal.org/index.php/topic,15716.msg85158.html#msg85158
  
  
  Gabor
  

You might give a look to the way the problem has been solved in fpcup,
  (or fpcupdeluxe )
  making it possible to make different versions of fpc and Lazarus
  to coexist without going one into the way of the other.
E.G. you may have a full tree (fpc+Lazarus) in ~/development/
  another one in ~/production and a third one in ~/experiments. The
  main trick, as far as fpc is concerned, is to have as fpc
  executable an fpc.sh (a name which is accepted by Lazarus) which
  sets up whatever is needed. This is a sample of fpc.sh:
#!/bin/sh
# This script starts the fpc compiler installed by fpcup
# and ignores any system-wide fpc.cfg files
# Note: maintained by fpcup; do not edit directly, your edits will be lost.
/home/colla/development/fpc/bin/x86_64-linux/fpc  -n @/home/colla/development/fpc/bin/x86_64-linux/fpc.cfg "$@"


Hope that it helps,
Giuliano

  

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


Re: [Lazarus] Qt WS on Raspberry pi 3

2018-05-05 Thread Giuliano Colla via Lazarus

Il 02/05/2018 20:52, Mark Morgan Lloyd via Lazarus ha scritto:

When you say "WS" what specifically do you mean? 


I was meaning compiling (or cross-compiling from) and running Lazarus 
applications using the Qt widgetset. From your reply I gather that 
you've been successful with Qt designer, and that's already a good 
starting point.
Now I'll try to cope with Qt bindings for Lazarus. If I stumble into 
issues I'll ask again for support.

For the moment many thanks for your feedback.
Giuliano

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


[Lazarus] Qt WS on Raspberry pi 3

2018-05-02 Thread Giuliano Colla via Lazarus

Hi all,

before starting from scratch, and falling in the same pitfalls someone 
else has already learned how to avoid, is there anyone who's already 
successfully managed to use the Qt WS on Rasbian for a Rapberry PI 3?


Thanks in advance for any hint.

Giuliano


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


Re: [Lazarus] Canvas cannot draw properly if has an alpha channel?

2018-04-25 Thread Giuliano Colla via Lazarus

Il 25/04/2018 13:05, Michael Van Canneyt via Lazarus ha scritto:


Where are they located?


packages/fcl-image 


Thanks to you and to Ondrej.

Giuliano

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


Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus

Il 22/04/2018 17:39, Mattias Gaertner via Lazarus ha scritto:


And what to do with

W := Image1.Picture.BItmap.Width?


You're right, there's no easy way out.

The original sin has been maybe to call Bitmap a TPicture property which 
isn't really a TBitmap, as the GetBitmap and SetBitmap methods show. 
This makes it easy to put any image into a picture, but creates 
unavoidable inconsistencies.


Giuliano




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


Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus

Il 22/04/2018 13:22, Michael Van Canneyt via Lazarus ha scritto:

This is how all properties that are  TPersistent descendents work, so 
this
behaviour should not come as a surprise. 


I wouldn't say so.

E.g. TCanvas is a TPersistent descendent, but the Canvas property of a 
TCustomControl is declared like that:

     property Canvas: TCanvas read FCanvas write FCanvas;

This means that after a

SomeControl.Canvas := MyCanvas;

or

MyCanvas := SomeControl.Canvas;

SomeControl.Canvas and MyCanvas will be the same object. Only a pointer 
is copied.


On the contrary, the property Bitmap of a TPicture is declare like that:


     property Bitmap: TBitmap read GetBitmap write SetBitmap;


where GetBitmap actually returns the TPicture.Bitmap Object, while 
SetBitmap creates a different Bitmap Object, and assigns it the content 
of the supplied bitmap (see TPicture.SetGraphic, called by 
TPicture.SetBitmap).


This means that after a

MyBitmap := SomePicture.Bitmap;

MyBitmap and SomePicture.Bitmap will represent the same Object, while 
after a


SomePicture.Bitmap := MyBitmap;

MyBitmap and SomePicture.Bitmap will represent different Objects.

This is IMHO a TPicture specific inconsistency.

Giuliano

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


Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus

Il 22/04/2018 13:49, Ondrej Pokorny via Lazarus ha scritto:


Do you really mean that
Image1.Picture.Bitmap.SomeProperty := SomeValue;
should apply SomeProperty := SomeValue on a copied object of Bitmap 
and produce a memory leak?


No, I mean that like

Image1.Picture.Bitmap := SomeBitmap;

actually executes a

Image1.Picture.Bitmap.assign(SomeBitmap);

(see TPicture.SetGraphic called by TPicture.SetBitmap in picture.inc), so

SomeBitmap := Image1.Picture.BItmap;

should execute (with proper checks)

SomeBitmap.assign(Image1.Picture.Bitmap);

I speak about manipulating the Tpicture.Bitmap property itself, not the 
TBitmap properties, which would not be affected.


Giuliano



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


Re: [Lazarus] A bitmap strange issue

2018-04-22 Thread Giuliano Colla via Lazarus

Il 21/04/2018 18:07, Vojtěch Čihák via Lazarus ha scritto:


@ MyBitmap := Image1.Picture.Bitmap;

This line only copies pointer, but Image1.Picture.Bitmap belongs to 
Image1 and it should care itself.




That's what I had guessed, but this means that there's a patent 
inconsistency, as shown in the Button2Click part of my test:


Image1.Picture.Bitmap := MyBitmap; FreeAndNil(MyBitmap); 


doesn't generate any error. If I don't free MyBitmap I see a memory 
leakage in heaptrc.


IOW

Image1.Picture.Bitmap := MyBitmap;

performs an implicit assign, creating a new Bitmap Object for Image1.

The apparently symmetrical

MyBitmap := Image1.Picture.Bitmap;

just copies the pointer. Timage.Picture.GetBitmap and 
TImage.Picture.SetBitmap do not follow the same logic.


All of this is maybe somewhat Delphi compatible. Actually Delphi (Rad 
Studio 10.1) doesn't generate a SIGSEV with the same code, but rather 
just an "Illegal Pointer Operation" warning. However IMO it still 
remains quite inconsistent.


Giuliano

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


Re: [Lazarus] Drag (and show) images

2018-04-13 Thread Giuliano Colla via Lazarus

Il 13/04/2018 02:40, Donald Ziesig via Lazarus ha scritto:

You're right.  It gets *close* but not quite there.  I can move the 
control so long as the mouse is *not* over the control while it is 
moving :-(. I will look at this closer in the morning and see if I can 
work around it (or if there is something I am missing).




You might find useful, as a guideline, the code I'm using in one of my 
application to drag a button so that it doesn't cover the useful part of 
an image. Just using the OnMouseDown, OnMouseMove and OnMouseUp of your 
TImage, and getting rid of the code you don't need, to perform an extra 
action on OnMouseUp, you should be able to do the trick.



  TErrForm = class(TForm)
..
  protected
    ResetDragged: Boolean;
    CursorPos: TPoint;
    ObjectPos: TPoint;


procedure TErrForm.ResetBtnMouseDown(Sender: TObject; Button: 
TMouseButton;

  Shift: TShiftState; X: LongInt; Y: LongInt);
begin
  ResetDragged := True;
  CursorPos.X := Mouse.CursorPos.X;
  CursorPos.Y := Mouse.CursorPos.Y;
  with ResetBtn do begin;
    ObjectPos.X := Left;
    ObjectPos.Y := Top;
    end;
end;

procedure TErrForm.ResetBtnMouseMove(Sender: TObject; Shift: TShiftState;
  X: LongInt; Y: LongInt);
begin
  if ResetDragged then begin
    with ResetBtn do begin
  Left := ObjectPos.X + (Mouse.CursorPos.X - CursorPos.X);
  Top := ObjectPos.Y +  (Mouse.CursorPos.Y - CursorPos.Y);
  ResetPos.X := (Left * NormalGeometry.ClientWidth div 
CurrImage.Width) + HorzScrollBar.Position;
  ResetPos.Y := (Top * NormalGeometry.ClientHeight div 
CurrImage.Height) + VertScrollBar.Position;

  end;
    end;
end;

procedure TErrForm.ResetBtnMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X: LongInt; Y: LongInt);
begin
  if ResetDragged then begin
    ResetDragged := False;
    Paint;
    end;
  if (abs(Mouse.CursorPos.X - CursorPos.X) < 10) and 
(abs(Mouse.CursorPos.Y - CursorPos.Y)< 10) then Close;

end;


Hope that it helps.

Giuliano

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


Re: [Lazarus] How to catch an unhandled exception?

2018-03-09 Thread Giuliano Colla via Lazarus

Il 09/03/2018 10:14, Gabor Boros via Lazarus ha scritto:


Any idea how to detect what/where is the source of the exception?

I use Linux 64bit, FPC 3.0.4 and Lazarus fixes_1_8. 


To obtain meaningful information from gdb I do the following:
1) Compile both Lazarus LCL and fpc with debug info
2) Install the glibc-debuginfo packages
Otherwise you get only the information about exceptions which generate 
directly from your source code, which is many cases isn't sufficient.


Hope that it helps,

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


Re: [Lazarus] Lazarus Digest, Vol 121, Issue 49

2018-03-05 Thread Giuliano Colla via Lazarus

Il 01/03/2018 23:44, Chavoux Luyt via Lazarus ha scritto:
I suppose there is some kind of magic involved that makes it work when 
recompiling the IDE with the new packages, but I would like to 
understand what.


The magic is performed by Lazarus IDE, and by startlazarus.

If Lazarus IDE detects that your installation directory is read-only, 
when recompiling it will put the new Lazarus copy in your home directory 
(~/.lazarus/...)


When you launch Lazarus via startlazarus, it will check if your home 
directory holds a Lazarus newer than the one in installation directory. 
If such is the case it will launch your personal copy.


If you happen to update Lazarus, then the system copy in /usr/lib will 
be newer than your personal copy. In that case startlazarus will ask you 
which one you want to start. If you choose to launch the newly installed 
copy, the IDE will detect that your additional packages are missing and 
will add them to the list of required packages. Recompiling the IDE will 
add those packages and create a new personal copy, which now becomes 
newer than the system one, and you are properly set.


Giuliano



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


Re: [Lazarus] An expression is returning false, why?

2018-03-05 Thread Giuliano Colla via Lazarus

Il 05/03/2018 09:41, Lubos Pintes via Lazarus ha scritto:

Hello and thank. And in general, if I have a TControl instance, can 
you tell me a reliable algorithm that tells me if the control has a 
focus? 


By definition, the focused control is the control which receives 
keyboard input.
That's why the form in itself is never focused because a form doesn't 
handle keyboard input.
With just a form you may strike any key, and nothing will happen: the 
keyboard input is simply ignored.


The Form's ActiveControl property tells you which control has focus and 
will receive the keyboard input.


The control's Focused property tells you if the control has focus.

The focused control may be a button a TEdit, or whatever control which 
may perform an action upon striking a key.
You may push a focused button by striking the enter key or the space 
bar, you may enter text on a Tedit, etc.


Giuliano

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


Re: [Lazarus] Translating a small C program to pascal (on lazarus)

2018-02-26 Thread Giuliano Colla via Lazarus

Il 26/02/2018 03:51, Carlos E. R. via Lazarus ha scritto:

Ah!  I didn't realize it could translate the declarations on a .c file,
I thought it was only for .h files.

I just had a quick test, but... I'll have to read on it, the quick test
crashes:


Well actually it is only for .h files, but as .h files are just 
declaration, it can handle a good part of the job.


Most likely it crashes because it doesn't know how to handle the code 
after the declarations.


What I'd do in your place would be to create a sort of .h file, by 
cutting away from the original source everything except the 
declarations, and translate it.


Then translating the code, when you have all declarations in place 
becomes much easier, the bulk of it being sort of:


replace all "{" with "begin"

replace all "}" with "end;"

replace all "0x" with "$"

and so on.

Giuliano

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


Re: [Lazarus] Translating a small C program to pascal (on lazarus)

2018-02-25 Thread Giuliano Colla via Lazarus

Il 25/02/2018 20:52, Carlos E. R. via Lazarus ha scritto:

I want to translate a little Linux C program (600 lines) to pascal (so 
that I can then add my parts in comfort). I failed to find a good 
automated tool in Linux. I had a look here: 


Did you consider h2pas (which comes with fpc/Lazarus)?
It's only intended to translate C headers to Pascal, but it makes a good 
job on this.


You can only use it to translate declarations, but once declarations are 
in Pascal, converting the code becomes much easier.


Giuliano

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


Re: [Lazarus] component for database ADS

2018-02-21 Thread Giuliano Colla via Lazarus

Il 22/02/2018 01:23, Paola Bruccoleri via Lazarus ha scritto:

Hello everyone In the company where we work, we use the ADS database 
(advantage database server) version 11.1 I have downloaded version 1.8 
of lazarus. Is there any component for that database? I would like to 
be able to migrate software made in the language harbuour (console 
mode) to lazarus.
A few years ago I used this language but with Firebird and I want to 
take it up again very thanks





You may find what you need in the Lazarus wiki page:

http://wiki.lazarus.freepascal.org/Advantage_Database_Server

Happy programming!

Giuliano

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


Re: [Lazarus] Form events firing order and count

2018-02-18 Thread Giuliano Colla via Lazarus

Il 18/02/2018 19:06, Graeme Geldenhuys via Lazarus ha scritto:

Are there any defined tests or test projects that can confirm 
LCL-Win32 is compatible with Delphi's VCL? I'm talking about events, 
order of events firing.


I hope that nobody will spend time which could be used for constructive 
purpose to verify Lazarus compliance to *undocumented* Delphi features, 
subject to change from one release to the next.


Giuliano

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


Re: [Lazarus] Form events firing order and count

2018-02-18 Thread Giuliano Colla via Lazarus

Il 18/02/2018 19:42, Ondrej Pokorny via Lazarus ha scritto:


Do you mean TForm.OnPaint?



Yes, sorry for the typo.

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


Re: [Lazarus] Form events firing order and count

2018-02-18 Thread Giuliano Colla via Lazarus

Il 18/02/2018 11:54, Ondrej Pokorny ha scritto:


What events are generated?


onFormPaint

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


Re: [Lazarus] Form events firing order and count

2018-02-18 Thread Giuliano Colla via Lazarus

Il 18/02/2018 11:09, Ondrej Pokorny via Lazarus ha scritto:


On 18.02.2018 0:59, Graeme Geldenhuys via Lazarus wrote:

Now comes the BIG question... Does LCL have a reference implementation?


Yes, it does. It is Delphi.



That's not true, as far as events triggering is concerned.
Delphi implementation is to fire each visual change when requested.
LCL implementation is to queue all visual changes and to fire all of 
them at the end. This provides better efficiency but completely disrupts 
the order in which events are fired.
Those lines of code generate two events on Delphi, and just one event on 
LCL:


MyLabel.Color := clRed;
MyLabel.Color := clGreen;

To achieve the Delphi behavior in Lazarus I should code:

MyLabel.Color := clRed;
Application:ProcessMessages;
MyLabel.Color := clGreen;


Giuliano

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


Re: [Lazarus] Form events firing order and count

2018-02-18 Thread Giuliano Colla via Lazarus

Il 18/02/2018 00:59, Graeme Geldenhuys via Lazarus ha scritto:

Now comes the BIG question... Does LCL have a reference 
implementation? Which LCL widgetset gives the correct behaviour and 
feature list, that the other LCL widgetsets need to follow or mimic?


IMHO that's impossible to achieve.
Design is the art of compromise. When you request feature A and feature 
B which are mutually exclusive, you must decide which one is most 
important and drop the other.
Lazarus since the beginning has chosen (wrongly, IMO, but that's another 
matter) that the basic feature is *native* look and feel, by making LCL 
delegate as much as possible to the underlying widgetset. This is 
incompatible both with *consistent* look and feel, and with *consistent* 
behaviour.


Giuliano


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


Re: [Lazarus] High-DPI TImageList

2018-02-05 Thread Giuliano Colla via Lazarus

Il 05/02/2018 16:01, Ondrej Pokorny via Lazarus ha scritto:

No, it's not needed if no extra resolutions are stored. I'll check if 
it can be omitted (it's a manually added entry and not a normal 
property). If not, I'll add an ignore entry for 1.8.2. 


In the past undefined properties were silently ignored when streaming 
the lfm files. This did provide a good backward compatibility for new 
properties. Of course using them in code would raise an error, but code 
can easily be edited, while manually editing lfm files is rather 
cumbersome. Wouldn't it be good to revive the old way? Or maybe just 
issue a warning?


Giuliano

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


[Lazarus] Run parameters and Launching application bug?

2018-01-02 Thread Giuliano Colla via Lazarus
I seldom use launching applications from a terminal window, so I 
happened to notice only recently what appears to me to be a regression 
from older Lazarus versions.


In the Run Parameters window, selecting "Use launching application" 
currently disables "Command line parameters" (Lazarus 1.6, 1.8 and trunk)


This appears rather inconsistent with the fact that a $(TargetCmdLine) 
macro in the launching application parameters properly picks up the 
content of the disabled "Command line parameters".


If you are using a launching application and need to change the command 
line parameters you're forced to deselect "Use launching application", 
edit your command line parameters, and then re-enable "Use launching 
application".


Is there any rationale behind this rather odd behaviour, introduced 
somewhere after Lazarus 1.4.4?


Giuliano


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


Re: [Lazarus] How to strip debug symbols from exe file?

2017-12-30 Thread Giuliano Colla via Lazarus

  
  
Il 30/12/2017 12:54, Bo Berglund via Lazarus ha scritto:


  Because the server I use is located in Austin, Tx and I am in Sweden.
Have to use a VPN, which is not fast at all.


In that case you might consider:
1) To use git in place of svn. It is unbelievably faster.
2) To use a separate file for debug symbols: tick in Project
  Options -> Compiler Options->Debugging: Use external gdb
debug symbols file. In that way you get at the same time a
  stripped executable, and debug symbols for exactly the same
  executable. As long as executable (whatever.exe on Windows
  - whatever on Linux) and debug symbols file (whatever.dbg)
  are on the same directory, gdb understands it and behaves exactly
  as if executable had debug info.
Giuliano





  

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


Re: [Lazarus] TTrackbar and Wine

2017-12-22 Thread Giuliano Colla via Lazarus


> Il giorno 22 dic 2017, alle ore 14:02, zeljko via Lazarus 
>  ha scritto:
> 
>> On 12/22/2017 01:26 PM, Vojtěch Čihák via Lazarus wrote:
>> I can confirm behavior in Wine. When you change trVertical to trHorizotal - 
>> everything OK. But oppositely, trackbar calculates with new width and OLD 
>> height and ticks remain horizontal. When you resize it at least 1 pixel, 
>> everything is OK.
>> But I'm not able to say if the issue is in Wine or in Lazarus.
> 
> What widgetset win32 or qt ?
> 

In my setup qt WS under wine works just fine. I’ve seen the problem only with 
win32. 

Giuliano


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


[Lazarus] TTrackbar and Wine

2017-12-22 Thread Giuliano Colla via Lazarus

Sorry, this is almost OT, but I don't know where else to ask.

While checking an application, I found a strange problem: under Windows 
WS when TTrackbar Orientation is trVertical, it doesn't behave properly 
under Wine. The widget size is correct, but Tick Marks and bar movement 
behave following the Width value instead of the Height value. In a real 
Windows environment, it works properly as it works with other


Does anybody with experience in using Lazarus and Wine under Linux have 
an idea of why this happens and how to fix it?


My environment: Linux CentOs 6, Lazarus 1.8.0 FPC 3.0.4, wine 1.8.6

Giuliano


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


[Lazarus] Qt Ws doesn't support properly GetWindowSize() and GetWindowRect()

2017-12-15 Thread Giuliano Colla via Lazarus
This snippet of code, which executes as expected with GTK2 WS, fails 
with QT WS:



procedure TForm1.btnWsizeClick(Sender: TObject);
var  aHandle: THandle;
   aWidth,aHeight: Integer;
   aRect: TRect;
begin
   aHandle:= Form1.Handle;
   if GetWindowSize(aHandle,aWidth,aHeight) then begin
     Label3.Caption:= Format('Width: %d Height: %d',[aWidth,aHeight]);
   end
   else Label3.Caption:= 'Failed to get Window Size';
   GetWindowRect(aHandle,aRect);
   Label3.Caption:= Label3.Caption + Format(' Rect: %d,%d',[
   aRect.Right-aRect.Left,
   aRect.Bottom-aRect.Top]);
   Label3.Visible:= True;
end;


As it is, it crashes with an AV in the GetWindowSize call. The failing 
call is in TQtWidget.GetWidget: it executes Result := 
QWidgetH(TheObject) where TheObject appears to have taken a bogus value.


If I remove the offending call, then the subsequent GetWindowRect() 
returns bogus values, sort of -32704 and -85984614 instead of 689 and 522.


Under GTK2 both calls work as expected.

Tested under Linux x86_64 (CentOs 6) with Lazarus 1.8 - QT45 - fpc 3.0.4

It doesn't appear to be a regression, because it does the same even with 
a very old Lazarus 1.2.6 , qt45 and fpc 2.6.4


Should I report a bug or is it a known issue?

Giuliano


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


Re: [Lazarus] Note to new high-DPI icons

2017-12-10 Thread Giuliano Colla via Lazarus

Il 10/12/2017 11:45, zeljko via Lazarus ha scritto:

No way, in that case we must split Translators, Developers etc 
...there's simply no point to touch contributions.txt.


+1

Of all the things that can be done to improve Lazarus and fpc, I believe 
that contribution.txt ranks in a very low place, as long as all 
contributors are listed.


Giuliano

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


Re: [Lazarus] External/out-of-tree LCL widgetset

2017-12-01 Thread Giuliano Colla via Lazarus

Il 01/12/2017 08:01, Graeme Geldenhuys via Lazarus ha scritto:
And your last 3 words is the most important part - "if done right". In 
my 20+ years of using Delphi, I can count of one hand how many company 
products I've seen "done right" using the RAD style approach. And I've 
worked at plenty of companies in that 20+ years. It seems "if done 
right" is a near impossibility for most Delphi developers.


So I'm not saying its impossible, just very very unlikely. Using 
non-RAD approaches seems to guide the developer in better design, but 
yes, they could still screw that up too (without leadership guidance).



I don't believe you can give a general rule. The tool must be 
appropriate for the application. The word "programming" includes an 
universe of non compatible things. Something like "mechanical design". 
Designing a watch is something completing different than designing a 
monorail train.


We used Delphi, and now use Lazarus to design the human interface for 
automatic machines, where the visual part is the most important one. The 
RAD approach is the most efficient and productive. But when we had to 
interface the production data generated with company database, it turned 
out that one had to write a lot of non-visual code, and we found that 
RAD approach would just have confused things, leading to unreadable and 
inefficient code.


Just my 2 cents.

Giuliano


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


[Lazarus] Ping

2017-11-26 Thread Giuliano Colla via Lazarus

Just a test to see if server is still alive


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


[Lazarus] Weird object variables access [SOLVED] - Sorry for the noise!

2017-11-03 Thread Giuliano Colla via Lazarus

Il 25/10/2017 14:12, Giuliano Colla via Lazarus ha scritto:

I raised some noise about procedural variables in Delphi mode, but it 
turns out that I had failed to notice some discrepancies while porting 
code back and forth from Delphi to Lazarus.


1.

   I had failed to notice that RAD Studio X10 when importing the Delphi
   7 project had silently dropped a declaration from my source, and
   this is what gave rise to a compiler error.

2.

   I had failed to detect that the OnCreate event, which should have
   properly initialized the procedural variable in my test program was
   never triggered.


When I realized it I did refine and repeat all my tests in Kylix, Delphi 
7, X10 and fpc, and the final result is the following:


1) Delphi accepts the assignment of an untyped pointer to a procedural 
variable even if it is a method pointer. This is true from Delphi 3 up 
to Kylix, Delphi 7 and Rad Studio X10.


2) The syntax for this particular assignment (again from Delphi 3 to 
X10) is:


@Procvar := aPointer;

3) What Delphi does in that case is:
copy the pointer to the procedure in the "code" field of the procedural 
variable, leaving the "data" field untouched.


4) fpc in Delphi mode does exactly the same.

This makes it possible in Delphi, or in Delphi mode fpc, to initialize 
the procedural variable to point to a method of an object, and 
subsequently to make it point to any other compatible method of the same 
object, just by providing an untyped pointer, which may be handled with 
the many tools which deal only with pointers, for jump tables, queues of 
actions etc.


Of course this is not the best thing to do. An appropriate typecast of 
the procedural variable to a TMethod, and then explicitly setting the 
fields would make the code much more readable. That is what common sense 
and good programming practice would suggest. ObjFpc mode only provides 
this second option, for the same purpose, and this is certainly better.


But, as the purpose of Delphi mode is not to provide what common sense 
or good programming practice would suggest, but to mimic Delphi 
behaviour, I raised the question when I detected an apparent fpc bug.


It turns out that it was my fault, so, sorry for the noise.

Giuliano

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


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-29 Thread Giuliano Colla via Lazarus

Il 28/10/2017 16:45, Marcos Douglas B. Santos via Lazarus ha scritto:


Do you have problems to find new Pascal programmers?

Experienced Pascal programmers are hard to find here in Italy.
But we've found that a good young programmer (usually trained in C) 
usually appreciates the beauty of Pascal language, becomes fond of it, 
and very quickly productive.
As in any case a new programmer must be trained to get acquainted with 
company software practices, the extra time required to grasp the 
fundamentals of Pascal is almost negligible.


Giuliano

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


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-28 Thread Giuliano Colla via Lazarus

Il 28/10/2017 02:42, Luiz Americo Pereira Camara via Lazarus ha scritto:

I have similar issue. I'm looking for third party companies to 
accelerate development of my current app (used in production by around 
200 people a day) and they all say that is obsolete technology and 
will not find programmers to maintain




You might tell them that tombstones are obsolete technology (stone age), 
but nobody has managed to find a more appropriate one for that purpose. 
The attempts to replace them with an iPhone app appear to have failed up 
to now!
The issue is never to use the most modern technology, but the most 
appropriate one.
If their programmers are unable to cope with an appropriate technology, 
but only with the latest one, they'll become useless, as soon as the 
latest technology is replaced by the next whatever.


However keep in mind that using an appropriate technology not widely 
used, has its advantages: you beat the competition of all those who are 
using the latest and inappropriate, because you'll provide a better 
result at a lower cost.


Giuliano

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


Re: [Lazarus] Who is using Object Pascal in production?

2017-10-27 Thread Giuliano Colla via Lazarus

Il 27/10/2017 14:26, Marcos Douglas B. Santos via Lazarus ha scritto:

I would like to propose a discussion about "What is the relevance of
Object Pascal nowadays".
I don't want waste your time. I just want to know if we are growing
and being more relevant or not.

I use Object Pascal (mostly FPC, some old Delphi) in production to
make real applications. But we are seeing more and more "new
frameworks", "new technologies" and new languages that are become more
relevant.

What do you think?

Thanks.

Regards,
Marcos Douglas



We're working in the field of automatic machines. From textile machines 
to printer post-processing equipments (mainly in the security printers 
field), from coffee roasting machines to chain wear monitoring 
equipment. We do not usually deploy software, but rather we sell control 
equipments which are then integrated by the final manufacturer in the 
machine.


Our equipments usually include custom embedded controllers and a 
supervisor which may range from an industrial grade PC to a Raspberry 
PI. It provides both the human interface and the real-time high-level 
process control.


We're also frequently asked to integrate our supervisor into the factory 
data network both to provide production data (for statistical purposes, 
quality assurance, and security) and to fetch process information when 
appropriate. This leads to supplying also small servers which do handle 
network protocols, Data Base handling, creating Reports etc.


We found today's Object Pascal and Lazarus to be the most cost effective 
solution, for a number of reasons. Mainly:


 * Object pascal syntax makes it easier to detect programmer errors at
   compile time, thus strongly reducing the debug time.
 * Being most projects quite similar and with very short development
   time allowed, we need readable and self documenting sources, making
   it easy for anyone to modify project A into project B.
 * For the same reason, re-usability of code for us is a must. Again
   Object Pascal is a winner by this POV.
 * Always for the same reason we need a RAD tool, and Lazarus IDE is
   again a winner.
 * We need to interface with our real-time framework with predictable
   timing, and this rules out most of the "modern" languages.
 * Given the relative stability of the Object Pascal language, we may
   take advantage of a huge amount of code we have developed in the
   past. I've just ported to Lazarus a program which was originally
   developed in the 90's with Delphi 3!

Many of those reasons apply also to Delphi, but we dropped Delphi long 
ago because:


1. Primarily, we need Linux support, because of the real-time
   requirements, which aren't achievable in Windows environment. OS-X
   isn't an option because we need industrial grade PC's.
2. Secondarily, Lazarus IDE is light years better than Delphi IDE.

For sake of completeness, I must add that our real-time framework and 
the real-time tasks are written in C. This was a must when it had to be 
part of a patched Linux kernel, running in kernel space. Now that 
RT_PREEMP has reached maturity and has made its way into the mainline 
kernel we've been able to move the stuff to user space. Therefore we're 
rewriting most of it in Object Pascal, to take advantage of a much lower 
development and maintenance cost.


Giuliano

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


Re: [Lazarus] Weird object variables access [SOLVED] - Delphi mode bug!

2017-10-26 Thread Giuliano Colla via Lazarus

Il 25/10/2017 17:15, Sven Barth ha scritto:
That's not what I asked. The documentation used a procedure pointer 
type, thus the documentation would still be correct if it works as the 
allowed usage of a method pointer type in past versions would then 
indeed have been a bug in Delphi. 


In Delphi 7 with just a procedure pointer it accepts both forms. If P is 
a generic pointer and PTS is defined as a Procedure Pointer type, you 
may write either


P := @myProcedure;
PTS := P;
PTS;

or

P := @myProcedure;
@PTS := P;
PTS;

In both cases no error is given and myProcedure is properly called.

As soon as I can put my hands on the right platform, I'll verify what 
happens with Rad Studio X10, and will let you know.


However I'm planning to pass this topic to the fpc list, where I think 
now it belongs.


Giuliano


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


Re: [Lazarus] Weird object variables access [SOLVED] - Delphi mode bug!

2017-10-25 Thread Giuliano Colla via Lazarus

Il 25/10/2017 14:20, Sven Barth via Lazarus ha scritto:
Did you test with a procedure pointer type or a method pointer type? 
Cause this might be the important difference here as the example uses 
a procedure pointer type. 


I tested assigning an untyped pointer to a method pointer type, because 
that's what I was interested to. It used to be accepted, it isn't 
anymore. A procedure pointer type shouldn't give rise to problems as far 
as I can gather, as it doesn't require a data field.


Giuliano



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


Re: [Lazarus] Weird object variables access [SOLVED] - Delphi mode bug!

2017-10-25 Thread Giuliano Colla via Lazarus

Il 25/10/2017 14:17, Sven Barth via Lazarus ha scritto:


1) The syntax @ProcIdentifier := whatever is no more valid. It's
no more possible to assign a pointer to a method type without
typecasting.


Probably for good reason.


You're right. It was misleading. I was misled.

Giuliano


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


Re: [Lazarus] Weird object variables access [SOLVED] - Delphi mode bug!

2017-10-25 Thread Giuliano Colla via Lazarus

Il 25/10/2017 13:41, Mattias Gaertner via Lazarus ha scritto:

No. The Delphi syntax is "ProcIdentifier:=Proc" or
"ProcIdentifier:=@Proc".

The "@Some:=" means assign something to address of Some. Which is bogus.
I guess Delphi's auto dereference actually translates this to
@Some^:=. Still bogus, but valid bogus.


From embarcadero doc wiki 
(http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Procedural_Types_(Delphi)):




Procedural Types in Statements and Expressions

When a procedural variable is on the left side of an assignment 
statement, the compiler expects a procedural value on the right. The 
assignment makes the variable on the left a pointer to the function or 
procedure indicated on the right. In other contexts, however, using a 
procedural variable results in a call to the referenced procedure or 
function. You can even use a procedural variable to pass parameters:



[snip]

The *@* operator can also be used to assign an untyped pointer value 
to a procedural variable. For example:


  var  StrComp:  function(Str1,  Str2:  PChar):  Integer;
 ...
  @StrComp:=  GetProcAddress(KernelHandle,  'lstrcmpi');


This  is no more true (as least as of X10 where I tested and it gave 
rise to a compiler error), but it has been for a long time. That's why I 
assumed that assigning an untyped pointer to a procedural variable was 
both legal and also properly supported.


Giuliano


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


  1   2   >