Re: [Lazarus] fpPDF: cannot embed DejaVu font
El 13/04/2016 a las 14:52, Michael Van Canneyt escribió: You must add images manually in a list. Drawing an image means: "draw image N here at (X,Y)" It is up to you to add an image only once and re-use that. Hello, Great, this answer my question completly! :) -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpPDF: cannot embed DejaVu font
El 13/04/2016 a las 13:42, Michael Van Canneyt escribió: The support for compressed images and embedding of raw JPEG is in SVN too, sample program adapted to demonstrate this (-i -j command line options). Hello, Does the library detect the same image used multiple times ? In the past I was using a pdf generator for a report that has an image as background watermark. The report could be more than 100 pages and the pdf was multi-megabyte because the library adds each page watermark as a new graphic object, instead reuse the same object. If its not easy to do automagically maybe an API to add a "shared" media object would be useful. Thank you. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] how to Draw Data Matrix by TLazBarcode
El 16/12/2015 a las 1:22, 최경식 escribió: Thank you for your answer. I solve this problem. I'm so so so appreciate. But I have one more problem. How to change Data Matrix width and Height. if you know any way, please share me. Hello, Can you be more precise ? Which kind of width & height ? With StrictSize checked the widget size would be 1x, 2x, 3x,...,Nx to fill as much as possible of the print space keeping pixels exactly as expected by the format so no "half pixel" dots appears. Non StrictSize can be used if the generated image would be big enought that non expected pixels (lines, "half pixel") will not affect the read capability (usually bigger than 4x original size). -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] how to Draw Data Matrix by TLazBarcode
El 15/12/2015 a las 10:28, 최경식 escribió: i use lazarus 1.0.10 ver. i want to Draw Data Matrix 2D Barcode. so i used TLazBarcode Component, but it dosen't draw well. Data Matrix Format is variable when increase Data Matrix data. how to fix Data Matrix Format? i attach two picture. thank you Hello, Both Datamatrix are OK and well formed, unfortunatly there are many options to generate some barcodes and I was unable to add much of them due lack of time and there is no much people using the package and maintain it is not, by now, a priority to me. In order to generate the DataMatrix as you like it, squared, please open the package source file "ubarcodes.pas", look for "procedure TBarcodeDataMatrix.Generate" and change the function by this one: --- procedure TBarcodeDataMatrix.Generate; var ErrorCode: integer; begin if Assigned(FQR) then begin ZBarcode_Delete(FQR); FQR:=nil; end; if Length(FText)>0 then begin FQR:=ZBarcode_Create(); with FQR^ do begin border_width:=1; option_3:=DM_SQUARE; end; ErrorCode:=dmatrix(FQR,@FText[1],Length(FText)); if ErrorCode<>0 then begin FLastErrorString:=FQR^.errtxt; exit; end; end; end; -- Note the "option_3" as DM_SQUARE setting. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus implementation of TListView etc?
El 02/11/2015 a las 20:32, Bo Berglund escribió: IMHO using lnet or Synapse would be a lot "clearer" than using the overly complex Indy Library. I had already looked at Synapse, but it is blocking. I did not know about lnet (or INet as it is shown when one searches) before but now I have had a look and it seems to fit the bill for me since it is event oriented, like I need for this particular task. Hello, I was following your thread from the beginning and or I do not understand absolutely nothing about your needs or you are focusing the problem in the opposite way. Let me explain me, I think you had inherited a GUI app which you need to transform in a console one and this GUI app uses events to coordinate data flows, so in example the app connects to a server, gets a web page and some event handler process this data and outputs something to a file. The problem was that the event handler also updates information on screen (AKA TListView, ...) which you already removed. That's fine, but my question is why you need event sockets ? I had converted some small apps with events in console ones and using only blocking sockets because I do not need to update screen information in GUI, only in console and as the console (in my case) do not need events from the user like response to keypress I do not need real events, so I wrote your "thread" in the main thread and manually "evented" each reception, something like this in pseudocode: begin Socket.Connect... MyClass.Connect(Socket); Socket.http('x'); while Socket.Connected do begin If Timedout() then break; ReceivedBytes:=Socket.Read(Buffer,0); if ReceivedBytes>=0 then begin ReceivedBytes:=Socket.Read(Buffer,ReceivedBytes); //Now I call the event reception //not a real event, but that's not important. MyClass.Received(Socket,Buffer,ReceivedBytes); end; end; Socket.Close; MyClass.Disconnect(Socket,REASON_GREACEFUL_CLOSE); Socket.Free; end; Of course the same can be done with multiple sockets at a time and call different handlers based in the socket that connects, receive data, etc... Even if you use http transfers its more easy with blocking, something like: Document:=http.get('http://xxx); MyClass.Connect(); MyClass.Receive(Buffer,Length(Buffer)); MyClass.Closed(); Your class do not know if the data comes from an event or from a blocking socket. A different thing is if you need some kind of timing between operations. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Spam in the Wiki main page
El 26/09/2015 a las 16:16, Florian Klämpfl escribió: http://wiki.freepascal.org/ virustotal says the linked page (chat11) is clean? I didn't click on the link though. I have removed the link though for now till we know more. Hello, The chat11 site is "clean" but the javascript is a roulette and most times it jumps to a scam page (iPhone by $4, ...) but sometimes it jumps to a malicious javascript page. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Spam in the Wiki main page
El 26/09/2015 a las 18:51, Florian Klämpfl escribió: The chat11 site is "clean" but the javascript is a roulette and most times it jumps to a scam page (iPhone by $4, ...) but sometimes it jumps to a malicious javascript page. Which javascript? On chat11 or on the wiki page? Hello, Chat11. I think Chat11 is no more online, domain is on sale AFAIK. In fact if you try a simple wget on index page it will return 403, but if you identify as Firefox useragent it loads a bunch of javascript files. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error
El 25/06/2015 a las 21:03, Bo Berglund escribió: There's a tool called CVTRES.EXE that comes with Visual Studio that does such conversion. It's an alternative to get a proper coff format I do have VS installed so I have this tool: D:\cvtres Hello, I think the tool is Editbin, cvtres is to convert resources: cvtres = ConVerT RESource Also the linker should do it (OMF to COFF): link -edit thefile.obj -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Newbie, porting class to FPC but get procedure assignment error
El 19/06/2015 a las 9:50, Bo Berglund escribió: Now I am getting to the real hurdle as follows: DongleTest.lpr(20,1) Error: Illegal COFF Magic while reading SPROMEPS.OBJ Hello, Try this tool: http://www.agner.org/optimize/#objconv -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Error messages: cannot versus can't
El 17/10/2014 a las 14:05, Reinier Olislagers escribió: On 17/10/2014 13:48, Mark Morgan Lloyd wrote: they've taken into account that a lot of developers and users have by now learnt acceptable Technical English from mailing lists. While I agree with that statement, there's probably many more who haven't progressed very far. See some forum posts... and probably quite a lot of forum posts that were never written because of lack of proficiency in written English. As always - lacking real world test data - it remains a subjective topic... Hello, I am spanish so my English is what here is called average where in fact it is low level (spanish people usually thinks their English is far better than it really is). My low level does not have any problem with can't, don't, I'm and some other basic contractions but things like ain't, 'll or the 's which can be replaced by is or has forces us to stop reading and think in the context in order to catch the real meaning. So from my point of view basic contractions are OK, but others should be avoided as much as possible. For us (non native) is much easy to write something wrong using contractions. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DateDif function needed
El 14/11/2013 7:56, Patrick Chevalley escribió: All this efforts are to bypass the problem with the calendar year (the one you mention) because it is sometime 365 and sometime 366 days. This is a totally unacceptable definition when you need an homogeneous time scale. Hello, I was following this thread about the years, months, days, datediff and almost all people expect that dates: 2013/05/15 - 2013/07/16 Return 2 months + 1 day, but I expect it to return 1 month and 16+16 days, because month definition out of context is around 30.43 So in the above example for sure 1 months has been passed and 32 days, then you can decide if 32 days is 1 month plus or not. The same applies to years: 1999/02/28 - 2000/02/29 = 1 Year 2000/02/27 - 2001/02/28 = 1 Year + 1 day 2000/02/28 - 2001/02/28 = 1 Year 2000/02/29 - 2001/02/28 = 1 Year 2000/02/29 - 2001/03/01 = 1 Year + 1 day 2001/05/2 - 2002/06/30 = 1 Year + 29+30 days Maybe I'm completly wrong ? -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Mac (or other BigEndian machine) users needed to test new Utf8StringOfChar code
El 17/09/2013 17:25, Bart escribió: I thought f performance when calling like Utf8StringOfChare(AnUtf8Char, 32768), This should perform better if Fill(D)Word can be used I think. Hello, Yes, it should, but you can place a check that if less than 64 bytes are used, do not call Fill(D)Word but use plain for..loop to fill the data. I'm quite sure that you will get a bit more speed. I had not fully checked you code, but I think you are coding always the UTF16 as little endian, and in big endian machines the UTF16 should be big endian also. In my coding (in this thread) there is no UTF16... Yes sorry... Age is killing me :) I saw the shr and the LEToN and inmediatly think in UTF16. Sorry. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Mac (or other BigEndian machine) users needed to test new Utf8StringOfChar code
El 17/09/2013 10:48, Bart escribió: I would think that FiilWord and FillDWord is faster than that. For 3-byte sequence I almost did the same as you. Hello, In most architectures (32 and 64 bits at least) memory moves of less than 16 bytes are faster done one by one. Just the call to the function kills the possible performance gain. More to the point: does it produce correct results on BigEndian. Theory (as in: as far as I can see and compute in my head) says yes, but I would like confirmation (on my secons code example). I had not fully checked you code, but I think you are coding always the UTF16 as little endian, and in big endian machines the UTF16 should be big endian also. I do not have a big endian machine in order to perform some tests. -- José Mejuto -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TMemo flicker
El 01/05/2013 15:59, Hans-Peter Diettrich escribió: Using Memo.Lines should work better, if possible at all. It should split the text into lines, update the lines, then pass the new text back to the memo. Hello, I understand that your suggest is to replace allways the whole text in the visual widget ? That will involve completly redraw of the component which, quite sure, will be even worst and the fact that you loose your caret position. I had tested it and the effect is visually the same as surrounding the code with begin/end update but slower. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TMemo flicker
El 01/05/2013 12:16, Jürgen Hestermann escribió: Yes, if the *programmer* does multiple things to a GUI component. But here it was only a single assignment which should not require Begin/EndUpdate but this assignment seems to cause multiple things internally which make it flicker . Hello, Before looking inside the LCL code the effect could be explained as TMemo text property is completly erased and rewritten each time something change in the text, so when the last line is changed, internally the whole content is erased and replaced by the new one. When the OS component receives the new text it seems to send some messages to itself to adjust scrollbars (which begin/end update will block), the first one remove scrollbars, the next one fill the text, as the text is larger than visible part scrollbar goes to the bottom (this will not happend with begin/end update). The strange thing is that this behavior should produce high CPU usage but not a up/down one line effect, so something is wrong either in LCL or in the Memo Windows control. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TMemo flicker
El 30/04/2013 10:31, Michael Van Canneyt escribió: Your solution of course is mutch faster but I thought seeing the progress is important for Jürgen. In that case the beginupdate/endupdate is a total waste of CPU. Hello, The problem is that the behavior changes with the use of begin/end update, at least on Windows platform. Run attached code to test. Just create a form and add a button and a Memo and link the button OnClick with this code (better visible with a quite big Memo): --- procedure TForm1.Button1Click(Sender: TObject); const TestMode=3; //CHANGE to 1..3 to run different tests var i: integer; begin for i := 1 to 40 do begin Memo1.Lines.add('Some lines at the beginning to watch the up/down flicker effect.'); end; if TestMode=1 then begin for i := 1 to 1000 do begin Memo1.Lines[Memo1.lines.Count-1]:=' '+IntToStr(i); end; end else if TestMode=2 then begin for i := 1 to 1000 do begin Memo1.Lines.BeginUpdate; Memo1.Lines[Memo1.lines.Count-1]:=' '+IntToStr(i); Memo1.Lines.EndUpdate; end; end else if TestMode=3 then begin for i := 1 to 1000 do begin Memo1.Lines.BeginUpdate; Memo1.Lines[Memo1.lines.Count-1]:=' '+IntToStr(i); Memo1.Lines.EndUpdate; Application.ProcessMessages; end; end; end; If Begin/End update is being used the vertical scroll bar position is not updated, I do not know if this is expected :-? -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to create a listbox that can be shifted
El 25/04/2013 7:10, Jürgen Hestermann escribió: As others told me these are all limitations of the underlying widgetset (in this case Win32 GUI) so it cannot be fixed within Lazarus. TMemo solves my problem for now (thanks again to Howard for the tip). And another tip was TScrollBox which I did not test yet but will try together with TStringGrid if I need more than one column of text. Hello, Or use a ListView (in report mode) or set the ListBox ScrollWidth property to the length of largest string, ... -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to create a listbox that can be shifted
El 25/04/2013 17:01, Jürgen Hestermann escribió: I think I played already with this but nothing changed (I set TListBox.ScrollWidth to arbitrary high values). And even if it works, would I have to scan all string widths after each change to find the widest string and then set TListBox.ScrollWidth to it? That would be very awkward. Hello, That's exactly what the operative system do in autosize columns, but usually only in additions, so you only store the largest one and the one that would add, if the new one is larger, scroll is adjusted, if smaller, nothing is done until a full autosize is requested. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Hints for Android
El 12/04/2013 11:22, Felipe Monteiro de Carvalho escribió: On Fri, Apr 12, 2013 at 10:46 AM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: Do you have any link to the docs that say that every window should have a new Activity? Window does not descend from Activity. It does not look correct to me... but I will study the issue. So if you have 1 app with 1 button and clicking on the button you get a fullscreen window to select a file you would need 2 activies (because 2 forms)? Looks very strange to me. Hello, Yes, that's the way/idea. Every activity should be considered an atomic user interface operation, any operation that could be logically performed in other activity should be in other activity. OS can unload each activity at any time, except the forefront one. Also data related directly to each activity is expected to be in activity related memory so a simple rotation of the device kills this memory blocks and the programmer should save important state variables in a process related memory. From a pascal/LCL point of view your approach is more robust because LCL is not designed to survive a situation where only one form (the forefront one) can exists, while an android app should survive. Usual bug in android apps follows this steps: 1) Show an activity 2) User selects something that opens a second activity 3) Second activity is created and shown. 4) First activity is destroyed by the OS. 5) Second activity is destroyed. 6) First activity is recreated by the OS but its state is as how it was in step 1, not in step 2 (programmer expect). -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SQLDB, Firebird, milliseconds
El 11/04/2013 17:06, Gabor Boros escribió: Hi, When insert record to a Firebird database with SQLDB the millisecond part of a TIMESTAMP field is sometimes 0 sometimes 999. I use Windows XP 32bit, Firebird 2.5.2 Embedded, fixes_1_0 branch and FPC 2.6.2. Tried with a snapshot (Lazarus-1.1-40778-fpc-2.7.1-20130410-win32.exe) too but the result is same. Hello, Maybe related to: http://bugs.freepascal.org/view.php?id=17199 Fixed in 2.7.1. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Hints for Android
El 11/04/2013 17:08, Graeme Geldenhuys escribió: Also, do you know if one needs to pay Google to develop and publish Android apps... eg: like the $99 per year per developer for iOS and Apps Store privileges? Hello, You must pay $25 for your developer account in the Google Play Store and it is permanent. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PAnsiChar to UTF8 issues
El 09/04/2013 19:35, Leonardo M. Ramé escribió: No, I've tried all kinds of combinations of ansitoutf8, unicodestring, etc, but nothing works, all returns ? or the box with the X in the place of ñ or accents. Hello, Maybe you have an ANSI string inside a string type declared as UTF8 coded, so try this: var ansivar: ansistring; begin ansivar:=lStr; //Your lStr SetCodePage(RawByteString(ansivar),CP_ACP,false); //Display the ansivar instead lStr to check. end; -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Is Mantis bad as i thought
El 04/04/2013 21:29, Zaher Dirkey escribió: I have monitored many bugs in Mantis, but no email for changes to notify me about this bugs even if i am the reporter. There is no option for that in Preferences in my account! I s that true, are there any body have this claiming? Hello, I had reset my configuration in Mantis to default settings in order to be able to properly select which emails I like to receive. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] FPSpreadSheet keeps existent formulas?
El 19/02/2013 0:52, silvioprog escribió: Hello, Can I write values in some cells but keeping the existents formulas? Demo for explain my doubt in attached. Hello, AFAIK no as the spreadsheet is fully loaded and interpreted (non interpreted information is discarded) and then saved. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extract the color data and alpha from a PNG image
El 05/02/2013 23:49, silvioprog escribió: You have puted a PNG image into a PDF? That's what I'm trying to do, and it needs of the uncompressed data too (or compressed as gzip). Hello, The attached code do more or less the same as the fpdf.php one. It can be written in a very different way but I tried to be more modular to acomodate in a future the indexed palettes and transparencies over palettes, and also allow an easy data to real RGB (after filtering) conversion. -- unit upng4pdftest; {$mode objfpc}{$H+} interface uses Classes, SysUtils, zstream; type RPNGChunkInfo=packed record ChunkSize: DWORD; ChunkID: array [0..3] of char; ChunkData: PBYTE; ChunkCRC: DWORD; end; RPNGIHDR=packed record Width: DWORD; Height: DWORD; BitDepth: BYTE; ColorType: BYTE; CompressionMethod: BYTE; FilterMethod: BYTE; InterlaceMode: BYTE; end; PPMGIHDR=^RPNGIHDR; RPNGPLTE=record PaletteEntries: BYTE; PaletteRGB: array [0..((256*3)-1)] of BYTE; end; RPNGtoPDFData=record IHDR: RPNGIHDR; PLTE: RPNGPLTE; IDATCompressed: PBYTE; IDATCompressedSize: DWORD; IDATUnCompressed: PBYTE; IDATUncompressedSize: DWORD; AlphaRGBColor: DWORD; AlphaPalette: array [0..255] of BYTE; IDATRGB: PBYTE; IDATRGBSize: DWORD; IDATHasTransparency: Boolean; IDATTransparency: PBYTE; IDATTransparencySize: DWORD; PDFColorSpace: string; ErrorString: string; end; function GetPNGInformation(const aFileName: string): RPNGtoPDFData; function GetPNGInformation(const aStream: TStream): RPNGtoPDFData; procedure PNGTest(); implementation function ReadChunk(const aStream: TStream; out aChunk: RPNGChunkInfo): integer; begin Result:=aStream.Read(aChunk.ChunkSize,4); if Result4 then exit(0); aChunk.ChunkSize:=BEtoN(aChunk.ChunkSize); Result:=Result+aStream.Read(aChunk.ChunkID,4); if Result8 then exit(0); GetMem(aChunk.ChunkData,aChunk.ChunkSize); Result:=Result+aStream.Read(aChunk.ChunkData^,aChunk.ChunkSize); if DWORD(Result)8+aChunk.ChunkSize then exit(0); Result:=Result+aStream.Read(aChunk.ChunkCRC,4); if DWORD(Result)8+4+aChunk.ChunkSize then exit(0); end; function ExpandIDAT(const aIDAT: PBYTE; const aSize: DWORD; out aIDATExpanded: PBYTE; out aExpandedSize: DWORD): Boolean; var ExpandStream: Tdecompressionstream; InputStream: TMemoryStream; OutputStream: TMemoryStream; begin aIDATExpanded:=nil; aExpandedSize:=0; InputStream:=TMemoryStream.Create; InputStream.Write(aIDAT^,aSize); InputStream.Position:=0; OutputStream:=TMemoryStream.Create; try ExpandStream:=nil; ExpandStream:=Tdecompressionstream.create(InputStream); try OutputStream.CopyFrom(ExpandStream,0); GetMem(aIDATExpanded,OutputStream.Size); OutputStream.Position:=0; OutputStream.Read(aIDATExpanded^,OutputStream.Size); aExpandedSize:=OutputStream.Size; result:=true; except Result:=false; if Assigned(aIDATExpanded) then begin FreeMem(aIDATExpanded); aIDATExpanded:=nil; end; aExpandedSize:=0; end; finally InputStream.Free; OutputStream.Free; ExpandStream.Free; end; end; function GetPNGInformation(const aFileName: string): RPNGtoPDFData; var FileStream: TFileStream; begin Result.ErrorString:=''; //No initialization warning FillByte(Result,sizeof(Result),0); FileStream:=TFileStream.Create(aFileName,fmOpenRead or fmShareDenyWrite); try Result:=GetPNGInformation(FileStream); finally FileStream.Free; end; end; function GetPNGInformation(const aStream: TStream): RPNGtoPDFData; const MatchSignature: array [0..7] of BYTE=(137,BYTE('P'),BYTE('N'),BYTE('G'),13,10,26,20); var Signature: array [0..7] of Byte; Chunk: RPNGChunkInfo; x,y: DWORD; FilterMode: BYTE; TargetRGB: DWORD; TargetAlpha: DWORD; Source: DWORD; begin FillByte(Result,sizeof(Result),0); Signature[0]:=0; //Avoid initialization warning FillByte(Signature,sizeof(Signature),0); aStream.Read(Signature,sizeof(Signature)); if CompareMem(@Signature[0],@MatchSignature[0],sizeof(Signature)) then begin Result.ErrorString:='Not PNG signature found.'; exit; end; if ReadChunk(aStream,Chunk)=0 then begin Result.ErrorString:='Error reading PNG.'; exit; end; if Chunk.ChunkID'IHDR' then begin Result.ErrorString:='IHDR not found, incorrect PNG file.'; exit; end; Result.IHDR:=PPMGIHDR(Chunk.ChunkData)^; FreeMem(Chunk.ChunkData); with Result do begin IHDR.Width:=BEtoN(IHDR.Width); IHDR.Height:=BEtoN(IHDR.Height); if IHDR.BitDepth8 then begin ErrorString:='Bit depth 8 not supported.'; exit; end; Case IHDR.ColorType of 0,4: PDFColorSpace:='DeviceGray'; 2,6: PDFColorSpace:='DeviceRGB'; 3: PDFColorSpace:='Indexed'; else begin ErrorString:='Color format not supported.'; exit; end; end; if
Re: [Lazarus] Extract the color data and alpha from a PNG image
El 05/02/2013 23:49, silvioprog escribió: You have puted a PNG image into a PDF? That's what I'm trying to do, and it needs of the uncompressed data too (or compressed as gzip). Hello, Hmmm... No I had not reached that point, in fact I'm too far, but I still think you do not need the uncompressed data, you should post the compressed one and add the /FlateDecode filter to the XObject. Maybe except the situation where PNG compressed data uses a color format or alike that is not supported in PDF (I do not know if that case exists at all). Anyway I must check documentation as images are too far in my project. That PHP code is a toy and can handle only a subset of PNGs. FPDF is a very good library, and it does what it promises. It handles a good range of PNG formats, indexeds, grayed, with or without palette etc. So, if is so easy to do, how I it do then? For PDF insert it could be fine, of course. I can convert that PHP to pascal, but I can not today. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Extract the color data and alpha from a PNG image
El 05/02/2013 15:36, silvioprog escribió: Hello friends, I'm trying to extract the color data and alpha from a PNG image. In PHP it is very easy to implement, but in FPC I don't know how to do it. I tried to do it via chunk.data, ZData etc., but, without success. The question is what information are you looking for ? The compressed PNG data, uncompressed, palette applied or not... I doubt that you need the raw uncompressed bitmap. That PHP code is a toy and can handle only a subset of PNGs. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Memory leaks
El 23/11/2012 12:46, Antonio Fortuny escribió: Le 23/11/2012 12:37, José Mejuto a écrit : El 22/11/2012 14:48, Antonio Fortuny escribió: Hello, Call trace for block $001EA898 size 28 $0060787C IDSTACK_init, line 937 of D:/Programmes/LazPk/Indy10_5_8/Lib/System/IdStack.pas This is clear ;) Obviously and it is known memory leak $0040DBB4 $004120D1 This two may come from Windows OS libraries, or maybe the fpc RTL functions (more probably). Annoying but can cope with it Just to be sure you can load your project and run procexp (process explorer) which could show you the base address for the loaded DLLs, quite sure one would be loaded in the 0040 address, which is the path to arrive the offending function (maybe sockets related). $BAADF00D This comes from an already freed object (BAD FOOD), so the first step could be to change all object.free by FreeAndNil(object). Ouaou ! This means a lot of search ! Not that much, but the problem is that many code runs fine due that bug, using a freed object (not intentionally). Maybe some regexp replaces will help you. You can review only code that deals with Indy activities. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] lazbarcodes: unsuccessfully compiled
El 21/11/2012 9:56, Eric Kom escribió: I downloaded the tar file for lazbarcodes, after tried to compile lazbarcodes_runtimeonly.lpk file, the above error message occurred: lazbarcodes_runtimeonly.pas(10,3) Fatal: Can not find unit zint used by lazbarcodes_runtimeonly. Check if package lazbarcodes_runtimeonly is in the dependencies. The Zint unit is not found! How can I install the Zint package? Hello, Package - Open Package (*.lpk) - lazbarcodes_runtimeonly.lpk - Compile (not install). Should not be any problem about it, maybe your folders layout is not the expected one ? lazbarcodes\packages\ lazbarcodes\images\ lazbarcodes\src\ -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Setter code
Hello, Is there any way to change the code generated when autocomplete a Setter in a class ? Currently it generates something like: procedure Tfrm.SetMyproperty(AValue: string); begin if FMyProperty = AValue then exit; FMyProperty := AValue; end; And I need to change it (for conveniece) to something like: procedure Tfrm.SetMyproperty(AValue: string); begin if FMyProperty = AValue then exit; debugln('property changed'); FMyProperty := AValue; end; Thank you. -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problems with Win8 x64
El 29/10/2012 16:59, Andrew Brunner escribió: Ok. There are issues. There has to be progress and resolution to move forward. It is better. Just go give you perspective here. The enemy is NEVER better. And this particular one is as bad as it gets. Hello, In the past other development environments (or even commercial apps. like some POS) create a subst'ed drive to run the software, so in the start it subst to a new drive letter, and move execution to that drive. With XP and upper a hardlink to X:\Lazarus from Program Files could be created on installation. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SIGSEGV with Debug only
Hello Lazarus-List, Friday, March 30, 2012, 5:11:07 PM, you wrote: DSdA Bingo... DSdA Is the HeapTrace.. I just removed HeapTrace Unit from DSdA Linking and the problem has gone... Removing heaptrace hide the error not fix the bug. The heaptrace is showing you a bug that otherwise you will not be aware of it in most situations like: var a: TSomething; begin a:=TSomething.Create; a.Method; a.Free; a.Method; //This is a bug that will be showed by heaptrace. end; -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Project activity
Hello Lazarus-List, Sunday, March 11, 2012, 7:54:47 PM, you wrote: Is there any package or something that add working in project time counters ? Something that shows the time spend in a project. MVC I have such a program, written in Lazarus. MVC It is not directly connected to a lazarus project. MVC It's a small app that sits in the tray, and can be used to manage project time. MVC If there is interest, I can donate it to the Lazarus community. It also serves MVC as a nice example of how to program Lazarus and tiOPF. It would be great if I can put an eye on it to decide if it matches my needs. I'm quite disorganizated in my project development as I need to jump from one to other several times each day and it is quite difficult to track the time consumed in each one. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Project activity
Hello Lazarus-List, Monday, March 12, 2012, 11:45:31 AM, you wrote: mvwb You'll need tiOPF and a database server. mvwb I use (and recommend) Firebird, but changing it to something mvwb else takes about 2 lines of code. mvwb The included time.sql file creates the database. Thank you, I'm using FireBird too. I'll install tiOPF and see what happends :) -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Project activity
Hello Lazarus-List, Is there any package or something that add working in project time counters ? Something that shows the time spend in a project. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] To TDBEdit users: EditMask property about to being ignored
Hello Lazarus-List, Tuesday, March 6, 2012, 11:27:19 AM, you wrote: LAPC This will make TDBEdit.EditMask to be ignored LAPC Any thoughts? TDBEdit.EditMask should be ignored only if it has default value (nothing), if it has a value it should override field mask IMHO. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] To TDBEdit users: EditMask property about to being ignored
Hello Lazarus-List, Tuesday, March 6, 2012, 1:26:18 PM, you wrote: TDBEdit.EditMask should be ignored only if it has default value (nothing), if it has a value it should override field mask IMHO. JM Why should there be 2 EditMasks? To confuse people maybe? JM Just remove TDBEdit.EditMask if it is not used. There are 2 possibilities. Same field could be editted in two different controls at the same time, like a TDBGrid and a TDBEdit, but in TDBGrid you can use a more compact mask for editing a date (in example) but a more verbose in a TDBEdit. The second one is that if the user does not define a edit mask he/she can not use a TDBMaskEdit (it does not exists). The presence of a TDBMaskEdit in the component palette will invalidate this of course. Anyway if TDBEditMask is removed I will not complaint. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] To TDBEdit users: EditMask property about to being ignored
Hello Lazarus-List, Tuesday, March 6, 2012, 4:57:45 PM, you wrote: LAPC I have the idea of adding a property OwnsMask that defaults to false. LAPC Seems a good compromise between Delphi compatibility (by default) and LAPC compatibility (just change a property) LAPC More thoughts? OverrideEditMask ? UseCustomEditMask ? Maybe an options set (with just one option) that could be extended if necesary with some toggles ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Problem encode UTF8 with BOM in unit
Hello Lazarus-List, Wednesday, January 25, 2012, 11:13:16 AM, you wrote: H Although BOM is valid in UTF8, its use is not recommended H (http://en.wikipedia.org/wiki/Byte_order_mark#cite_note-1). I'm H surprised Lazarus supports this at all. IMO this feature should be H removed and UTF-8 files with BOM should be rejected by FPC and Lazarus H as invalid. Please, re-read the cite. It should be used in undetermined encoding protocol media, like files, in fact it is quite mandatory in many of them. The cite is about setting a BOM in things like string variables where the protocol is expected (programatically) or database fields where the field definition already states the encoding used. A pascal program file without BOM is ansi as you can say that a file could not be UTF8 but you can not say that it is not ansi unless BOM is present. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OT: Two videos that I've made for Lazarus
Hello Lazarus-List, Sunday, October 2, 2011, 10:25:51 AM, you wrote: i 2. Display how to use the QR Code http://vimeo.com/29903848 (from ccr) So the LazBarcodes 2D works in Linux ? :) Great as I had not tested them :) -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LazBarCodes
Hello Lazarus-List, Tuesday, September 13, 2011, 1:39:58 AM, you wrote: s I'm trying to use the lazbarcodes, but any component of this package s freezes my IDE, please, see: s http://silvioprog.com.br/video/lazb/video.html Wow! I had only tested them in WinXP. I'll check in a Win7 installation, maybe I do something wrong in the screen update :-? Which FPC and Lazarus are you using ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LazBarCodes
Hello silvioprog, Tuesday, September 13, 2011, 1:58:52 PM, you wrote: Which FPC and Lazarus are you using ? s Lazarus 0.9.31 r32312 FPC 2.5.1 i386-win32-win32/win64 s Win: http://imagebin.org/172241 It is a division by zero error. Instead dropping the barcode in the form with a single click, drop it and resizing at the same time, so, click in the control, go to the form, press left mouse button, move it some pixels and release the left button. I think I have the bug solved in my development repository but I can not commit right now the last changes as it needs a bit of clean. Maybe I'll have it fixed this afternoon, but meanwhile the work around should work. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Convert assembler to Pascal
Hello Lazarus-List, Tuesday, September 13, 2011, 2:42:25 PM, you wrote: LMR While converting the code, I found this routine in Assembler. I'm LMR wondering if somebody can help me convert this to Pascal?. LMR Here's the routine: Basically: LMR procedure XorMemPrim(var Mem1; const Mem2; Count : Cardinal); procedure XorMemPrim(var Mem1; const Mem2; Count : Cardinal); var c: PtrUint; begin for c:=0 to Count-1 do begin PBYTE(Mem1)[c]^:=PBYTE(Mem1)[c]^ xor PBYTE(Mem2)[c]^; end; end; Syntax not checked. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] widgetset roadmap issue query
Hello Lazarus-List, Tuesday, August 23, 2011, 12:56:54 PM, you wrote: GG In the LCL-xxx widgetset roadmap GG [http://wiki.freepascal.org/Roadmap], GG there are some items under lcl-fpgui listed as Partially GG Implemented. eg: TButton GG How or where do I find out what is not working or completed? Standard tab components should be almost complete, or at least usable, but as nobody is using the widgetset it is quite difficult to determine if it is complete. GG Also, how do you test that a widget / component is 100% working? Is GG there some test app or test suite for this? No test suite, I simply wrote a form with different objects and handle different events (most important ones) and check manually that they works, but event chain order, or operations inside an event could be not work as expected. I had not seen any serious missing in the standard tab components (except frame and action list which I do not know how to test). There are some missings in the WinAPI compatibility layer like focus rect (missing xor effect). TLabel can have serious problems due the WinAPI compatibility. For sure there are some missing things not tested, like accelerators and others. The examples folder can be used as a test suite. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] RE : RE : RE : Console App Development
Hello Lazarus-List, Sunday, August 14, 2011, 1:56:31 PM, you wrote: M Now once it is known that this does happen, the same may happen for any M other of the unfreed memory. It may or may not. It is totally unknown. M Of all the unfreed memory, when you close the editors, or project M anything from 0.1% to 99.9% could be hold by the memory manager. Why not simply compile with heaptrc and produce a heaptrc.dumphead; using a menu option. It would take some time, but large memory blocks would be discovered and divergences with VM should be revealed (memory not returned to the OS by the memory manager). -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Why I can't see my own messages in this list?
Hello Lazarus-List, Friday, August 12, 2011, 2:21:49 PM, you wrote: SB I suspect the settings of his mailing list account, because there IS an SB option to enable/disable the sending of ones own mails. I had changed that option multiple times and never got my written emails back. Maybe is gmail deleting them as dupes ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Laz Barcodes
Hello Lazarus-List, I had added a new set of components to Lazarus CCR http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus-ccr/components/lazbarcodes/ to generate, currently, 2D barcodes: * QR * MicroQR * Aztec * Aztec Rune * DataMatrix The backend has been ported from Zint http://sourceforge.net/projects/zint/ C sources, so I think the license should be the same, GPL 3.0. I wish to add a wiki page but I can't remind how to do it using the template :-? Can anybody please refresh my mind ? The code has been tested only in Win32 by now using Lazarus SVN and fpc SVN too. PS: I think Silvio was looking for something like this some weeks/months back. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] thread safe
Hello Lazarus-List, Wednesday, June 29, 2011, 5:09:22 PM, you wrote: *** This one must work Thread/core/processor 2 --- while true do begin Critical.Enter; if ab then Raise Exception.Create('KBOOM!'); Critical.Leave; end; If the second one will not work in a n-code processor, or SMP, please tell me why not. Of course the performance will be quite poor. MS Did you experience that it does not work ? IMHO that would be really ban MS news. No, exactly the opposite, I do not see how it could fail about memory order access, cache coherence, ... -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to use Lazrus IDE as a test case?
Hello Lazarus-List, Saturday, June 25, 2011, 9:24:10 AM, you wrote: When I want to debug Lazarus.lpi, it seems to behave properly, but when I then rebuild the IDE, it exposes a different behaviour, e.g. hangs on startup :-( press pause and see where? HPD The new IDE only hangs, when started. No forms... :-( If you are on Win32 check the debug.txt file, quite sure an exception is begin raised and you will see it in this file. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Setting SQL locale
Hello Lazarus-List, Monday, June 13, 2011, 8:01:44 PM, you wrote: MML I'm trying to send a SET TIMEZONE command to the server, to get DST MML correction applied to the resultset. This has to be done using the same MML handle as will be used for the query, otherwise the server thinks it's a MML different session and it has no effect. Keep warning about that! In my life I had found a lot of troubles with that, your DST setting could be applied blindly to the data and it could result in wrong times. Many code checks DST against now, get the offset and apply it to the time, which is wrong for any date/time different than now. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Trying to get the svn v ersions of Lazarus and FPC running on Windows
Hello Lazarus-List, Tuesday, May 17, 2011, 10:24:37 AM, you wrote: MS This does work perfectly, but, even if I have it do nothing (no thread MS created etc), when closing the program I get: MS In Linux with GTK2, there is no problem when stopping the program MS How to find out what is wrong here ? Your code is compiled with heap trace in the linking section, and good news your code do not have memory leaks :) -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] QR Code
Hello Lazarus-List, Monday, May 16, 2011, 12:22:54 PM, you wrote: Jg Bo Berglund kirjoitti maanantai, 16. toukokuuta 2011 12:48:10: The sources are also available (C++) but they operate with the Qt graphics library so I guess there is a bit of a hurdle converting to native FPC... Jg No, the backend code seems to be pure C. Jg You can convert the headers and use it with FPC, or you could even convert the Jg C-code to Pascal. The code looks clear considering it is C. I'm trying to do it in order to test a c to pascal helper I'm working on (it is not a conversor but a helper). If somebody starts to port to pascal I'll stop as this code is quite larger and for sure my tests will be better with a smaller piece of code. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Rev: 30677 error, Paul commit.
Hello Lazarus-List, --- Compiling F:\Lazarus\debugger\breakpointsdlg.pp breakpointsdlg.pp(311,55) Error: Identifier not found lisDbgBreakpointPropertiesHint breakpointsdlg.pp(838) Fatal: There were 1 errors compiling module, stopping --- Missing commit files ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] UTF16 2 utf8
Hello Lazarus-List, Thursday, May 5, 2011, 12:20:10 PM, you wrote: MW According to unicode.org, when UTF-16 got introduced, the USC2 standard MW was extended. So yes they are the same. MW In some cases when ppl refer to USC2 they mean the old unicode 1.1 MW standard, but that is wrong. The name USC2 is misleading and should not MW be used anymore. Maybe, but, taken from www.unicode.org glossary of terms: UCS-2. ISO/IEC 10646 encoding form: Universal Character Set coded in 2 octets, limited to the Basic Multilingual Plane. (See Appendix C, Relationship to ISO/IEC 10646.) UTF-16. A multibyte encoding for text that represents each Unicode character with 2 or 4 bytes; it is not backward-compatible with ASCII. It is the internal form of Unicode in many programming languages, such as Java, C#, and JavaScript, and in many operating systems. More technically: (1) The UTF-16 encoding form. (2) The UTF-16 encoding scheme. (3) Transformation format for 16 planes of Group 00, defined in Annex C of ISO/IEC 10646:2003; technically equivalent to the definitions in the Unicode Standard. I think that the text that says the UCS2 has been extended, does not means that UCS2 has been extended, it says that UCS2 has been extended to UTF-16, so UCS2 can not be considered Unicode anymore as noted in ISO 10646: UCS-2. UCS-2 stands for Universal Character Set coded in 2 octets and is also known as the two-octet BMP form. It was documented in earlier editions of 10646 as the two-octet (16-bit) encoding consisting only of code positions for plane zero, the Basic Multilingual Plane. This documentation has been removed from ISO/IEC 10646:2011, and the term UCS-2 should now be considered obsolete. It no longer refers to an encoding form in either 10646 or the Unicode Standard. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Menu caption standards
Hello Lazarus-List, Tuesday, April 19, 2011, 8:35:01 AM, you wrote: GG That's not the case in Mozilla Thunderbird. Only modal dialogs have the GG ellipsis in the menu item. Examples: GG * 'Tools Preferences' does not. GG * 'File New Message' does not. GG * 'File Print' does because it is modal. GG etc... GG At least this is the case under Linux. The ... is added when the menu entry is an action verb and this action requires further configuration/data. Examples: Open: If the option just only open the file selector no ..., but if it opens a configuration window to select which open it should have it. Print: If it prints directly no dots, but if configuration is opened then ... Select All: If selects all text no ..., but if a dialog is opened to define what to select the elipsis must be added. Configure: The verb itself indicates a new dialog, so it will never present an ... Ellipsis indicates that a verb need more configuration to finish its action. 98% times the opened dialog is a modal dialog. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SIGSEGV with gdb.exe
Hello Lazarus-List, Tuesday, April 19, 2011, 7:51:35 PM, you wrote: K I had no problems until last Friday (15/04/11) and now, also K deactivating my Avira Antivir the problem persist. K As printer I have an Epson PX720WD, but that never caused errors to K gdb until today. Deactivating Avira is not enougth. I had the same problem a few months ago, so uninstalled Avira and reinstalled it a few days later. Now everything is running fine. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Geckoport Lazarus/Delphi
Hello Lazarus-List, I'm working in the Lazarus GeckoPort but recently tried to make it compile and work in Delphi again and I found a strange problem, I know it is not a problem with Lazarus, but here there are some people with very good skills in windows programming. In Lazarus SVN my test code works fine, no problem. In Delphi 7 everything looks fine except that I have serious focus problems. I'm loading www.google.com for tests and get focus in the inputbox for the search, now if I press in a non-gecko object like a TEdit I get focus in the TEdit but the google inputbox still shows the caret (as the control does not receive a kill_focus). The problem becomes more severe if there are more than one gecko in the program. Does anybody know any difference about how Lazarus handle something different about passing messages to the controls and/or DLGC codes ? Any idea would be great, also how to check possible differences, because all my tries went futile after a week performing tests. Thank you to everybody. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] software licence question - deceased author
Hello Lazarus-List, Friday, February 25, 2011, 1:16:46 PM, you wrote: MvdV On Fri, Feb 25, 2011 at 09:54:08AM +0100, Felipe Monteiro de Carvalho wrote: 2011/2/24 Fl?vio Etrusco flavio.etru...@gmail.com: IIRC (at least) on US law only the copyright holder can file an infrigent lawsuit, In Brazil too MvdV Reading this I wonder how heirs are defined in this context. MvdV Do cousins count? Second cousins? Third MvdV degree cousins? And, by default, finally the government. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] software licence question - deceased author
Hello Lazarus-List, Friday, February 25, 2011, 2:56:15 PM, you wrote: MvdV Reading this I wonder how heirs are defined in this context. MvdV Do cousins count? Second cousins? Third MvdV degree cousins? And, by default, finally the government. MvdV If it is not a first order relative (siblings, parents, children), then MvdV afaik there is already a 30 or 40% tax here. Are we talking about copyright ? A copyright by itself does not have any kind of taxes because it is not monetizable. The tax is applied over the commercial value of the copyrighted material (contable value, if it is the right word in english) and in all this cases are zero. PS: I'm not a lawyer or finantial expert. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] software licence question - deceased author
Hello Lazarus-List, Friday, February 25, 2011, 6:10:43 PM, you wrote: Are we talking about copyright ? MvdV No, we are talking about inheritance in general. But it was more meant as an MvdV illustration that the definition of heir can vary in law and common speak. In Spain and I think in almost all Europe, the blood line level influence the amount of taxes (taking blood line as an in law inclusive) but the rights are not finished at a defined level, as far away, less chances to reclaim something. The first three levels are somehow direct candicates while far away levels must present a complaint (I'm not sure about the word) and if no people is presented with closer level he/she can reclaim something. Same rules are applied (more or less) when the there is somthing like a house but legal titular is not localizable, so heirs can reclaim the possesion but before they must complaint in a court. This kind of processes are usually very, very slow and can take up much more than the legal 3 years. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Portable way to get accurate timestamps?
Hello Lazarus-List, Monday, February 21, 2011, 7:23:54 AM, you wrote: BB When I run a test against a fairly accurate GPS time source I see that BB there is an uncertainty of about 16 ms in the time given such that if BB GetTickCount is executed at exactly 1 second intervals the last two BB digits of the value is not the same as it should be. BB Instead it slowly (over a period of 16 seconds) reduces by 16 ms and BB then suddenly restores to a max value. BB It is like a superimposed sawtooth with an amplitude of 16 ms. Quote from MSDN: The resolution of the GetTickCount function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds. The resolution of the GetTickCount function is not affected by adjustments made by the GetSystemTimeAdjustment function. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] language database
Hello Lazarus-List, Monday, February 21, 2011, 8:37:27 PM, you wrote: i I'm thinking in starting to create a language database unit for Lazarus. i The idea is to know as much as possible about all the needed features of a i language. [...] i This is not a hard work in developing but it is a lot of work do research i all of this information and I wish to know if anyone will be interested in i such unit, and if so will they be willing to give a hand for it ? That information is already at http://cldr.unicode.org/ take a look at it. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Friday, February 18, 2011, 12:37:53 PM, you wrote: Both have FIFOs, in fact the FIFO was implemented for the transmitter (sender) to achive a speed higher than 38400 bps and before the chip goes out a receive FIFO was added also. HPD Correction: the FIFO was implemented first for the receiver, because HPD lost bytes can not be recovered, and not all lines or senders allow for HPD hardware handshake (RTS/CTS) - that was a big problem with the old HPD devices. The baudrate is generated by the device, so that sending never HPD suffered from timing problems. [In synchronous protocol the device HPD inserts sync codes automatically, when no new data is supplied in time] Well, maybe we can talk for hours about this :) as I can not show you a document about this topic, but I'll show you my background about why transmission buffer FIFO was more important in the beginning. In the past times most communications in serial devices was synchronous, so in the receiver part due the possible errors in transferences and, of course, buffer overruns some protocols can have some simple error correction techniques. The problem appears when serial communications want to be far away from 38400 bps as the time needed to raise the interrupt and just put a new byte in the buffer (1 byte buffer) is more than the character frame time which in fact raises a buffer underrun error and a serial comunication break (break, not error). What a change in less than 20 years! :) -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Friday, February 18, 2011, 4:16:31 PM, you wrote: MS BTW be warned: The necessary Event-mechanism (e.g MS Apllication.QueuAsyncCall) does not work correctly with the current svn MS Lazarus version and gtk2 (maybe it does work with the Windows and/or MS the qt Widget Type) You can use Syncronize, the syncronized procedure raises the event in your code. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Thursday, February 17, 2011, 12:25:26 AM, you wrote: AFAIK the FIFO is in the receive, in sent the FIFOs are filled but function does not return until the hardware sends the last byte. HPD I'm not sure, but IMO a FIFO for outgoing data is used at best in a HPD *synchronous* protocol, not in a UART. More likely synchronous I/O is HPD done by DMA, not in code. But which nowadays hardware is capable of HPD synchronous serial transmission at all? Now you know why PCSpeaker has been removed from Windows ;) 8250 chip which carries RS232 has been removed and it also controls the PCSpeaker. The 8250 is interrupt driven without FIFO and the 16550A is interrupt driven and FIFO 16 bytes. 16550A and alike are no more integrated in PC motherboards because it is the last real IRQ and port mapped device so it overcomplex circuitry and OS to handle it. Anyway the APIs are based in the same concept as when it was interrupt and I/O driven (around 3 years ago). Of course the 16550A chip was not included since a lot of years, but the circuitry in replacement was compatible in operation mode (IRQs / I/O). -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Does Lazarus support a complete Unicode Component Library?
Hello Lazarus-List, Thursday, February 17, 2011, 8:21:07 AM, you wrote: GG Well, for any string handling in your application, you need to know the GG difference between what is perceived as a Unicode character on the GG screen, and the various ways such a character can be presented in a GG language structure. There is no way around this, unless FPC defines that GG such Unicode strings are always stored in some specific normalized manner. I think FPC should handle them as codepoints, this means they are normalized. If the string is not normalized is responsability of the user to normalize it via the supported functions or create new functions to support it unnormalized. In other words strings support do not deal with their representation. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Hans-Peter, Thursday, February 17, 2011, 12:28:08 PM, you wrote: the 16550A is interrupt driven and FIFO 16 bytes. HPD And the FIFO resides in the receiver, the transmitter doesn't have a HPD FIFO. At least it was so, 20 years ago... Both have FIFOs, in fact the FIFO was implemented for the transmitter (sender) to achive a speed higher than 38400 bps and before the chip goes out a receive FIFO was added also. Quote: RBR : Receiver buffer register (RO) The RBR, receiver buffer register contains the byte received if no FIFO is used, or the oldest unread byte with FIFO's. If FIFO buffering is used, each new read action of the register will return the next byte, until no more bytes are present. Bit 0 in the LSR line status register can be used to check if all received bytes have been read. This bit wil change to zero if no more bytes are present. THR : Transmitter holding register (WO) The THR, transmitter holding register is used to buffer outgoing characters. If no FIFO buffering is used, only one character can be stored. Otherwise the amount of characters depends on the type of UART. Bit 5 in the LSR, line status register can be used to check if new information must be written to THR. The value 1 indicates that the register is empty. If FIFO buffering is used, more than one character can be written to the transmitter holding register when the bit signals an empty state. There is no indication of the amount of bytes currently present in the transmitter FIFO. -- You can get further information from http://www.lammertbies.nl/comm/info/serial-uart.html -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Thursday, February 17, 2011, 5:46:08 PM, you wrote: AFAIK the FIFO is in the receive, in sent the FIFOs are filled but function does not return until the hardware sends the last byte. BB At least in the embedded world UART:s have *both* a transmit and BB receive FIFO. You usually are able to set the interrupt trigger such BB that it fires when there are a certain number of bytes in the Rx FIFO BB and when it reduces below a certain number of bytes in the transmit BB FIFO. This way one can fill the FIFO with outgoing data and then go BB away doing something else until the iterrupt fires at which time the BB interrupt routine will move available data from the buffer to the BB FIFO. Right, I do not correctly write the idea. I was trying to say that the FIFO in acts like a buffer that you can forget about it (until no receive event/interrupt) is received, while in the send FIFO the OS waits for a full empty/transmission before return from call. Are we completly off-topic ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Wednesday, February 16, 2011, 10:59:02 AM, you wrote: MS On 02/15/2011 10:45 AM, Bo Berglund wrote: Does that mean that until all of the bytes have left the serial port the Write does not return to my program? This is exactly why I asked about the buffers... MS Regarding sending, there still is a FiFo (usually some 4..64 Bytes ) in MS the serial hardware (hundreds or thousands of bytes) and a software Fifo MS in the OS driver. So the software can't tell when something has left the MS serial port. For such deeply embedded issues the specifics of the MS driver and hardware needs to be considered AFAIK the FIFO is in the receive, in sent the FIFOs are filled but function does not return until the hardware sends the last byte. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Wednesday, February 16, 2011, 1:26:38 PM, you wrote: MS On 02/16/2011 12:07 PM, José Mejuto wrote: AFAIK the FIFO is in the receive, in sent the FIFOs are filled but function does not return until the hardware sends the last byte. MS If this is true somewhere, it is not portable. Glups! What ? MSDN about RS232: Nonoverlapped I/O is familiar to most developers because this is the traditional form of I/O, where an operation is requested and is assumed to be complete when the function returns. In non-overlapped mode, block mode, or whichever you like to call it, the program sends, in example, 100 bytes to rs-232, the operative system sends 16 of them to the UART, when FIFO bytes has been sent the UART generates an interrupt to tell to the OS to refill the FIFO buffer. This procedure is repeated several times, when no more data is pending in the OS buffers to be sent, the OS waits for the interrupt or timeout interrupt, and when the transmission buffer is empty (interrupt received) the OS exits the send function. FIFO in transmission alleviate the overhead in interrupts 16:1. The problem is in the timeout case as you will not know at which byte the transmission timedout as the FIFO can only be asked about empty or not. Non blocking is pretty the same at the OS level, except that the send function returns inmediatly and you have some helper functions to inquiry the current transmission status/state/progress. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Does Lazarus support a complete Unicode Component Library?
Hello Lazarus-List, Tuesday, February 15, 2011, 4:27:40 PM, you wrote: MvdV There is a solution that you can take FPC and Lazarus libraries out of the MvdV equation by splitting each target into an one and two byte encoding MvdV platform. That should fix the bulk of the problem. [...] MvdV Update to what? The point is that neither of both most used encodings (UTF8/16) is MvdV is going away anything soon, and the split is right through platforms. So you are talking about a platform about the encoding, but in any operative system platform, this means you can choose RTL Linux 32 bits WideString or RTL Linux 32 bits UTF8, do not ? Using a different RTL for each encoding is even worst IMHO. But this is just a simple opinion. MvdV Let's here the argumentation for that then. Well, maybe I misunderstood the platform split... -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Does Lazarus support a complete Unicode Component Library?
Hello Lazarus-List, Monday, February 14, 2011, 8:29:04 PM, you wrote: I'm unable to see the great problems with UnicodeString. The conversions should be the minimun needed, and they will be. Problem would be in the RTL, but not at user level. MG Yes, since for example Linux allows non valid UTF-8 as file names, MG so any auto conversion of file names to UTF-16 is an error. Hmmm... To me it looks like a Linux problem/bug for that kind of access it is logical to me to use low level APIs. OK, that way you can not access those files ? yes, but also in Windows there are similar problems, some files can not be accessed using regular APIs and some tricks must be used. Many people are concerned about speed due hidden conversions, so can anybody tell me why ? Maybe I'm blind and I can not see something that is absolutly a problem (except some pieces of RTL). MG For instance searching needs a lot of compares. Comparing two MG strings normally fails on the very first characters. An auto conversion MG will always convert the whole string including allocating and releasing MG memory, easily slowing down the conversion by an order of magnitude. This are the some corner cases which can not be handled in the usual conversion, operation, conversion back, but I think there are not much cases like this. Of course, there are cases like a TStringList with 10 items in UTF16 and perform a search using an UTF8String, so or a conversion request to the stringlist (convert all elements in one go) or you must use your unicodestring using default unicode format for the platform. I would like to see an example of such problem (snippet) which could be a headache, but maybe in the fpc mailing lists ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] SdpoSerial Tx and Rx buffers?
Hello Lazarus-List, Monday, February 14, 2011, 8:32:37 PM, you wrote: BB While the transfer runs my program sits and waits for an ACK coming BB back from the other end after it has checked the checksum. That is a BB loop with Application.Processmessages, Sleep and a timeout... BB In a blocking design this wait loop would of course not have been BB needed becaus ethe Write would not return until all data have been BB written to the output. So you can send in small chuncks (64 bytes) and give feedback every 250ms. Or use a send thread. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Does Lazarus support a complete Unicode Component Library?
Hello Lazarus-List, Monday, February 14, 2011, 8:52:27 PM, you wrote: Many people are concerned about speed due hidden conversions, so can anybody tell me why ? Maybe I'm blind and I can not see something that is absolutly a problem (except some pieces of RTL). MvdV Typical example is you mix two codebases which have a different opinion MvdV about the string type. Then for every transition between those two codebases MvdV you have a fair chance that a conversion is needed. It is throughout MvdV possible that if you do an Tstringlist.indexof() that you do as many MvdV conversions as elements in the stringlist (if your passed stringtype is MvdV different from the tstringlist one). But you are in the same trouble if you use any other approach, or you use your data in the same unicode format as the other codebase or you update the codebase to use your new unicode format. There isn't a solution for such situation. I'm currently working with GeckoPort which uses WideString in every place and other special strings. I know that conversions must happend so when I need to scan for a string first convert my data to the native format and them perform the scan. I think expecting a TStringList in ansi encode to work transparently and optimal using unicodestrings is just a dream, programmers should update their codebase, but at least only for speed (reduce autoconversions) and do not need to decide constantly which encoding format is needed to call this or that function. Using a different RTL for each encoding is even worst IMHO. But this is just a simple opinion. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] substr return wrong string with some utf8 char
Hello Lazarus-List, Friday, February 11, 2011, 9:24:21 AM, you wrote: Make that UTF8Pos() (in combination with UTF8Copy) because a UTF-8 character can be anything from 14 bytes long. MS Obviously UTF8Pos() and UTF8Copy() are a lot slower than Pos() and MS Copy(), and in many cases (i.e when that arguments of copy are obtained If no checks about utf8 integrity are performed they should not be that lot slower, only a bit slower, at least utf8pos, utf8copy is for sure slower. A different thing is that current implementation is a bit overengined which add some overhead. Is it logical/safe that utf8 functions do not check utf8 integrity ? I'm talking about utf8pos, utf8copy, etc... -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] substr return wrong string with some utf8 char
Hello Lazarus-List, Friday, February 11, 2011, 1:38:58 PM, you wrote: Is it logical/safe that utf8 functions do not check utf8 integrity ? I'm talking about utf8pos, utf8copy, etc... LS Maybe make the sanity check optional with default true ? LS Or some unit flag, default true and the utf* routines could force check LS if told so ? LS Not that I know anything about this code but why not let people who LS know what they are doing to skip the check or call check when they know they need to? LS (and as I said, in order not to break existing code, default would be to check always) Current code does not perform sanity check, and I think most functions should not perform it, only conversion functions and a sanitize function should perform the checks, otherwise most functions will degradate in speed even when you know that the data is utf8 compliant. The same applies to UTF16. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] substr return wrong string with some utf8 char
Hello Lazarus-List, Friday, February 11, 2011, 3:06:50 PM, you wrote: Is it logical/safe that utf8 functions do not check utf8 integrity ? I'm talking about utf8pos, utf8copy, etc... HPD There exists no need for an utf8pos function, for use with an utf8copy, Nothing is needed for utf8copy ;) utf8pos is needed to return the characters position of an string it use for utf8copy or to display the information somewhere is a different matter. HPD when Pos already returns the correct start index for Copy. Only the If not integrity checks are performed, yes, it returns a valid index position. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] substr return wrong string with some utf8 char
Hello Lazarus-List, Friday, February 11, 2011, 6:55:43 PM, you wrote: Nothing is needed for utf8copy ;) utf8pos is needed to return the characters position of an string it use for utf8copy or to display the information somewhere is a different matter. HPD Why determine an UTF-8 character index, when this one has to be HPD converted later into an byte (char) index inside utf8copy? Please, re-read my comment ( fixing my it use by if used :) ). The result is a character position index, not a need for use copy, but maybe for an information display. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] GeckoPort HTTP Auth
Hello Lazarus-List, Thursday, January 27, 2011, 10:29:56 PM, you wrote: waiting if the problem in Linux64 can be solved. Also this feature will not work in Linux64 due the same reason DirectoryService does not work. AS It is necessary for a particular project, but the project has a low AS priority. OK, I add this task in my queue for the next week. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] GeckoPort HTTP Auth
Hello Lazarus-List, Thursday, January 27, 2011, 8:11:48 PM, you wrote: AS How to open page with HTTPAuth? It shows prompt with only 'OK' 'Cancel' AS with no text and no place to input credentials in infinite loop. There is no support for security authentication in the current implementation. Gecko port is more targetted to an html render than a browser, so more functions where added in the render and embed field than in other like authentication, file saves, and other interactive operations. If you really need it I can try to add some kind of event to allow the user to display a message box or any other window and fill the authentication needed. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] GeckoPort HTTP Auth
Hello Lazarus-List, Thursday, January 27, 2011, 9:05:14 PM, you wrote: If you really need it I can try to add some kind of event to allow the user to display a message box or any other window and fill the authentication needed. AS It will be good to add callback to set user defined factory for prompt AS windows. I not figured out how to register it. (I need to be able toset AS credentials without prompt) The event will fire, whatever you do in the event is in your own, you can display a window, fill data by code or format your harddisk ;-) The other question, do you need it ASAP ? My working in geckoport is quite stopped this days as other things are in my queue and also waiting if the problem in Linux64 can be solved. Also this feature will not work in Linux64 due the same reason DirectoryService does not work. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Accessing MS SQLServer database from Lazarus/FPC?
Hello Lazarus-List, Tuesday, January 25, 2011, 8:08:14 PM, you wrote: What happens if you put an explicit .First before the loop? query.Active:= true; query.First; while not query.EOF do begin S := S + query.FieldByName('AppNo').AsString + #13#10; query.Next; end; BB This does not help at all... BB The query.Recordcount property shows the number of records as 1 and BB this is also what is listed in the loop. Do not care the RecordCount property, it could be less than real fetchable records. Anyway it seems to not affect this case, just a clarification. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Accessing MS SQLServer database from Lazarus/FPC?
Hello Lazarus-List, Sunday, January 23, 2011, 12:06:12 PM, you wrote: MVC Attached is a possible patch. I don't have MS-SQL (doesn't MVC run on Linux) so I can't test. MVC Please apply it to packages/fcl-db/src/sqldb/sqldb.pp and MVC report whether this helped you MVC solve your problem. If so, I will commit it to SVN. I think this piece of code is a problem for your patch (last line): function TCustomSQLQuery.Fetch : boolean; begin if not (Fcursor.FStatementType in [stSelect,stExecProcedure]) then Exit; if not FIsEof then FIsEOF := not TSQLConnection(Database).Fetch(Fcursor); Result := not FIsEOF; // A stored procedure is always at EOF after its first fetch if FCursor.FStatementType = stExecProcedure then FIsEOF := True; end; -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Event handling example project: results for gtk2 and fpGUI
Hello Lazarus-List, Thursday, January 20, 2011, 10:47:41 AM, you wrote: MS Some testing results with Lazarus revision 29134 and fpGUI revision as MS of 20110120: MS GTK2 fpGUI MS From a Thread====== MSSynchronize(*) OK MSPostMessageOK no function MSSendMessage(**)no function MSDispatch (**)(***) MSQueueAsyncCall (*) () MS From a Timer MSSynchronize impossible MSPostMessageOK no function MSSendMessageOK no function MSDispatch OK OK MSQueueAsyncCall OK (*) May you send me the test in order to test PostMessage and SendMessage at least under LCLfpGUI ? As you know it is very alpha :) Your test invironmen is Linux or Windows ? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Get binary (byte by byte) from a HTTP host
Hello Lazarus-List, Tuesday, January 18, 2011, 4:13:13 AM, you wrote: s Not works, Document property always is empty in OnMonitor event. x( You can not access Document from OnMonitor, you can only access Socked properties/status. Synapse is blocking, so : 1) HTTPSend prepare headers. 2) HTTPSend GET 3) HTTPSend access document. Or in your code: -- procedure TMainForm.StartButtonClick(Sender: TObject); begin if FileExistsUTF8(CFile) then FFileStream := TFileStream.Create(CFile, fmOpenReadWrite) else FFileStream := TFileStream.Create(CFile, fmCreate); try FHTTPSend.Sock.MaxRecvBandwidth := 50; FHTTPSend.Clear; FHTTPSend.RangeEnd := FFileStream.Size; FFileStream.Position := FFileStream.Size; FHTTPSend.HTTPMethod('GET', CURL); //Now you can acess Document FFileStream.CopyFrom(FHTTPSend.Document, FHTTPSend.Document.Size); finally FFileStream.Free; end; end; procedure TMainForm.OnMonitor(Sender: TObject; Writing: Boolean; const Buffer: Pointer; Len: Integer); begin //Nothing... //FHHTPSend information at this point is undefined. end; s Hm..., I think isn't possible resume download with Synapse, I tryed all but s without sucess. What's the problem ? Paste headers sent and received headers. Resuming is not supported by all web servers. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpGUI
Hello Lazarus-List, Monday, January 17, 2011, 11:28:25 AM, you wrote: What are you talking about? MS In fact I don't yet fully understand the two different incarnations of MS fpGUI. (Seeming one supported by the Lazarus GUI designer, one coming MS with it's own GUI designer) but I'm learning. There aren't two different ones, only one fpGUI. Lazarus LCL can use fpGUI as a backend. LCL does not known which engine draws controls, or how they are being painted, it only request some operations to be performed and the backend is performing them (fpGUI, Windows, GTK, ...). There is a widgetset glue code API that both, the backend and the LCL must conform as a common language. When you are in a conversation with another people of other country you may need a translator, so in example, you speaking english wish to talk with smoebody that speak spanish so hire a translator which speaks both of them so: You (english) - Translator (English/Spanish) - Other (Spanish) Or in Lazarus fpGUI terms: LCL (LCL) - LCLfpGUI (LCL/fpGUI) - fpGUI (fpGUI) In Windows terms: LCL (LCL) - LCLWin32 (LCL/Win32) - Win32 (Win32) In Linux/GTK2 terms: LCL (LCL) - LCLGTK (LCL/GTK2) - Linux (GTK2) In Windows/GTK2 terms LCL (LCL) - LCLGTK2 (LCL/GTK2) - Win32 (GTK2) In MacOS terms: LCL (LCL) - LCLCocoa (LCL/Cocoa) - MacOSX (Cocoa) The man in the middle just translates the requested operations by the LCL to the desired widgetset. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Setting up debugger in Lazarus?????
Hello Lazarus-List, Saturday, January 15, 2011, 10:32:54 AM, you wrote: BB But now when I try to set a breakpoint in my program code there is a BB pop-up telling me to set up a debugger first SVN versions does not provide all binaries as platform dependent installers because SVN is platform independent ;) You only need to copy your gdb.exe from your previous Lazarus installation or download a gdb for your platform and setup it in the Environment - Options - Debugger. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Forum under attack
Hello Lazarus-List, Wednesday, January 12, 2011, 2:00:34 AM, you wrote: IMHO the solution is to personalize the captcha. The most simple captcha is hard to be resolved by a computer if the captcha style change everyday. HPD IMO it depends on the financial interest, when e.g. companies recruit HPD data entry people in freelancer.com, or pay for huge numbers of email HPD accounts. All that nowadays is available for a few dollars, in addition HPD to automated intrusion. That's what I try to say :) There is no real solution about captcha farms for large sites, except non standard email posting verification (or something like that) that consumes too much time even for real users. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpGUI
Hello Lazarus-List, Wednesday, January 12, 2011, 12:18:41 PM, you wrote: MS Thus the Lazarus Form designer does work for fpGUI including visually MS creating TTimer instances. It works for LCLfpGUI, not for fpGUI ;) MS GREAT ! MS So what do I need the external dedicated / additional fpGUI designer for MS ? Can it do additional tricks ? You need external designer to work with pure fpGUI. MS Additional questions: MS Can I hope for some thinks that are broken in the gtk2 Widget set to be MS working with fpGUI ? Such as MS TThread.synchronize (that is said to drop events when system load is high), MS SendMessage - Procedure ..Message (AFAIK, not working in the current MS svn version of gtk2) MS TThread.Queue (not implemented yet :) ) Maybe better make TImage, TBitmap and many other basic things work. In most cases LCLfpGUI will not deliver/handle some, how to call them... maybe advanced, messages like WM_ERASEBGRD because the widgetset does not have such concept, or at least I had not found it :-? -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpGUI
Hello Lazarus-List, Wednesday, January 12, 2011, 4:13:16 PM, you wrote: MS More funny stuff: MS TThread.Synchronize seems to work fine with fpGUI, but with gtk2 I only MS see events when I (e.g.) move the move around on Form. Check my comments in: http://bugs.freepascal.org/view.php?id=18191 -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] fpGUI
Hello Lazarus-List, Wednesday, January 12, 2011, 4:49:35 PM, you wrote: Graeme (or anybody): is it possible to build Lazarus+fpGUI completely from source, i.e. without having a working Lazarus as described at http://wiki.lazarus.freepascal.org/fpGUI_Interface mvwb I don't think so: LCL-fpGUI lacks way too much controls for the Lazarus IDE mvwb to be able to run. And only around 15-20% of non complete WinAPI (with workarounds to make it just work with controls). -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LCL-fpGUI widgetset and COM interfaces
Hello Lazarus-List, Monday, January 10, 2011, 2:27:02 PM, you wrote: GG I'm not well versed in the LCL-fpGUI widgetset code, so if there really GG is an advantage to using COM-style interface in this widgetset, would GG somebody so kind as to explain those advantages. Many thanks. As one of the last commiters :) I can only say that I do not know, just simply use whatever done in code and try to expand and adapt it as much as possible. Currently the lack of regions in fpGUI (At least I had not found them) is driving me crazy, but that's the funny thing :) -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LCL-fpGUI widgetset and COM interfaces
Hello Lazarus-List, Monday, January 10, 2011, 3:37:21 PM, you wrote: Currently the lack of regions in fpGUI (At least I had not found them) is driving me crazy, but that's the funny thing :) GG Not sure what that has to do with my original question, but I'll try and GG answer. Nothing, just bring to my mind as I'm working on it right now :) GG Do you mean methods like the following: GG TfpgBaseCanvas = class( ) GG procedure SetClipRect(const ARect: TfpgRect); GG functionGetClipRect: TfpgRect; GG procedure AddClipRect(const ARect: TfpgRect); GG procedure ClearClipRect; GG end; GG If not, then what is the difference between regions and clip rectangles? GG Where, or for what, would you use regions? A region is more complex, it could have rectangles or any kind of path, so for WinAPI compatibility I had created a simple workaround for rectangles (as far as I know LCL only uses rectangles) and to operate them because you can add cliprects but you can not read the cliprect if it is a combination of two rects. I'm not using regions, is LCL which use them (testing TLabel). Anyway this is becoming off topic ;) -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] invisible break points??
Hello Lazarus-List, Friday, January 7, 2011, 7:54:17 AM, you wrote: GG I have looked into it (at the time), and it seems that if you set a GG breakpoint in the IDE and save the project. Then modify your code so the GG line at which the breakpoint was, is not source code any more (eg: a blank GG line or a comment), the app still breaks at a point close to the original GG breakpoint, but the IDE doesn't show it as a breakpoint (no red dot, and GG not breakpoint listing in the breakpoints window). In my case the reason is that the code where the real breakpoint is located has been removed by the linker (non called code) so gdb sets the breakpoint in the next valid source code line, while editor keeps the original line for the breakpoint position. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] invisible break points??
Hello Lazarus-List, Friday, January 7, 2011, 12:52:46 PM, you wrote: AS Sounds like you had smart linking enabled. As a rule of thumb you AS should have no optimizations enabled when debugging: optimization level AS 0 or 1 and most importantly no smart linking. No, I do not have any kind of smartlinking active and my debug level are always 1 or in some programs 0, never 2 or upper. Maybe is the compiler which removes the code and not the linker (I'm working mostly in Windows). But for sure if the code is not called anywhere and you put a breakpoint there the next executable line will stop the code, 99% of times a function/procedure entry. Ah! another hint, in that cases the breakpoint does not change to invalid breakpoint when run. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] invisible break points??
Hello Lazarus-List, Friday, January 7, 2011, 1:44:22 PM, you wrote: VS Maybe -CX can/should be disabled, but -XX cannot be disabled, VS otherwise all external declaration (for example in the windows unit) VS must be available on the target computer, even if they are not used. VS I don't know how up to date the windows unit is, but I am not sure it VS doesn't contain exports only available in vista or windows 7. This are my settings in one project under Windows XP SP3: -MObjFPC -Scghi -Cirot -O1 -g -gl -gh -WG -vewnhi -l -FiF:\Sources\own\SODO\lib\i386-win32 -Fusynapse -FuF:\Sources\own\virtualmedia\package\lib\i386-win32 -FuF:\Sources\own\varios\streams\lib\i386-win32 -FuF:\Sources\own\components\lib\i386-win32 -FuF:\Lazarus\components\lazcontrols\lib\i386-win32 -FuF:\Lazarus\lcl\units\i386-win32 -FuF:\Lazarus\lcl\units\i386-win32\win32 -FuF:\Lazarus\packager\units\i386-win32 -Fu. -FUlib\i386-win32\ -FEoutput\ -osodo.exe -dLCL -dLCLwin32 I can not see any -XX around :-? Same code executes fine under Win7. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] invisible break points??
Hello Lazarus-List, Friday, January 7, 2011, 2:04:02 PM, you wrote: M Imho the most reasonable course of action is to check at the time the M breakpoint is hit. M So if the IDE stops at a breakpoint, it should check that the breakpoint M actually is at the same place that the debugger stopped. M If not it should present the user with a set of reasonable options: M ignore, remove, disable or relocate breakpoint That looks like a quite good solution, at least it will reduce confusion. M BTW, I never knew this was an issue, I encountered that many times M myself, it never did bother me at all. Until this mails I never saw any M complaint (at least none that I could relate to this issue).., I'm not complaining (misspelled?), I was presenting a description of when I get that behaviour and why. First time that happends to me it was a confusion, but after realialized that the breakpoint was in a dead code everything becomes clear, not ideal but clear. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Help building Lazarus in Linux64
Hello Lazarus-List, I'm trying to setup an Ubuntu10/x64 machine with Lazarus SVN and fpc SVN. For fpc SVN no serious problem, installed a basic 2.4.2 with rtl and compiler from .deb and compiled the 2.5.1 SVN, and installed in a folder under my home. So fpc is installed in /home/joshy/pascal/fpcbin And here is the problem, after solve the fpc.cfg location to be used :) I try to make the Lazarus so used this line: make bigide FPC=/home/joshy/pascal/fpcbin/lib/fpc/2.5.1/ppcx64 It stops with: [0.055] Can't find unit system used by AllLCLUnits so I added the OPT=-va to see where it search the files. At the beginning everything looks fine, with lines like: [0.047] found source file name alllclunits.pp but in the ppcx86 execution I saw something strange from my point of view: [0.047] Free Pascal Compiler version 2.5.1 [2011/01/06] for x86_64 [0.047] Copyright (c) 1993-2010 by Florian Klaempfl [0.047] Path /usr/lib/fpc/2.5.1/units/x86_64-linux/rtl/ not found /usr/lib/... A bit later everything starts to be not found messages :-? What I'm doing wrong ? I can attach my fpc.cfg but I think it is right and there is no reference to /usr/lib/ nowhere in the cfg. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Help building Lazarus in Linux64
Hello Andrew, Thursday, January 6, 2011, 10:02:21 PM, you wrote: AH execute /home/joshy/pascal/fpcbin/lib/fpc/2.5.1/ppcx64 -va | grep AH fpc.cfg from console to see which config file it is loading. AH Then check the paths in that config file. That was my first check ;) It reads the config from /home/joshy/ and the paths in screen are the ones expected /home/joshy/fpcbin/ When I'll be back in the development computer (maybe one hour) I'll attach a complete output for make bigide trying to use this fpc compilation. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Help building Lazarus in Linux64
Hello Andrew, Thursday, January 6, 2011, 10:02:21 PM, you wrote: AH execute /home/joshy/pascal/fpcbin/lib/fpc/2.5.1/ppcx64 -va | grep AH fpc.cfg from console to see which config file it is loading. AH Then check the paths in that config file. Please excuse me, I had found MY!! error. Lazarus seems to be building now fine. -- Best regards, José -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus