Re: [Lazarus] Lazarus Release Candidate 1 of 2.0

2018-09-23 Thread Mark Morgan Lloyd via Lazarus
Please could somebody (Martin?) review the final patch at 
https://bugs.freepascal.org/view.php?id=33935 which limits a hack I put 
in to certain widget sets (Qt will print a $00 character, GTK2 won't).


I'm off-list in a couple of days time, I'll probably be able to get to 
Mantis before I have a replacement email address.


I'm not cancelling this account's subscription so that my colleagues 
have access.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2018-09-23 Thread Mark Morgan Lloyd via Lazarus

On 23/09/18 08:15, Bo Berglund via Lazarus wrote:

On Sun, 23 Sep 2018 08:39:52 +0200, Bo Berglund via 
Lazarus wrote:

I have now come as far in my application as I can test the way the>Serial unit opens and closes com 
ports.>It turns out that on Windows there are two port name syntaxes:>>Ports 1..9: COM1 to 
COM9 will work>Ports 10..255:  Only \\.\COM10 to \\.\COM255 will work>>But one does not need 
to use different naming depending on the port>number, the second syntax \\.\COMx works also for 
ports 1..9

Forgot to add a question regarding making this a cross-platformprogram:
If I add a check for the platform inside my program, how sghould itlook like to 
work on both Windows and Linux?
Something like this:
function TWiFiCommTester.ConnectSerial(Port: byte; Baud: integer):boolean;var  
ComportName: string;  Flags: TSerialFlags;begin  FLastError := '';  {$IFDEF 
WINDOWS}  ComPortName:= '\\.\COM' + IntToStr(Port);  {$ENDIF}  {$IFDEF UNIX}
 //What goes here? ComPortName :=   {$ENDIF}  FSerial := 
SerOpen(ComPortName);  


Sorry Bo and Paul, I mailed you directly when I meant to reply here. 
This rolls up the messages from earlier.



> Ports 1..9: COM1 to COM9 will workPorts 10..255:  Only \\.\COM10 
to \\.\COM255 will work


Which is something that I pointed out to you, although in my case I 
think I only tested up to 12 (i.e. with an 8-port card).


What comes after 255: 0 or 1? If 0 which form or name does it require?

> I have yet to complete other parts of the application so I don't 
yetknow if the data flow will wok as expected.


Note that that unit was specifically written to be usable either with or 
without separate communications threads. If you're /not/ using threads 
then there's a callback so that the read-with-timeout functions can 
periodically call Application.ProcessMessages, and that the places that 
it is used are OS-specific. You obviously /don't/ want to use that 
callback if the comms functions are in their own threads, since APM 
should only be called from the main thread.


I'm probably losing this email address on Tuesday, if there's anything 
that you think I can possibly clarify please raise it sooner rather than 
later.


> On 09/23/2018 02:39 AM, Bo Berglund via Lazarus wrote:...> Notice 
that contrary to the wiki example adding a colon to the end> like COM32: 
does NOT work so that is a wiki error.

> If I remember correctly the colon at the end is required for WinCE?--

OK, but this is something that the application programmer needs to be 
aware of. I suppose it would be possible to modify the unit so that if 
it sees a trailing : it changes it to a leading \\.\ if there isn't one 
there already, but since the exact names are OS-specific and since we're 
already insisting that the application programmer or user puts in /dev/ 
for unix I'm not sure that's justifiable.


In any event I'm not in a position to do any mods right now and am 
probably about to lose access to Solaris (which is probably still worth 
testing against) permanently.


(* If there are no serial ports on the system then return NIL, otherwise 
a  *)
(* TStringList. 
   *)
(* 
   *)
(* This returns an object, it is the caller's (eventual) responsibility 
to free *)
(* this. 
   *)

//
FUNCTION EnumeratePorts: TStringList;

(* On a Linux system with udev or similar the /dev directory will only 
contain  *)
(* devices which have been detected as being present. On an older system 
it *)
(* will probably contain all possible devices so we need to restrict the 
list   *)
(* to what's reasonable; the user should still be able to enter a device 
name   *)
(* manually if necessary, e.g. where a machine with 2x standard ports 
plus a*)
(* 2-port card insists that it's got ttyS0, ttyS1, ttyS45 and ttyS46. 
   *)


CONST   countTtyS= 12;  (* Main board plus an 8-port 
card   *)
countTtyUSB= 8; (* Four dual-port adapters 
*)
countTtyI= 4;   (* A single 4-port ISDN card. 
*)


VAR searchRec: TSearchRec;
counter: INTEGER;

BEGIN
  RESULT:= TStringList.Create;
  RESULT.Sorted:= TRUE;
  counter:= countTtyS;
  IF FindFirst('/dev/ttyS*', faSysFile, searchRec) = 0 THEN
REPEAT
  RESULT.Append('/dev/' + searchRec.Name);
  DEC(counter)
UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0);
  FindClose(searchRec);
  counter:= countTtyUSB;
  IF FindFirst('/dev/ttyUSB*', faSysFile, searchRec) = 0 THEN
REPEAT
  RESULT.Append('/dev/' + searchRec.Name);
  DEC(counter)
UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0);
  FindClose(searchRec);
  counter:= countTtyI;
  IF FindFirst('/dev/ttyI*', faSysFile, searchRec) = 0 THEN
REPEAT
  RESULT.Append('/dev/' + searchRec.Name);
  DEC(counter)
UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0);
  FindClose(searchRec);
  IF Result.Count = 0 THEN
FreeAndNil(RESULT)
END { EnumeratePorts } ;

--

Re: [Lazarus] Lazarus Release Candidate 1 of 2.0

2018-09-19 Thread Mark Morgan Lloyd via Lazarus

On 19/09/18 12:00, Mattias Gaertner via Lazarus wrote:

The Lazarus team is glad to announce the first release candidate ofLazarus 2.0.
This release was built with FPC 3.0.4.The previous release Lazarus 1.8.4 was 
built with FPC 3.0.4 as well.
Here is the list of fixes for Lazarus 
2.0.x:http://wiki.freepascal.org/Lazarus_2.0_fixes_branch
Here is the list of changes for Lazarus and Free 
Pascal:http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_noteshttp://wiki.lazarus.freepascal.org/User_Changes_3.0.4


Please could somebody (Martin?) review the final patch at 
https://bugs.freepascal.org/view.php?id=33935 which limits a hack I put 
in to certain widget sets (Qt will print a $00 character, GTK2 won't).


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2018-09-10 Thread Mark Morgan Lloyd via Lazarus

On 10/09/18 13:30, Bo Berglund via Lazarus wrote:

On Sun, 9 Sep 2018 20:44:34 +, Mark Morgan Lloyd via 
Lazarus wrote:

I did quite lot of work on the serial.pp unit more recently than that >wiki page, 
in fact I didn't even know it existed. Please refer to the >comments in that file 
in the first instance.

Thanks Mark,I did that too and there is stuff I don't find there, like:
Read blocking?--From interface section:
{ Reads a maximum of "Count" bytes of data into the specified buffer.  Result: 
Number of bytes read. }function SerRead(Handle: TSerialHandle; var Buffer; Count: 
LongInt):LongInt;
Does this function read whatever is in the buffer when called up to amaximum of 
Count, or does it actually wait until Count bytes havearrived? If it waits, for 
how long?


From further down:

function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): 
LongInt;

begin
  Result := fpRead(Handle, Buffer, Count);
end;

where the documentation for fpread() says

"FpdRead reads at most nbytes bytes from the file descriptor fd, and 
stores them in buf.


"The function returns the number of bytes actually read"

So this is a unix-style read that is prepared to read  Count  bytes, but 
returns the number actually available.


If you want timeouts then see SerReadTimeout(). I'd expect the Windows 
variants to behave the same (I tested Linux, Solaris and I think W2K, so 
there's a risk that newer versions behave differently). /If/ you find 
anomalies, please raise a bug report with the caveat that I have rather 
a lot of problems on my plate right now.



Concerning the com port name for SerOpen():
{ Open the serial device with the given device name, for example:\COM1, \COM2 
(strictly, \\.\COM1...) for normal serial ports.ISDN devices, serial port 
redirectors/virtualisers etc. normallyimplement names of this form, but refer to your 
OS documentation.  Returns "0" if device could not be found }function 
SerOpen(const DeviceName: String): TSerialHandle;


On Linux that is, again, a very thin wrapper around the RTL fpOpen() 
function, on Windows it's a wrapper around CreateFile(). I really can't 
say the extent that I tested that with odder devices and high port 
numbers (I think I took SerOpen() etc. pretty much as supplied by the 
original author), but from other serial libraries on Delphi my 
recollection is that that leading \\.\ is mandatory for higher-numbered 
ports... I /think/ I got up to 12 ports but that really was a very long 
time ago.


Note that C/C++ examples relating to that sort of thing will usually 
refer to .\\ because of the special significance of \ in strings.



In the Wiki example they use COMx: where x is a number, but this isprobably 
only working for single digit numbers 1..9.In any case the naming there is not 
described in serial.pp
I need to huse a high numbered com port since all I have is USB2Serialdongles, 
which typically get you a port number like 29...


I can't comment on Windows there but on Linux they typically get called 
something like /dev/USB0 etc., with a risk that the numeric suffix will 
increment if it's replugged. I've used that library fairly heavily on 
Linux for instrumentation type stuff, it works fairly well with USB 
devices except that their timing can get flaky if you're trying to get 
the exact time at which e.g. CTS changes state relative to a stream of 
characters faster than about 300 Baud.


When I was working on it the major thing I did was reorganise some of 
the flush/drain/sync stuff which was generally felt to be in a mess, add 
a bit more in the way of control signal interfacing, and add 
SerReadTimeout()... note the provision for an idle callback.


HTH.

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2018-09-09 Thread Mark Morgan Lloyd via Lazarus

On 09/09/18 12:00, Bo Berglund via Lazarus wrote:

I am writing a testing application for checking out a TCP to Serialbridge 
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 unitdescribed 
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 theWindows port naming is different 
than for higher port numbers...
And if I want to port this to Linux, I guess thta the name iscompletely 
different, but no hint is given.


I did quite lot of work on the serial.pp unit more recently than that 
wiki page, in fact I didn't even know it existed. Please refer to the 
comments in that file in the first instance.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Building a C (or possibly C++) program into a Lazarus app

2018-08-12 Thread Mark Morgan Lloyd via Lazarus

On 12/08/18 20:00, leledumbo via Lazarus wrote:

what's the current situation and future plans of > Lazarus as far as Android is 
concerned? I see mention of Laz4Android in > e.g. 
http://wiki.lazarus.freepascal.org/Android_tutorial : is that > mainstream or is 
there some other preferred solution?

Laz4Android is just a prepackaged Lazarus  + FPC + Android NDK. You cancreate 
Android apps using Custom Drawn Interface, but it's very incompleteand 
non-native. I don't see any better way than LAMW right now, at leastit's 
maintained, progressing, user requests are handled (quite fast), rathercomplete 
(just look at the demos, I don't think you need more than alreadyprovided 
components for most apps) and use native look and feel.


TFT, I'll investigate.

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Building a C (or possibly C++) program into a Lazarus app

2018-08-10 Thread Mark Morgan Lloyd via Lazarus

On 10/08/18 20:45, leledumbo via Lazarus wrote:

I find myself wondering whether > they could be given a more friendly frontend by 
wrapping them in a > Lazarus app, with an on-screen keyboard similar to what's found 
on a > tablet etc.

Sounds like my non-web hobby projects with Lazarus.

Is it possible to link a C or possibly C++ program into a Lazarus one by > 
simply calling its main() function? Has anybody actually done this?

I don't do that, though. Even if technically possible, there are hiddenstuffs 
you have to be aware of. main() is only a specification in Cstandard, where the 
user code starts. However, long before that, there's astartup mechanism 
specific to each implementation. In GCC, this is _start,absolutely 
non-portable. That's why the IMO better way is to communicateover pipes via 
TProcess.


Thanks for that. The program I'm thinking about is actually pretty 
simple and ancient- written by Ken Thompson- so I might be in with a chance.


What I'd /really/ like to do is port it- complete with UI helper- to 
Android. However at that point I have to add my voice to Bo's plea of a 
couple of weeks ago: what's the current situation and future plans of 
Lazarus as far as Android is concerned? I see mention of Laz4Android in 
e.g. http://wiki.lazarus.freepascal.org/Android_tutorial : is that 
mainstream or is there some other preferred solution?


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Building a C (or possibly C++) program into a Lazarus app

2018-08-10 Thread Mark Morgan Lloyd via Lazarus
Is it possible to link a C or possibly C++ program into a Lazarus one by 
simply calling its main() function? Has anybody actually done this?


I've got a couple of C/C++ programs which are based on stdin/stdout user 
interaction (no curses etc.) but have thoroughly unpleasant keyboard 
requirements and odd output encoding. I find myself wondering whether 
they could be given a more friendly frontend by wrapping them in a 
Lazarus app, with an on-screen keyboard similar to what's found on a 
tablet etc.


I would, obviously, be able to rename main() if necessary, as well as 
I/O functions.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debugging Lazarus using Lazarus

2018-07-07 Thread Mark Morgan Lloyd via Lazarus

On 07/07/18 10:45, Martin Frb via Lazarus wrote:
On 07/07/2018 11:46, Mark Morgan Lloyd via Lazarus wrote:> When multiple 
copies of the same version (e.g. trunk) Lazarus are > being run, with a 
view to stepping through a problem in IDE-related > code, is there any 
way to force an override so that all windows > associated with the 
"inner" copy are marked distinctively with e.g. an > implausible 
background colour, a thin diagonal line overlaying the > content, or at 
the very least an instance identifier in every caption?>In menu Run > 
Run Parameter, specify --primary-config-path=/somefolder
- Then on first run, go into options > editor > colors, and change 
whatever color you like. (e.g. background or gutter). well ok that is 
only the editor windows. It will not affect breakpoints, etc- The 
main IDE bar has/has not the word "debugging" in it.- You can also have 
a different projects open. As the last open project will be re-open, and 
that is stored in primary conf. With that, the debugged IDE will not 
open the stack and watches window (unless you want it to).


I've got /two/ main editor bars with "debugging" in them, two windws 
called "Source Editor (2)" and so on :-)


I'd have thought that a comparatively easy way round this would have 
been a global option to put the main-process PID on all form/dialogue 
captions. That would have result in a useful distinction even when 
multiple instances were using the same configuration files.


But I'm not volunteering to do it this weekend ;-)

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Debugging Lazarus using Lazarus

2018-07-07 Thread Mark Morgan Lloyd via Lazarus
When multiple copies of the same version (e.g. trunk) Lazarus are being 
run, with a view to stepping through a problem in IDE-related code, is 
there any way to force an override so that all windows associated with 
the "inner" copy are marked distinctively with e.g. an implausible 
background colour, a thin diagonal line overlaying the content, or at 
the very least an instance identifier in every caption?


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus IDE on Android (ARM and x86_64)

2018-06-29 Thread Mark Morgan Lloyd via Lazarus

On 29/06/18 16:00, Paul Breneman via Lazarus wrote:
On 06/24/2018 03:16 AM, Mark Morgan Lloyd via Lazarus wrote:> On 
24/06/18 01:00, Paul Breneman via Lazarus wrote:>> A couple of days ago 
I loaded UserLAnd on my Moto Z2 Android phone.  I >> then loaded fpc and 
got fpc 3.0.0 loaded for AArch64.  I have this web >> page started:  
www.turbocontrol.com/userland.htm>> Please try UserLAnd and report back 
how it works for you.  Hopefully >> you will get a 64-bit Debian 9.> >


Note that I'm specifically commenting on (and originally asking about) 
Termux, in part because of things I was being asked elsewhere. Also note 
that my Android tables is x86_64, not ARM (not my choice).


Console mode stuff is no problem, until one tries to use things like > 
pthread. Yesterday I set up a makefile for a project that did and got > 
bogged down with linkage errors, so it isn't simply that ld is > 
hardcoding references to the wrong .so file.


Any more info in the last 
five days Mark?  Thanks!
Did you get 64-bit FPC working?-- 


Haven't had time to experiment (I'm afraid I have problems here), but 
what I can say from looking at Termux in the past is that while it will 
run both 32- and 64-bit programs they've only got binutils (i.e. ld 
etc.) for 32.


I did try taking one of my programs that uses pthreads and writing a 
makefile for it so that I could compile up with FPC (rather than having 
to have Lazarus which obviously wouldn't work) but it still had pthreads 
problems i.e. it's not just the usual kind of symlink error.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus IDE on Android (ARM and x86_64)

2018-06-24 Thread Mark Morgan Lloyd via Lazarus

On 24/06/18 01:00, Paul Breneman via Lazarus wrote:
A couple of days ago I loaded UserLAnd on my Moto Z2 Android phone.  I 
then loaded fpc and got fpc 3.0.0 loaded for AArch64.  I have this web 
page started:  www.turbocontrol.com/userland.htm
Please try UserLAnd and report back how it works for you.  Hopefully you 
will get a 64-bit Debian 9.


Console mode stuff is no problem, until one tries to use things like 
pthread. Yesterday I set up a makefile for a project that did and got 
bogged down with linkage errors, so it isn't simply that ld is 
hardcoding references to the wrong .so file.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Lazarus IDE on Android (ARM and x86_64)

2018-06-23 Thread Mark Morgan Lloyd via Lazarus
I'm aware of 
http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android and 
assume it's fairly current, but could somebody give me a quick summary 
of where Lazarus is when it comes to running the IDE etc. on a tablet? 
I'm in a situation elsewhere where I need to compare notes with a Kotlin 
developer.


I'm able to run i386 FPC using Termux on x86_64 Android, but more 
sophisticated programs appear to have problems because libpthread/libdl 
has been rebundled.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2018-05-09 Thread Mark Morgan Lloyd via Lazarus

On 09/05/18 10:45, Joost van der Sluis via Lazarus wrote:
Op 08-05-18 om 13:46 schreef Giuliano Colla via Lazarus:> 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 "$@" That's more a 
hack then a solution, and the real solution is simple and also works 
outside Lazarus: place the fpc.cfg in ~/experiments/etc, 
~/development/etc etc, as already suggested by Ingo. Or, even better, 
just alongside the compiler-executable. You can call 'fpc -va' to check 
which configuration file is used.
See the documentation for more info: 


On Linux and Solaris I have a /usr/local/bin/fpc.d directory containing 
multiple versions. In /usr/local/bin I basically have


fpc
fpc.d
fpcres
ppcx64 -> ppcx64-3.0.2
ppcx64-2.6.4 -> /usr/local/lib/fpc/2.6.4/ppcx64
ppcx64-3.0.0 -> /usr/local/lib/fpc/3.0.0/ppcx64

It works well except for building FPC itself when I have to modify the 
ppcx64 symlink, and there were problems with trunk at some point when it 
ignored instruction to install into e.g. fpc.d/2.7.1


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Qt WS on Raspberry pi 3

2018-05-02 Thread Mark Morgan Lloyd via Lazarus

On 02/05/18 15:15, Giuliano Colla via Lazarus wrote:

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.


When you say "WS" what specifically do you mean? I've run the Qt IDE and 
programs compiled for Qt on Raspbian on occasion, and apart from the 
usual problems of element spacing being slightly adrift etc. have had no 
significant issues that wouldn't be expected on a PC... noting obviously 
the current problems that somebody has with VNC, which I don't think is 
really a Raspbian issue.


Something like two or maybe three years ago I tried to graft KDE onto 
Raspbian and it wasn't entirely successful, but there were other factors 
involved (e.g. a 4K screen which was pushing the graphics capability at 
the time). Most of the time we run a hybrid of the Raspbian kernel and 
Debian apps etc., to a variety of 1080p and 4K screens.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Google vs Oracle case - does it affect LCL ?

2018-04-15 Thread Mark Morgan Lloyd via Lazarus

On 15/04/18 10:30, Graeme Geldenhuys via Lazarus wrote:

On 2018-04-15 09:42, Adrian Veith via Lazarus wrote:> What do you think ?
It will never concern or worry use. Why...? If Embarcadero can't evenbother, or 
simply can't stop Code Typhon in shipping a leaked FMXframework, why would 
Google, Oracle or Microsoft bother with somethingas small as FPC or Lazarus. 
They just wont - it will be a colossal wasteof time for them with no financial 
reward.



I'd suggest that that is not a safe assumption: "We didn't think anybody 
would notice" has never been a valid defence, and copyright is governed 
by international treaties.



Leaving aside the question of jurisdiction and differing tolerance of 
reverse engineering etc. in different countries, I'd suggest that the 
most relevant thing is that at one point the company that owned the 
rights to Delphi made commercial use of the FPC compiler. They cannot 
claim to be ignorant of the function and structure names in the FCL, and 
the fact that they (presumably) did not challenge the FPC developers at 
that point would probably make it more difficult to do so now.



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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Terminal Component Available

2018-04-12 Thread Mark Morgan Lloyd via Lazarus

On 12/04/18 05:45, R0b0t1 via Lazarus wrote:


Did you ever try to make it cross platform? I only ask as I have notfound a 
good way to embed either PowerShell or cmd.exe.


I did it years ago for cmd.exe on Delphi, I think it used pipes in some 
form.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] E,bedding a terminal window in Lazarus

2018-04-10 Thread Mark Morgan Lloyd via Lazarus

On 10/04/18 03:30, leledumbo via Lazarus wrote:

I am considering writing an IDE package to do this, but wanted to know ifanyone 
knows if this has been done before

AFAIK, no. Previous  attempts don't embed actual terminal, but use aterminal 
like component with application controlled command to execute.


Could I throw one thing in here which probably isn't immediately helpful.

A couple of months ago, working on Linux, I experimented with embedding 
Xnest/Xephyr sessions in LCL (GTK2?) panels, with the object being to 
present multiple copies of a program that refused to run more than one 
instance per X server on the same screen.


It didn't work directly, but I was /was/ in the end able to embed an 
xterm in an LCL panel, then embed Xnest/Xephyr in the xterm... it was 
crude since I'd put minimal effort into sizing etc. the panels, but it 
worked as a POC.


So I suspect that there's something- possibly a Window Manager hint- 
that's being unnecessarily propagated into panels that possibly needn't 
be, and that is likely to cause problems embedding at least some 
standalone programs (as distinct from specially-written components).


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus - Windows NT4

2018-04-09 Thread Mark Morgan Lloyd via Lazarus

On 08/04/18 21:15, Graeme Geldenhuys via Lazarus wrote:


But like I also mentioned... "you might be lucky" in that that is theonly non 
NT4 API. If you are not so lucky, then there might be otherAPI's that also break NT4 
support. In which case it might be worth usingan older LCL version for that application, 
or adding IFDEF's toLCL-Win32 to keep NT4 support going for a while longer. The amount 
ofeffort is up to the original poster of this thread.


There's actually two cases here. The first is where a statically-linked 
entry point is not available, which can only be fixed by an IFDEF.


The second is where a function is available but not fully implemented, 
and where the caller- i.e. code written by an FPC or Lazarus 
contributor- isn't checking for an error in an ill-considered attempt at 
efficiency.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus - Windows NT4

2018-04-07 Thread Mark Morgan Lloyd via Lazarus

On 06/04/18 18:30, Graeme Geldenhuys via Lazarus wrote:

On 2018-04-06 16:26, Reinhold via Lazarus wrote:> I compiled a lazarus project with lazarus 
1.8.0 and 1.8.2. This error > occurs (s. appendix):> > With 1.6.4 is no problem.> 
> Is this a bug, or is Win NT4 out of time?
It's not so much about Lazarus as far as I know, but more about whichversion of 
FPC (the compiler) you are using. You can install differentversions of FPC and 
use them all with the same copy of Lazarus - I dothis all the time.
You probably need FPC 2.6.x or FPC 2.4.x to support NT4. I'm sure thewiki will 
tell you when which Windows versions got dropped. Search thewiki for the FPC 
changelogs.


I agree, with the caveat that each version of Lazarus tends to work with 
a fairly tight range of compiler versions.


I can't give accurate version numbers without spending time looking 
things up, but somewhere around 2.6.x FPC started assuming Unicode 
handling that was documented but unimplemented in NT4. At that point 
there was a simple patch which could be applied to the RTL (?) to fix 
it, but realistically it made that version the last that supported NT 
(and I suspect '98).


I appreciate that some people have no choice but to use NT4, typically 
because it is running on rack-mounted "industrial computers" or similar. 
But I'd suggest that wherever there is a choice it would be better to 
look at W2K if at all possible, which while still well out of support at 
least doesn't "self destruct" like XP. At the very least, use W2K for 
development and then test on NT4.


18803 is relevant but might not be the only issue.

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-13 Thread Mark Morgan Lloyd via Lazarus

On 13/03/18 09:00, José Mejuto via Lazarus wrote:
El 13/03/2018 a las 9:21, Mark Morgan Lloyd via Lazarus escribió:>>> 
Yes, the modal form appears while the mouse button is held down (for >>> 
both GTK2 and Qt).>>>>>>> So, yes, seem that grid expects mouseup>


I think the proper solution is to instruct GTK2 to use the MOUSE_UP 
event, but meanwhile QueueAsyncCall will not be the solution as when the 
AsyncCall will be processed grid will be still waiting for MOUSE_UP, so 
my solution would be add a MOUSE_UP and MOUSE_DOWN handlers, something 
like this in pseudo code:

MOUSE_DOWN:   SelectChanged:=false;
ON_SELECT:   SelectChanged:=true;
MOUSE_UP:   if SelectChanged then Form.ShowModal();


I can confirm that that approach appears reliable.

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-13 Thread Mark Morgan Lloyd via Lazarus

On 13/03/18 09:00, José Mejuto via Lazarus wrote:
El 13/03/2018 a las 9:21, Mark Morgan Lloyd via Lazarus escribió:>>> 
Yes, the modal form appears while the mouse button is held down (for >>> 
both GTK2 and Qt).>>>>>>> So, yes, seem that grid expects mouseup> > Is 
there a portable way this can be sent? Otherwise I presume I could > 
fudge it with something like QueueAsyncCall()... unless that also went> 
through before the mouse activity was sorted out.> > I'm fairly keen to 
hack this in such a way that it's not tied to one > version of the LCL 
since I want this program to be fairly easy to build > even for people 
with an old (or no existing) copy of Lazarus etc.

Hello,
I think the proper solution is to instruct GTK2 to use the MOUSE_UP 
event, but meanwhile QueueAsyncCall will not be the solution as when the 
AsyncCall will be processed grid will be still waiting for MOUSE_UP, so 
my solution would be add a MOUSE_UP and MOUSE_DOWN handlers, something 
like this in pseudo code:

MOUSE_DOWN:   SelectChanged:=false;
ON_SELECT:   SelectChanged:=true;
MOUSE_UP:   if SelectChanged then Form.ShowModal();


Thanks, I'd just about worked that one out. I'll try later- I'm spending 
the day helping with some flocking sheep ;-)


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-13 Thread Mark Morgan Lloyd via Lazarus

On 13/03/18 08:00, zeljko wrote:

On 03/12/2018 08:05 PM, Mark Morgan Lloyd via Lazarus wrote:

On 12/03/18 17:45, José Mejuto via Lazarus wrote:
El 12/03/2018 a las 18:25, Mark Morgan Lloyd via Lazarus escribió:> 


On the main form I've got (a tabbed notebook containing multiple > 
instances of) a TStringGrid. The OnSelection event invokes a modal 
form > (containing nothing of significant complexity) with OK and 
Cancel > buttons, and stripped down looks like this:

Hello,
Just for testing the OnSelection is raised by mouse click ? If the 
answer is yes, try to click the cell and keep the mouse button 
pressed. If the form appears the grid is still waiting for a MOUSE_UP 
(thinking you are holding MOUSE_DOWN to perform a selection) and the 
modal form has its own queue, so MOUSE_UP never arrives.


Yes, the modal form appears while the mouse button is held down (for 
both GTK2 and Qt).




So, yes, seem that grid expects mouseup


Is there a portable way this can be sent? Otherwise I presume I could 
fudge it with something like QueueAsyncCall()... unless that also went

through before the mouse activity was sorted out.

I'm fairly keen to hack this in such a way that it's not tied to one 
version of the LCL since I want this program to be fairly easy to build 
even for people with an old (or no existing) copy of Lazarus etc.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-12 Thread Mark Morgan Lloyd via Lazarus

On 12/03/18 18:15, zeljko wrote:

On 03/12/2018 06:25 PM, Mark Morgan Lloyd via Lazarus wrote:
Running on (Debian) Linux on AMD64 or ARM, Lazarus 1.6.4 and FPC 
3.0.2, I'm seeing different behaviour depending on whether a program 
uses Qt or GTK2. The program changes the hardware configuration of a 
mouse (Logitech G600) using hidraw, and as such needs to run with root 
privilege (e.g. kdesudo or sudo -E).


On the main form I've got (a tabbed notebook containing multiple 
instances of) a TStringGrid. The OnSelection event invokes a modal 
form (containing nothing of significant complexity) with OK and Cancel 
buttons, and stripped down looks like this:


procedure TFormLG600.StringGridMode1UnshiftedSelection(Sender: 
TObject; aCol, aRow: Integer);


begin
{...}
   if ButtonsAndKeys.ShowModal() = mrOk then begin
{...}
   end
end;

This is fine if built for Qt, but if built for GTK2 what I see is that 
after the modal form is exited any mouse activity over the grid 
appears to cause an erratic multicell selection and the modal form 
immediately pops up again. This is reproducible if the Cancel button 
is pressed, and in at least some cases after OK.


I've seen indeterminate discussion of this in the foramina, and have 
followed up the indicated wiki pages etc. Does anybody have any 
suggestions, preferably not along the lines of "don't use GTK2" since 
I was thinking of sticking this on Sourceforge and that restriction 
would probably be unpopular?




hmm, try LCLIntf.SetCapture(0) after closing modal form , just to 
isolate capture problems.


Like this?

}  end

;  LCLIntf.SetCapture(0)

end { TFormLG600.StringGridMode1UnshiftedSelection } ;

No obvious change- what should I be looking for?

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TStringGrid and cancelling a modal form

2018-03-12 Thread Mark Morgan Lloyd via Lazarus

On 12/03/18 17:45, José Mejuto via Lazarus wrote:
El 12/03/2018 a las 18:25, Mark Morgan Lloyd via Lazarus escribió:> 


On the main form I've got (a 
tabbed notebook containing multiple > instances of) a TStringGrid. The 
OnSelection event invokes a modal form > (containing nothing of 
significant complexity) with OK and Cancel > buttons, and stripped down 
looks like this:

Hello,
Just for testing the OnSelection is raised by mouse click ? If the 
answer is yes, try to click the cell and keep the mouse button pressed. 
If the form appears the grid is still waiting for a MOUSE_UP (thinking 
you are holding MOUSE_DOWN to perform a selection) and the modal form 
has its own queue, so MOUSE_UP never arrives.


Yes, the modal form appears while the mouse button is held down (for 
both GTK2 and Qt).


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TStringGrid and cancelling a modal form

2018-03-12 Thread Mark Morgan Lloyd via Lazarus
Running on (Debian) Linux on AMD64 or ARM, Lazarus 1.6.4 and FPC 3.0.2, 
I'm seeing different behaviour depending on whether a program uses Qt or 
GTK2. The program changes the hardware configuration of a mouse 
(Logitech G600) using hidraw, and as such needs to run with root 
privilege (e.g. kdesudo or sudo -E).


On the main form I've got (a tabbed notebook containing multiple 
instances of) a TStringGrid. The OnSelection event invokes a modal form 
(containing nothing of significant complexity) with OK and Cancel 
buttons, and stripped down looks like this:


procedure TFormLG600.StringGridMode1UnshiftedSelection(Sender: TObject; 
aCol, aRow: Integer);


begin
{...}
  if ButtonsAndKeys.ShowModal() = mrOk then begin
{...}
  end
end;

This is fine if built for Qt, but if built for GTK2 what I see is that 
after the modal form is exited any mouse activity over the grid appears 
to cause an erratic multicell selection and the modal form immediately 
pops up again. This is reproducible if the Cancel button is pressed, and 
in at least some cases after OK.


I've seen indeterminate discussion of this in the foramina, and have 
followed up the indicated wiki pages etc. Does anybody have any 
suggestions, preferably not along the lines of "don't use GTK2" since I 
was thinking of sticking this on Sourceforge and that restriction would 
probably be unpopular?


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2018-02-25 Thread Mark Morgan Lloyd via Lazarus

On 25/02/18 20:00, Carlos E. R. via Lazarus wrote:

-BEGIN PGP SIGNED MESSAGE-Hash: SHA1

Hi,
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:


I used "OpenC2Pas" but there remains quite a lot to translate.


etc. Presumably the original looks something like 
https://github.com/unterwulf/egctl/blob/master/egctl.c


I've just been through a comparable exercise writing a utility to 
program a Logitech G600 gamer's mouse, and my suggestion would be to use 
Wireshark etc. to get an understanding of the messages going over the 
network then to transcribe the bits of the program you need into Pascal 
manually.


Assuming that since you're asking on the Lazarus ML you're putting 
together a GUI to control the device you probably won't want roughly 
half of the original code which is using C-style string operations to 
read a configuration file.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Linux: howto define file *.lpi to be opened with lazarus?

2018-01-15 Thread Mark Morgan Lloyd via Lazarus

On 15/01/18 17:30, John Landmesser via Lazarus wrote:
I'm on Linux-Mint Cinnamon and i want to associate *.lpi with lazarus 
Application:

*.lpi is of Filetype XML, but we need the fileExtension *.lpi here!!
found:
lazarus.desktop
copied:
  cp '/home/john1/lazarus/install/lazarus.desktop' /usr/share/applications/
and
lazarus-mime.xml
copied:
  cp '/home/john1/lazarus/install/lazarus-mime.xml' 
'/usr/share/mime/application/'
Content of these two files seems to define for what i'm looking for, but 
reboot wasn't enough.

What i'm missing to get the filetypes/extension-Database updated?
Tipps are welcome!!


Possibly one of the xdg-* programs... a bit of Googling suggests xdg-mime

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Embedding an X11 server as a component

2017-12-26 Thread Mark Morgan Lloyd via Lazarus
Is it possible to embed the main window of another program into a pane 
in something written using Lazarus, letting the Lazarus program provide 
the "furniture" functionality that's usually handled by the window manager?


The scenario I'm thinking about is putting multiple instances of 
something non-trivial like Wireshark into an overall "wrapper".


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TTrackbar and Wine

2017-12-23 Thread Mark Morgan Lloyd via Lazarus

On 22/12/17 15:00, Giuliano Colla via Lazarus wrote:

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.


As a non-expert I don't like raising my head above the parapet, and I 
very much don't want to appear to be criticising anybody's work.


Incompatibilities in Wine are not unknown. I know somebody who found 
that a specialist comms program we both used misbehaved under Wine, he 
localised and reported the bug to the Wine developers and it was fixed 
promptly. The twist in that particular case is that the program 
concerned was written by somebody who then moved to MS, and he might 
have done maintenance on it with "a more complete understanding of the 
API than is normally documented".


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Character" -> "Codepoint" in LazUTF8 function names

2017-12-12 Thread Mark Morgan Lloyd via Lazarus

On 12/12/17 16:00, Juha Manninen via Lazarus wrote:

On Tue, Dec 12, 2017 at 5:10 PM, Mark Morgan Lloyd via 
Lazarus<lazarus@lists.lazarus-ide.org> wrote:> I think it was IBM introduced the term 
no later than the 80s when people> started using codepages. It might have been related to 
CUA, and it was used> in the context of both ASCII and EBCDIC.
Ok, I learn new things every day. :)


:-) It might go back at least as far as IBM's GDDM from 1979. In IBM's 
context, I think a codepoint would have represented a numeric value 
which was translated by lookup in a (single- or double-byte) codepage to 
a glyph, with the obvious gross differences depending on whether the 
codepage family was ASCII or EBCDIC. I think Unicode usage is fairly 
consistent with that, assuming that codepage lookup was brushed under 
the carpet as a manufacturer-specific detail.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Character" -> "Codepoint" in LazUTF8 function names

2017-12-12 Thread Mark Morgan Lloyd via Lazarus

On 12/12/17 14:15, Juha Manninen via Lazarus wrote:

On Tue, Dec 12, 2017 at 11:51 AM, Mark Morgan Lloyd via Lazarus<lazarus@lists.lazarus-ide.org> wrote:> 
Agreed, but I hope nobody tries to retrofit any more IBMisms like "octet"> instead of 
"byte" :-)
Where did you get the connection for IBM?AFAIK "codepoint" is not related to 
IBM but it is an essential part of Unicode.


I think it was IBM introduced the term no later than the 80s when people 
started using codepages. It might have been related to CUA, and it was 
used in the context of both ASCII and EBCDIC.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] "Character" -> "Codepoint" in LazUTF8 function names

2017-12-12 Thread Mark Morgan Lloyd via Lazarus

On 11/12/17 22:00, Graeme Geldenhuys via Lazarus wrote:
On 2017-12-11 20:11, Juha Manninen via Lazarus wrote:> I changed 
"Character" to "Codepoint" in some LazUTF8 function names in> r56692. 
Please take a look.> "Codepoint" is more accurate and hopefully reduces 
confusion.
I haven't looked at the code changes, but fully agree with the 
sentiment. Getting the terminology correct is already a great leap 
forward in the right direction.


Agreed, but I hope nobody tries to retrofit any more IBMisms like 
"octet" instead of "byte" :-)


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


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

2017-10-27 Thread Mark Morgan Lloyd via Lazarus

On 27/10/17 12:30, Marcos Douglas B. Santos via Lazarus wrote:

I would like to propose a discussion about "What is the relevance ofObject Pascal 
nowadays".I don't want waste your time. I just want to know if we are growingand 
being more relevant or not.
I use Object Pascal (mostly FPC, some old Delphi) in production tomake real applications. But we 
are seeing more and more "newframeworks", "new technologies" and new languages 
that are become morerelevant.
What do you think?


We are, but for in-house services rather than selling stuff for outside use.

If challenged I call it a 4GL, in the vein of the 4GLs that were popular 
in the late 80s and early 90s. It's an exceptionally good tool for 
certain types of job, and the fact that it is descended from Pascal is 
irrelevant.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] custom thread reading file does not respond properly

2017-09-05 Thread Mark Morgan Lloyd via Lazarus

On 05/09/17 13:00, Andrea Mauri via Lazarus wrote:

Dear all,
I have an issue using threads on OSX.Basically I have a thread reading a 
file and looking for a string match.I have no problem on win and linux 
but on osx my thread updates the form but my application does not 
respond.I opened a topic on the forum 
(https://forum.lazarus.freepascal.org/index.php/topic,38146.0.html), I 
would like a more satisfactory answer. I am trying here.
If possible, I would like to understand if this behaviour is related to 
OSX or SSD drive. If related to OSX I can simply add IFDEF DARWIN 
calling sleep?If it is related to SSD how can I manage it?


James Richters on the fpc-pascal ML commented on SSD commit problems in 
March. However I don't see why something like that should spill over to 
the UI.


I notice that multiple people have already told you not to use a tight 
loop, and that applies to any OS.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Attaching GDB to running process

2017-08-31 Thread Mark Morgan Lloyd via Lazarus

On 30/08/17 22:30, Cyrax via Lazarus wrote:
On 31/08/17 00:22, Mark Morgan Lloyd via Lazarus wrote:> I'm sorry to 
have to ask this, but can somebody remind me please how to > get Lazarus 
to attach gdb to a running program by GDB? I think I'm > having a 
"senior moment".> > (Debian on x86_64 etc.)



Run->Attach to program


I don't appear to have that, which is odd because I'm sure I've I've 
used this copy of Lazarus (1.0.14) working on this project to do it a 
few weeks ago.


I see it on 1.6.4, was it hidden on a form somewhere earlier?

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Attaching GDB to running process

2017-08-30 Thread Mark Morgan Lloyd via Lazarus
I'm sorry to have to ask this, but can somebody remind me please how to 
get Lazarus to attach gdb to a running program by GDB? I think I'm 
having a "senior moment".


(Debian on x86_64 etc.)

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] (Local) variable value hints

2017-06-07 Thread Mark Morgan Lloyd via Lazarus

On 06/06/17 20:00, Ondrej Pokorny via Lazarus wrote:

On 06.06.2017 21:54, Mark Morgan Lloyd via Lazarus wrote:> Bearing in
mind things like the %H hint that Lazarus uses to suppress > warning
messages, is there anything comparable that can be applied to > a
variable so that when the IDE pops up a value during debugging it > will
always be shown in a certain format?>> ..> end else begin>   euCount :=
cardEsu;>   euVector := sysEuVector <=== THIS ONLY MEANINGFUL AS HEX OR
BINARY



You can define your own value formatter with
TBaseDebugManagerIntf.RegisterValueFormatter
But: it works on a type-basis and not variable name basis. So define a
specific type euVector:
  TeuVector = type Integer; // or type whatever
and then register it with RegisterValueFormatter(skSimple, 'TeuVector',
@MyFormatFunction);
See how TDateTime is handled in ide/debugmanager.pas


So does that mean that the IDE has to be tailored for a specific project?

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] (Local) variable value hints

2017-06-06 Thread Mark Morgan Lloyd via Lazarus
Bearing in mind things like the %H hint that Lazarus uses to suppress 
warning messages, is there anything comparable that can be applied to a 
variable so that when the IDE pops up a value during debugging it will 
always be shown in a certain format?


..
end else begin
  euCount := cardEsu;
  euVector := sysEuVector <=== THIS ONLY MEANINGFUL AS HEX OR BINARY
end;
Assert(euCount * euVector > 0, 'Bad EU count or vector');

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus 1.8 RC1 under Raspbian Jessie

2017-06-06 Thread Mark Morgan Lloyd via Lazarus

On 06/06/17 06:30, Joe via Lazarus wrote:

Am 30.05.2017 um 00:36 schrieb Bo Berglund via Lazarus:> The corrected
script is found here:>
http://blog.boberglund.com/install_lazfpc_local_pi.sh.On Pi Zero W,
using the ARMv6 option and De-de locale, i get this error message:
"make: -iVSPTPSOTO Kommando nicht gefunden"
What does this say? How to fix?


It says it can't find the compiler binary. Hopefully Bo will be able to 
give you some direct help, but the classical way of fixing it would be 
by something like


make clean all PP=ppcXXX

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus 1.8 RC1 under Raspbian Jessie

2017-05-27 Thread Mark Morgan Lloyd via Lazarus

On 27/05/17 09:40, Joe via Lazarus wrote:

Am 26.05.2017 um 15:29 schrieb Mark Morgan Lloyd via Lazarus:> Just to
check the "standard way of doing it" in case there's any > surprises,
with FPC 3.0.2 installed:>> svn co
http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_8_0_RC1> cd
lazarus_1_8_0_RC1> make>> That worked as expected.>> make clean bigide
Mark,I installed FPC 3.0.2 and then followed your proposal. But the
compilation of Lazarus 1.8.0 RC1 was aborted with an error message
saying FPC 3.0.0 was needed.How to fix?


Make sure that the ppcarm command points to the 3.0.2 binary. Here's 
what I've got in my /usr/local/bin:


lrwxrwxrwx 1 root staff 12 Mar 25 14:14 ppcarm -> ppcarm-3.0.2
lrwxrwxrwx 1 root staff 31 Mar 25 14:13 ppcarm-3.0.2 -> 
/usr/local/lib/fpc/3.0.2/ppcarm


The fpc -v command should give you version info:

$ fpc -v
Free Pascal Compiler version 3.0.2 [2017/03/02] for arm
Copyright (c) 1993-2017 by Florian Klaempfl and others
Fatal: No source file name in command line
Fatal: Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus 1.8 RC1 under Raspbian Jessie

2017-05-26 Thread Mark Morgan Lloyd via Lazarus

On 26/05/17 15:02, Bo Berglund via Lazarus wrote:

On Fri, 26 May 2017 13:29:50 +, Mark Morgan Lloyd via 
Lazarus<lazarus@lists.lazarus-ide.org> wrote:

Just to check the "standard way of doing it" in case there's any >surprises, with FPC 3.0.2 installed:>>svn co 
http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_8_0_RC1>cd lazarus_1_8_0_RC1>make>>That worked as expected.>>make clean 
bigide>>That also worked, except that there was a message about >EditorMacroScript at startup. A purist woult probably object that the >binary 
hadn't been added to the desktop environment's menu.>>That's an up-to-date "full" Raspbian (i.e. not "lite").

I made the script in order to install "everything" on a bare bones RPiwith 
Raspbian from the install image. So it therefore also installsFPC, then Lazarus. And it 
uses a start compiler I made myself since Icould not find any 3.0.0 FPC for ARMHF on RPi 
at the time.It is downloaded as part of running the script.


My apologies, but since you hadn't tested it for the current RC I 
assumed you'd abandoned it.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus 1.8 RC1 under Raspbian Jessie

2017-05-26 Thread Mark Morgan Lloyd via Lazarus

On 26/05/17 11:20, Bo Berglund via Lazarus wrote:

On Thu, 25 May 2017 18:46:43 +0200, Joe via 
Lazarus wrote:

I am trying to test Lazarus 1.8 RC1 (and following versions) under >Raspbian Jessie with 
PIXEL.>But unfortunately I could not find any instructions or scripts helping >to 
install *this* RC.>Any hint?

You could try my script for installation of FPC + Lazarus on an 
RPi3.http://blog.boberglund.com/install_lazfpc_local_pi.sh
In order to get the version you need just edit the script beforerunning it and 
replace the versions at the top of the file with theone you want.It will 
install into the pi user space rather than make a globalinstallation using sudo.
I have not tested with the more recent Lazarus 1.8, but it worked finewith 
1.6RCx and 1.6 release.


Just to check the "standard way of doing it" in case there's any 
surprises, with FPC 3.0.2 installed:


svn co http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_8_0_RC1
cd lazarus_1_8_0_RC1
make

That worked as expected.

make clean bigide

That also worked, except that there was a message about 
EditorMacroScript at startup. A purist woult probably object that the 
binary hadn't been added to the desktop environment's menu.


That's an up-to-date "full" Raspbian (i.e. not "lite").

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Startup environment: to Gui, or not to GUI?

2017-05-04 Thread Mark Morgan Lloyd via Lazarus

On 11/04/17 09:30, Mark Morgan Lloyd via Lazarus wrote:

Apologies if this is an FAQ.
Is there an orthodox way that a Lazarus program can very early on look
at how it's been started and decide whether it can usefully fall back to
a text mode, e.g. to display help info on stdout rather than a messagebox?
I'm tinkering with something (a media test program for SDCards etc.)
which I'd like to either run as a conventional console program, or using
a GUI. I've previously written stuff where operation was entirely
dependant on command-line options, but haven't tried making the decision
completely automatically.


In case it helps anybody avoid wasted time: looking carefully at what 
I've been doing, it turns out that it's not possible to make an 
LCL-based program running on unix (i.e. with X11 etc.) to fall back 
cleanly to text mode, such that it could be run on e.g. a serial 
terminal, by manipulating the main program unit (.lpr or whatever).


The problem is that the main unit will import LCL units which assume the 
presence of X11 or equivalent, and that they will attempt to initialise 
themselves before the main block in the .lpr is run. Hence any attempted 
decision in the .lpr is too late to be of much use.


A program can fairly easily be written such that if it's started from a 
shell wrapped in a GUI (Konsole, xterm or whatever) it can display help 
or version text and quit in good order. The same applies if it's run 
from an SSH session provided that X11 tunnelling is enabled. But it 
won't run over e.g. a serial line or from the main console on a non-GUI 
system, and will probably give problems is executed as root using sudo 
or setuid.


There might be ways of working round this using a special unit imported 
early (i.e. like cmem etc.), I've not experimented with that approach.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How can I write to arbitrary position on device

2017-05-04 Thread Mark Morgan Lloyd via Lazarus

On 13/04/17 07:30, Mark Morgan Lloyd via Lazarus wrote:

On 12/04/17 21:30, Carlos E. R. via Lazarus wrote:> Hi,> I'm new on this
list, so if I should post this to a different place,> just tell me.> I
want to find a function that I can use on Linux to write a memory> block
to an arbitrary position on a device, say, /dev/sda or /dev/sda5 .> I
can do that on an opened file with seek() and write(), but apparently>
only on files. I need accessing the raw disk device. So currently I
call> 'dd' instead.> I also had problems with blockread/write: it failed
reading more than> one megabyte.
That's interesting, I need to look at some medium testing stuff over the
next few days and was assuming I'd need to check the dd sources. Are you
running as root to get direct access to the device?


In case this is useful to anybody at any point: I was filling a device 
with a pattern and then reading it back, and found that the read time 
depended crucially on the amount of RAM available (relative to the size 
of device I was testing). This turned out to be because I was relying on 
Reset() with FileMode = 2 to open the file R/W, but this was causing the 
Linux kernel to buffer as much as possible in RAM. Switching to using 
Rewrite(), then closing and reopening with Reset() only if needed, 
resulted in predictable performance.


So I think that the lesson is that Reset() should only be used for R/W 
files when the write and read operations are expected to be 
comparatively close to each other in time and position.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compiling Cudatext on RPi 3

2017-04-14 Thread Mark Morgan Lloyd via Lazarus

On 14/04/17 07:30, Alexey via Lazarus wrote:

Hi,
I'm new to RPi 3. only byed it (sum is bigger than in Europe).
Maybe someone helps to compile CudaText on RPi, ie ARM. I can distribute
compiled app. as ARM version. On Raspbian i don't know how to install
Lazarus, FPC, svn ..
ps. I can put to site url to your homepage (with compiled arm version)


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

http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi

And please stop sending me direct emails. I've already said- twice- that 
this is the place to discuss it, and sending me a third this morning is 
doing nothing to make me more cooperative.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How can I write to arbitrary position on device

2017-04-13 Thread Mark Morgan Lloyd via Lazarus

On 12/04/17 21:30, Carlos E. R. via Lazarus wrote:

Hi,
I'm new on this list, so if I should post this to a different place,
just tell me.
I want to find a function that I can use on Linux to write a memory
block to an arbitrary position on a device, say, /dev/sda or /dev/sda5 .
I can do that on an opened file with seek() and write(), but apparently
only on files. I need accessing the raw disk device. So currently I call
'dd' instead.
I also had problems with blockread/write: it failed reading more than
one megabyte.


That's interesting, I need to look at some medium testing stuff over the 
next few days and was assuming I'd need to check the dd sources. Are you 
running as root to get direct access to the device?


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Startup environment: to Gui, or not to GUI?

2017-04-11 Thread Mark Morgan Lloyd via Lazarus

On 11/04/17 16:00, Henry Vermaak via Lazarus wrote:

On Tue, Apr 11, 2017 at 01:34:35PM +, Mark Morgan Lloyd via Lazarus wrote:> Something like this does appear to work, tested on Linux 
only.> > function notGui(): boolean;> > var i: integer;> > begin>   i := IsaTty(Input);> {$ifdef ISGUI }>   exit 
false;> {$endif ISGUI }> {$ifdef NOGUI }>   exit true;> {$endif NOGUI }>   result := i <> 0> end { notGui } ;> > 
The explicit overrides might be needed during debugging, since the> involvement of gdb forces the program to think it's being run from a 
shell> session.
I'd recommend making the overrides command line parameters.  That wayyou do 
away with the ifdefs and a user can always override it if yourlogic somehow 
doesn't do the right thing.


I agree, --GUI and --TUI by choice (case-sensitive, no short form). But 
from the POV of getting a statement of what appeared to work and its 
limitations into the record I didn't want to introduce anything extraneous.



Looking back through older sources, I've had to jump through hoops-> reopening the 
input and using GetFileType() under Windows- to find out> whether stdin was piped. 
Fortunately I don't need that here.

The experience on Windows is pretty awful and I've seen some interestingtricks 
to get a program to do the right thing based on where it waslaunched from.  For 
example, Visual Studio's devenv.com vs. devenv.exe,using the fact that .com 
takes preference over .exe in the terminal tohandle the command line parameters 
and sending output to the terminalthat it was called from.


Regrettably, investigating that sort of thing in too much depth can get 
one flagged as a malware writer. A few days ago I saw something very odd 
happen as a result of some search terms I used when reading up about a 
particular comms protocol.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Startup environment: to Gui, or not to GUI?

2017-04-11 Thread Mark Morgan Lloyd via Lazarus

On 11/04/17 10:30, Mark Morgan Lloyd via Lazarus wrote:

On 11/04/17 10:00, Henry Vermaak via Lazarus wrote:> On Tue, Apr 11,
2017 at 09:15:16AM +0000, Mark Morgan Lloyd via Lazarus wrote:>
Apologies if this is an FAQ.> > Is there an orthodox way that a Lazarus
program can very early on look at> how it's been started and decide
whether it can usefully fall back to a text> mode, e.g. to display help
info on stdout rather than a messagebox?> isatty() is traditionally used
for this on POSIX operating systems.It's in unit termio.
Thanks Henry, I'll check. I know I've used it in the past when deciding
whether a program was actually being fed piped input etc.


Something like this does appear to work, tested on Linux only.

function notGui(): boolean;

var i: integer;

begin
  i := IsaTty(Input);
{$ifdef ISGUI }
  exit false;
{$endif ISGUI }
{$ifdef NOGUI }
  exit true;
{$endif NOGUI }
  result := i <> 0
end { notGui } ;

The explicit overrides might be needed during debugging, since the 
involvement of gdb forces the program to think it's being run from a 
shell session.


Looking back through older sources, I've had to jump through hoops- 
reopening the input and using GetFileType() under Windows- to find out 
whether stdin was piped. Fortunately I don't need that here.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Startup environment: to Gui, or not to GUI?

2017-04-11 Thread Mark Morgan Lloyd via Lazarus

On 11/04/17 11:00, Tony Whyman via Lazarus wrote:

This question could be reformulated as "How do I dynamically determine
the correct GUI to use or whether to use the nogui interface."
My understanding is that Lazarus programs usually do this at link time
as a result of setting the LCL_PLATFORM environment variable.


Well, no, it couldn't :-)

What I'm doing is writing a  program using the Lazarus IDE and creating 
the project as "Application" so that I can easily add a full GUI later. 
I'm manually inserting code immediately after Application.Initialize to 
pick up command-line options (including --help and --version) which also 
gives me the ability to run the entire program from the command line if 
sufficient options/parameters have been supplied.


My experience in the past has been that this approach is reliable, and 
that it's also possible to raise a dialog for cases such as a program 
being run from the GUI but with a --version option.


I'm hoping to use this program as a testbed to run in three ways: 
non-interactively if sufficient options are supplied, with a GUI if no 
options are supplied, and /possibly/ using a TUI created by dialedit3b 
but this very much depends on whether the modifications required to get 
it working can be done in the limited time available.


What that will mean in practice is that irrespective of what widget set 
the program is compiled for it will also have the capability of running 
as a non-interactive (batch) utility. Call me old-school if you like but 
I find that useful.


http://free-pascal-general.1045716.n5.nabble.com/Free-Vision-etc-form-editor-td5727305.html

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Startup environment: to Gui, or not to GUI?

2017-04-11 Thread Mark Morgan Lloyd via Lazarus

On 11/04/17 10:00, Henry Vermaak via Lazarus wrote:

On Tue, Apr 11, 2017 at 09:15:16AM +, Mark Morgan Lloyd via Lazarus wrote:> Apologies 
if this is an FAQ.> > Is there an orthodox way that a Lazarus program can very early on 
look at> how it's been started and decide whether it can usefully fall back to a text> 
mode, e.g. to display help info on stdout rather than a messagebox?
isatty() is traditionally used for this on POSIX operating systems.It's in unit 
termio.


Thanks Henry, I'll check. I know I've used it in the past when deciding 
whether a program was actually being fed piped input etc.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Startup environment: to Gui, or not to GUI?

2017-04-11 Thread Mark Morgan Lloyd via Lazarus

Apologies if this is an FAQ.

Is there an orthodox way that a Lazarus program can very early on look 
at how it's been started and decide whether it can usefully fall back to 
a text mode, e.g. to display help info on stdout rather than a messagebox?


I'm tinkering with something (a media test program for SDCards etc.) 
which I'd like to either run as a conventional console program, or using 
a GUI. I've previously written stuff where operation was entirely 
dependant on command-line options, but haven't tried making the decision 
completely automatically.


Current operating environment is KDE on Debian on an RPi.

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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Error when rebuilding the IDE in Lazarus 1.6.4, AMD64

2017-03-05 Thread Mark Morgan Lloyd via Lazarus

On 05/03/17 15:00, brian via Lazarus wrote:

On 03/05/2017 09:15 AM, brian666--- via Lazarus wrote:> Hi all,> > Just upgraded to the AMD 64 versions of FPC 
3.02 and Lazarus 1.6.4 as> downloaded from SourceForge, I upgraded an instance of 1.6.2 (from the> same source) 
which was working just fine. I'm running 64-bit Linux> Mint 'Betsy', i.e. the Debian-based version of Mint, on a AMD 
Phenom> x2. The problem is that rebuilding the IDE doesn't seem to work.> > The error is shown as 'Generic error 
while linking'. I don't think the> source line is relevant, as it tags the 'end.' in lazarus.pp. The exit> code 
returned is 512.> > Any ideas, please?>
P.S. Same error when trying to build a 'Hello, World' simple program.


I built on amd64 using pukka Debian a couple of days ago with no 
problems.  GNU ld (GNU Binutils for Debian) 2.25


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] "Configure Lazarus IDE" window

2017-03-05 Thread Mark Morgan Lloyd via Lazarus
I'm in the middle of setting up several versions of Lazarus for test 
purposes on a system I use rarely.


Is it possible to invoke this form from inside the IDE, please could it 
tell us where it's about to store the information, and could it please 
have a button to clone the information to a different directory that can 
later be picked up by a newer version of the IDE using the --pcp option.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Detecting anomalous DPI

2017-02-25 Thread Mark Morgan Lloyd via Lazarus

On 25/02/17 18:30, Ondrej Pokorny via Lazarus wrote:

On 25.02.2017 16:16, Mark Morgan Lloyd via Lazarus wrote:> But it would
be very useful if a program could log the /actual/ DPI > for support
purposes.
You have these properties: TScreen.PixelsPerInch and
TMonitor.PixelsPerInch. You surely can log them.
Ondrej--


As I said in my original note, Screen.PixelsPerInch returns the nominal 
DPI not the override. I don't see TMonitor.PixelsPerInch documented.


So I've got a test system in front of me where the "Force fonts DPI" is 
set to 108 but Screen.PixelsPerInch still returns 96 as does 
GetDeviceCaps(dc, LOGPIXELSX).


The only thing I've found so far that does appear to vary predictably is 
the ascent and descent returned by GetTextMetrics, but I think that 
describes the fount that has been selected since it doesn't have a 
linear relationship to the DPI.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Widget set definitions

2017-02-13 Thread Mark Morgan Lloyd via Lazarus

On 13/02/17 10:00, Mattias Gaertner via Lazarus wrote:

On Mon, 13 Feb 2017 09:23:35 +Mark Morgan Lloyd via Lazarus 
 wrote:

I've got a bit of diagnostic code that I add to most programs that > retrieves things like Subversion revision numbers and 
link-time build > ID. It also contains> > (*$IFDEF LCLQT *)>widV= 'Linked with the Qt widget set';>
(*$DEFINE WIDGETSET *)> (*$ENDIF   *)> (*$IFDEF LCLFPGUI *)> widV= 'Linked with the FPGUI widget set';>
(*$DEFINE WIDGETSET *)> (*$ENDIF   *)> > and so on.> > Presumably LCLQT and the rest are defined somewhere in 
the IDE or LCL, > but where can I find this so that I can make sure that my code's kept in > step?

uses InterfaceBase, LCLPlatformDef;
widV:='Linked with '+LCLPlatformDisplayNames[WidgetSet.LCLPlatform]+'widget 
set';


OK, Thanks. So I can see how I can derive the names etc. from that, it 
appears to have been supported since the dawn of time, and linking to it 
is still going to be no more intrusive than some of the other stuff 
that's already in my diagnostic unit.


But out of curiosity, I'd still be very interested to know how the 
compile-time definitions like the ones in my example are generated :-)


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Widget set definitions

2017-02-13 Thread Mark Morgan Lloyd via Lazarus
I've got a bit of diagnostic code that I add to most programs that 
retrieves things like Subversion revision numbers and link-time build 
ID. It also contains


(*$IFDEF LCLQT *)
  widV= 'Linked with the Qt widget set';
  (*$DEFINE WIDGETSET *)
(*$ENDIF   *)
(*$IFDEF LCLFPGUI *)
  widV= 'Linked with the FPGUI widget set';
  (*$DEFINE WIDGETSET *)
(*$ENDIF   *)

and so on.

Presumably LCLQT and the rest are defined somewhere in the IDE or LCL, 
but where can I find this so that I can make sure that my code's kept in 
step?


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Semicolon checking

2017-01-16 Thread Mark Morgan Lloyd via Lazarus

On 16/01/17 07:30, Lars via Lazarus wrote:

On Sun, January 15, 2017 3:30 pm, Vojtěch Čihák via Lazarus wrote:> Hello, has Lazarus (CodeTools) or 
FPC some checking for empty commands? I> accidentally did this stupid mistake:  > if ... then 
begin>>   end else;>   begin> ...> exit;>   end;>
Yikes! I think you just discovered a bug in the pascal language itselfthat was 
not thought of... as when using a text editor it's easy to leavea semi colon 
laying around by accident some times.
I wonder if Oberon solves this issue, or semi-colon-less languages haveany 
advantage.  If you remove the begin from a language (Wirth did in hislater 
languages) you get rid of some issues.-- 
___Lazarus mailing 
listLazarus@lists.lazarus-ide.orghttp://lists.lazarus-ide.org/listinfo/lazarus


It's one of a number of known nasties in the language definition. This 
is controversial, but Pascal was defined with ; being a /separator/ not 
a /terminator/, so strictly a semicolon is not needed before  end else 
until  etc. and in my experience only using it where necessary is a good 
habit to get into ( ;until was a syntax error in at least some versions 
of Turbo Pascal).


One other thing that helps in a very small way is to use 
case-otherwise-end rather than case-else-end, since it reduces the 
number of ambiguities.


Apart from that Wirth deserves no credit at all for leaving the 
dangling-else ambiguity in Pascal when it had been recognised and 
eliminated in ALGOL-68.


I expect to get kicked for all of the above. They are my opinions only, 
and might not be aligned with e.g. the coding style expected in patches 
submitted to the FPC or Lazarus projects.


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazarus Version

2016-11-08 Thread Mark Morgan Lloyd via Lazarus

On 08/11/16 16:30, Mattias Gaertner via Lazarus wrote:

On Tue, 8 Nov 2016 15:20:22 +Mark Morgan Lloyd via Lazarus 
 wrote:

On 08/11/16 13:30, Mattias Gaertner via Lazarus wrote:> > On Tue, 8 Nov 2016 13:08:41 +0100 (CET)Michael Van Canneyt 
 wrote:  > >> [...]> I'm not sure we're talking about the same thing. I don't know 
what 'version> unit' you mean ?  > > For example lazarus/lcl/lclversion.pas  > > I don't want to hijack 
anybody else's thread, but I habitually use that > file to get version info so that I can always find out what compiler 
> etc. has been used to build a binary.

How does lclversion tell you the used compiler?


I said compiler /etc./

  lazV= 'Lazarus IDE v' + (*$I version.inc *) ;
  lclV= 'Lazarus Class Library v' + lcl_version;
  fpcV= 'Free Pascal v' + (*$I %FPCVERSION% *) ;
  fpcC= ' for ' + (*$I %FPCTARGETCPU% *) ;
  fpcO= (*$I %FPCTARGETOS% *) ;

..and much other stuff, almost all captured at build although in some 
cases post-processed.



The one downside of this is that I > end up with a -Fu $(LazarusDir)/lcl which (I 
suspect) contributes to the > entire LCL being rebuilt more often than is strictly 
necessary.

Alternative: add lclbase as requirement in the project inspector.


Thanks, I'll try that. Is there an easy way to get the version.inc file 
without specifying an absolute path? At the moment I'm using -Fi (or 
rather, the equivalent in the paths dialogue).


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

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus