Re: [Lazarus] Printing on Raspberry Pi
Op 05-04-16 om 21:00 schreef ahiggins: Not sure if you resolved the missed align data error (im coming to the party late), today i have had the same problem, now below is the crude mod i did to get it working for me, not sure if it will help your problem but worth a try. LR_Prntr unit. around line 1042 // screen sizes Pgw := round((PaperSize.PaperRect.PhysicalRect.Right-PaperSize.PaperRect.PhysicalRect.Left) * kx); //Pgw := round(PPgw * kx); Pgh := round((PaperSize.PaperRect.PhysicalRect.Bottom-PaperSize.PaperRect.PhysicalRect.Top) * ky); //Pgh := round(PPgh * ky); Ofx := round(PaperSize.PaperRect.WorkRect.Left * kx); //Ofx := round(POfx * kx); Ofy := round(PaperSize.PaperRect.WorkRect.Top * ky); //Ofy := round(POfy * ky); Pw := round((PaperSize.PaperRect.WorkRect.Right-PaperSize.PaperRect.WorkRect.Left) * kx); //Pw := round(PPw * kx); Ph := round((PaperSize.PaperRect.WorkRect.Bottom-PaperSize.PaperRect.WorkRect.Top) * ky); //Ph := round(PPh * ky); kind regards Tony Hi Tony, If you had looked at the bug-tracker, you would have found a solution ;-) Maybe I should have posted it here also. I used an intermediate variable, because a type-cast crashed the application : // Pgw := round(PPgw * kx); Does not work on Pi tmp1:=PPgw; Pgw:=round(tmp1 * kx); etc. where tmp1 is a longint. I find my solution also a hack, but it works so I'm satisfied. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PWM on raspberry pi
Op 08-03-16 om 19:50 schreef Bo Berglund: In PiGpio I added the following (roundabout line #20: {$DEFINE RPi2} const REG_GPIO = {$IFDEF RPi2} $3F000 {$ELSE} $2 {$ENDIF};//bcm2835/bcm2836 gpio register 0x2000 . new fpMap uses page offset, one page is 4096bytes then later down in the file (around line #150): function TIoDriver.MapIo: boolean; begin Result := True; {$IFDEF RPi2} fd := fpopen('/dev/gpiomem', O_RdWr or O_Sync); // Open the master /dev/memory device {$ELSE} fd := fpopen('/dev/mem', O_RdWr or O_Sync); // Open the master /dev/memory device {$ENDIF} I do not know for a fact tha the second change is because of the RPi2 hardware, it was probably put there in order to make my program run as a normal user rather than su. Well, that's what I did, although without the conditionals. Did you try PWM, e.g. with the demo-program ? Does it work ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PWM on raspberry pi
Op 07-03-16 om 20:11 schreef Mark Morgan Lloyd: Koenraad Lelong wrote: Hi, I'm trying to configure a PWM-pin on the raspberry pi 2. I'm using pigpio, with the demo-program. I configured pin 12 (GPIO 18) to be a PWM pin. When I click the PWM-button on the demo-program, the pi hangs. I have to power-cycle to "recover". I modified this: REG_GPIO = $3F000; and this : fd := fpopen('/dev/gpiomem', O_RdWr or O_Sync); // Open the master /dev/memory device I'm trying to debug this : delayNanoseconds(200); <-- breakpoint pwmf := Pointer(LongWord(Self.FPwm)+PWM0_RANGE); pwmf^ := $400 ; //max: 1023 delayNanoseconds(200); pwmf := Pointer(LongWord(Self.FPwm)+PWM1_RANGE); pwmf^ := $400 ; //max: 1023 delayNanoseconds(200); Stepping further with F8. When I press F8 on the first pwmf^ := $400; the code "singe steps" automatically, but after a number of steps the application crashes and the pi hangs. This is different from normally running the application where the application just hangs after pressing the PWM-button. Input and output works fine, as user "pi". Two things: first, Bo on 8th Oct mentioned that he'd had to modify pigpio.pas to make it compatible with the RPi2. Second, how are you physically driving the system, my experience is that remote access can be less reliable than using the directly connected screen and keyboard particularly when single-stepping. I think the modifications I mentioned are what is needed (in and out works). I did all this on the pi itself, no remote. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] PWM on raspberry pi
Hi, I'm trying to configure a PWM-pin on the raspberry pi 2. I'm using pigpio, with the demo-program. I configured pin 12 (GPIO 18) to be a PWM pin. When I click the PWM-button on the demo-program, the pi hangs. I have to power-cycle to "recover". I modified this: REG_GPIO = $3F000; and this : fd := fpopen('/dev/gpiomem', O_RdWr or O_Sync); // Open the master /dev/memory device I'm trying to debug this : delayNanoseconds(200); <-- breakpoint pwmf := Pointer(LongWord(Self.FPwm)+PWM0_RANGE); pwmf^ := $400 ; //max: 1023 delayNanoseconds(200); pwmf := Pointer(LongWord(Self.FPwm)+PWM1_RANGE); pwmf^ := $400 ; //max: 1023 delayNanoseconds(200); Stepping further with F8. When I press F8 on the first pwmf^ := $400; the code "singe steps" automatically, but after a number of steps the application crashes and the pi hangs. This is different from normally running the application where the application just hangs after pressing the PWM-button. Input and output works fine, as user "pi". Any thoughts ? Thanks, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] FreePascal TCPIP data tunnel code sample?
Op 05-02-16 om 14:20 schreef Bo Berglund: On Thu, 4 Feb 2016 21:10:54 +0100, Koenraad Lelong wrote: Op 04-02-16 om 17:17 schreef Bo Berglund: Then whatever data comes in through the Ethernet port should be sent via the WiFi connection to the instrument. All data received from the instrument should be sent out to the connected client on the Ethernet connection. So the program I am looking for should not do anything at all with the data content, except transfer byte-by-byte between the networks. And this should be running on a Raspberry Pi2B so it can be easily deployed in the place the instrument is located. Meanwhile I can sit in another building and test the actual client code. Is there something like this available already? Hi, Isn't this just port-forwarding ? Set up the firewall to forward data to the wired NIC to the device's address and port. Which firewall? But you are right in the port forwarding part. I want my new RPi2 unit to forward the communications on port 1001 on the Ethernet side to a specific unit on the WiFi side on its 1001 port. Every linux-machine, and the pi is no exception, has a firewall : iptables. You could configure it manually, but myself, I prefer shorewall to configure the firewall. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] FreePascal TCPIP data tunnel code sample?
Op 04-02-16 om 17:17 schreef Bo Berglund: I wonder if someone has built a program that can be used as a "tunnel" of data from one TCP server to a TCP client on another network? The program should sit in between in a computer connected to both networks (Ethernet and WiFi). If so I would be grateful to share the solutions. Reason: I am trying to develop a client program for controlling a data collection instrument, which has WiFi connectivity only. Its connection is implemented as a WiFi Access Point to which you connect. Then you have access to the data source via TCP port 1001. The source is actually operating via RS232 internally. There is a protocol involved for commanding actions and for transferring data in both directions. Now, I would like to be able to connect to this unit from my place of coding by having a multi-homed device sitting close to the instrument and connecting to it via the WiFi AP, but at the same time it is also connected to the office network by Ethernet. The device should run a program to connect it to the data port (TCP:1001) of the WiFi AP and start a TCP server on the Ethernet connection on TCP port 1001. Then whatever data comes in through the Ethernet port should be sent via the WiFi connection to the instrument. All data received from the instrument should be sent out to the connected client on the Ethernet connection. So the program I am looking for should not do anything at all with the data content, except transfer byte-by-byte between the networks. And this should be running on a Raspberry Pi2B so it can be easily deployed in the place the instrument is located. Meanwhile I can sit in another building and test the actual client code. Is there something like this available already? Hi, Isn't this just port-forwarding ? Set up the firewall to forward data to the wired NIC to the device's address and port. If you want it secure, you could use stunnel. My 2 cents, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Printing on Raspberry Pi
Op 29-10-15 om 16:24 schreef Koenraad Lelong: Hi, I'm trying to print a lazreport on a Raspberry Pi2. It's not working, I get : Bus Error or misaligned data access Press OK to ignore ... Pressing OK does nothing. Any suggestions to solve this ? I also tried the example from http://wiki.lazarus.freepascal.org/Using_the_printer. Koenraad. Hi, Hopefully someone with more knowledge than me will look into this : bugtracker issue# 29512 B.T.W. the program from the wiki-page mentioned above does work on the PI. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Raspberry Pi Debug Digital I/O
Op 25-01-16 om 09:40 schreef Koenraad Lelong: First : I'm using pascalio, on a Pi2 model B. Just modified bcm2708.pas : GPIO_BASE = (BCM2708_PERI_BASE + $003F); // GPIO controller and mem_fd := FpOpen('/dev/gpiomem', O_RDWR OR O_SYNC); Now I can run my app as user 'pi'. Thanks. Forget this. I don't know what I did, but this seems not to work anymore. Looking at the sources of pascalio, it should not have worked anyway. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Raspberry Pi Debug Digital I/O
Op 25-01-16 om 09:40 schreef Koenraad Lelong: According to Bo's post (http://lists.lazarus.freepascal.org/pipermail/lazarus/2015-October/094438.html) GPIO_BASE depends on where the app runs. I'm going to look for a way to detect which device the application runs on so I can automatically switch the GPIO_BASE. FWIW, rpi_hal is already testing for which pi it runs on, and sets it's GPIO_BASE based on that. I'm going to try to mimic that in pascalio. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Raspberry Pi Debug Digital I/O
Op 25-01-16 om 09:00 schreef Koenraad Lelong: Op 25-01-16 om 00:18 schreef Marc Santhoff: I'm going to try that patch of Bo. I'll report back. First : I'm using pascalio, on a Pi2 model B. Just modified bcm2708.pas : GPIO_BASE = (BCM2708_PERI_BASE + $003F); // GPIO controller and mem_fd := FpOpen('/dev/gpiomem', O_RDWR OR O_SYNC); Now I can run my app as user 'pi'. Thanks. According to Bo's post (http://lists.lazarus.freepascal.org/pipermail/lazarus/2015-October/094438.html) GPIO_BASE depends on where the app runs. I'm going to look for a way to detect which device the application runs on so I can automatically switch the GPIO_BASE. Suggestions ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Raspberry Pi Debug Digital I/O
Op 25-01-16 om 00:18 schreef Marc Santhoff: On Mo, 2016-01-25 at 00:11 +0100, Bo Berglund wrote: On Sun, 24 Jan 2016 21:42:06 +0100, Marc Santhoff wrote: My results : root@raspberrypi:/home/pi# grep gpio /etc/group gpio:x:997:pi root@raspberrypi:/home/pi# ls -lL /sys/class/gpio/gpiochip0 totaal 0 -rwxrwx--- 1 root gpio 4096 jan 24 22:10 base drwxr-xr-x 3 root root0 jan 24 22:10 device -rwxrwx--- 1 root gpio 4096 jan 24 22:10 label -rwxrwx--- 1 root gpio 4096 jan 24 22:10 ngpio drwxrwx--- 2 root gpio0 jan 24 22:10 subsystem -rwxrwx--- 1 root gpio 4096 jan 24 22:10 uevent root@raspberrypi:/home/pi# cd /sys/class/gpio/ Application running as user pi : root@raspberrypi:/sys/class/gpio# ls -lL ../../devices/platform/soc/3f20.gpio/gpio/ totaal 0 drwxrwx--- 2 root gpio 0 jan 25 08:54 gpio17 drwxrwx--- 2 root gpio 0 jan 25 08:54 gpio18 drwxrwx--- 2 root gpio 0 jan 24 22:10 gpiochip0 Application running as user root : root@raspberrypi:/sys/class/gpio# ls -lL ../../devices/platform/soc/3f20.gpio/gpio/ totaal 0 drwxrwx--- 2 root gpio 0 jan 25 08:56 gpio17 drwxrwx--- 2 root gpio 0 jan 25 08:56 gpio18 drwxrwx--- 2 root gpio 0 jan 24 22:10 gpiochip0 I'm going to try that patch of Bo. I'll report back. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Raspberry Pi Debug Digital I/O
Op 24-01-16 om 11:47 schreef Bo Berglund: On Fri, 22 Jan 2016 20:55:59 -0500, Donald Ziesig wrote: The application itself must run as root to do digital I/O. If you don't want to debug using the IDE, you don't have to make the IDE run as root, though, just the app. I do not think this is necessary! Strange, I tried this with my test-application and it does not work as user 'pi'. I investigated a little bit further. No application running : root@raspberrypi:/home/pi/Documents/lazarus/pascalio/koen-test# ls -l /sys/class/gpio totaal 0 -rwxrwx--- 1 root gpio 4096 jan 22 22:03 export lrwxrwxrwx 1 root gpio0 jan 22 22:03 gpiochip0 -> ../../devices/platform/soc/3f20.gpio/gpio/gpiochip0 -rwxrwx--- 1 root gpio 4096 jan 22 22:03 unexport When I run the application as 'pi', I get this : root@raspberrypi:/home/pi/Documents/lazarus/pascalio/koen-test# ls -l /sys/class/gpio totaal 0 -rwxrwx--- 1 root gpio 4096 jan 22 22:03 export lrwxrwxrwx 1 root gpio0 jan 24 19:43 gpio17 -> ../../devices/platform/soc/3f20.gpio/gpio/gpio17 lrwxrwxrwx 1 root gpio0 jan 24 19:43 gpio18 -> ../../devices/platform/soc/3f20.gpio/gpio/gpio18 lrwxrwxrwx 1 root gpio0 jan 22 22:03 gpiochip0 -> ../../devices/platform/soc/3f20.gpio/gpio/gpiochip0 -rwxrwx--- 1 root gpio 4096 jan 22 22:03 unexport root@raspberrypi:/home/pi/Documents/lazarus/pascalio/koen-test# But the IO does not work. When I do echo 1 > /sys/class/gpio/gpio17/value from the command-line, the IO does not work, even when I do this as root. When I run the application as root, everything works as expected. B.T.W. what 'library' are you using for the GPIO's ? Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Installation under SUSE
Op 06-01-16 om 19:40 schreef Josef Schnieder: Hello, the setup-script from http://www.getlazarus.org/setup/ will not work under SUSE (open SUSE 42.1 Leap). the message is: "This script requires the package libgdk-pixbuf2.0-dev which was not found on your system" But I can't find this package for SUSE. What should I do? Is there another way to install Lazarus with FPC 3.0 under SUSE. best regards Josef FWIW, The Education repo of Opensuse has lazarus 1.4.4 (https://software.opensuse.org/package/lazarus). I think it should be possible to discover what packages this needs, lazarus 3.0 should need the same libraries, I think. I successfully installed fpcup on my opensuse 13.2. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Printing on Raspberry Pi
I did some further testing. I modified the code somewhat : tmp1:=PPgw; tmp2:=kx; tmp1:=tmp1 * tmp2; Pgw:=round(tmp1); // Pgw := round(PPgw * kx); tmp1 and tmp2 are Double. Running in gdb and backtracing at the crash gives this : Program received signal SIGBUS, Bus error. 0x004b45fc in TFRPRINTER__FILLPRNINFO (P=..., this=variable>) at lr_prntr.pas:1044 1044 tmp1:=PPgw; (gdb) bt #0 0x004b45fc in TFRPRINTER__FILLPRNINFO (P=..., this=variable>) at lr_prntr.pas:1044 #1 0x003bc198 in TFRREPORT__DOPRINTREPORT (PAGENUMBERS=0x744cff8c '1-1', COPIES=1, this=) at lr_class.pas:11429 #2 0x003bbe20 in TFRREPORT__PRINTBEFOREMODAL (SENDER=0x75f0a450, this=) at lr_class.pas:11237 #3 0x004c4548 in TFRPROGRESSFORM__DOBEFOREMODAL (DATA=0, this=reading variable>) at lr_progr.pas:88 #4 0x0006b71c in TAPPLICATION__PROCESSASYNCCALLQUEUE (this=reading variable>) at ./include/application.inc:1067 #5 0x000699c0 in TAPPLICATION__IDLE (WAIT=true, this=variable>) at ./include/application.inc:389 #6 0x00063930 in TCUSTOMFORM__SHOWMODAL (this=) at ./include/customform.inc:2916 #7 0x004c4484 in TFRPROGRESSFORM__SHOW_MODAL (DOC=0x754ab400, this=) at lr_progr.pas:70 #8 0x003bbfbc in TFRREPORT__PRINTPREPAREDREPORT (PAGENUMBERS=0x744cff8c '1-1', COPIES=1, this=) at lr_class.pas:11265 #9 0x000739d8 in BTNPRINTSETUPCLICK (this=0x756429b0, SENDER=0x75f04870) at modmain.pas:229 #10 0x00224e5c in TCONTROL__CLICK (this=) at ./include/control.inc:2734 #11 0x00251028 in TBUTTONCONTROL__CLICK (this=) at ./include/buttoncontrol.inc:54 #12 0x00251928 in TCUSTOMBUTTON__CLICK (this=) at ./include/buttons.inc:169 #13 0x00250ef4 in TBUTTONCONTROL__WMDEFAULTCLICKED (MESSAGE=..., this=) at ./include/buttoncontrol.inc:20 #14 0x00041360 in SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal () #15 0x00223bc8 in TCONTROL__WNDPROC (THEMESSAGE=..., this=variable>) at ./include/control.inc:2122 #16 0x00215b1c in TWINCONTROL__WNDPROC (MESSAGE=..., this=variable>) at ./include/wincontrol.inc:5383 #17 0x002f7a14 in DELIVERMESSAGE (TARGET=0x75f04870, AMESSAGE=pointer.>) at lclmessageglue.pas:112 #18 0x00309f78 in GTK2WSBUTTON_CLICKED (AWIDGET=0x985708, AINFO=0x75c5c7e0) at gtk2wsstdctrls.pp:2428 #19 0x76972afc in ?? () from /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Printing on Raspberry Pi
Op 05-11-15 om 11:30 schreef Koenraad Lelong: Op 01-11-15 om 18:08 schreef Anthony Tekatch: I'm trying to print a lazreport on a Raspberry Pi2. It's not working, I get : Bus Error or misaligned data access Press OK to ignore ... Pressing OK does nothing. I managed to get Lazarus running on my Odroid-C1 so I can debug. When running the application, and trying to print it gives the error in LR_Prntr : // printer sizes with PaperSize.PaperRect do begin PPgw := PhysicalRect.Right-PhysicalRect.Left; Ppgh := PhysicalRect.Bottom-PhysicalRect.Top; POFx := WorkRect.Left; POFy := WorkRect.Top; PPw := WorkRect.Right-WorkRect.Left; // this is the same as PageWidth PPh := WorkRect.Bottom-WorkRect.Top; // this is the same as PageHeight end; // screen sizes Pgw := round(PPgw * kx); <- error, line 1042 Pgh := round(PPgh * ky); Ofx := round(POfx * kx); Ofy := round(POfy * ky); Pw := round(PPw * kx); Ph := round(PPh * ky); I tried on a raspberry pi, with fpc 3.0.0 and lazarus 1.6rc1. It gives the same error. I investigated further and it's the product that gives the error. Any idea what's happening ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 1.6RC1 make bigide fails on Raspberry Pi2
Op 18-12-15 om 11:41 schreef Alfred: In my experience, fpres fails also due to lack of memory ! Just increase your swapsize with 500MB, and try again. Saved me many times. (normally, I use cross-compile ... also saves lots of time ... ) Hi, You seem to be right. I added swap, now I can compile an existing project. Many thanks. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 1.6RC1 make bigide fails on Raspberry Pi2
Op 17-12-15 om 18:17 schreef Mark Morgan Lloyd: Koenraad Lelong wrote: Op 17-12-15 om 11:36 schreef Mark Morgan Lloyd: $ fpc -iV 3.0.0 # Unpack 1.6RC1, rename directory to lazarus-1.6.0+3.0.0 $ cd lazarus-1.6.0+3.0.0 $ make bigide .. make[1]: Leaving directory ... lazarus-1.6.0+3.0.0/components/chmhelp/lhelp' The result runs, including on Raspbian Jessie's GTK2. The only obvious thing that I'd fault is that the lazarus binary (i.e. specifically referring to the IDE) is poor at handling --help and --version. However Hi, I tried what you said. Lazarus runs indeed, but can't compile a existing project. I get an error stating fpcres could not be found. When I run fpcres on the command-line it starts and gives some output. I also can't compile lazarus itself (e.g. after adding packages). I also get the error that fpcres can not be found. Am I missing something ? I know this sounds silly, but check fpcres is on the path. My experience it that for Lazarus it's the only program that's needed apart from fpc and ppcarm etc. Hi, Like I said, when I run fpcres on the commandline, it works : pi@raspberrypi ~ $ fpcres fpcres - resource file converter, version 2.0 [2015/12/06], FPC 3.0.0 Host platform: Linux - arm Copyright (c) 2008 by Giulio Bernardi. Syntax: fpcres [options] [...] [-o ] ... pi@raspberrypi ~ $ which fpcres /home/pi/bin/fpcres I downloaded fpc from somewhere (I can't find where from at the moment) and installed it in a non-previleged place (/home/pi/fpc-3.0.0). Then I made symbolic links in /home/pi/bin and set the PATH to include /home/pi/bin. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 1.6RC1 make bigide fails on Raspberry Pi2
Op 17-12-15 om 11:36 schreef Mark Morgan Lloyd: $ fpc -iV 3.0.0 # Unpack 1.6RC1, rename directory to lazarus-1.6.0+3.0.0 $ cd lazarus-1.6.0+3.0.0 $ make bigide .. make[1]: Leaving directory ... lazarus-1.6.0+3.0.0/components/chmhelp/lhelp' The result runs, including on Raspbian Jessie's GTK2. The only obvious thing that I'd fault is that the lazarus binary (i.e. specifically referring to the IDE) is poor at handling --help and --version. However Hi, I tried what you said. Lazarus runs indeed, but can't compile a existing project. I get an error stating fpcres could not be found. When I run fpcres on the command-line it starts and gives some output. I also can't compile lazarus itself (e.g. after adding packages). I also get the error that fpcres can not be found. Am I missing something ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Editing stringgrid without keyboard
Op 21-11-15 om 13:10 schreef Koenraad Lelong: Hi, I'm trying to make an application that uses a touch-screen. I want to enter numbers in a stringgrid. I made a separate form to enter the number. I pop up my form using the OnClick event of the stringgrid. Unfortunately, I seem unable to get the number in the right cell. How can I know which cell was clicked ? A suggestion of a better way to do what I want is also welcome : I need something to enter a number of pairs of numeric values. I want these values saved to a file and be able to retrieve those values from that file. Keep in mind that I have no keyboard ! Thanks, Koenraad. Please ingore. I found there are Col and Row properties, that identify the selected cell. Too simple. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Editing stringgrid without keyboard
Hi, I'm trying to make an application that uses a touch-screen. I want to enter numbers in a stringgrid. I made a separate form to enter the number. I pop up my form using the OnClick event of the stringgrid. Unfortunately, I seem unable to get the number in the right cell. How can I know which cell was clicked ? A suggestion of a better way to do what I want is also welcome : I need something to enter a number of pairs of numeric values. I want these values saved to a file and be able to retrieve those values from that file. Keep in mind that I have no keyboard ! Thanks, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpcup on arm-linux
Op 05-11-15 om 20:34 schreef Koenraad Lelong: Op 05-11-15 om 18:19 schreef Alfred: Use a very big swap (file) ! For Lazarus, at least 1GB is needed. On my RPi2, Lazarus installs (fpcup) and runs ok Thanks, But I have about 5G swap on a USB hard-disk. Koenraad. Hi, I made a new SD-card, installed the requirements, added swap and mounted a USB-HD on the development directory. Now I have a working lazarus on the Raspberry Pi 2. Thanks. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpcup on arm-linux
Op 05-11-15 om 18:19 schreef Alfred: Use a very big swap (file) ! For Lazarus, at least 1GB is needed. On my RPi2, Lazarus installs (fpcup) and runs ok Thanks, But I have about 5G swap on a USB hard-disk. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] fpcup on arm-linux
Hi, Did anyone succeed to run fpcup on a raspberrypi2 ? I added a USB-disk to the pi, to get swap and some disk-space. I started fpcuprpi2. This runs for a while and it seems to make freepascal successfully. But after a while building lazarus it hangs. On an odroid-C1 I can generate lazarus successfully, using the same fpcuprpi2 script. Can anyone give suggestions how to make svn-lazarus on a pi2 ? Thanks. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Printing on Raspberry Pi
Op 01-11-15 om 18:08 schreef Anthony Tekatch: I'm trying to print a lazreport on a Raspberry Pi2. It's not working, I get : Bus Error or misaligned data access Press OK to ignore ... Pressing OK does nothing. I managed to get Lazarus running on my Odroid-C1 so I can debug. When running the application, and trying to print it gives the error in LR_Prntr : // printer sizes with PaperSize.PaperRect do begin PPgw := PhysicalRect.Right-PhysicalRect.Left; Ppgh := PhysicalRect.Bottom-PhysicalRect.Top; POFx := WorkRect.Left; POFy := WorkRect.Top; PPw := WorkRect.Right-WorkRect.Left; // this is the same as PageWidth PPh := WorkRect.Bottom-WorkRect.Top; // this is the same as PageHeight end; // screen sizes Pgw := round(PPgw * kx); <- error, line 1042 Pgh := round(PPgh * ky); Ofx := round(POfx * kx); Ofy := round(POfy * ky); Pw := round(PPw * kx); Ph := round(PPh * ky); -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Printing on Raspberry Pi
Op 30-10-15 om 09:51 schreef Leonardo M. Ramé: El 29/10/15 a las 12:24, Koenraad Lelong escribió: Hi, I'm trying to print a lazreport on a Raspberry Pi2. It's not working, I get : Bus Error or misaligned data access Press OK to ignore ... Pressing OK does nothing. Any suggestions to solve this ? I also tried the example from http://wiki.lazarus.freepascal.org/Using_the_printer. On my x86 linux-machine this works, on the RPi, nothing happens. Koenraad. Hi Koenraad, can you print using the RPi from other applications?. Regards, Leonardo. Hi Leonardo, Yes I can print. The cups-testpage certainly works. I also tried with libreoffice, works fine. But leafpad has a problem. It generates a job in cups, but nothing comes out of the printer. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Printing on Raspberry Pi
Hi, I'm trying to print a lazreport on a Raspberry Pi2. It's not working, I get : Bus Error or misaligned data access Press OK to ignore ... Pressing OK does nothing. Any suggestions to solve this ? I also tried the example from http://wiki.lazarus.freepascal.org/Using_the_printer. On my x86 linux-machine this works, on the RPi, nothing happens. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WinCE call for testers
Op 15-10-15 om 10:20 schreef patspiper: Hi, The bug reporting/testing/fixing cycle for WinCE has been severely impacted by the ever dwindling number of WinCE users. I therefore ask all interested users to identify themselves so that we are able to communicate more closely in order to test/apply provided patches, especially that what may work for one device and use case might not work somewhere else or even break something else in other use cases. Stephano We recently purchased an intelligent bar-codes-scanner running Windows CE. We were planning to make some applications for it. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Literature about REST
Op 08-10-15 om 17:23 schreef Luiz Americo Pereira Camara: > Hi, > > I would like to know more about web-programming with REST. Can anyone recommend books or web-sites to read about it ? I virtually know nothing about it. I read this book http://shop.oreilly.com/product/mobile/9780596805838.do Its a good one, with a few shortcomings: It uses examples with XML Has a focus in HATEOAS. Particularly i dont buy HATEOS stuff, so i read only until the CRUD service chapter. I have some free books/resources about it. I can send later Luiz Hi Luiz, I would like those extra resources you mentioned. Meanwhile I read some articles on the web, but I need more knowledge about html. Thanks, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Literature about REST
Hi, I would like to know more about web-programming with REST. Can anyone recommend books or web-sites to read about it ? I virtually know nothing about it. Searching amazon gives a number of books, but since those are not cheap, I would like to get a good book for my money. Thanks, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Compiling lazarus on arm-linux
Op 30-09-15 om 19:06 schreef Mark Morgan Lloyd: Koenraad Lelong wrote: Op 30-09-15 om 15:43 schreef Martin Schreiber: This is wrong, you need a eabihf compiler, either a patched FPC 2.6.4 or better FPC 3.0.1 from here: http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/ Martin Thanks, Although the link points to a crosscompiler, I managed to compile lazarus on the odroid with binaries from your repo. I had to configure the device to run without GUI because of lack of memory. Unfortunately, when I start lazarus, it complains it can't find the fpc-sources, which is true, because I only have a number of binaries. Can I just get the svn-sources and use these ? And when I try to add packages in lazarus, I can't because of lack of memory. So how can I add packages from the command-line ? Add a USB memory stick and put a swap partition on it. Assume you need at least 512Mb overall memory to build Lazarus. http://wiki.lazarus.freepascal.org/Native_ARM_Systems Thanks, An odroid C1 has 1G ram, more than 800M free. But I added an SD-card as swap, and I could compile lazarus with extra packages :-). Remains the fact that lazarus keeps complaining about the fpc-sources. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Compiling lazarus on arm-linux
Op 30-09-15 om 15:43 schreef Martin Schreiber: This is wrong, you need a eabihf compiler, either a patched FPC 2.6.4 or better FPC 3.0.1 from here: http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/ Martin Thanks, Although the link points to a crosscompiler, I managed to compile lazarus on the odroid with binaries from your repo. I had to configure the device to run without GUI because of lack of memory. Unfortunately, when I start lazarus, it complains it can't find the fpc-sources, which is true, because I only have a number of binaries. Can I just get the svn-sources and use these ? And when I try to add packages in lazarus, I can't because of lack of memory. So how can I add packages from the command-line ? Thanks. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Compiling lazarus on arm-linux
Hi, I'm trying to compile lazarus on an arm-linux system (odroid C1, but also on RPi model 2). It works until this : ... make --assume-new=svn2revisioninc.pas svn2revisioninc make[2]: Entering directory `/home/odroid/Downloads/source/tools' Makefile:2332: warning: overriding commands for target `.' Makefile:2330: warning: ignoring old commands for target `.' /home/odroid/fpc-2.6.4/bin/ppcarm -gl -Fu. -Fu../components/lazutils/lib/arm-linux -Fu../lcl/units/arm-linux -Fu../lcl/units/arm-linux/nogui -FE. -FU. -Fl/usr/lib/gcc/arm-linux-gnueabihf/4.9 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -dFPC_ARMHF -darm svn2revisioninc.pas Free Pascal Compiler version 2.6.4 [2014/03/21] for arm Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling svn2revisioninc.pas Assembling svn2revisioninc Linking ./svn2revisioninc /usr/bin/ld.bfd.real: warning: ./link.res contains output sections; did you forget -T? /home/odroid/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /home/odroid/fpc-2.6.4/lib/fpc/2.6.4/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' svn2revisioninc.pas(791) Error: Error while linking svn2revisioninc.pas(791) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: *** [svn2revisioninc] Error 1 make[2]: Leaving directory `/home/odroid/Downloads/source/tools' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/odroid/Downloads/source/tools' make: *** [lazbuild] Error 2 Firt I tried with the latest stable sources, than I tried with the latest svn-verion, both the same error. What am I missing ? First compiled with "make all bigide", the tried with "make all OPT=-dFPC_ARMHF", both have the same problem. Thanks for any help, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Multiple versions of MySQL/MariaDB
Hi, What defines the TMySQL-connection-version ? Are those the installed libraries on the client ? Or is it the server ? Is it possible to detect which version of MySQL/MariaDB is used , and according to the result select the right connection, at run-time ? The problem is that my development-PC does not neccessarily have the same libraties as the user-PC. FWIW, I'm running linux on the development-PC. Regards, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LazReport - Feature questions
Op 10-07-15 om 09:36 schreef Michael Van Canneyt: The primary save format will be JSON, which can be converted to anything you want. I don't know much about JSON, but I'm about to start an application that writes to a label-printer (= small paper-sizes). Would it be possible to generate output for that, without manual intermediate steps ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Support for MariaDB 10.0
Op 10-06-15 om 07:43 schreef leledumbo: fpc 2.6.4-2.10, lazarus 1.4.0.0, OpenSuse 13.2 Perhaps opensuse team creates its own 2.6.4? AFAIR TMySQL56Connection is not available in 2.6.4. You should either use fixes 3.0.0 or trunk. I used fpc-up. In the about-form of lazarus I get : Version 1.5 Date : 2015-05-05 FPC version : 2.6.5 SVN version : 48926 x86_64-linux-gtk 2 The error is like Josef Schnieder said. I'm going to try to replace the files. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Support for MariaDB 10.0
Op 12-05-15 om 10:03 schreef leledumbo: Any support for MariaDB 10.0 branch? client library? TMySQL56Connection can connect to MariaDB perfectly. Hi, I have the MariaDB 10.0.13 client-libs. TMySQL56Connection can not connect. Any solution ? Thanks. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Dropdown in stringgrid ?
Op 05-06-15 om 15:45 schreef Jesus Reyes A.: En Fri, 05 Jun 2015 05:55:51 -0500, Koenraad Lelong escribió: Op 03-06-15 om 01:19 schreef Jesus Reyes A.: In the grid such combobox is called a picklist. 1. Select the grid 2. In the Object Inspector select the columns property and click the "..." button. 3. Add some custom columns 4. Select the column where you wish to add a pick list 5. In the Object Inspector change the ButtonStyle to cbsPickList 6. In the Object Inspector select the PickList property and click the "..." button. 7. Add all options you want to this list. 8. make sure the grid is editable. Thanks, just tried this, but it's not what I need. Like I said, I want to import a csv-file. Then, using the first row, I use a picklist of fieldnames to identify which column of the csv needs to go to which field in the database. Maybe this clarifies it better : --- | Field2 | Field1 || Field3 ||| <--- picklist (Field1, Field2, Field3, blank) --- |Col0Row1|Col1Row1|Col2Row1|Col3Row1|Col4Row1|Col5Row1| |Col0Row2|Col1Row2|Col2Row2|Col3Row2|Col4Row2|Col5Row2| etc. This means column0 should got to Field2 of the database, column1 should got to Field1 of the database and column3 should got to Field3 of the database. The rest of the columns are not needed in the database. Koenraad. So you want the picklist only in the first row. Then use something like: // use grid's OnSelectEditor procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow: Integer; var Editor: TWinControl); begin if aRow=StringGrid1.fixedRows then begin Editor := StringGrid1.EditorByStyle(cbsPickList); // fill the picklist with field list TPickListCellEditor(Editor).Items.CommaText := 'Field1,Field2,Field3,etc'; // or TPickListCellEditor(Editor).Items.Assign(FieldList) // or etc end else Editor := nil; // readonly the rest of rows (or select another editor) end; Hi, It's almost what I want. Your code makes the second row behave like a picklist (1 fixed row : row #0 is fixed), so I subtracted 1 from StringGrid1.fixedRows but no luck ;-) . I tried a few things, but I can't let the cells of the fixed row to behave like a picklist. Am I still missing something ? Anyway, thanks very much already. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Dropdown in stringgrid ?
Op 03-06-15 om 01:19 schreef Jesus Reyes A.: In the grid such combobox is called a picklist. 1. Select the grid 2. In the Object Inspector select the columns property and click the "..." button. 3. Add some custom columns 4. Select the column where you wish to add a pick list 5. In the Object Inspector change the ButtonStyle to cbsPickList 6. In the Object Inspector select the PickList property and click the "..." button. 7. Add all options you want to this list. 8. make sure the grid is editable. Thanks, just tried this, but it's not what I need. Like I said, I want to import a csv-file. Then, using the first row, I use a picklist of fieldnames to identify which column of the csv needs to go to which field in the database. Maybe this clarifies it better : --- | Field2 | Field1 || Field3 ||| <--- picklist (Field1, Field2, Field3, blank) --- |Col0Row1|Col1Row1|Col2Row1|Col3Row1|Col4Row1|Col5Row1| |Col0Row2|Col1Row2|Col2Row2|Col3Row2|Col4Row2|Col5Row2| etc. This means column0 should got to Field2 of the database, column1 should got to Field1 of the database and column3 should got to Field3 of the database. The rest of the columns are not needed in the database. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Dropdown in stringgrid ?
Hi, I'm trying to make a "universal importer". I have a database I want to populate/modify with data from a csv-file. The column order of the csv-file cannot be imposed. So I have to have a way to say which column of the csv-file is which field in the database. I have a commercial application that has something like a stringgrid but the first row has dropdown's with possible field-names. I was trying to mimic this, more or less, but had issues. Is this possible someway ? Any hints ? Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] StringGrid.loadFromCSVFile question
Op 02-06-15 om 12:30 schreef Bart: On 6/2/15, Koenraad Lelong wrote: I think I better open a bug-report. I found what's the problem : I use two fixed rows. When I tried to make that sample program I was surprised the minimal version worked, but then I added a second fixed row, and then it crashed also. OK, but also there attach sample project + "offending" .csv file so we can reproduce. Bart Bug ID = 0028230 Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] StringGrid.loadFromCSVFile question
Op 01-06-15 om 15:30 schreef Bart: On 6/1/15, Koenraad Lelong wrote: A few months ago I made an application that uses StringGrid.LoadFromCSVFile. This worked. Now, on a PC with a newer linux-OS, and a newer Lazarus/FPC, I try to work further on that application but now the application from the original sources crashes. It seems it can no longer automatically append lines to a stringgrid. Error : index out of range Cell[Col=0, Row=x]. When I manually append lines (= in the IDE) the application can load some more lines, but crashes when the grid-lines are all used. Please attach a sample program and sample .csv to demonstrate the problem. Keep it as simple as possibe (1 grid, 1 button should suffice). Bart I think I better open a bug-report. I found what's the problem : I use two fixed rows. When I tried to make that sample program I was surprised the minimal version worked, but then I added a second fixed row, and then it crashed also. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] StringGrid.loadFromCSVFile question
Hi, A few months ago I made an application that uses StringGrid.LoadFromCSVFile. This worked. Now, on a PC with a newer linux-OS, and a newer Lazarus/FPC, I try to work further on that application but now the application from the original sources crashes. It seems it can no longer automatically append lines to a stringgrid. Error : index out of range Cell[Col=0, Row=x]. When I manually append lines (= in the IDE) the application can load some more lines, but crashes when the grid-lines are all used. I found in the stringgrid.options goAutoAddRows and set this to true. No help. I set goAutoAddRowsSkipContentCheck to true, no help. Am I missing something ? I made lazarus with fpc-up. Lazarus about says : fpc-version 2.6.5, svn revision 48926. Any help ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Windows CE
Hi, I could be able to purchase a number of second hand intelligent barcode scanners. I have project in mind where I could use such devices. The scanners run Windows CE 5. Is it possible and advisable to develop for these devices using Lazarus ? I know Lazarus has support for Windows CE, but at the moment I don't find which versions are supported. Thanks, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Unable to find method
Op 05-05-15 om 09:43 schreef Michael Van Canneyt: Looks like it cannot find the lazarus and Free Pascal sources. They need to be specified in the Tools|Options dialog under "Environment". ("Lazarus directory", and "FPC source directory ") Michael. I rescanned for the sources, now it's fine. Thanks. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Unable to find method
Hi, I just re-installed my operating system : OpenSuse 13.2, 64bit. I used fpcup to get Lazarus. Actually, this is the first time I used fpcup. My first project using this new environment gives me the error "Unable to find method. Please fix the error shown in the message window, ..." In the message window I get : Codetools, Errors: 2 forms.pp(40,3) Error: unit not found: gettext lclclasses.pp(26,10) Error: unit not found: Classes I just tried to create an OnCreate event in the main form. I ran fpcup_update, but the error remains. Searching for those units, I find them, and the compiled versions are from today, when I updated. What's happening ? How to solve ? Thanks. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazreport of master-detail
op 24-06-14 12:20, Reinier Olislagers schreef: On 24/06/2014 10:29, Koenraad Lelong wrote: backtrace. Can I have a backtrace in Windows ? Yes. Use e.g. -gw2 -gl -O-1 (Lazarus: dwarf 2 format, line number, no optimization, add -O-1 in extra options or whatever it's called) when compiling. Run gdb as usual and you should get the backtrace or run it in the debugger under Lazarus to do things the GUI way ;) Hi, Since I did not find a way to backtrace in Lazarus, I did it via gdb-commandline. This is what I get (Windows XP) : Program received signal SIGSEGV, Segmentation fault. 0x004036bb in SYSTEM_FORWARDS_SSE_3 () (gdb) bt #0 0x004036bb in SYSTEM_FORWARDS_SSE_3 () #1 0x005dc7a4 in BUFDATASET_TCUSTOMBUFDATASET_$__CURRENTRECORDTOBUFFER$PCHAR () #2 0x0009b908 in ?? () #3 0x00594cee in DB_TDATASET_$__GETPRIORRECORD$$BOOLEAN () #4 0x00596fa7 in DB_TDATASET_$__RESYNC$TRESYNCMODE () #5 0x0059692e in DB_TDATASET_$__GOTOBOOKMARK$POINTER () #6 0x0001 in ?? () #7 0x0007da50 in ?? () #8 0x005c677a in RESTOREBOOKMARKS (parentfp=0x260f1e8) at lr_class.pas:7171 #9 0x005c5ecb in TFRPAGE__FORMPAGE (this=) at lr_class.pas:7438 #10 0x005cef0e in TFRREPORT__DOBUILDREPORT (this=) at lr_class.pas:9873 #11 0x005cdf8a in TFRREPORT__BUILDBEFOREMODAL (SENDER=0x9bb48, this=) at lr_class.pas:9517 #12 0x00612e5f in TFRPROGRESSFORM__DOBEFOREMODAL (DATA=0, this=) at lr_progr.pas:88 #13 0x0042309d in TAPPLICATION__PROCESSASYNCCALLQUEUE ( this=) at ./include/application.inc:1079 #14 0x0042192f in TAPPLICATION__IDLE (WAIT=true, this=) at ./include/application.inc:389 #15 0x0041d46c in TCUSTOMFORM__SHOWMODAL (this=) at ./include/customform.inc:2907 #16 0x00612db1 in TFRPROGRESSFORM__SHOW_MODAL (DOC=0x2f88228, this=) at lr_progr.pas:70 #17 0x005ce45e in TFRREPORT__DOPREPAREREPORT (this=) at lr_class.pas:9671 #18 0x005ce0eb in TFRREPORT__PREPAREREPORT (this=) at lr_class.pas:9567 #19 0x005cf151 in TFRREPORT__SHOWREPORT (this=) at lr_class.pas:9927 #20 0x00426f09 in TFORM1__BTNPREVIEWCLICK (SENDER=0x2f3fc10, this=) at modmain.pas:65 #21 0x00513068 in TCONTROL__CLICK (this=) at ./include/control.inc:2711 #22 0x0052fe6f in TBUTTONCONTROL__CLICK (this=) at ./include/buttoncontrol.inc:54 #23 0x005305c6 in TCUSTOMBUTTON__CLICK (this=) at ./include/buttons.inc:169 #24 0x00530c21 in TBUTTON__CLICK (this=) at ./include/buttons.inc:349 #25 0x0052fd7a in TBUTTONCONTROL__WMDEFAULTCLICKED (MESSAGE=..., this=) at ./include/buttoncontrol.inc:20 #26 0x0040b846 in SYSTEM_TOBJECT_$__DISPATCH$formal () #27 0x0052fd60 in TBUTTONCONTROL__ISCHECKEDSTORED ( this=) at ./include/buttoncontrol.inc:16 #28 0x00506b1f in TWINCONTROL__WNDPROC (MESSAGE=..., this=) at ./include/wincontrol.inc:5327 #29 0x0055e8db in DELIVERMESSAGE (TARGET=0x2f3fc10, AMESSAGE=void) at lclmessageglue.pas:112 #30 0x004de361 in WINDOWPROC (WINDOW=66834, MSG=273, WPARAM=64528, LPARAM=66846) at win32callback.inc:2478 #31 0x00587338 in CUSTOMFORMWNDPROC (WINDOW=66834, MSG=273, WPARAM=64528, LPARAM=66846) at win32wsforms.pp:395 #32 0x7e398734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll #33 0x00010512 in ?? () #34 0x7e398816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll #35 0x00587230 in ADJUSTFORMBOUNDS (AFORM=0x0, SIZERECT=...) at win32wsforms.pp:316 #36 0x7e3a927b in USER32!GetParent () from C:\WINDOWS\system32\user32.dll #37 0x in ?? () (gdb) Since it's not my application that's behaving bad (AFAICT) I'm going to try to reproduce this with a "public" database. Then I'll write a bug-report. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Lazreport of master-detail
Hi, I got a strange problem when I show a Lazreport of a master-detail relationship. If the master-table contains an odd number of items, the report is OK. If it contains an even number of items it crashes with this error : Program received signal SIGSEGV, Segmentation fault. 0x004df6d4 in SYSTEM_MOVE$formal$formal$INT64 () (gdb) bt #0 0x004df6d4 in SYSTEM_MOVE$formal$formal$INT64 () #1 0x008c2893 in BUFDATASET_TCUSTOMBUFDATASET_$__CURRENTRECORDTOBUFFER$PCHAR () #2 0x77fb6701 in ?? () #3 0x in ?? () That's with Lazarus 1.2.2, on Linux 64bit. But I think I do have the same problem on 32bit Windows. I switched to linux to be able to backtrace. Can I have a backtrace in Windows ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] service launch
op 03-06-14 15:45, A. Fortuny schreef: Yesy it does. AT the same time I have to apologize. After re-creating the service script from the original /etc/init.d/skeleton, - changing the first line as a /bin/bash script - adapt the comments in the INIT INFO about the service name - change the service binary program - change the conf file name - add the -r to the launching of the service binary file everything runs OK; I did forget to register the service (chkconfig) and to reload (systemctl --system daemon-reload) Sorry for the annoyance and thanks anyway. Beware ! Newer distro's use systemd. While I think the /etc/init.d scripts will still be supported for a while, eventually they will not run anymore. I need to study systemd, because I also do have a daemon made with fpc and started with an init.d-script. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Gdb and openocd via lazarus
op 28-05-14 13:57, Michael Ring schreef: Here's how I call gdb: arm-none-eabi-gdb hello.elf --tui --eval-command="target extended :" --eval-command="monitor reset halt" --eval-command="set mem inaccessible-by-default off" --eval-command="load" This loads the binary, you should end up with the debugger showing you your source code. Now try stepping through the code, if all is fine then great, problem is in the integration of gdb. Stept I use: break main cont step This all works. Tomorrow I will try to send those commands with mseide. Many thanks. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Gdb and openocd via lazarus
op 28-05-14 22:39, Martin Schreiber schreef: On Wednesday 28 May 2014 12:36:57 Koenraad Lelong wrote: I tried to debug my arm-board with MSEide. I manually started openocd (I need to be root). Is the debug interface connected by USB? Then it is possible to setup an udev rule in order to allow non-root access. Copy a file to /etc/udev/rules.d, for the J-Link for example I named it 99-jlink_mse.rules, the content: I don't know why, but now it works. I use a board with an stlink-v2 interface, via USB. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Gdb and openocd via lazarus
op 28-05-14 13:21, Martin Schreiber schreef: I don't think the theme is appropriate for this list. ;-) I hesitated to post in the Lazarus-list, because it's indeed not lazarus-related anymore. I find the theme is appopriate : gdb-debugging of pascal-source. I'll subscribe to yet another list, and contunue there. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Gdb and openocd via lazarus
op 21-05-14 20:17, Martin Schreiber schreef: In MSEide the procedure is as follows - I assume same as in Lazarus: In 'Start gdb server command run target' write the command or script which starts the OpenOCD gdb proxy server (I don't know the command). Set 'Wait before connect' to the GDB server startup time + some reserve. 'Target connection' = remote localhost: Activate 'gdb download' then MSEide will use the gdb "load" command for program download. I suggest to make first a minimal C-program with the gcc toolchain of your target. If that works the FPC adventure can start. ;-) Martin Hi, I tried to debug my arm-board with MSEide. I manually started openocd (I need to be root). I configured MSEide debugger : Target connection : extended-remote localhost:. I configured debug-target to the elf-file of my project. Is there a macro to add an extention to the "make-output-file" ? I compiled the project and manually flashed it, and I left it in reset halt. I then can attach to the target, I see gdb connecting to openocd. I get the proper source in the source window. I can start the project, but since there seems still a problem with the compile-fase (the resulting binary does not work properly) I tried to reset the board. There gdb drops the connection to the target. When I set a breakpoint, the target halts, but MSEide does not indicate in the source where it stops. I can step, but again MSEide does not follow in the source. I can "continue" the target and stop it. But when I stop it, no indication where in the source it stopped. So progress, but not there yet. Or maybe I'm doing things wrong ? I still need to find why the binary is not good. When I compile the project via cli, it's working. From within MSEide, it does not work, although the command-line is the same as my manual command-line. I will add -va again and compare the outputs. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazreport master-detail on one line
op 26-05-14 13:47, Reinier Olislagers schreef: (Note: haven't ever set up master/detail reporting in Lazreport, so just some ideas below) At least in other reporting solutions, master details means having some master band, then a detail band below it. This gives the following setup: Master1 record ...detail1:record1 ...detail1:record2 ... ...detail1.recordn Master2 record ...detail2:record1 ... ...detail2:recordn1 In other words, it supports single row reports only. No idea if this applies to lazreport. This works fine in Lazreport, but it's not what I want. I want all data, including details, of the master-record on one line. In other reporting solutions, if you want to have master+detail info next to each other, you can use a query in the database that provides the info in the desired layout. This is often known as s acrosstab query, searching gives e.g. Postgresql http://stackoverflow.com/questions/3002499/postgresql-crosstab-query Or http://www.paragoncorporation.com/ArticleDetail.aspx?ArticleID=25 Obviously no idea if this applies to lazreport as well. This should work in Lazreport, but that's just a case of a masterband. The point is then : what's the cross-data band used for ? How does it work ? Anyway, thanks for your input. B.T.W. I'm using Firebird as a database. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to color a field in a LazReport ?
op 10-03-14 15:33, Koenraad Lelong schreef: Hi, I'm trying to make the background of dbfield in a LazReport different. Hi, Just found out how to do this : In the report-editor there is a button 'Highlight Attributes'. I found this by chance by having my mouse stay over it for some time. There you can enter something like 'VALUE<0' and select some attributes. One remark : on Linux the attributes-form is cut. Not all information is shown. On Windows, you can see all. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to tell debugger what executable to use ?
op 21-05-14 15:59, Justin Smyth schreef: I can now compile in lazarus , I have openocd working it detects my board. I need to flash the elf file to my board , I have read open ocd can do , and I read somewhere GBD can do it too Whats the best way to do this ? Also do I need to have openocd running first then compile my program ? ( then flash ??) Kind Regards Justin Justin, Compiling and debugging are separate processes. So you can e.g. compile somewhere, transfer the elf-file to your debugging station, flash your processor and debug. So no, openocd does not need to run to *compile*. What I do (but hope to do with lazarus) : Start openocd, it should detect your board. In another terminal-session, telnet to localhost port . For my processor (but I think it should be for all processors) I do : "reset halt" to stop the processor. Then I erase the processor : "stm32f1x mass_erase 0" (that's specific for the stm32f1x-processors). Then I can program : "flash write_image " After that you can start the processor : "reset" Debugging should be done like this : start your arm-none-eabi-gdb. I used tui as parameter : TextUserInterface. I have a .gdbinit file in my home-directory containing : "target extended-remote localhost:" This connects gdb to openocd. Unfortunately, I don't know text-based gdb enough to give more details. Depending on your processor/debug-interface you could use Insight, that's a stand-alone GUI gdb. Unfortunately, I personally can't use it anymore because openocd 0.8 changed so gdb 6.8 (Insight's version of gdb) can't be used. And I need openocd 0.8 for my processor. Openocd 0.7 has no problems with Insight though. HTH. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to tell debugger what executable to use ?
op 21-05-14 13:35, Michael Ring schreef: ... Unfortunaltely the debugger cannot be set on project level, you need to set it in Tools->Options->Debugger That's where I configured the "remote gdb" options. But how do I tel it to use an elf-file ? Does lazarus svn have more possibilities ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How to tell debugger what executable to use ?
Hi, I'm trying to use lazarus as a debugging-frontend for arm-embedded. I managed to configure lazarus to compile my source into arm-embedded-code for the STM32F103-processor. My next step is to configure lazarus to debug the code. When I do nothing, the debugger complains that project1 does not exist (used path is OK), which is true because that file really does not exist and should not exist. It's an *elf-file* (extension : .elf) that should be used. If I use gdb-cli I also have to use the elf-file. So how do I tell lazarus to use that elf-file ? I configured lazarus to use arm-none-eabi-gdb as debugger, connect to localhost, port . Which is the port openocd uses to let the debugger have control. I'm using lazarus 1.2.2, and fpc svn 27738 as arm-embedded-compiler. On a linux-machine. P.S. is there a way to send "monitor" commands to the debugger ? That way I could program my chip. Thanks, Koenraad.. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Fpcup problem with Lazarus
Hi, I tried fpcup to get a "user" version of lazarus. With that I mean a version of lazarus where adding packages is more easy than with a packaged version of lazarus. But I'm exeriencing a problem. I ran fpcup and all seems OK, but when I make a simple project, form with a button, I can't double click on the button to give it an OnClick-event. I get an error (on the commandline) : TDesigner.InvokeComponentEditor A Button1:TButton TDesigner.InvokeComponentEditor B TDefaultComponentEditor ### TCodeToolManager.HandleException: "unit not found: Classes" at Line=26 Col=10 in "/home/koenraad/development/lazarus/lcl/lclclasses.pp" TDesigner.InvokeComponentEditor ERROR: Unable to find method. Please fix the error shown in the message window, which is normally below the source editor. In the lazarus-IDE I also get an error-message, stating the same. I'm running linux. My lazarus is at svn rev. 45085. What's wrong ? Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] [LAZARUS] Minilib (was : Any Free/Cheap Async Serial Port Component)
op 10-05-14 18:23, Koenraad Lelong schreef: op 10-05-14 16:44, Zaher Dirkey schreef: What functions? I added the missed file, and you can use the bug tracker. Try again Thank you Never mind those functions. I later read that I needed to use release, in stead of trunk. There all was OK. I will try again ASAP. Koenraad. I spoke a bit too soon. I downloaded release (download snapshot). Then I tried to compile lib/minicommons. I get the same errors I had before : /lib/mnFields.pas(750,20) Error: Calling convention doesn't match forward /lib/mnFields.pas(213,14) Hint: Found declaration: TmnFields.QueryInterface(constref TGuid,out ):LongInt; CDecl; /lib/mnFields.pas(798,20) Error: Calling convention doesn't match forward /lib/mnFields.pas(205,14) Hint: Found declaration: TmnFields._AddRef:LongInt; CDecl; /lib/mnFields.pas(803,20) Error: Calling convention doesn't match forward /lib/mnFields.pas(206,14) Hint: Found declaration: TmnFields._Release:LongInt; CDecl; After fixing those I get : /lib/mnUtils.pas(121,18) Error: Identifier not found "CharInSet" /lib/mnUtils.pas(251,51) Error: Identifier not found "CharInSet" /lib/mnUtils.pas(259,108) Error: Identifier not found "CharInSet" /lib/mnUtils.pas(261,50) Error: Identifier not found "CharInSet" /lib/mnUtils.pas(509,17) Error: Identifier not found "CharInSet" Here I'm stuck. P.S. I do it this way because I don't see how I can use the bug-tracker of sourceforge. I will have to search more. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] [LAZARUS] Minilib (was : Any Free/Cheap Async Serial Port Component)
op 10-05-14 16:44, Zaher Dirkey schreef: What functions? I added the missed file, and you can use the bug tracker. Try again Thank you Never mind those functions. I later read that I needed to use release, in stead of trunk. There all was OK. I will try again ASAP. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] [LAZARUS] Minilib (was : Any Free/Cheap Async Serial Port Component)
op 06-05-14 21:08, Zaher Dirkey schreef: Try https://sourceforge.net/p/minilib https://sourceforge.net/p/minilib/code/HEAD/tree/trunk/comm/ Hi, Out of curiosity I looked into this, and I downloaded the source from sourceforge. Trying to install I found problems : minicommons never compiled for fpc/lazarus ? Because some function declarations are different from the forward declarations. Solved this for now by making them identical. More problematic : minilib lacks HTMLKeywords.inc. There I'm stuck. I would like to try the pos-library. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to color a field in a LazReport ?
op 10-03-14 17:28, Jesus Reyes schreef: El Lunes, 10 de marzo, 2014 9:10:39, Koenraad Lelong escribió: Hi, Have you tried procedure TDataModule1.frReport1EnterRect(Memo: TStringList; View: TfrView); begin if Dataset.FieldByName('VERSCHIL').asFloat<0.0 then View.FillColor := clRed else View.FillColor := clWhite; end; ? Now I have ;-). It does not work like expected because (I think) Dataset contains a whole record. The code says : if the field 'VERSCHIL' of the current record contains a negative value paint the box of the current field red. But that's true for all fields in the record. I added : if Memo.Text='[qrySamenVatting."VERSCHIL"]'#13#10 then > if Dataset.FieldByName('VERSCHIL').asFloat<0.0 then > View.FillColor := clRed > else > View.FillColor := clWhite; This works as I expected. Another way is, as shown in UserDs example, using a Script, You can make a script var 'Negative', which value is updated in OnGetValue, just like FNegative below, the difference would be that 'Negative' is a script var and in your example FNegative is some data module field or property. In the UserDS sample that would be something similar to variable 'I', for example. procedure TDataModule1.frReport1GetValue(const ParName: String; var ParValue: Variant); begin Append(OutFile); writeln(OutFile,ParName); CloseFile(OutFile); if ParName='qrySamenVatting."VERSCHIL"' then FNegative:=qrySamenVattingVERSCHIL.AsFloat<0.0 else FNegative:=false; end; Used that way, the memo field's script would be something like: Begin if Negative then FillColor := clRed else FillColor := clWhite; End When will that script be executed ? Before or after the EnterRect ? Before is OK, after, like GetValue, is too late. This colors the wrong field. After some debugging I found EnterRect is fired before GetValue. So, how can I modify the color based on the value ? Koenraad. Thanks anyway, I'm a step further. Now getting a crosstab to work. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How to color a field in a LazReport ?
Hi, I'm trying to make the background of dbfield in a LazReport different. I tried using the userds example, but it does not work. This is what I wrote : procedure TDataModule1.frReport1EnterRect(Memo: TStringList; View: TfrView); begin if FNegative then View.FillColor:=clRed else View.FillColor:=clWhite; end; procedure TDataModule1.frReport1GetValue(const ParName: String; var ParValue: Variant); begin Append(OutFile); writeln(OutFile,ParName); CloseFile(OutFile); if ParName='qrySamenVatting."VERSCHIL"' then FNegative:=qrySamenVattingVERSCHIL.AsFloat<0.0 else FNegative:=false; end; This colors the wrong field. After some debugging I found EnterRect is fired before GetValue. So, how can I modify the color based on the value ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Bugtracker password lost
op 10-03-14 11:02, Michael Van Canneyt schreef: On Mon, 10 Mar 2014, Koenraad Lelong wrote: Hi, I'm trying to log into the bugtracker. Unfortunately I forgot the password. Moreover, the email-address is not valid anymore. What can I do ? Create a new account ? If you give me the name of your account, and the new email address, I can tell mantis to reset your password. Michael. Hi, It's solved. I used the email-address to log in. When I used the name of the account I could log in (and modify the email-address). Thanks anyway. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LazReport & Database
op 09-01-12 09:36, Koenraad Lelong schreef: On 05-01-12 18:07, Mattias Gaertner wrote: Can you create a small example and a bug report? Mattias http://bugs.freepascal.org/view.php?id=21050 Koenraad Hi, With a new project, last week I tried to do this again. First with Lazarus 1.08, today with Lazarus 1.2 (downloaded and installed this morning). Still the same problem. I looked in the bugtracker. There is a request for a new sample-project. Unfortunately I lost my password and the email-address is not valid anymore. The bugtracker states : You need to first link TfrDBDataSet to a TDbf (which could be in a TDatamodule) and then link the TfrDBDataSet to the TfrReport via the Dataset property. When you use the query on the same form as the report, this is *not* needed. And adding a TfrDBDataSet and connecting it to the query on the datamodule does not work. FWIW, I'm running WinXP. I do have a new project with the mentioned TfrDBDataSet. Can I upload it here ? Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Bugtracker password lost
Hi, I'm trying to log into the bugtracker. Unfortunately I forgot the password. Moreover, the email-address is not valid anymore. What can I do ? Create a new account ? Regards, Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Rowheight of a DBGrid
Hi, Is it possible to set the height of individual rows in a DBGrid ? I have a database containing multi-line texts. I now can display these lines, but more than two lines of text in a rowheigth of 18 will be problematic. I could modify the defaultrowheight but then also the fixed row height will be bigger. I found some code to calculate the required height, but I get a compile-error on this line : WidgetSet.DrawText(DC, pChar(str), Length(str), fRect, DT_CALCRECT or Options); Where do I find that WidgetSet ? Thanks for any pointers. Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Memo for touchscreen
Op 27-08-13 18:50, Malcolm Poole schreef: This happens because '§' and the other 'characters' are represented in UTF8 by more than one byte. I reproduced your problem and got around it by replacing Inc(testcaretpos); by Inc(testcaretpos, Length(Kars)); I don't know what consequences this might have for your navigation using the arrow keys, though: I haven't had much experience working with multibyte chars. Hope this helps, anyway. Hi, Unfortunately, that does not work. I already tried that. The effect is the same. I think this will not work. Maybe it's better to really simulate keypresses and send these to the application. I remember doing something similar in a Delphi application. I will have to look at that. Thanks anyway. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Memo for touchscreen
Op 18-07-13 21:24, Malcolm Poole schreef: // procedure TForm1.LetterAButtonClick ( Sender: TObject ) ; var testcaretpos: Integer; begin testcaretpos := Memo1.SelStart; Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + 'A' + Copy(Memo1.Text, testcaretpos+1, MaxInt); Inc(testcaretpos); Memo1.SelStart := testcaretpos; Memo1.SetFocus; end; Hi Malcolm, I made a few testprograms that work fine with your code. Now I made a full keyboard (Belgian AZERTY) and I'm having a problem I can't solve. The keyboard has some "special" characters : é§èçà and others. Those are not 1 byte characters. When I add them, they appear in the memo, but the next character seems to erase the memo. If I have already some lines in it, all disappears and the cursor is on the first line, fully left. I add the characters with a string : Kars:='§'; Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + Kars + Copy(Memo1.Text, testcaretpos+1, MaxInt); Actually, I do this in a procedure with Kars as a parameter. Any suggestions where to look ? BTW, I tried this on Lazarus 1.0 on Linux. Thanks, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Postgresql error [solved]
Op 05-08-13 11:19, Koenraad Lelong schreef: Hi, I can't find out why I get this error in my application : EPQDatabase Error pqMyServer1 : Preparation of query failed (PostgreSQL:ERROR: prepared statement "prepst0" already exists) Severity : ERROR SQL State : 42P05 Hi, The problem is solved. To my shame I used the wrong transaction for the query. And I didn't see this until after a few hours of debugging. Regards, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Postgresql error
Hi, I can't find out why I get this error in my application : EPQDatabase Error pqMyServer1 : Preparation of query failed (PostgreSQL:ERROR: prepared statement "prepst0" already exists) Severity : ERROR SQL State : 42P05 I'm using a TPQConnection, and I can make it active. My TSQLQuery.SQL (pqQuery2) is this : UPDATE mydbcarrview_10.carrier_magname SET location = :location where carrierid = :carrierid Then I do this : with Datamodule1 do begin //pqQuery2.UnPrepare; <-- does not help pqQuery2.ParamByName('Location').AsString:=edtLocation.Text; pqQuery2.ParamByName('CarrierId').AsString:=edtCarrierId.Text; try pqQuery2.ExecSQL; <-- gives the error pgTransaction1.Commit; except on e:exception do begin showmessage(e.Message); pgTransaction1.Rollback; end; end; end; pqQuery2.UpdateMode was UpWhereKeyOnly, and I tried UpWhereAll, with the same error as result. Lazarus 1.08, fpc 2.6.2 on winXP-32 bit. What am I doing wrong ? Thanks, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Memo for touchscreen
Op 19-07-13 16:21, Malcolm Poole schreef: ... == procedure TForm1.UpButtonClick ( Sender: TObject ) ; var newcaretPos: Integer; x: Integer; begin newcaretPos := 0; writeln(Memo1.CaretPos.Y, #32, Memo1.CaretPos.X); for x := 0 to Memo1.CaretPos.Y-2 do newcaretPos := newcaretPos + Length(Memo1.Lines[x]) + Length(LineEnding); if Length(Memo1.Lines[Memo1.CaretPos.Y-1]) < Memo1.CaretPos.X then newcaretPos := newcaretPos + Length(Memo1.Lines[Memo1.CaretPos.Y-1]) + 1 else newcaretPos := newcaretpos + Memo1.CaretPos.X; Memo1.SelStart := newcaretPos; Memo1.SetFocus; end; Hi, Thanks, but you're too nice, leave me some homework ! ;-) Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Memo for touchscreen
Op 18-07-13 21:24, Malcolm Poole schreef: > > procedure TForm1.LetterAButtonClick ( Sender: TObject ) ; > var >testcaretpos: Integer; > begin >testcaretpos := Memo1.SelStart; >Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + 'A' > + Copy(Memo1.Text, testcaretpos+1, MaxInt); >Inc(testcaretpos); >Memo1.SelStart := testcaretpos; >Memo1.SetFocus; > end; > > procedure TForm1.DeleteButtonClick ( Sender: TObject ) ; > var >testcaretpos: Integer; > begin >testcaretpos := Memo1.SelStart; >Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) > + Copy(Memo1.Text, testcaretpos+2, MaxInt); >Memo1.SelStart := testcaretpos; >Memo1.SetFocus; > end; Thanks, Works fine, except for navigating up and down. Left and right is OK, I have to find out how to know on what line the cursor is, and then going to the next/previous line, if possible. regards, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Memo for touchscreen
Op 18-07-13 17:32, waldo kitty schreef: On 7/18/2013 07:54, Koenraad Lelong wrote: whatever you choose, you appear to need at least some sort of on-screen keyboard component like some (so-called) smartphones have... Waldo, I was working on that. I also thought of "virtual keyboards", but then the problem arises how to invoke these. I mean, most of the time I don't need a keyboard. But when I need it, how do I pop it up ? Could be as simple as calling the application's name, but then how do I remove it ? I need to study and try. The simplest thing seems making my own virtual keyboard. Regards, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Memo for touchscreen
Hi, For a touchscreen-application (so no real keyboard) I need something like a memo. I first tried a memo, but how do I enter text at the caret ? And the caretpos is readonly. Next I tried synMemo, but if I move the caret, the caret disappears. How can I show it ? How do I send a BackSpace, Delete ? How do I hide the "rightedge" of the synMemo ? Just set it to the backgroundcolor ? Is there a better component ? B.T.W. it will run on linux. Regards, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PDF in a Form
Op 13-07-13 18:40, Paul Breneman schreef: Thank you *very* much Koenraad for mentioning that this project uses fpGUI. I didn't find any docs at the site but I hope to study the code more ASAP. It is very interesting to see a fpGUI program set up for use with a touchscreen! I've started down that path myself. It seems to be setup to use Lazarus? I didn't think fpGUI support in Lazarus was very complete but maybe things have been improved recently? Paul, The code is managed with Lazarus, I think. The GUI is made with fpgui-designer or what's it called ? Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PDF in a Form
Op 12-07-13 20:29, Malcolm Poole schreef: http://code.google.com/p/firepos/source/browse/#svn%2Ftrunk%2FmuPDFlaz Malcolm, Reading this thread I went to the link. It seems this is a POS system. Since I'm thinking about writing a POS system myself I downloaded firepos and I tried to compile it. But I'm having dependency problems, fpgui related. I have a development system (odroid arm-linux) that has lazarus 1.1 and fpc 2.7.1 (both some svn downloads). I also have fpgui 1.0. I tried to set the path's to include that fpgui in firepos, or the fpgui in the firepos tree, but both fail because some (different) units are not found. Could you provide some guide how to setup lazarus to compile firepos ? Thanks in advance, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Touchscreen
Hi, I'm considering an application that will run on a touchscreen. I made some test-apps, and I think there will be problems with things like scrollbars. Is there a way to make those bigger ? Or is there a way to implement the "swipe" to move items in a list ? The touchscreen is connected to a linux-machine. Any suggestions ? Thanks, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] SDPO and recent Lazarus
Hi, Does anyone uses SDPO (more specific, the serial port component) in recent Lazarus versions ? I tried to install the package in 1.0.4, but it fails because of some errors. Unfortunately I didn't note the specific error, because I was in a hurry to investigate a bug in an application that uses that component so I had to re-install Lazarus 0.9.30. I remember something about LResource and FileUtil. Regards, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus and Arm Embedded.( see FPC Bug report 23844)
Op 14-02-13 17:15, Michael Schnell schreef: On 02/14/2013 04:46 PM, Koenraad Lelong wrote: I would like to test this. Could you give a link to the wiki-page ? We did not start it yet. Supposedly first a German version will be done. Ill translate it to English when it's ready. Hi, I don't mind the German version. I have no problems reading German. Writing is a bit more difficult for me ;-). P.S. can you make executables with your compiler ? Andy already built a workable arm (v5 le) cross-compiler as a x86 executable. I am currently working on compiling same as an x86-64 executable (on Linux). What I mean with an executable is the result of a crosscompiled source, a binary you run on your embedded-arm-processor. Regards, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus and Arm Embedded.( see FPC Bug report 23844)
On 14-02-13 14:51, Michael Ring wrote: Hi Justin, as Michael already wrote we are currently integrating openocd into lazarus, the integration is already working but needs some testing. I would love to see that somebody else besides me gives the implementation a try. If Unlink2 is supported by openocd you should be fine, same is true if unlink2 brings it's own gdbserver. What OS are you working on, MacOS, Windows or linux? Michael Hi Micheal, I would like to test this. Could you give a link to the wiki-page ? P.S. can you make executables with your compiler ? How did you make your compiler ? I always get an error about not being able to link (see my post of jan 30, 18:26 in the fpc-pascal list). FWIW, I made a virtual machine : x386 with fpc 2.7.1, arm-none-eabi- toolchain, available on susestudio.com. Is there a way to make big files available, without being forced to have an account on the service (like dropbox or susestudio) ? Thanks, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Upgrading a project
Hi, I have a project that builds fine with Lazarus 0.9.30.4. When I open it in Lazarus 1.0.4 I lose a TNotebook, and my project is "destroyed". Is there a way to upgrade my project so I can compile it in newer versions of Lazarus ? Are there any "best practices" to avoid such misfortunes in the future ? Thanks. Regards, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] emulating DBCtrlGrid ?
Hi, I have master & detail tables in a database. The details are just a number of multiline texts. The master-table is shown in a dbGrid and I need to show the details also, in a separate list. How would I show these texts ? Since Lazarus has no DBCtrlGrid like the Delphi I still use I was thinking of emulating that grid with a scrollbox and creating memo's in it when the master-table scrolls. Is this a good idea ? Are there better ways to do this ? The database is not too big, a few hundred master-rows, each with a few details. Thanks for your advice, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ODBC-problems
Op 20-11-12 15:15, Reinier Olislagers schreef: Maybe that's because I installed the 64-bit Firebird drivers ? No. I've got both 32 bit and 64 bit Firebird ODBC drivers here. (Wwhen I use FPC with FB I generally use the SQLDB interbae/Firebird driver - but I can confirm both x86 and x64 Firebird ODBC drivers work here e.g. using Access) When I use Firebird, I use the native drivers. It was only a testcase to see if ODBC works. But why a user DSN works and a system DSN does not is a problem. Did you try that with Access ? Also Pervasive can't install 32-bit ODBC drivers. Well, I'll have to get a 32bit machine somehow (more exact : Windows-license for the machine). - Why would that help with Pervasive if it can only run 64 bit ODBC drivers anyway? Pervasive does not install 32 bit on 64bit. 32 bit on 32 bit is no problem. - Apparently on some Win7 editions, you can run a VM for x86 Win XP (Virtual XP mode), which may work for you. That would be a problem I think. I'm running Win7 as a VM on a linux host. Regards, Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ODBC-problems
On 20-11-12 12:35, Reinier Olislagers wrote: On 20-11-2012 12:23, Koenraad Lelong wrote: On 20-11-12 12:13, Koenraad Lelong wrote: In Win7 64 bit only the system DSN of Firebird works. Sorry, should be user DSN works, system DSN does not work. As you're using 32 bit Lazarus, just to be sure: please confirm the DSNs you are using are defined in the 32 bit ODBC control panel (using 32 bit Firebird ODBC drivers), not the 64 bit ones... That error message seems to indicate some bitness mismatch between application<>ODBC<>ODBC driver Hi, All the drivers are 64bit. I tried to install Firebird 32 bit but that seems not to work, I don't see a Firebird driver when I try to make a DSN. Maybe that's because I installed the 64-bit Firebird drivers ? Also Pervasive can't install 32-bit ODBC drivers. Well, I'll have to get a 32bit machine somehow (more exact : Windows-license for the machine). Thanks for your help. Koenraad Lelong -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ODBC-problems
On 20-11-12 12:13, Koenraad Lelong wrote: In Win7 64 bit only the system DSN of Firebird works. Sorry, should be user DSN works, system DSN does not work. Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ODBC-problems
On 20-11-12 09:47, michael.vancann...@wisa.be wrote: ... Is this on a 64-bit system ? And if so, are you programming 32-bit or 64-bit? Michael. I'm programming on a 64bit Win7 system. AFAIK Lazarus is 32 bit (because the apps should run also on 32 bit systems, and they do). I tried some things. I made a test-program that accepts a DSN-name and then tries to connect to that DSN. In Win7 64 bit only the system DSN of Firebird works. On WinXP 32 bit everything works fine, Firebird system and user DSN and Pervasive system and user DSN. Is this a known problem ? Regards, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] ODBC-problems
Hi, I'm trying to use a Pervasive-database via ODBC. In Lazarus, I seem unable to set up the connection so I first tried with a Firebird connection. There also I have problems. In Windows' ODBC-configuration-appication I made a user DSN to the Firebird server. Testing gives OK. Trying to contact it via lazarus gives is OK. Then I tried to do the same with a system DSN. There I have a problem, see the image. I tried to do the same with the Pervasive driver, but there I have the problem for both user-DSN and system DSN. Am I doing something wrong ? Thanks for any help, Koenraad Lelong. <>-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] RE : TProcess-problem (solved)
On 10-07-12 08:50, Ludo Brands wrote: That's under Windows, using Lazarus 0.9.30.4. What is the fpc version? Tprocess is part of fpc. There have been some changes recently in trunk because of parameter quoting problems. Can you give an example of the executable and parameters that fail? Ludo Hi Ludo, I'm using fpc 2.6.0. I prefer using the stable releases. My older version used "commandline" and that does work. This is my old-code : pk2cmd.CommandLine:=PicKitFile+' /B'+ExtractFilePath(PicKitFile)+' /P /F'+PICFile+' /E /M /Y /J /R'; //pk2cmd.Executable:=PicKitFile; So I tried to "shortcut" to the new method : executable:=PicKitFile; Parameter[0]:="rest of commandline" That does not work. I have to add every parameter on its own. Then it works. Thanks anyway, Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] TProcess-problem
Hi, I'm updating an application that uses Tprocess to execute an external (DOS) application. My new version does not work any more and I don't know how to solve this. I created a TProcess and assinged the executable. Then I added a parameter line. Executing that gives an error that a needed file is not found. To debug this, I create a batch-file from within the Lazarus-application containing the executable and the parameter line. Executing that batch-file from the directory where my Lazarus-app is located works, the needed file is found. Any suggestions to debug this ? What do I have to do to keep the dos-box open ? Then, maybe, I can see more about the problem. Now it opens and closes too fast, impossible to see anything. The error I can see because I use a pipe to get the output of the dos-application. That's under Windows, using Lazarus 0.9.30.4. Thanks, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Manually creating a form
On 29-06-12 11:22, Antonio Fortuny wrote: upper:=10; for i:=0 to 4 do begin form2.Height:=form2.height+25; edits[i]:=Tedit.Create(self); edits[i].Parent:=form2; edits[i].Parent:=Self; That simple ! Thanks. It works now. Koenraad -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Manually creating a form
Hi, I'm trying to manually create a form and in it's OnCreate event populate it with controls. But I'm doing somehing wrong. This is my creating sequence : form2:=Tform2.Create(nil); form2.ShowModal; Form2.Destroy; Nothing special I think. This is a sample of the create-code : procedure TForm2.FormCreate(Sender: TObject); var i : integer; upper : integer; begin upper:=10; for i:=0 to 4 do begin form2.Height:=form2.height+25; edits[i]:=Tedit.Create(self); edits[i].Parent:=form2; edits[i].Top:=upper; edits[i].Left:=10; upper:=upper+25; end; end; But when I run the code, I get a segfault at the location where I modify the form's height. If I remove that, I get the form but the edits do not show. When I modify the code to automatically create the form this works. So I'm clearly missing something. Any tips, links to documentation ? Thanks, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to use DBCombobox
On 18-06-12 11:44, Reinier Olislagers wrote: Try seeing if a DBLookupCombobox does what you want: it should let you select a value out of another table and insert that into the field bound to the dblookupcombobox. Hi, Just tried, it's worse. There absolutely nothing shows. I must be doing something wrong. I'll switch to Delphi (again, frustrating). Thanks. Koenraad. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to use DBCombobox
On 18-06-12 11:28, Koenraad Lelong wrote: No suggestions what I'm doing wrong ? I enclose a project, using the employee-database. Regards, Koenraad Lelong. Hi, I forgot to say that scrolling the grid makes the highlighted field of the grid appear in the combobox, but only that field is available, not other fields are visible. Regards, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How to use DBCombobox
Hi, I'm trying to use a DBCombobox, but I don't know how to show all records. Only the first record shows. What I did : Put an IBConnection on the form. Fill in the details. Put an SQLTransaction on the form. Put an SQLQuery on the form and fill in the details about the table to use. Put a Datasource on the form. Put a DBCombobox on the form. To test I put a DBGrid on the form. When I activate the SQL, I see some records filling the grid and the first record in the DBCombobox. When I run the application, I can navigate to all records in the grid and I see the first record in the DBCombobox. But the drop down of the DBCombobox shows nothing so I can't select other records than the first. I'm using Lazarus 0.9.30.4 with FPC 2.6.0. What am I missing ? Regards, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Another Master-detail problem
Hi, I think I am doing something fundamentally wrong. Every time I try to do something with master-detail tables, I get stuck on errors I don't understand :-( . I want to add a record in the detail-table, and modify a field in the master-table. When one of those two goes wrong, I need to revert. So I made this : qryDetail.Open; qryDetail.Append; qryDetailPRICE.Value:=Price; qryDetailCALIBDATE.Value:=CalibDate; ... other fields of detail are filled qryMaster.Edit; qryMasterLASTCALIB.Value:=CalibDate; try qryDetail.Post; qryDetail.ApplyUpdates; qryToestel.Post; qryToestel.ApplyUpdates; traMasterDetail.Commit; except qryDetail.CancelUpdates; qryMaster.CancelUpdates; traMasterDetail.Rollback; end; When I remove the master-operations, the detail insert works. My first try did not have the post-statements. The master-update did work, but nothing got inserted in the detail-table. When I added the post-statements, I got an error : qryDetail is not in insert or edit mode. What am I doing wrong ? Thanks for any clarification, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File copy
On 26-04-12 15:45, Antonio Fortuny wrote: Le 26/04/2012 14:57, Koenraad Lelong a écrit : Hi, I would like to make an application to centrally store documents. I will put a reference to the location in a Firebird database, so I can retrieve (and show) the document. This could lead to very big directories and I don't know any OS who loves this. This situation generalyy leads to a drastic preformance loose. I will categorize the files, so they come in several directories. I will let the user specify the source document, then the application will copy the document to the central location. So, I wonder if there is an OS-independent way to copy files. In fact input and output files depend on how your program access them. I guess that Win and Linux are mixed. In this case one solution is to use UNC and SMB sharing system on both sides: Windows folder share and Linux Samba server. That's what will be used. I could do block-read/block-writes, but is this the most efficient way ? Or should I use an os-dependent call of the copy command ? Or something else ? Using FPC, it is very easy to manage this with a pair of TFileStream provided each of them has an appropriate file path depending on the OS. I'm looking into this. Thanks. I could store the documents in the database, but I never worked with blobs so I will try this in a next version. It is quite easy to use blobs (either binary or text) most of the times. What components set do you plan to use ? Lazarus SQLdb works very well in both 32 and 64 bit. Prodigy UIB components do the same work. I am using SQLdb, but like I said that will be for the next version. And I'm considering a similar application retrieving files from CD-rom. I _think_ a CD-rom based database will be too slow. But I could be wrong. Thank you very much, that was very helpfull. Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] File copy
Hi, I would like to make an application to centrally store documents. I will put a reference to the location in a Firebird database, so I can retrieve (and show) the document. I will let the user specify the source document, then the application will copy the document to the central location. So, I wonder if there is an OS-independent way to copy files. I could do block-read/block-writes, but is this the most efficient way ? Or should I use an os-dependent call of the copy command ? Or something else ? I could store the documents in the database, but I never worked with blobs so I will try this in a next version. Comments, tips, etc. are welcome. Thanks, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Sorting with TDBGrid
Hi, I would like to implement sorting of columns with a TDBGrid. I found how to detect a click of the title, so that's OK. However, in Delphi there are components where I can modify the title showing the sorting order of the field (a small triangle pointing up or down on the right of the colums' title). Is this implemented in TDBGrid ? I could add a v or ^ to the title to indicate the sorting order, but that's not nice to see. I'm using Lazarus 0.9.30.4 on Windows. Thanks, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Vector graphics
On 06-04-12 15:11, Felipe Monteiro de Carvalho wrote: On Fri, Apr 6, 2012 at 3:02 PM, Koenraad Lelong wrote: So I would need some drawing routines, eventually with filled surfaces i.e. filled circles, rectangles but also rectangles with rounded corners, etc. What could I use ? I tried compiling fpvectorial on lazarus 0.9.30.4, but it needs fcl version 1.01. I think that's from a newer version of fpc than 2.6.0 I'm using. I think it should work fine in Lazarus 0.9.30, just edit the dependency. fpvectorial is mostly independent from Lazarus, only the 2D drawing output uses the LCL. fpvectorial does not depend on having a new FPC. I recommend using the latest svn of fpvectorial which is in the lazarus trunk. Of course I highly recommend using fpvectorial for you task, I can offer you tips as to how to add support for the file format you are working with, and as a bonus you get support for all formats already supported by fpvectorial. If you have trouble setting up the necessary things you could try a snapshot of Lazarus trunk. Hi Felipe, Thanks for your response. Just to report my experience : I downloaded the package via svn. First I modified the fcl-version needed. Then I had to remove a unit (rawvectorialreadwrite.pas) from the package before I could compile it. I don't remember the error but it was on the line containing lRawImage.Description.Init_BPP24_R8G8B8_BIO_TTB(RAW_IMAGE_WIDTH, RAW_IMAGE_HEIGHT); Then, unfortunately, none of the examples seem to work. Only two I could compile : fpcorelexplorer, but when I run it, it gives a "list index out of bounds" error after selecting a coreldraw 9 file. Then it gives correctly the version of the coreldraw used, but no size. I don't know what it's supposed to do more. fpvectorialconverter gives an "unsupported vector graphics format" error when I select a pdf and click to visualise it. fpv3dviewer gives "identifier not found" on RequireDerivedFromResource. fpvmodifytest and fpvwritetest give errors on a bunch of "WSRegister..." statements. That's all with the latest release version of lazarus/fpc, on Windows 7. I'll have to see if I can get a working lazarus from svn. Regards, Koenraad Lelong. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus