Re: [lazarus] Open URL in a browser
En/na Antonio Sanguigni ha escrit: Thanks all, guys. I'll have a look at your suggests. Note that all suggestions are distro specific. As more and more distro move to freedesktop, maybe the best cross-distro solution is to use the freedesktop standards, e.g. xdg-open: http://portland.freedesktop.org/wiki/XdgUtils (but then you have to provide a fall-back if xdg is not available) Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Distro Wiki
En/na Graeme Geldenhuys ha escrit: I use Ubuntu because it's small - a one CD download. I don't have the bandwidth to download 4-6 CD's like other distros. I only need one editor, one office application etc... Ubuntu gives me that. And what it doesn't have, I can install later (one package at a time). Not to start a distro-war, but you can do that with mandriva. In fact not only you can do it now, with the mandriva one live cd, but even many years ago, when the distro was split in 3 CDs (which, btw, only comprised a reduced set of what's available in the online repositories), you could just download the first one and the installer would ask how many CDs you downloaded. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] I have a dream
En/na Marc Weustink ha escrit: For scrolling after a line is added, I don't know. Personally I hate it when a memo gets updated and I want to read the contents the same time. Well, there could be a property that controls this behavior. Or scroll to the bottom only if the last line is visible (assuming that if it isn't visible you've manually scrolled to read old messages). That's what, e.g., kconsole does, and I manually replicated it with a TSynMemo (I'm not sure it'll work with a plain TMemo), something like: function TMyForm.AtBottom:boolean; begin Result:=SMemo.TopLineSmemo.Lines.Count-Smemo.LinesInWindow; end; procedure TMyForm.ScrollToBottom; begin SMemo.TopLine:=SMemo.Lines.Count-SMemo.LinesInWindow+1; end; procedure TMyForm.test; var autolast:boolean; i:integer; begin autolast:=AtBottom; SMemo.lines.beginupdate; for i:=1 to 10 do SMemo.lines.append(IntToStr(i)); SMemo.lines.endupdate; if autolast then ScrollToBottom; end; Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] C++ libraries
En/na Felipe Monteiro de Carvalho ha escrit: You have to build a C wrapper around C++. Look at the Qt 4 Pascal bindings. I cannot find the link now, but I read of someone wrapping C++ classes directly into fpc classes, working both under windows and linux. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Introduction
En/na Giuliano Colla ha escrit: I can't say. I read that someone is *using* gtk2. I tried to make a form with a button, and the lower half of the caption was lost. I tried to put a panel with a memo on the form, and I could see the panel through the memo (or the opposite, I don't remember). From time to time I recover my test form, retry it and the situation hasn't changed. I would never think that it's usable. But someone claims to use it. What for is a mystery for me. I've just done a project with gtk2 (disclaimer: it's not in production yet). It manages a simple sqlite database (using zeos, a handful of forms with TDBgrid and TDBNavigator) and communicates with the control process (which is a console mode daemon, so no gtk*) via dbus (it was fun using dbus with fpc, well, if you are a masochist :-D ) It seems to be working well. The biggest problem is the gtk2 memory leak, however these programs aren't meant to work 24/7 (only the control process is working 24/7) so I don't worry too much. When the graphical part has to run 24/7 I have no other option than use gtk1 (due to the above mentioned memory leak). Oh, the ide is compiled with gtk2. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] OpenMoko and FPC/Lazarus
En/na Florian Klaempfl ha escrit: It should be enough to build FPC with OPT=-dFPC_ARMEL So it's now possible to produce eabi code with fpc? Great! (not that I grasp the full implications of oabi vs. eabi, but I'd like to make some experiment with my n800, which is an eabi system). Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Memory leaks with gtk2
En/na Luca Olivetti ha escrit: A simple test form, with a label and a timer with interval set to 5: procedure TForm1.Timer1Timer(Sender: TObject); begin Label1.Caption:=IntToStr(GetMsCount); counter:=counter+1; end; with gtk1 memory usage is constant, while under gtk2 it grows continuosly. Heaptrc report no leaks (probably the memory is freed when the program ends, but that's of no use to me since my program is supposed to run forever), valgrind chokes on it. Any news on this (apart that it is still valid with today svn version)? (i.e.: is this a bug in my version of gtk2 or is it a problem in the lcl?) Bug report: http://bugs.freepascal.org/view.php?id=9259 Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Zeos - Lazarus next release
En/na Archangel ha escrit: does anybody know if next version of the lazarus it will be possible to use the zeos? I'm using zeos now, with a relatively ancient svn version of lazarus, so I suppose it should work with the recently released version. You should use a recent zeos snapshot or svn though. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] SQLite 3 datetime and timestamp
En/na Luiz Americo Pereira Camara ha escrit: - Try sqlitepass and sqldb/sqlite3. I vaguely remenber of sqlitepass to support timestamp. I don't know about sqldb. Note that sqlitepass is windows only (at least it was last time I looked). You can also use zeos, it is cross platform but I didn't check if/how it does support timestamps with sqlite (since, as Luiz explained, you can put any data type in any sqlite column). Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] SQLite 3 datetime and timestamp
En/na Roberto Padovani ha escrit: When the project I'm working on is finished, I'll strip everything from the source code and only leave a detailed tutorial for using sqlite without visual components. FWIW to do that you can also use sqlite3 directly (or with a thin wrapper), you don't have the convenience of a full dataset descendant but you have complete control on what you get from the database. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Google's Android OS :)
En/na Razvan Adrian Bogdan ha escrit: Google is creating a revolution in the mobile equipment market, their new OS (Android) is based on Linux and is OpenSource, they are planning to support a wide range of devices and are willing to pay lot's of money to people making apps for the new OS. I wonder if Lazarus and FPC could have an impact here :) Considering that application for android have to be written in java I somewhat doubt it. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Google's Android OS :)
En/na Paul Ishenin ha escrit: Víctor R. Ruiz пишет: Hi: 2007/11/22, Luca Olivetti [EMAIL PROTECTED]: Considering that application for android have to be written in java I somewhat doubt it. Even worse, Google uses its own virtual machine. Lets teach fpc to generate java byte code for that machine :) Let's[*] teach it to generate arm eabi code, so we can write apps for maemo instead ;-) [*] well, that us should be a you since I don't have the slightest idea on how to do it ;-) Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Tips for lazarus projects and Subversion
En/na Mattias Gaertner ha escrit: .lfm files: no .lrs files: it depends. It is recommended to keep them. Why? Cannot they be automatically generated from the lfm? Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Data-aware contols, updateSQL
En/na Maxim Ganetsky ha escrit: Howard Lee Harkness пишет: I guess I need to check them out. However, the files on sourceforge are about 6 years old. Is there a more recent version of ZeosDB? Yes. See here: http://zeosforum.net.ms/ I thought the official page was http://zeos.firmos.at Anyway, I used the trunk from svn, see the Downloading section here: http://zeos.firmos.at/viewtopic.php?t=1317 Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Data-aware contols, updateSQL
En/na Howard Lee Harkness ha escrit: Is there ANYBODY who has a COMPLETE example of a database application with a datagrid that can display, modify, add, and delete rows in a simple table? I could successfully do that using zeosdb components and sqlite, but it should work equally well with any other database supported by zeosdb. I just had to write a simple Select * from table in the sql property. I'm not sure it'd work with joins, but I used lookup fields to show data from other tables (I have a relatively simple database schema) Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] KOL-CE release
En/na Michael Van Canneyt ha escrit: Any plans to port to X11 (linux/bsd/mac) ? and maemo/hildon (aka gnome mobile)? Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] UTF-8 vs UTF-16 support
En/na Marco Ciampa ha escrit: On Fri, Oct 05, 2007 at 01:14:23PM +0200, Luca Olivetti wrote: En/na [EMAIL PROTECTED] ha escrit: * WideString allows indexed [] accessing individual chars. This does not seem to be correct. I read that utf16 can be 4 byte long.. Then calculation is needed sometimes... Unless you're dealing with klingon and ancient languages, Like Chinese? Just a billion people use it...not a real problem at all... :-\ I (wrongly) thought that chines was in the bmp :-( I think you can assume that for 99.99% of currently spoken languages every character will be exactly 2 bytes long. Wrong as I said before. There's a risk of having some character with more that 2 bytes but it is a small risk. With utf-8 the risk is bigger, so you have always to traverse the string if you need access to a specific character index. You have to go through the string for UTF-8 and UTF-16 encodings so the advantages are at least questionable... Yes, but my (wrong) premise is that you could assume all characters are 2 bytes wide, so the Nth character would be at N*2 byte. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] UTF-8 vs UTF-16 support
En/na Luca Olivetti ha escrit: You have to go through the string for UTF-8 and UTF-16 encodings so the advantages are at least questionable... Yes, but my (wrong) premise is that you could assume all characters are 2 bytes wide, so the Nth character would be at N*2 byte. BTW, using strings as arrays of char to get at individual characters is risky business with utf-8. Or will be they converted to (pseudo) properties and (slowly) do the (slow) right thing? I also suppose that the functions in strutils are not utf-8 aware, so what should we be using in its place? Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] UTF-8 vs UTF-16 support
En/na Mattias Gärtner ha escrit: For most string operations, like computing the byte length or comparing strings ASCII case insensitive, UTF-8 is 100% compatible. but not if you need char length, say limiting a text to 40 characters and indicating there that the text has been truncated with '..': if length(s)40 then s:=copy(s,1,38)+'..'; or maybe faster if length(s)40 then begin s[39]:='.'; s[40]:='.'; setlength(s,40); end; would break with utf-8 (and with utf-16 too if you use characters outside the bmp). There are probably utf-8 equivalents of the above, but old habits die hard Maybe for internal processing utf-32 is better and only use utf-8 for input/output and/or interface with other systems? Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] UTF-8 vs UTF-16 support
En/na [EMAIL PROTECTED] ha escrit: * WideString allows indexed [] accessing individual chars. This does not seem to be correct. I read that utf16 can be 4 byte long.. Then calculation is needed sometimes... Unless you're dealing with klingon and ancient languages, I think you can assume that for 99.99% of currently spoken languages every character will be exactly 2 bytes long. There's a risk of having some character with more that 2 bytes but it is a small risk. With utf-8 the risk is bigger, so you have always to traverse the string if you need access to a specific character index. -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Linking to properties on other forms/datamodules..
En/na Dominique Louis ha escrit: How about setting this via the IDE, how is that done for the scenario I mentioned earlier? It doesn't work yet: http://www.freepascal.org/mantis/view.php?id=648 Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus FPC 2.2.0
En/na Graeme Geldenhuys ha escrit: Hi, Every time I startup Lazarus since I changed to FPC 2.2.0, I need to manually select the Environment- Rescan FPC Source directory option. Otherwise Lazarus can't find any units included in FPC. Here is a sample error message. I Ctrl-Click'ed on a class and Lazarus jumped to the SysUtils entry in the uses clause and then showing the following error. - /home/graemeg/programming/fpGUI/src/corelib/gfxbase.pas(9,3) Error: source not found: unit /opt/fpc_2.2.0/lib/fpc/2.2.0/units/i386-linux/rtl/sysutils.ppu I'm running Lazarus 0.9.23 (r11993) compiled with GTK1 under Ubuntu Linux 7.04. Anybody else experience this issue and even better, have a solution? Are you sure there aren't remnants of the previous fpc version in /etc/fpc.cfg or ~/fpc.cfg? At least that was what happened to me the last time I had a similar problem: I forgot I had an old fpc.cfg in my home directory and that what the file that fpc used. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Is lazreport supposed to work? (gtk2/linux)
En/na Luca Olivetti ha escrit: En/na Jesus Reyes ha escrit: The Gtk2 interface is not yet as complete or tested as the windows or GTK1 inteface, as the more work is put in GTK2 interface it will benefit LazReport also. Btw, there are several bug reported in relation with LazReport and GTK2 interface, if you find a bug in LazReport either in GTK2, GTK1 o Windows that is not yet in bug tracker please submit it, otherwise it might be forgotten. Ok, I submitted bugs 9678 and 9679 http://www.freepascal.org/mantis/view.php?id=9678 (components placed 200-300 pixels to the right of the cursor) http://www.freepascal.org/mantis/view.php?id=9679 (no text in the printed report). Now that at least the second bug is fixed (thanks!), here comes the difficult part ;-) Is there a simple (or not so simple) way to use lazreport to send a report to the printer without X (I'm going to need this on an headless machine)? Just to test the waters, I started with a really simple test program program simple; {$mode objfpc}{$H+} uses LR_Class; begin end. and it is enough to cause this: TCUPSPrinter.GetEnumAttributeString Attribute not found: media-supported TCUPSPrinter.GetEnumAttributeString Attribute not found: media-supported TCUPSPrinter.GetEnumAttributeString Attribute not found: media-supported [FORMS.PP] ExceptionOccurred Sender=EAccessViolation Exception=Access violation Stack trace: $08132A57 GETDC, line 336 of ./include/winapi.inc $0811FD0D TBITMAP__HANDLENEEDED, line 442 of ./include/bitmap.inc $08122139 TBITMAPCANVAS__CREATEHANDLE, line 46 of ./include/bitmapcanvas.inc $081292F8 TCANVAS__REQUIREDSTATE, line 1530 of ./include/canvas.inc $0812916C TCANVAS__GETHANDLE, line 1440 of ./include/canvas.inc $08126A46 TCANVAS__SETPIXEL, line 109 of ./include/canvas.inc $0807CFC0 DOINIT, line 8706 of lr_class.pas $0807EC5D LR_CLASS_init, line 9084 of lr_class.pas $080579B4 TApplication.HandleException Access violation Stack trace: $08132A57 GETDC, line 336 of ./include/winapi.inc $0811FD0D TBITMAP__HANDLENEEDED, line 442 of ./include/bitmap.inc $08122139 TBITMAPCANVAS__CREATEHANDLE, line 46 of ./include/bitmapcanvas.inc $081292F8 TCANVAS__REQUIREDSTATE, line 1530 of ./include/canvas.inc $0812916C TCANVAS__GETHANDLE, line 1440 of ./include/canvas.inc $08126A46 TCANVAS__SETPIXEL, line 109 of ./include/canvas.inc $0807CFC0 DOINIT, line 8706 of lr_class.pas $0807EC5D LR_CLASS_init, line 9084 of lr_class.pas $080579B4 Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Is lazreport supposed to work? (gtk2/linux)
En/na Hess, Philip J ha escrit: Luca, The DC is invalid. Maybe you need to include the interfaces unit to initialize the widgetset? But then it doesn't work without X: ---[Test program]-- program simple; {$mode objfpc}{$H+} uses interfaces, LR_Class; begin Writeln('Ok'); end. --[ output in a konsole/xterm ]-- TCUPSPrinter.GetEnumAttributeString Attribute not found: media-supported TCUPSPrinter.GetEnumAttributeString Attribute not found: media-supported TCUPSPrinter.GetEnumAttributeString Attribute not found: media-supported Ok --[ output in a real console/no DISPLAY ] Gtk-WARNING **: cannot open display: -- Anyway, it doesn't matter too much, since what I need to do is print a listing with barcodes, and I found that I could do it by either invoking the gnu barcode utility or to manually generate the needed postscript using the barcode writer in pure postscript: http://www.terryburton.co.uk/barcodewriter/ Thank you. -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Is lazreport supposed to work? (gtk2/linux)
En/na Jesus Reyes ha escrit: The Gtk2 interface is not yet as complete or tested as the windows or GTK1 inteface, as the more work is put in GTK2 interface it will benefit LazReport also. Btw, there are several bug reported in relation with LazReport and GTK2 interface, if you find a bug in LazReport either in GTK2, GTK1 o Windows that is not yet in bug tracker please submit it, otherwise it might be forgotten. Ok, I submitted bugs 9678 and 9679 http://www.freepascal.org/mantis/view.php?id=9678 (components placed 200-300 pixels to the right of the cursor) http://www.freepascal.org/mantis/view.php?id=9679 (no text in the printed report). Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Is lazreport supposed to work? (gtk2/linux)
I'm trying to learn lazreport but I cannot do anything with it: when I try to add a band, it is ~200-300 pixels to the right of the cursor, so placing and selecting it is really difficult, when I add a rectangle (again, it's 200-300 pixels off) I cannot write anything in it (I cannot even be sure if it is inside the band or not). If I try to do various things (e.g. showing the grid, selecting the rectangle, etc.) it crashes and takes lazarus with it. I'm using the ide compiled with the gtk2 interface, lazarus svn 12004, fpc 2.2.0, under 32bits linux. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus on one window (aka SDI)
En/na Marc Weustink ha escrit: I've the same layout in separate windows. I never can get used to delphi versions where they are placed in one window, since whin I want to edit some properties in the object inspector, the whole is covering my form so I cannot see the visual imapact. This means that I've to switch everytime between OI and form to see if it is OK. So if you ask me, I won't invest time implementing a feature in Lazarus which I never would use. OTOH I find it really sweet to have the toolbar, the messages and the editor in the same window (I always seem to be chasing the messages and/or the toolbar when I move windows around or maximize the editor, ok, my fault but I'd still like to have those in the same window). I agree that the object inspector should be in a stand alone window. Maybe the interface could be dockable? Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] IDE, start once, open files
En/na Mattias Gärtner ha escrit: Is there already a cross platform component for applications to check if it is already running and if yes then pass some commands to the already application? For example clicking on files in the file browser should not open a second instance, but tell the already running instance to open the files. There's uniqueinstance http://sourceforge.net/project/shownotes.php?group_id=92177release_id=471823 (The wiki is down, so I cannot give you the wiki link) *but* it doesn't work here under Linux (I could launch more that one instance of my program). Since I hadn't too much time to debug it, I slightly modified it to open and lock a file instead of using TSimpleIpc, but that makes it non-crossplatform. Since it's short I'm including it here, it could be extended to write the pid in the file, so another instance can somewhat contact the first one. Bye -- Luca unit uniqueinstanceraw; {$mode objfpc}{$H+} interface uses Classes, SysUtils,baseunix,unix; function InstanceRunning(const Identifier: String): Boolean; function InstanceRunning: Boolean; implementation const BaseServerId = 'tuniqueinstance_'; function InstanceRunning(const Identifier: String): Boolean; var FLockFile:cint; function GetServerId: String; begin if Identifier '' then Result:=BaseServerId+Identifier else Result:=BaseServerId+ExtractFileName(ParamStr(0)); end; begin //cuando el programa termine el lock desaparece solo result:=true; FLockFile:=fpOpen('/tmp/'+GetServerId, O_RDWR or O_CREAT); if FLockFile0 then result:=fpFlock(FLockFile, LOCK_EX or LOCK_NB)0; end; function InstanceRunning: Boolean; begin InstanceRunning(''); end; end.
Re: [lazarus] IDE, start once, open files
En/na Luiz Americo Pereira Camara ha escrit: It's working here both under win32 and linux (testraw and testcomponent programs). Using fpc 220, Ubuntu Feisty Faw, recent lazarus svn. I assure you that I could lauch various copies of my program. I used fpc 2.0.4, maybe that's the problem. I only used uniqueinstanceraw, since it's a daemon, not a gui app. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] IDE, start once, open files
En/na Luiz Americo Pereira Camara ha escrit: Luca Olivetti wrote: En/na Luiz Americo Pereira Camara ha escrit: It's working here both under win32 and linux (testraw and testcomponent programs). Using fpc 220, Ubuntu Feisty Faw, recent lazarus svn. I assure you that I could lauch various copies of my program. I used fpc 2.0.4, maybe that's the problem. I only used uniqueinstanceraw, since it's a daemon, not a gui app. Did you tested the testraw program that comes bundled with the package? Although it uses a Lazarus app, the pattern usage can be transported to a non gui app straightforward. Yes, the testraw program works, but my program forks and using your unit it allows multiple instances, with mine only one. Here's a simple program that doesn't work (i.e it allows multiple instances) if it forks, but it works if left in the foreground (give it the -f parameter). This is with fpc 2.0.4. Wait a moment...now I tested with 2.2.0 and everything works as expected, so it was probably a 2.0.4 thing. Bye -- Luca program test; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes, sysutils, strutils, baseunix, { add your units here } uniqueinstanceraw; var terminated:boolean; procedure Init; var mypid:TPid; begin if InstanceRunning('testprogram') then begin Writeln('Already running!'); Halt(100); end; if paramstr(1)'-f' then begin mypid:=FpFork; if mypid0 then begin writeln('fork failed'); halt(mypid); end; if mypid0 then Halt(0); //parent end; Close(input); Close(stderr); Assign(stderr,'/dev/null'); Rewrite(stderr); Close(stdout); Assign(stdout,'/dev/null'); Rewrite(stdout); end; procedure CatchSignal(Sig : Longint; Info : PSigInfo; Context : PSigContext);cdecl; begin terminated:=true; end; procedure InitSignals; Var old,new : SigactionRec; begin New.sa_handler:[EMAIL PROTECTED]; fpSigaction(SIGQUIT,@New,@Old); fpSigaction(SIGTERM,@New,@Old); fpSigaction(SIGINT,@New,@Old); end; begin Init; InitSignals; while not terminated do sleep(100); end.
Re: [lazarus] arm-linux
En/na Tony Maro ha escrit: On Fri, 2007-08-03 at 10:29 -0400, Tony Maro wrote: On Fri, 2007-08-03 at 11:45 +0200, Luca Olivetti wrote: If you're cross-compiling, you need the target libraries at hand and specify the path with -Fl, then add -Xr with the path of the libraries on the target, e.g.: ppcarm -Fl/directory/with/target/libraries -Fl/other/directory/with/target/libraries -XParm-linux- -Xd -Xr/lib:/usr/lib test.pas Aha! I've copied the /lib directory off the device and onto my desktop. It still wouldn't find it. There was no link from libpthread.so to libpthread.so.0. I made that link and it worked. If I do this, is the app going to require those .so links to .so.0 on the device? If so that's a problem... is there any way around this? I don't think it's necessary. I'm not a binutil expert (neither I play one on tv), but I think .so are for linking, .a for statically linking and .so.* for runtime, so once the program is prepared it should use libpthread.so.0, searching it in the directories you specified with -Xr. You can test it with ldd on the binary. On that note, it still won't find libglib. On the device is only libglib-2.0.so so I assume ppcarm is trying to link to libglib-1.2 or some such... Try compiling for gtk2 instead of gtk1. Or find gtk1 libraries for the n800 and install them. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] arm-linux
En/na Tony Maro ha escrit: On Thu, 2007-08-02 at 18:51 -0400, Tony Maro wrote: I created a simple console app and ran the following at a command line: ppcarm -Xd -Sd -XParm-linux- project1.lpr Worked like a charm. Placing those options in the additional options for the compiler options in Lazarus also works, though setting processor to arm and os to linux didn't do it for me. I have no clue what those params mean - copied it off a website. I'm unclear of how to get the LCL built for ARM... if I try this to build any GUI app, it won't link, complaining about an incompatible crtbegin.o Well I got past that with a few #ifdef in the fpc.cfg. Now I'm stuck on: Compiling project1.lpr Assembling project1 Linking project1 /usr/local/bin/arm-linux-ld: cannot find -lpthread project1.lpr(19) Error: Error while linking If you're cross-compiling, you need the target libraries at hand and specify the path with -Fl, then add -Xr with the path of the libraries on the target, e.g.: ppcarm -Fl/directory/with/target/libraries -Fl/other/directory/with/target/libraries -XParm-linux- -Xd -Xr/lib:/usr/lib test.pas Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Wow, Kudos to the GTK2 team whoever you are!
En/na Tony Maro ha escrit: And, it compiled and ran just the same in GTK 2, so I'm excited to be able to release a GTK 2 version of it! My experience mirros yours, but before releasing it, stress-test it. My preliminary tests show that the gtk2 interface leaks memory: http://www.freepascal.org/mantis/view.php?id=9259 The ide itself is much more pleasant to use with gtk2 than with gtk1. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Making Configure Build Lazarus more user friendly
En/na Giuliano Colla ha escrit: The All Button checks all the Build (or Clean+Build, if Clean All is checked), You can do that now by clicking on the column header for clean+build (the rightmost one) the LCL button unchecks everything, except LCL (which is set to Build or Clean+Build as above), Two clicks: one on the column header with the red cross (the leftmost one), then click on build or clean+build for the lcl while Custom unchecks everything. click on the column header with the red cross. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: Your SearchPath only contains the default paths: SearchPath Value=/home/luca/.lazarus/;/usr/lib/fpc/2.0.4/units/i386-linux/rtl/;/usr/lib/fpc/2.0.4/;/ That means your fpc config is broken. It should contain lines like: -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl The fact is, these lines are already there, in fact the project builds and works fine. These are created by the fpc RPM, unless you already have a /etc/fpc.cfg. You can generate a fresh fpc.cfg with: sudo /usr/lib/fpc/2.0.4/samplecfg /usr/lib/fpc/\$version It generated the same file :-( Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: On Tue, 17 Jul 2007 09:38:15 +0200 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: Your SearchPath only contains the default paths: SearchPath Value=/home/luca/.lazarus/;/usr/lib/fpc/2.0.4/units/i386-linux/rtl/;/usr/lib/fpc/2.0.4/;/ That means your fpc config is broken. It should contain lines like: -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl The fact is, these lines are already there, in fact the project builds and works fine. Weird. But at least a step further. Ok, please try touch empty.pas ppc386 -va empty.pas Can you send me or publish the output? Aaagh, I knew I did something stupid: there was an fpc.cfg file in my home directory (a remnant of a test I did with fpc 2.1.4) and this was the file fpc was reading, not /etc/fpc.cfg. I still don't understand how it could possibly build the project (taking units from 2.1.4 instead of 2.0.4?) but now that I removed the rogue fpc.cfg everything is ok. Thank you for your patience and sorry for all the noise. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: Lazarus does not expand the unix shell ~ shortcut. And '*', '?' are normal characters. Ok, that explains (and solves) the problem with my units, but what about fpc standard ones? Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: On Mon, 16 Jul 2007 09:03:45 +0200 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: Lazarus does not expand the unix shell ~ shortcut. And '*', '?' are normal characters. Ok, that explains (and solves) the problem with my units, but what about fpc standard ones? Can no fpc unit be found or only some? Try to find the Classes unit. (Find declaration on 'Classes' in the uses section). Yes, classes is found If no fpc unit can be found, check the FPC path in the environment options. If only some units can not be found, then please rescan the FPC source. did that, many times :-( If this does not work: What OS, distribution do you use? linux, mandriva 2007.1, and the not found units are definitely there, somewhere under /usr/share/fpcsrc Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gärtner ha escrit: If this does not work: What OS, distribution do you use? linux, mandriva 2007.1, and the not found units are definitely there, somewhere under /usr/share/fpcsrc What processor? 32 bit or 64 bit? 32 bit What unit can not be found? e.g. contnrs, eventlog and other units in the fcl Where is the corresponding .ppu? (Probably somewhere under /usr/lib/fpc/) /usr/lib/fpc/2.0.4/units/i386-linux/fcl/contnrs.ppu /usr/lib/fpc/2.0.4/units/i386-linux/fcl/eventlog.ppu the corresponding sources: $ rpm -ql fpc-src | grep eventlog /usr/share/fpcsrc/fcl/amiga/eventlog.inc /usr/share/fpcsrc/fcl/beos/eventlog.inc /usr/share/fpcsrc/fcl/go32v2/eventlog.inc /usr/share/fpcsrc/fcl/inc/eventlog.pp /usr/share/fpcsrc/fcl/netware/eventlog.inc /usr/share/fpcsrc/fcl/netwlibc/eventlog.inc /usr/share/fpcsrc/fcl/os2/eventlog.inc /usr/share/fpcsrc/fcl/qnx/eventlog.inc /usr/share/fpcsrc/fcl/unix/eventlog.inc /usr/share/fpcsrc/fcl/win32/eventlog.inc $ rpm -ql fpc-src | grep contnrs /usr/share/fpcsrc/fcl/inc/contnrs.pp I'm currently adding some more tests to Lazarus. I hope we find out the reason, so I can add a check for this and future users will not step into this. I'm still thinking that I did something stupid, the problem is I don't know what ;-) Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: Please check ~/.lazarus/inputhistory.xml. Search for the missing units. For example there should be a line eventlog /usr/share/fpcsrc/fcl/inc/eventlog.pp Are they there? No, I can only see aliases for units in the rtl, anyway I pasted what I think are the relevant lines (between FPCConfigCache and /FPCConfigCache) here: http://pastebin.com/m11bae573 If not, please compile lazarus clean with -dVerboseFPCSrcScan. Then start the new IDE and rescan the FPC sources (again). Can you send me the output? I pasted it here: http://pastebin.com/m689efbb9 it seems it scans everything but then it only adds aliases for units under /usr/share/fpcsrc/rtl Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Luca Olivetti ha escrit: En/na Mattias Gaertner ha escrit: On Tue, 10 Jul 2007 12:56:09 +0200 Luca Olivetti [EMAIL PROTECTED] wrote: En/na [EMAIL PROTECTED] ha escrit: - Original Message - From: Luca Olivetti [EMAIL PROTECTED] [...] Error: unit not found: contnrs The unit builds fine. I'm using rev. 11454, but this started before. Is your fpc source directory in the environment options correct? yes. What fpc version do you use? 2.0.4 (installed from the rpm on the sourceforge/lazarus page) What version are your fpc sources (compiler/version.pas)? const { version string } version_nr = '2'; release_nr = '0'; patch_nr = '4'; minorpatch = ''; sources installed from the fpc-src rpm (same page), they're in /usr/share/fpcsrc and that's where lazarus should look for them. Are you cross compiling? No Well, now I found that it's worse than that, the error prevents from creating new events by, e.g., double clicking on a new button or from the object inspector: The component editor of class TDefaultComponentEditor has created the error: Unable to find method. Plz fix the error shown in the message windows. and the message window says Error unit not found: contnrs. To create the event I have to comment out the not found units, then uncomment them before compiling. Double clicking on a button that already has an event works. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: First try this: Environment Rescan FPC Source directory. First thing I tried. It didn't help. Note that this problem doesn't manifest exclusively with fpc sources, but also with units that are in the Other units files in compiler options. This will search again the FPC sources (.pp files). Then try to reproduce the bug. If this does not help: Stop the IDE and remove ~/.lazarus/includelinks.xml. Then start the IDE and try to reproduce the bug. it didn't help If this does not help: Please stop the IDE, uninstall the fpc-src and lazarus RPMs. Make sure, that /usr/share/fpcsrc is gone and install the RPMs again. Then start lazarus and use Environment Rescan FPC Source directory. I'm not using a lazarus rpm (I'm using the svn version) so I skipped that part. I tried uninstalling and reinstalling the fpc-src rpm but it didn't help either. I do have read access to all files under /usr/share/fpcsrc Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: On Fri, 13 Jul 2007 17:11:11 +0200 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: First try this: Environment Rescan FPC Source directory. First thing I tried. It didn't help. Note that this problem doesn't manifest exclusively with fpc sources, but also with units that are in the Other units files in compiler options. I see. Please make sure, the unit is really part of your project (Project Add editor file to project). I'd really like to avoid that: these are my standard units, similar to the library path in delphi. Anyway, this happens also in a fresh project, with standard fpc units. Then check the search paths of this unit: Source Editor Popup menu unit info Unit Paths. Are there the search paths of the Other units files? Are there any weird paths? Ok, one weird thing is that I defined the Other units as ~/lazcustom;~/lazcustom/*/ and lazarus didn't expand the ~ but just appended it to the current path. Now I hanged that to /home/luca/lazcustom;/home/luca/lazcustom/*/ and that fixed the problem with my units. One less problem but still it doesn't find standard fpc units. In a fresh, not saved yet, project this is what the popup for the Units paths shows: /home/luca/lazsvn/lazarus/lcl/units/i386-linux /home/luca/lazsvn/lazarus/lcl/units/i386-linux/gtk2 /home/luca/lazsvn/lazarus/packager/units/i386-linux when I save it it adds the path of the project. Please check that the filenames of the units are either lowercase (unit1.pas) or the unitnames are written correct in your uses sections (Unit1.pas - uses Unit1;). filenames are lowercase (though the name of the unit is mixed case). Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Burkhard Carstens ha escrit: Am Freitag, 13. Juli 2007 20:52 schrieb Luca Olivetti: [..] Ok, one weird thing is that I defined the Other units as ~/lazcustom;~/lazcustom/*/ and lazarus didn't expand the ~ but just appended it to the current path. Now I hanged that to /home/luca/lazcustom;/home/luca/lazcustom/*/ and that fixed the problem with my units. One less problem but still it doesn't find standard fpc units. Not 100% sure, but AFAIK lazarus does not expand xx/*/ like fpc does .. well, after I manually changed ~ to /home/luca, it finds a units in a subdirectory of lazcustom, so I think it is working. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Luca Olivetti ha escrit: En/na Burkhard Carstens ha escrit: Am Freitag, 13. Juli 2007 20:52 schrieb Luca Olivetti: [..] Ok, one weird thing is that I defined the Other units as ~/lazcustom;~/lazcustom/*/ and lazarus didn't expand the ~ but just appended it to the current path. Now I hanged that to /home/luca/lazcustom;/home/luca/lazcustom/*/ and that fixed the problem with my units. One less problem but still it doesn't find standard fpc units. Not 100% sure, but AFAIK lazarus does not expand xx/*/ like fpc does .. well, after I manually changed ~ to /home/luca, it finds a units in a subdirectory of lazcustom, so I think it is working. But it doesn't in another project. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na Mattias Gaertner ha escrit: On Tue, 10 Jul 2007 12:56:09 +0200 Luca Olivetti [EMAIL PROTECTED] wrote: En/na [EMAIL PROTECTED] ha escrit: - Original Message - From: Luca Olivetti [EMAIL PROTECTED] [...] Error: unit not found: contnrs The unit builds fine. I'm using rev. 11454, but this started before. Is your fpc source directory in the environment options correct? yes. What fpc version do you use? 2.0.4 (installed from the rpm on the sourceforge/lazarus page) What version are your fpc sources (compiler/version.pas)? const { version string } version_nr = '2'; release_nr = '0'; patch_nr = '4'; minorpatch = ''; sources installed from the fpc-src rpm (same page), they're in /usr/share/fpcsrc and that's where lazarus should look for them. Are you cross compiling? No Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Gettext, what am I doing wrong ?
En/na Mattias Gaertner ha escrit: Then I run: LANG=af ./oklin You forgot the or ; LANG=af ; ./oklin No, this is actually correct, it will execute a command with that environment variable set. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Ide doesn't find units in the fcl (or outside the project)
I surely did something stupid, but lately, every time I do a find declaration, the ide bombs on units that aren't in the project (e.g. are in the fcl or in Other units options). unit myunit; {$mode objfpc}{$H+} interface uses Classes, SysUtils, contnrs; Error: unit not found: contnrs The unit builds fine. I'm using rev. 11454, but this started before. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Ide doesn't find units in the fcl (or outside the project)
En/na [EMAIL PROTECTED] ha escrit: - Original Message - From: Luca Olivetti [EMAIL PROTECTED] [...] Error: unit not found: contnrs The unit builds fine. I'm using rev. 11454, but this started before. Is your fpc source directory in the environment options correct? yes. -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Selecting the right libraries when building
En/na Mark Morgan Lloyd ha escrit: I'm trying to build Lazarus using FPC 2.0.4 on Debian 3.1 (Sarge), and I've hit the perennial -lglib etc. problems. I've set up symlinks including libglib.so - libglib-2.0.so libgdk.so - libgdk-x11-2.0.so libgtk.so - libgtk-x11-2.0.so Don't do that, it's bad practice. Install the -dev package instead. If you don't know which -dev package to install, head to http://packages.debian.org (which will lead to http://www.debian.org/distrib/packages) and use the second search box (e.g.: searching for libglib.so in distribution old stable, i.e. yours I think, the result is libgtk1.2-dbg and libgtk1.2-deb, install the latter). This should solve your other problem too. DISCLAIMER: I don't do development under debian so I cannot be sure that the above is right, but under mandriva (and I suppose other rpm based distribution) the solution is similar, but the devel package has the -devel suffix instead. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] How to hide the mouse cursor?
En/na Paul Ishenin ha escrit: Hello, lazarus mail list. Implemented in revision 11400. Please test. Works here, gtk1 2 Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] TSpinedit/TFloatSpinedit width issue
En/na Felipe Monteiro de Carvalho ha escrit: http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report I just wanted to know if it was a known issue before flooding the tracker with a useless bug report. Anyway, here it is: http://www.freepascal.org/mantis/view.php?id=9171 -- Bye _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] How to hide the mouse cursor?
En/na Christian Iversen ha escrit: Luca Olivetti wrote: En/na Lord Satan ha escrit: Hi, I need to hide the mouse cursor in my app. Changing it with Screen.Cursor:=crSomething works, setting it to crNone does not have any effect. Any ideas? Btw this is on Linux, gtk1. I use the trick to move it offscreen, e.g.: procedure TMainForm.HideMouse; const p:TPoint = (X:15000; Y:15000); begin Mouse.CursorPos:=p; end; That's a nasty hack. It could really mess with programs that try to track the mouse or somesuch. It's not a good way to proceed. Two years ago it was the only solution I could find (well, actually the second, there's a program that does it but I don't remember its name), and since I only need to hide the mouse, not to track it, it's not a problem for me. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Memory leaks with gtk2
A simple test form, with a label and a timer with interval set to 5: procedure TForm1.Timer1Timer(Sender: TObject); begin Label1.Caption:=IntToStr(GetMsCount); counter:=counter+1; end; with gtk1 memory usage is constant, while under gtk2 it grows continuosly. Heaptrc report no leaks (probably the memory is freed when the program ends, but that's of no use to me since my program is supposed to run forever), valgrind chokes on it. With the following code (to adapt the size of the text to the available space) memory usage grows an order of magnitude faster (again, with gtk1 it is stable) procedure TForm1.Timer1Timer(Sender: TObject); var DC : hDC; OldFont: HGDIOBJ; AFont: TFont; NeededWidth: Integer; xSize : tSize; t: string; begin t:=IntToStr(GetMsCount); AFont:=TFont.Create; AFont.Assign(Label1.Font); AFont.Size:=100; DC := GetDC(Handle); try OldFont:=SelectObject(DC, AFont.Handle); GetTextExtentPoint(DC, PChar(t), Length(t), xSize); SelectObject(DC, OldFont); NeededWidth:=xSize.cx; if NeededWidthLabel1.Width then begin AFont.Size:=100*Label1.Width div NeededWidth -5; end; finally ReleaseDC(Handle, DC); Label1.Font.Size:=Afont.Size; Label1.Caption:=t; AFont.Free; end; end; Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch for TGtkWidgetSet.DrawText
En/na Marc Weustink ha escrit: Anyhow I prefer an ugly workaround to a crash ;-) I don't share that preference. The point is with these kind of projects where a lot of ppl are submitting parts of code, there is a big chance that someone doesn't understand the full code. So when another but appears, one is tempted to make a fix on top of that, without touching the underlying code. The result if such patches usually is a pile of spagetti where noone understands what the real functionlity was. I prefer to solve problems at the source, even it means that will take longer Well, so let me qualify: I prefer an ugly workaround as long as it is clearly marked as an ugly workaround in need of a proper solution. Since I really don't understand the full code, I have no other option at the moment than apply that patch. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch for TGtkWidgetSet.DrawText
En/na Marc Weustink ha escrit: clearly marked as an ugly workaround in need of a proper solution. Since I really don't understand the full code, Thats why I didn't apply the patch. I need to get the whole picture. FYI, one key indication that something strange is happening there is that PChars are returned from an internal function. I don't see it returning a pchar, anyway I'm looking more carefully into that patch and the problem aren't the ampersand (my labels don't have any) neither the word wrap (ditto), but the fact that gdk_text_extents (in gtkproc.inc) sigsevs when calling pango_layout_get_pixel_size, the patch solves it simply because it avoids calling GetTextExtentIgnoringAmpersands which in turn calls gdk_text_extents. I still don't know the reason of the failure in the call to pango_layout_get_pixel_size. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] TSpinedit/TFloatSpinedit width issue
It's just me or is it impossible to correctly set the width of a spin edit (yesterday svn, gtk2)? i.e. if I try to resize it with the mouse it will shrink and then it'll go off the screen, while if I write the width in the object inspector, the value it gets is 14 pixels less than what I entered, then while running it gets 14 pixels less (i.e: I write 40, the object inspector tells 26 and at runtime it's 12). It seems as if the set width is corrected by subtracting the width of the spinner, but this is made every time the property is set (so if I reopen the form, the spinedit is smaller). Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] TSpinedit/TFloatSpinedit width issue
En/na Luca Olivetti ha escrit: It's just me or is it impossible to correctly set the width of a spin edit (yesterday svn, gtk2)? FYI gtk1 is fine. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] How to hide the mouse cursor?
En/na Lord Satan ha escrit: Hi, I need to hide the mouse cursor in my app. Changing it with Screen.Cursor:=crSomething works, setting it to crNone does not have any effect. Any ideas? Btw this is on Linux, gtk1. I use the trick to move it offscreen, e.g.: procedure TMainForm.HideMouse; const p:TPoint = (X:15000; Y:15000); begin Mouse.CursorPos:=p; end; bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch for TGtkWidgetSet.DrawText
En/na darekm ha escrit: Hi Attached patch repair TGtkWidgetSet.DrawText under GTK2 (I receive crush). Problem was connected with WordWrap. Could someone apply this 3 months old patch (or a similar one)? I was suffering the same crash until I found it and applied to my local copy. Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch for TGtkWidgetSet.DrawText
En/na Marc Weustink ha escrit: Luca Olivetti wrote: En/na darekm ha escrit: Hi Attached patch repair TGtkWidgetSet.DrawText under GTK2 (I receive crush). Problem was connected with WordWrap. Could someone apply this 3 months old patch (or a similar one)? I was suffering the same crash until I found it and applied to my local copy. The problem is that I've the idea that this patch is a workaround for something and not a fix. And that is what I also wrote in my response. After that I forgot about it. As i look at it now it still has serious flaws, to much to comment now. Please add the patch to mantis and assign it to me, then I'll try to have a look again. I opened a bug but I cannot assign it: http://www.freepascal.org/mantis/view.php?id=9159 Anyhow I prefer an ugly workaround to a crash ;-) BTW, maybe it's related, but the OptimalFill of a TLabel does nothing (but then it also does nothing under gtk1, where the above method doesn't crash). Bye -- Luca _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] win32 snapshots with gdb 6.6
En/na Vincent Snijders ha escrit: Hi, I want to inform you that since a couple of days, the lazarus snapshots come with gdb 6.6 instead of gdb 6.0. Does the new gdb bring us the possibility to debug multithreaded applications or was it a lazarus and not a gdb limitation? Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] win32 snapshots with gdb 6.6
En/na [EMAIL PROTECTED] ha escrit: - Original Message - From: Luca Olivetti [EMAIL PROTECTED] Date: Tuesday, June 19, 2007 9:16 am Subject: Re: [lazarus] win32 snapshots with gdb 6.6 En/na Vincent Snijders ha escrit: Hi, I want to inform you that since a couple of days, the lazarus snapshots come with gdb 6.6 instead of gdb 6.0. Does the new gdb bring us the possibility to debug multithreaded applications or was it a lazarus and not a gdb limitation? I don't know. Sorry, I was too quick: I checked and I already have gdb 6.6 under linux, and multithreaded applications have problems if run under gdb, so I don't think it'll be any different under windows. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] sqlite components
En/na Luiz Americo Pereira Camara ha escrit: See as a balance between features/code size. Sure, that's a good trade off. One has just to know the peculiarities of this dataset and where it diverges from the standard dataset behaviour (btw: why did you implement a method RefetchData instead of using Refresh?) Anyway, for more featured, you can use ZeosLib which is by far the most complete database layer in fpc or even SqlitePass that has more options. No, I'm actually after something rather lightweight (I won't be using dbgrids, I won't even have a user interface), so for this project I'll probably use sqlite3ds now that I know what are its strengths and weaknesses. Besides, zeoslib has a nasty memory leak with sqlite. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] zeoslib still won't compile
En/na pineal ha escrit: On Monday 11 June 2007 11:47, [EMAIL PROTECTED] wrote: Before compile package try delete all files from ...\build directory except dummy.txt and .svn directory. Hi Michal, I tried that on my current linux platform after reinstalling fpc-2.0.4 ( I have dependency problems with fpc-2.1.4). Lazarus builds fine, but I still have the same abort on Zcomponent when installing zeoslib. Any particular reason to use the svn version of zeoslib? I'm asking because I'm completely ignorant about the development of zeos, so I just took the latest released beta (6.6.1) and it installed fine, both under windows and under linux. I know that any software has bugs, but are there particularly nasty bugs in 6.6.1 that forced you to use the svn version? Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] sqlite components
En/na Luiz Americo Pereira Camara ha escrit: - ApplyUpdates error handling: Error is handled just does not follows the exception model. Check if ApplyUpdates is false. If so check ReturnCode (see sqlite docs for values) and ReturnString values. I understand and appreciate the KISS concept, but that's not the behaviour I would expect from a dataset descendant. Your approach is good enough only when you're controlling completely data access in code (which is most of the times, but not always, the correct thing to do), if you just want to write a quick'n'dirty data entry application where you just wire up a datasource with, e.g., a db grid and let the tool kit take care of the rest, with the exception model the user at least get a meaningful error message, with your implementation of ApplyUpdates the error is silently ignored and the data is still visible on the dbgrid. And even if you check the result of ApplyUpdates, if there are more than 400 changes and the error only occurs in the first transaction I think it will be silently ignored. - Primary key handling: sqliteds automatically handles primary key in two ways. First add a AutoInc field to the table (Using FieldDefs.Add/CreateTable) and sqliteds will ensure it will always be unique and not null without user intervention. Second, if you have a integer field as primary key set AutoIncrementKey to true and PrimaryKey to the field name. Ok, I didn't set AutoIncrementKey to true. Now I tried it and the result is that I cannot edit the key in the dbgrid, I suppose that if I want to allow manual insertion of a primary case I have to manage that by myself. Another test I did, is to leave AutoIncrementKey to false and try to deliberately insert a duplicate of the primary key. Even if I check the result of ApplyUpdates and use it to display a message, the wrong rows are still visible in the dbgrid, then subsequent updates succeed (without writing the data, since the dataset forgot about the changes) and the wrong data is still visible in the grid. Ok, I can refetch the data in case of errors, but that's not really KISS anymore. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] zeoslib still won't compile
En/na pineal ha escrit: On Tuesday 12 June 2007 07:06, Luca Olivetti wrote: Any particular reason to use the svn version of zeoslib? I'm asking because I'm completely ignorant about the development of zeos, so I just took the latest released beta (6.6.1) and it installed fine, both under windows and under linux. I know that any software has bugs, but are there particularly nasty bugs in 6.6.1 that forced you to use the svn version? Bye -- Luca Olivetti Hi Luca, No reason other than Sod's Law! ;) and that having followed links via the Lazarus Wiki, all I can find are links and instructions for the svn sources, so probably that too. I will check out what you suggest Luca, reluctantly. I'm past the point of wanting to spend more time trying to make something work when I don't know enough about what I'm doing, but just in case this time Where exactly did you download the latest beta from? at the ZeosLib forum I can only see a link for beta 6.6.0. So perhaps there is another reason, that I couldn't find what you say anyway. Its a while back now so don't remember, just going by what I can find or not, today. but if you can provide a link it will be appreciated and I'll try it. I found the link here: http://zeos.firmos.at/viewtopic.php?t=1097 *BUT* I saw that there was a nasty memory leak as reported in the forums, so, to see if it was fixed, I downloaded the latest trunk snapshot (rev 263) from the page linked here: http://zeos.firmos.at/viewtopic.php?t=970 Since that didn't actually fix the leak, and on another post I saw that is fpc 2.0.4 that's leaking memory with interfaces, I downloaded fpc2.1.4 and rebuilt lazarus with it. I had to change a thing in rev 263 to make it compile with fpc 2.1.4: in file ZAbstractRODataset.pas, line 3019, change {$IFDEF VER2_1_3} to {$IFDEF VER2_1_4} and now the memory leak (at least that memory leak) has gone. This is under windows, later I'll try under linux. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] zeoslib still won't compile
En/na Luca Olivetti ha escrit: Since that didn't actually fix the leak, and on another post I saw that is fpc 2.0.4 that's leaking memory with interfaces, I downloaded fpc2.1.4 and rebuilt lazarus with it. I had to change a thing in rev 263 to make it compile with fpc 2.1.4: in file ZAbstractRODataset.pas, line 3019, change {$IFDEF VER2_1_3} to {$IFDEF VER2_1_4} I also had to change line 1468 DisplayName := FName to Name := FName (DisplayName is a read only property). Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] zeoslib still won't compile
En/na Vincent Snijders ha escrit: Luca Olivetti schreef: in file ZAbstractRODataset.pas, line 3019, change {$IFDEF VER2_1_3} to {$IFDEF VER2_1_4} Tip: You can use {$IFDEF VER2_1} for all 2.1.x. Maybe even better is to use {$IFNDEF VER2_0} so that is works to 2.3.1 and later. Thanks, I opened a bug with this suggestion at the zeoslib bugtracker http://zeosbugs.firmos.at/view.php?id=46 Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Threads and Forms
En/na Al Boldi ha escrit: Have you found a problem with synchronize now? Yes: now it works :-D Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] sqlite components
Hello, I'm writing an embedded application that will need a small database (no more than a couple thousand records), and I though sqlite could do it. It probably won't have any graphical interface, so I don't need all the goodies of a TDataset descendant, OTOH I like some other things a dataset will buy me. Needless to say, the application must be rock solid, running unattended 24/7. I made a quick test with the sqlite3ds component that's included in lazarus and with SQLitePass http://source.online.free.fr/ I dropped either dataset in a form with a datasource and a dbgrid (as suggested in the wiki). My first impression (and as every first impression may just be wrong) is tha sqlite3ds doesn't work well with a dbgrid, because it doesn't automatically update the underlying database and so it doesn't catches exceptions when you, e.g, try to insert a duplicate. What's worse, when I call ApplyUpdates it silently discards the data (I would have expected at least an exception, but I see that there's no exception raised and neither an event is called in case of errors in TCustomSqliteDataset.ApplyUpdates). SQLitePass seems more solid (again, only with this simple test), since it automatically updates the database and raises an exception immediately if I try to insert a duplicate key. OTOH it raises a RunError(204) when I close the form. Pros of sqlite3ds: - included in lazarus - author active on this mailing list - ...? Cons of sqlite3ds: - incomplete (?) implementation - doesn't really check errors - ...? Pros of SQLitePass: - it seems to be a more thorough implementation of a dataset - ...? Cons of SQLitePass: - RunError(204) - 3rd party component (though it seems to be closely tracking lazarus development) - ...? Any other opinion/option/suggestion (Zeoslib? a simpler wrapper around sqlite library?) Note that I discarded firebird embedded since I read I cannot open the same database in more than one program (http://www.sqlite.org/cvstrac/wiki?p=SqliteVersusFirebird, section Concurrency). Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Threads and Forms
En/na Burkhard Carstens ha escrit: , but if I don't use synchronize I can move the window and see the label updating, so I wonder if synchronize is really (always) needed nowadays. Yes it is. Of course, there are other ways to solve this, but you should not just ommit synchronize, especially when updating GUI controls. In your example, you could e.g. use InterlockedIncrement to inc your counter in the thread and update your label in mainthread either in application.OnIdle or with a timer, like: I wasn't actually interested in updating the counter, it was just a test to see if while I was sleeping ;-) the LCL became automagically thread safe :-D [*] (I still remember the shock when I wrote my first delphi 2.0 heavily multithreaded application only to discover that it didn't work at all because the VCL wasn't thread-safe). e.g. I also tested adding lines to a memo directly from the thread with no apparent problems. [*]in fact, a couple of years ago, when I lastly used lazarus for a project, if I used synchronized the program did't work at all (IIRC either it would lock or the synchronized method was triggered more than once), so I just boldly avoided using synchronize. I don't remember the exact details, so it may just have been a fringe case where synchronize wasn't actually needed[**]. It's a simple program but it's been running unattended 24 hours a day since then. [**]Ok, I looked again at that old code and I cheated: the access to the data was protected with a critical section, but I'm pretty sure I avoided synchronize because it didn't work right at the time. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Threads and Forms
En/na Luca Olivetti ha escrit: En/na Lee Jenkins ha escrit: Hi all, I need to build a GUI application where a spawned thread will open a socket, receive messages and the controls on the form (TStringGride, etc) will need to be updated with values received from the socket. Should I use a critical section for this? I remember that Delphi has a method for interacting with the main thread from other threads, is this supported in Laz/FPC? Synchronize(method) will execute method in the context of the main thread. Mmmh, I just made an experiment (under windows, but development will probably follow under linux): I have a communication thread in a continuous polling loop. Each time I complete a successful communication, I increase a label tag and change its caption to display the counter. If I use synchronize to call the method of the main form and move the window around, while I'm moving the window the counter (and so I think the thread) stops, but if I don't use synchronize I can move the window and see the label updating, so I wonder if synchronize is really (always) needed nowadays. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Threads and Forms
En/na Lee Jenkins ha escrit: Hi all, I need to build a GUI application where a spawned thread will open a socket, receive messages and the controls on the form (TStringGride, etc) will need to be updated with values received from the socket. Should I use a critical section for this? I remember that Delphi has a method for interacting with the main thread from other threads, is this supported in Laz/FPC? Synchronize(method) will execute method in the context of the main thread. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Headless sip client?
En/na Luca Olivetti ha escrit: Hello, I'm trying to use an usb phone under Linux. I already successfully used Lazarus with libusb to quickly test the communication protocol that I reverse engineered, so I can control the phone. My ultimate goal is to connect the phone to a headless server, something like this: http://www.devbase.at/voip/yeaphone.php (my server, btw, is a linkstation pro, so it's arm based too, I suppose that as long as I don't use the LCL but only the FCL that should be fine) but obviously I'd avoid the pain of coding it in C ;-) I thoght of a couple of options 1) do the same as yeaphone and use the linphone library after conversion of the header with h2pas. This would be relatively straightforward, however I'm not sure it will work (the library is heavily callback based, besides I'll need the same patch to be informed of the status of linphone) 2) try to port the non-visual parts of SIPInside http://tothpaul.free.fr/sources.php?dprtcp.sipinside I'd prefer the second option (everything in pascal), but then I'd need good audio library (ACS maybe?) and I don't know yet how difficult it would be to port (I suppose that, with some coaxing, I could use synapse where sipinside uses winsock). Well, I tried both approaches. I started with the SIP component of SIPInside, but, though I succeeded in sending and receiving data, my registrar tells me that it's sending an invalid request, and I think it's because SIPInside is not fully sip compliant. Instead of debugging it more (considering that then I had to port STUN, RTP and audio components) I tried to use linphone. Converting the h file was a pain (and I'm not completely satisfied with the result), but at least basic functionality is working (register, make calls, receive calls). I'm testing it on x86, I hope that it'll work when I compile it for arm. Bye -- Luca A: Because it destroys the flow of the conversation Q: Why is it bad? A: No, it's bad. Q: Should I top post in replies to mailing lists? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Headless sip client?
En/na ik ha escrit: Hi, Please try the soft-phone called twinkle (by the house of KDE), or if you simply wish to create tests for SIP, use SIPp (http://sipp.sourceforge.net/). Hi, yes, I normally use twinkle, but for this project isn't really suitable, unless there's a way to make it work headless and controlling it completely from a freepascal program. Bye -- Luca A: Because it destroys the flow of the conversation Q: Why is it bad? A: No, it's bad. Q: Should I top post in replies to mailing lists? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Headless sip client?
En/na ik ha escrit: Have you tried using it using dcop ? No, I wouldn't even know how to start (and a quick search on the freepascal site, either using its search or google, doesn't offer any hint). And then it has to be seen if it could work on an arm machine, with limited memory and no X in sight. It's much simpler to just call, e.g., linphone_core_invite(@lc,number) to make a call (and linphone *is* working on arm, and there's an arm version of the fpc compiler). Anyway, I plan to write a separate class managing the conversation with the usb phone, so you can do whatever you want with it if you happen to have the same model. Bye -- Luca A: Because it destroys the flow of the conversation Q: Why is it bad? A: No, it's bad. Q: Should I top post in replies to mailing lists? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Headless sip client?
Hello, I'm trying to use an usb phone under Linux. I already successfully used Lazarus with libusb to quickly test the communication protocol that I reverse engineered, so I can control the phone. My ultimate goal is to connect the phone to a headless server, something like this: http://www.devbase.at/voip/yeaphone.php (my server, btw, is a linkstation pro, so it's arm based too, I suppose that as long as I don't use the LCL but only the FCL that should be fine) but obviously I'd avoid the pain of coding it in C ;-) I thoght of a couple of options 1) do the same as yeaphone and use the linphone library after conversion of the header with h2pas. This would be relatively straightforward, however I'm not sure it will work (the library is heavily callback based, besides I'll need the same patch to be informed of the status of linphone) 2) try to port the non-visual parts of SIPInside http://tothpaul.free.fr/sources.php?dprtcp.sipinside I'd prefer the second option (everything in pascal), but then I'd need good audio library (ACS maybe?) and I don't know yet how difficult it would be to port (I suppose that, with some coaxing, I could use synapse where sipinside uses winsock). Any suggestion, other option, anything? TIA Bye -- Luca A: Because it destroys the flow of the conversation Q: Why is it bad? A: No, it's bad. Q: Should I top post in replies to mailing lists? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Headless sip client?
En/na ik ha escrit: Having said that, now to your questions. Why won't you use softphone rather then usb VOIP phone? The usb phone is actually a glorified soundcard with a keypad, a display and a ringer, so, yes, I'll need a softphone, but it has to be controlled exclusively by the phone keypad and display everything on the phone display, and signal incoming calls with the ringer. Please look again at the yeaphone project , I want to do something similar but with a different phone (mine is wireless and more featureful) and in pascal ;-) but the motivation is the same http://www.devbase.at/voip/yeaphone.php Bye -- Luca A: Because it destroys the flow of the conversation Q: Why is it bad? A: No, it's bad. Q: Should I top post in replies to mailing lists? _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Thread Behavior in Lazarus
En/na Paul Michell ha escrit: If you use synchronize, the IDE calls CheckSynchronize for you. In command line you need to do this in main thread. I tried this in the application OnIdle event with Done set to false and it worked a charm! I am a little concerned this may not be the best way to get this call seen by the main application loop. Any ideas? Once I have decided on the best way to handle this I will post a link to the revised code. IMHO this should work automagically, no matter if inside the IDE or not. In fact I though this was already so, but since I hadn't time to play with lazarus lately I couldn't check: http://www.lazarus.freepascal.org/list_archives/lazarus/msg10481.html http://www.lazarus.freepascal.org/list_archives/lazarus/msg10483.html Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Am I being too ambitious?
En/na A.J. Venter ha escrit: So while it´s true that I don´t use FOutPut in this class -that is because I want to be able to use it in the calling application. Having explained this, does it clarify why the code looks as it does ? Ok, but in your test program I think you don't give synchronize a chance to do its magic (I'd use another word but I want to be polite ;-). I doubt it will solve your problem but you should call Application.ProcessMessages in the wait loop. BTW you could write a different creator to simplify things (and make it more readable IMHO), e.g. instead of procedure TForm1.Button1Click(Sender: TObject); begin MyProcess := TThreadedProcess.Create(True); MyProcess.Command := Edit1.Text; Button1.Enabled := False; MyProcess.Resume; While MyProcess.Running do sleep(100); Button1.Enabled := True; Memo1.Lines.Assign(MyProcess.OutPut); MyProcess.Free; end; procedure TForm1.Button1Click(Sender: TObject); begin Button1.Enabled:=False; MyProcess := TThreadedProcess.Create(Edit1.Text,Memo1.Lines); While MyProcess.Running do begin sleep(100); Application.ProcessMessages; Button1.Enabled := True; MyProcess.Free; end; where the constructor is something like constructor TThreadedProcess.Create(command:string;output:TStringList); begin FRunning := False; FCommand := command; FOutPut := TStringList.Create; FRealOutput := output; FreeOnTerminate := False; inherited Create(False); end; Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Am I being too ambitious?
En/na A.J. Venter ha escrit: The synchronize calls shouldn't be placed inside your TThreadedProcess code... they should be used in the main application thread to provide mutual exclusion for the shared visual components. It's the other way round, at least in delphi: you call synchronize from a thread when you want the method executed in the context of the main thread. That is correct, I know this much at least :) after all how can you synchronize from the main thread it doesn´t know what the other thread is doing. Mmmh, looking more closely to your code (I didn't before, I was just replying to the assertion that you call synchronize from the main thread) I don't think you should use synchronize at all (maybe a mutex to coordinate the access to FRunning, but even that may be overkill for a boolean): since you don't access the TStringList unless the process has ended there's no problem of simultaneous access from the main thread and the thread (and even if you wanted to do that I'd prefer a mutex over synchronize). In fact (not knowing the internals of the synchronize implementation, so I may be wrong) I cannot see how your thread can work since you're in a busy loop waiting for the thread to finish, so there's no way the main thread can schedule your synchronize call. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Am I being too ambitious?
En/na Tom Lisjac ha escrit: On 2/3/06, A.J. Venter [EMAIL PROTECTED] wrote: But the moment I try to use it in a simple test program, it throws an async-reply exception, something I would normally only expect if threaded code tried to update the display irectly. Any ideas where my thinking went wrong ? The synchronize calls shouldn't be placed inside your TThreadedProcess code... they should be used in the main application thread to provide mutual exclusion for the shared visual components. It's the other way round, at least in delphi: you call synchronize from a thread when you want the method executed in the context of the main thread. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Multithreading in Lazarus = SMP Enabled applications?
En/na Michael Van Canneyt ha escrit: Second, If a thread wants to interact with the main thread, it calls 'Synchronize'. The main thread calls checksynchronize at regular intervals. This is transparant for you. Back in august for this to work the lcl had to be compiled with the -dUSE_SYNCHRONIZE option (which wasn't the default). (the relevant message from Micha is missing both at gmane and lazarus.freepascal.org). Is this the default now? Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Testing new forum
En/na Bogusław Brandys ha escrit: Luca Olivetti wrote: En/na John Samperi ha escrit: Also is there any serial port component available? I have been using Cport with D6. I've been successfully using synaser (http://www.ararat.cz/synapse/) with lazarus. I made some changes to make it work (and changed the behaviour of connect not to change the name of the device: it's better with usb serial port). Note that I developed my program under linux, but it should work fine in windows too. My changes are attached, I forgot to send them upstream (I'll do it asap). Bye Did you sent patch to Synapse development group and author ? I did so right after I sent that message, to Lukáš Gebauer (from the page http://www.ararat.cz/synapse/credits.htm) is that really work with USB also ? Yes. The problem with the original implementation is that, in IMHO a misguided attempt to cross compatibility, it mangled the name of the device, so if you try to open 'COM1' it would try to open /dev/ttyS0 under linux, and viceversa. The problem is that serial usb ports take the name /dev/ttyUSBx (where x is the number of the port), so that approach would fail miserably. I changed that so that the library doesn't mangle the name (i.e. you can try to open the device with any name) and added an overloaded method to open the port by number (e.g. 1 for COM1 or /dev/ttyS0). And I'm pretty sure it works: I have 4 PCs using this library to gather data on an assembly line working 24h a day ;-) Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Testing new forum
En/na Luca Olivetti ha escrit: I did so right after I sent that message, to Lukáš Gebauer (from the page http://www.ararat.cz/synapse/credits.htm) is that really work with USB also ? Yes. The problem with the original implementation is that, in IMHO a misguided attempt to cross compatibility, it mangled the name of the device, so if you try to open 'COM1' it would try to open /dev/ttyS0 under linux, and viceversa. The problem is that serial usb ports take the name /dev/ttyUSBx (where x is the number of the port), so that approach would fail miserably. I changed that so that the library doesn't mangle the name (i.e. you can try to open the device with any name) and added an overloaded method to open the port by number (e.g. 1 for COM1 or /dev/ttyS0). And I'm pretty sure it works: I have 4 PCs using this library to gather data on an assembly line working 24h a day ;-) Well, Lukáš has replied and my change (wrt device name) isn't really necessary. I don't remember why I though so. Regarding the changes in synautil.pas he told me that it is shared with the Synapse project, so it's not a good idea to make a special version for synaser: the latest version included in the synapse project should work. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus 0.9.10b officially released
En/na Mattias Gaertner ha escrit: automatic cleaning/creating .lrs files Does this mean it's no longer necessary to put these files under revision control (cvs/svn)? Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: Help - TMemo shows only english text
En/na Marc Weustink ha escrit: And maybe as a hack around your problems, can't you translate your text to UTB8 ? iconv is the tool to do it (if you know the source encoding). Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Thread Communications
En/na Luca Olivetti ha escrit: Yes, it's necessary because the LCL is not multi-thread safe. Ok, I thought it was. The chances of two threads changing the same variable in the same object is very low so you probably won't notice, but that doesn't mean there is no bug. Yes, I know the issues. Now I wonder how well is USE_SYNCHRONIZE tested since it's not the default option. I just made a quick test with an old copy of lazarus (0.9.6) I had installed in windows (where USE_SYNCHRONIZE is enabled by default): if I use synchronize I get a lot of 'thread' lines in memo1 insted of one per call. unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, StdCtrls; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); procedure Form1Show(Sender: TObject); private { private declarations } public { public declarations } end; TMyThread = class(TThread) procedure Execute;override; procedure Ref; end; var Form1: TForm1; implementation { TForm1 } procedure TMyThread.Execute; var i:integer; begin for i:=1 to 10 do begin synchronize(@ref); //ref; sleep(5000); end; end; procedure TMyThread.Ref; begin Form1.Memo1.Lines.Add('thread'); end; procedure TForm1.Button1Click(Sender: TObject); begin Memo1.Lines.Add('main'); end; procedure TForm1.Form1Show(Sender: TObject); begin TMyThread.Create(false); end; initialization {$I unit1.lrs} end. Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives