Re: [Lazarus] DOM and GTK 1&2: how to set encoding?

2009-04-17 Thread Sergei Gorelkin
Marc Santhoff wrote: > Hi, > > I have a DOM model read from a xml file that has no encoding named > inside it. The var TXMLDocument.Encoding is empty after the file is > loaded. > TXMLDocument.Encoding is currently not functional. The XML reader assumes that files without specified encoding are

Re: [Lazarus] function StabBackTraceStr(addr:Pointer):shortstring; - problem with subsequent back traces

2009-04-15 Thread Sergei Gorelkin
Bogusław Brandys пишет: > There is a problem with this function. To avoid recursion there is a > hack there to point BackTraceStrFunc to system implementation (which > only shows addresses in hex).Long back trace which mostly ends with > incorrect frame address as I suppose (OpenStabs is return

Re: [Lazarus] TFilestream raises exception class 'External SIGSEGV'

2009-04-14 Thread Sergei Gorelkin
Dave Coventry wrote: > ... > Do TFileStream objects not have to be freed? > TFileStream's have to be freed. Your problem is most probably caused by memory corruption somewhere in the skipped part of code. Once the heap is corrupt, any operation that involves allocating or freeing memory may en

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project

2009-04-07 Thread Sergei Gorelkin
Mattias Gaertner wrote: >> >> Btw a little different question : what is needed to allow lineinfo >> reading stack trace from external file (in case of exception) for >> example of the name corresponding to exe name but with different >> extension. FPC can now dump debug info into such separate

Re: [Lazarus] Exception dialog

2009-03-16 Thread Sergei Gorelkin
Michael Van Canneyt пишет: > Hello, > > Is there a reason why the default exception dialog has a cancel > button to kill the application ? > > We often use an exception to signal wrong entry of data or so, > because it stops all further processing. > > If the user then uses the cancel button,

Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Sergei Gorelkin
Michael Van Canneyt wrote: > > Not in delphi 7, I tested ? > > However, it is called when you set EditorMode explicitly to false. > But never by itself. > Yep, I was wrong, details tend to become forgotten with time :( But only partially. It is called when you finish editing by pressing Enter,

Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Sergei Gorelkin
Jesus Reyes wrote: > > Is this different on Delphi? I would like to improve compatibility if it's > not. If OnSetEditText is enough in Delphi to know when editing is finished > then I think we should do it also. > It appears to be different then. In Delphi, OnSetEditText is called multiple tim

Re: [Lazarus] Stringgrid woes...

2009-03-13 Thread Sergei Gorelkin
Michael Van Canneyt wrote: >... > Is there a reason for the current behaviour, and can it be changed ? > With Delphi, I used to check the grid.EditorMode property in OnSetEditText handler, and skip all validations when EditorMode=true. Didn't check this with LCL, but there's a good chance it wo

Re: [Lazarus] Line Ending FPC/Delphi

2009-03-05 Thread Sergei Gorelkin
Felipe Monteiro de Carvalho wrote: > In my projects I usually have a file with only general constants, > which is added by all others. In this file I add the following > declaration: > > {$IFNDEF FPC} > const > LineEnding = #10#13; > {#endif} In Delphi this constant is called sLineBreak. For co

Re: [Lazarus] Zipfiles using Paszlib...

2009-02-14 Thread Sergei Gorelkin
Lee Jenkins wrote: > > I'm confused. Does TZipper produce pkZIP compatible files or is it zlib > based > and only called TZipper? > Yes, it produces pkZIP compatible files and yes, it uses zlib for compression. .zip file format deals only with overall archive file structure (headers, directo

Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Sergei Gorelkin
Michael Van Canneyt wrote: > As far as I know, in Delphi the statusbar updates immediatly, contrary to a > label. > There is a bug in VCL that causes statusbars flicker. It can be fixed by something like not passing WM_ERASEBKGND to DefWindowProc ("something like" is because it was a long time

Re: [Lazarus] Linking to an arbitrary DLL (libusb-win32)

2008-11-28 Thread Sergei Gorelkin
Mark Morgan Lloyd wrote: > ... > When compiled for Linux I've got a simple unit UsbIf that calls Uwe > Zimmerman's translation of libusb.h which includes > > {$linklib usb} > .. > procedure usb_set_debug(level: longint);cdecl;external; > > On the Windows systems the DLL is libusb0.dll and in pr

Re: [Lazarus] Finding out the Hostname of the Computer.

2008-11-27 Thread Sergei Gorelkin
Dave Coventry wrote: > ... > Can anyone see what I'm doing wrong, or offer an alternative way of > getting the name of the computer? A simple result := GetEnvironmentVariable('HOSTNAME'); should do it. Alternatively, you may read the /etc/hostname file just as you read any other text file. Re

Re: [Lazarus] XML and memory loss

2008-10-09 Thread Sergei Gorelkin
Bart wrote: > > Then how can I free those TDOMNodeList objects? I.o.w. how can I get > access to them? > You just put them into a variable and later call Free: var Nodes: TDOMNodeList; ... Nodes := MyNode.ChildNodes; writeln(Nodes[0].NodeName); ... Nodes.Free > I tried that, and it wordk li

Re: [Lazarus] XML and memory loss

2008-10-08 Thread Sergei Gorelkin
Jesus Reyes wrote: > > By the way, and taking the fact that xml files are stored always in utf-8 > encoding it's surprising that for example XMLConfig doesn't have a way to set > a value which is already utf-8 encoded. so, any change to add a methods that > take utf-8 encoded strings as argumen

Re: [Lazarus] XML and memory loss

2008-10-08 Thread Sergei Gorelkin
Bart wrote: ... > > This file is more or less as I excpected it to be (i would think it > would include the encoding="utf-8"). Currently changing the encoding is not supported, and files are always written in utf-8 encoding. According to the XML specs, files without encoding label are read as

Re: [Lazarus] Xml

2008-10-07 Thread Sergei Gorelkin
Graeme Geldenhuys wrote: > I know whitespace is irrelevant in XML, but I always thought there was > a "pretty format" option somewhere. FPCUnit's xml output is formatted > pretty. So is Lazarus's .xml config files. What do they use then? > The specs (DOM level 3 Load and Save) define such an opt

Re: [Lazarus] (patch) File Open dialog start in the directory of active source file

2008-06-09 Thread Sergei Gorelkin
Michael Van Canneyt wrote: > > I think it should definitely be made configurable. > I much prefer the notion of the 'currently active' directory. > > I have many files open, in many directories. Often the current file > (rtl/vcl/fcl whatever files, opened with ctrl-enter on a unit name) > will

[Lazarus] (patch) File Open dialog start in the directory of active source file

2008-06-09 Thread Sergei Gorelkin
Hello, This tiny patch implements a feature which can be found in Programmer's Notepad, and which proves to be very useful (at least to me). It makes the File Open dialog open in the directory of the file which is active in source notebook. Thus, each opened file acts as a filesystem bookmark,