Re: [Lazarus] Ideas for improving lazarus.dci code templates
On Wed, 13 May 2009 16:31:04 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: 2009/5/13 Mattias Gärtner nc-gaert...@netcologne.de: About the default file: The defaults are compiled into the IDE. I know, but that is part of the problem. And it shouldn't be compiled into the IDE. At the moment as soon as you start the IDE for the first time, those defaults are written the users profile directory and into a file called lazarus.dci. Now if the next version of the IDE has new defaults, the users lazarus.dci is not updated. Defaults should not be copied to the users profile directory, they should live in a objectpascal.dci file in the Lazarus install directory. This also makes it easier to for contributors to find the code templates and email patches for updates. Yes, lazarus.dci is an exception and should be changed to follow the other settings - defaults will not be written to disk. The IDE has a 'secondary' config path, where pool admins and package maintainers can put default configs. A secondary config file is copied to the user's config directory, iff no user config exists. i.e. the configs are not merged. I get the idea, but I have never seen this in real life (as far as I know). For example the windows installer sets the fpc search path. The linux packages and OS X packages use the secondaries too. What is the name of the secondary user config file? I always only have the one lazarus.dci file in my ~/.lazarus/ directory. I have searched my $HOME/.lazarus/ directory and I only have one .dci file. When the IDE starts it writes the primary and secondary config directory to stdout. If no primary and no secondary config exists, the IDE uses its defaults. So there is already a chain of defaults. I think adding a further default file only complicates things and will not solve much. Maybe I misunderstood your comment about secondary config files and that it relates more that just to .dci files. I'm thinking in line of something like Project Templates - a directory with default code templates that the IDE reads. You have the default template .dci files for various languages (html.dci, objectpascal.dci, etc..). If the user did not create any custom code templates, no .dci files are in the lazarus profile directory (~/.lazarus) as it only uses the ones in the Lazarus install directory. That way if you add new code templates like your latest one ('ofall' enum template), you simply need to patch the objectpascal.dci file and on the next update, everybody will have it. The lazarus profile directory should just store custom user created code templates. The internals are little bit more complicated but from users pov you are right. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Bug form containing frame inheritance
On Thu, 7 May 2009 23:16:34 +0700 Bambang P bpran...@gmail.com wrote: Hello, I am just trying Lazarus and find a bug with form inheritance when the parent form contains frame. Here is the step to produce it: 1. Create a form Form1 2. Create a frame Frame1 contains a button 3. Place Frame1 onto Form1 4. Create form Form2 descended from Form1 through File - New .. - Inherited Items 5. Change something on Form2 like repositioning the frame. Please create a bug report. So it won't be forgotten. Mattias Compile and run, when Form2 shows up an error message will be poped up: Project raised exception class EComponentError with message: Duplicate name: A Component named Frame1_1 already exists. The problem lies in the lfm file which generated as follows: inherited Form2: TForm2 Left = 452 Top = 67 Caption = 'Form2' inline Frame1_1: TFrame1 == HERE IS THE BUG Left = 48 Top = 96 Visible = True inherited Button1: TButton end end end if I change inline Frame1_1: TFrame1 to inherited Frame1_1: TFrame1 everything goes well. However, there are still some problems: 1. I can't display the .lfm file as Form, lazarus complains class TFrame1 is not found. Manually adding Frame1 to uses clause of unit2.pas solves the problem. 2. As soon you change anything in Form2, the inline Frame1_1: TFrame1 always comes back again. I am using Lazarus 0.9.26.2 on Windows XP. Is this a known bug? ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Packages and file loading
On Tue, 5 May 2009 15:35:13 +0200 Lord Satan reimg...@web.de wrote: Hi everyone, I have a problem with the package I am writing. I have some non-pascal source code which my package must load at compile or run time into a TStringList. But as there is nothing like a $PkgDir macro There is one: $PkgDir(asmodaypkg) I don't know how to find the files at run time. Include files would be my only option at compile time which I don't like as they need at least a token, which means that every source line must be in quotes which makes it impossible to use syntax highlighting for the non-pascal code. Of course I could just put the source into my pascal code but that would be cumbersome, ugly and not easy to maintain. You could create lrs files from arbitrary files: compile tools/lazres.lpi to create tools/lazres ./tools/lazres your.lrs your1.something your2.something ... You can update them manually or write a script/program and execute that before package compile. So as a last option I wanted to copy my non-pascal source files after compilation of the package to a known directory (the plattforms config dir for example). So I wrote a little console app to do that just to realize that I cannot add a program to my package. At the moment I am at a loss what to do now. Is my only option to call fpc myself in the 'after compilation step' of the package compilation to compile my copy tool and after that call the tool to copy the files? Maybe this works for you: Create a package (e.g. yourtool), add the source of your program, uncheck 'use unit'. Then put the command to compile into the 'after compilation step': fpc yourprogram.pas -FE$PkgOutDir(yourtool)/ and check 'Scan for FPC messages'. Then add yourtool as requirement to your main package. Whenever your main package is compiled, the yourtool package is compiled too, which automatically compiles your tool. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] lfm as pascal
On Tue, 5 May 2009 22:10:06 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Tue, May 5, 2009 at 8:36 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: Where is RegisterComponentInit() defined? I search all of Lazarus and FPC 2.2.5 and couldn't find a definition. Sorry. It's only pseudo code. The functions do not exists yet. Just to demonstrate how it could look like. Oops, my bad. ;) Well, power users don't scroll, they fly via shortcuts. Casual users use PgUp/PgDown. That's putting it nicely. My business model units are all fairly big. PgUp/PgDn will just take to long. I the procedure list feature 1000's of times a day. Umm, that would make for an interesting study. A statistics gathering feature for Lazarus IDE. See what is the most used keyboard shortcuts or features used. :) I believe Microsoft did that for the build-up to Office 2007. IMO it is more important what features/functions are not used and would help the user most. AFAIK there was a Delphi plugin that did that. For example: If you use the Search dialog often to search for procedures, then you probably don't know the Ctrl+Shift+Up/Down and procedure list. If you type keywords then you probably don't know word completion. If you often add manually local variables then you probably don't know code completion. And so forth ... Back to topic: The IDE can do some magic, but IMO the units should be kept readable enough for other viewers too. For example diffs will always show big changes in the binary parts of the lfm. Include files will be better for casual users and scale better for big projects. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Editor font disturbed after upgrading to r19705
On Fri, 01 May 2009 10:48:19 +0200 Bernd Mueller muelle...@gmx.net wrote: [...] The class TForm1 is mixed then. See attached screen shot. Sorry. My fault. I fixed that an hour ago in svn r19726. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] File region locking under Linux
On Fri, 01 May 2009 17:10:09 +0200 ajv a...@vogelaar-electronics.com wrote: I have a problem with file region locking under Linux. First I start setup to create a file and writelock range 10..30 Wrong list. This question is better asked on the FPC mailing list. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus IDE crash on Centos 5.3 x86
On Wed, 29 Apr 2009 17:53:13 -0300 Carlos German Tejero german_tej...@yahoo.com.ar wrote: I install fpc and lazarus Lazarus 0.9.27 r19639 from daily snapshot, and when start lazarus, it crash. I start lazarus from a terminal and the output is: GetStyleWithName adding menuitem to menubar TMainIDE.ParseCmdLineOptions: PrimaryConfigPath=/root/.lazarus You can start lazarus as normal user instead of root. SecondaryConfigPath=/etc/lazarus NOTE: editor options config file not found - using defaults NOTE: miscellaneous options file not found - using defaults NOTA: No se ha encontrado el archivo de configuración de las CodeTools - usando valores por defecto NOTE: help options config file not found - using defaults TMainIDE.DoNewProject A TCustomFormEditor.CreateComponent Form1:TForm1 True TMainIDE.The program 'lazarus-ide' received an X Window System error. This probably reflects a bug in the program. The error was 'BadValue (integer parameter out of range for operation)'. (Details: serial 3718 error_code 2 request_code 53 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) Strange is that it works well on a centos 5.2 x86. Any ideas?? X errors typically means memory corruption, which typically is caused by: a) uncommon libraries b) you had bad luck and got a buggy lazarus snapshot c) hardware Try another theme, try rebooting (to make sure you have no pending library updates), try another lazarus version, try another fpc version, try another window manager, etc. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory
On Tue, 28 Apr 2009 12:47:20 +0200 Bart bartjun...@gmail.com wrote: On 4/28/09, Mattias Gaertner nc-gaert...@netcologne.de wrote: Bart schrieb: I'm not even sure that Extended has the same size on all platforms. [...] And on some machine extended can be a double. Mattias And so they probably do not have the same size ...? Another thougth. Are you gonna run int endian-ness problems when reading files on a Mac that are created on a PC? Yes, see here http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide#Endianess Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory
On Tue, 28 Apr 2009 08:16:04 +0200 Vincent Snijders vsnijd...@vodafonevast.nl wrote: Hans-Peter Diettrich schreef: Bart schrieb: I'm not even sure that Extended has the same size on all platforms. What size might it have, other than the FPU defined size? what FPU? What if some FPU does not support 80 bits floating point, but does support 128 bits floating point, then the extended type may be 128 bits. Similar things happened with 'integer' too, it grew from 16 to 32 bits. I know that you know this, but for the others: integer is 32bit on 64 bit machines too. AFAIK integer is only 16bit in mode tp. And on some machine extended can be a double. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory
On Tue, 28 Apr 2009 15:23:42 +0200 Roland Turcan k...@rotursoft.sk wrote: 27.4.2009 19:26 - Mattias Gaertner nc-gaert...@netcologne.de MG Use packed records and add gap variables. U, look at this: TYPE TPackedGap =PACKED RECORD VarInteger :INTEGER; Dummy1 :INTEGER; VarDouble :DOUBLE; VarBoolean :BOOLEAN; VarBoolean2:BOOLEAN; Dummy2 :Word; Dummy3 :INTEGER; END; ... and I would expect, that the binary representation of this definition will keep the order of variables from definition, but it doesn't. It does. Could somebody explain what rules is applied to change the order of variables in memory? You forgot to explain why you think that the order is wrong. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] New code macro OfAll
Hi testers, I implemented a new code macro for case statements. http://wiki.lazarus.freepascal.org/New_IDE_features_since#code_macro_OfAll Update your svn and follow the instructions on the wiki. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] New code macro OfAll
On Tue, 28 Apr 2009 18:20:26 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Tue, Apr 28, 2009 at 5:38 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: http://wiki.lazarus.freepascal.org/New_IDE_features_since#code_macro_OfAll I uploaded a new version of your animated image - optimized the file size. I got the file down from 279,420 bytes (rather large) to only 39,010 bytes. :-) Thanks. PS: I'll write the Animated Gif wiki page tomorrow to explain what I do. I'm waiting ... Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] EXC_BAD_ACCESS, Could not access memory
On Mon, 27 Apr 2009 17:27:30 +0200 Roland Turcan k...@rotursoft.sk wrote: Hello Dmitry, Thanks for your reply, but I think, that you haven't understood me what I am trying to explain. I have binary contents which are copied from memory using by an application which is written in Delphi. I am porting an application to MacOS X 10.5, but I need to use the same structures as I have in Delphi and Kylix where NOT PACKED records are aligned. The fact is, that FPC compiler on intel based Mac OS X builds up application which contains records packed by 4 bytes by default. Use packed records and add gap variables. I need to get the same behavior in intel based mac os x as I have in other platforms. What should I do to build FPC compiler which will behave the same on all platforms. This won't work. The other sources and libs expect another alignment. FPC uses the various alignments for good reason. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Invalid component names
On Sun, 26 Apr 2009 19:54:58 +0200 Hans-Peter Diettrich drdiettri...@aol.com wrote: Gabor Boros schrieb: Dynamically created components have empty name after creation on Win32 too. This thing is true for Delphi too. This is normal I think. Right, I was misleaded by different settings in my various test projects. Only forms get an unique name, and this works in Lazarus as well as in Delphi. So the remaining question is: How to assign unique names to dynamically created components? Does there exist an immediately usable method or function? Empty names seem to be harmless, but every attempt to assign an non-empty and already used name to a component results in an exception. What's the scope (list of names...), within which every component must have an unique name? Have you looked at TComponent.SetName? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WSRegister error on console application
On Fri, 24 Apr 2009 19:22:35 +0200 Vincent Snijders vincent.snijd...@gmail.com wrote: Andrea Mauri schreef: Dear all, I have a cross-platform console application project. The project were compiled with no problem but actually when I compile it I get the following errors (WinXp lazarus svn fpc 2.2.4). I got this error both with fpc 2.2.2 and fpc 2.2.4, I don't know exactly when this error appears (the svn revision number of lazarus). Suggestions? Remove the dependency on the LCL. Or if it must depend on the LCL, include uses interfaces to the main program. or use only the non visual units. For example lclproc, translations, etc. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Production
On Fri, 24 Apr 2009 15:15:30 -0300 Osvaldo Filho arquivos...@gmail.com wrote: Could i use my comments/class completion in-line (ctrl+space), etc ? I don't understand. Can you give more details / an example. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Code-completion on erroneous code [0008663: codetools behaviour / attn: Benito]
On Thu, 23 Apr 2009 13:19:48 +0100 Martin laza...@mfriebe.de wrote: This is a follow up to http://bugs.freepascal.org/view.php?id=8663 1) When the code contains a critical error, pressing Ctrl+Space the cursor moves to this point. I think it would be better just to mark the error (e.g line highlighting), because the error is due to the incompleteness of the code. So what should happen? If the code indeed has an error, then it must be fixed. And code-completion will not work until it has been fixed. - If it was simply highlighted, then the user will (at some time) have to go there by hand. So that (imho) is less convenient. And the position may not be in the visible area, so the user would not notice. Or the user may have continues to type, that usually makes line highlight disappear. - On the other hand, the current behaviour triggers an unexpected jump, and (for me) it always takes a second or two, to figure out what just happened. So what other options are there? Ideas: - code tools display a drop-down, but it simply has an entry, pointing to the error. The entry can be selected (cursor-down-key; then enter) and you jump to the error location. Continue typing, or pressing escape would keep you at your current location. Sounds reasonable. We should test how it works. - instead of a drop-down a hint could be shown - we could keep jumping to the error immediately (as current); but make some extra visible hint, what and why happened (display a hint / highlight the word in red / if still within the visible area, highlight the original position too) And maybe give a hint that you can jump back with Ctrl-h. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Installing Lazarus in OS X from SVN
On Wed, 22 Apr 2009 20:34:07 -0700 Ron Grove ron.gr...@me.com wrote: I decided to update to the latest 2.2.4 compiler so I cleaned out the 2.2.2 install and deleted the Lazarus from the website that I was using. Decided I'd live on the wild side and try to use the SVN version like I do in Windows. On OS X I had been using the download version from last year. Worked fine, but it looks like there's a lot of activity with Lazarus on OS X so I wanted to take a shot at the svn version. Also installed the latest QT so I could see how that was coming. I've compiled it using the information here: http://wiki.lazarus.freepascal.org/Carbon_Interface The compilation appears to go just fine but no .app is created. Is that expected? I try and run it from the command line with ./lazarus and a popup appears saying it can't find the FPC source folder (I put it in /usr/share/fpcsource which I saw referenced somewhere). I try and hit the ignore button but it doesn't respond to the clicks. I can move the window around, but that's it until I hit CTRL-C to kill the app. Hopefully this will give someone an idea. That's normal when starting without lazarus.app. The lazarus.app comes with the svn sources. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Code Observer notes
On Tue, 21 Apr 2009 14:20:55 +1100 Alexander Klenin kle...@gmail.com wrote: 1) The name is good, if somewhat reminiscent of market-speak. Buy our Lazarus -- now with Code Observer (tm) ;-) 2) The body of empty procedure is superfluously detected as empty block. empty procedures can contain comments. I don't see a problem with listing a completely empty block in two categories. 3) Perhaps 'Create' and 'CreateFmt' should be added to the list of functions ignoring constants? raise Exception.Create('Error text') is a common construct. As Paul said, these are normal texts and are therefore not in the default list. If you use them otherwise you can add them to your personal list. 4) I still think ' ' (space) should be added to the list of ignored constants -- for those who prefer to turn single-char constant detection on. Why ' ' and not #10 or #13 or #0? 5) 'Show Code observer' group box should better be named 'Show observations' 6) Some kind of sorting is necessary for the observations in the box. Perhaps at least alphabetical? A patch is welcome. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Code Observer notes
On Wed, 22 Apr 2009 01:54:57 +1100 Alexander Klenin kle...@gmail.com wrote: On Tue, Apr 21, 2009 at 19:45, Mattias Gaertner nc-gaert...@netcologne.de wrote: 4) I still think ' ' (space) should be added to the list of ignored constants -- for those who prefer to turn single-char constant detection on. Why ' ' and not #10 or #13 or #0? It is by far the most common. I doubt that: lazarus sources: #10: 911 #13: 1425 #0: 1125 ' ': 1740 Without debug calls there are only about 1000 ' '. fpc sources: #10: 1213 #13: 5766 #0: 2384 ' ': 1846 Without debug calls there are only about 1500 ' '. Also, unnamed #10 and #13 might indicate platform-dependent line endings usage. And ' ' might indicate i18n problems. 5) 'Show Code observer' group box should better be named 'Show observations' 6) Some kind of sorting is necessary for the observations in the box. Perhaps at least alphabetical? A patch is welcome. http://bugs.freepascal.org/view.php?id=13551 BTW, can you please also review http://bugs.freepascal.org/view.php?id=13501 ? It followed from our previous discussion. I will take a look. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Figures in code explorer
On Mon, 20 Apr 2009 09:08:33 + (UTC) Duncan Parsons laza...@dsparsons.co.uk wrote: [...] Maybe it should be 'Go figure(s)'... So what have we got so far? Figures Statistics Style Hints Analytics Metrics Formatting .. Well, it's kinda all of them.. Whilst it isn't a very 'hip and happening' term, it strikes me that they are Observations about the code structure, formatting, etc. Maybe 'Code Observer' would suit? I like that. It fits and is unique enough. :) Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Figures in code explorer
On Tue, 21 Apr 2009 09:25:13 +1100 Alexander Klenin kle...@gmail.com wrote: On Mon, Apr 20, 2009 at 20:50, Mattias Gaertner nc-gaert...@netcologne.de wrote: About (4d) - single line begin..end Maybe you can give an example when this is not about code formatting? I just mean that removing non-whitespace characters is not formally 'formatting'. I agree it is gray area. FYI: The jedi code formatter can add semicolons. A good formatter is very flexible and has a lot of options to fine tune indentation and line break. IMO complex expressions which can not be automatically broken nicely, should be changed anyway. Maybe the code explorer should show deeply nested expressions. Or simply expressions with too many tokens, regardless of nesting. You can create a lot of tokens without getting complicated: if (Nodenil) and (Node.TheType=something) and (Node.Parentnil) and (Node.Parent.TheType in [bla,bla,bla]) and (Node.Parent.NextBrothernil) then Long lines depends on right margin and this heavily depends on programmers choice. For example if you set your right margin to 80 and you open a unit of other programmers the code explorer will easily list thousands of long lines. A performance killer. Is not it O(total number of lines) anyway? I do not see how a performance could depend on that. Reading is far less expensive than creating a TTreeNode with an icon, a text and data. And don't forget that the tree nodes must be sorted. If you are worried about the number of items found, then I suggest to implement a generic limit of, say, 100 items. 100'th item should contain 'too many items found' text. Yes. But we have already more than ten categories and I guess we can easily get twenty. I guess the only solution is to parse only til the first occurence and read the rest only on demand. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Figures in code explorer
On Sun, 19 Apr 2009 20:28:31 +1100 Alexander Klenin kle...@gmail.com wrote: New figures feature is an excellent addition, thanks Paul and Mattias! It already motivated be to fix some stylistic problems in one of my projects ;-) A few questions/suggestions for improvement: 1) Where did the name came from? It is totally meaningless for me. See http://www.askoxford.com/concise_oed/figure?view=uk Maybe 'Stylistic notes' or 'Style' or something along these lines? Not all are about style. 2) What is wrong with published properties without default? See http://wiki.freepascal.org/User_Changes_2.2.4#Default_property_values If a property is streamed without need it 1. increases the size of the lfm 2. makes updating error prone, because even useless properties are streamed. For example if a property was introduced and later removed/renamed it is still in the lfm and the compiler does not notice. The LCL had the last case a few times in the last years and every time you have to check all lfm files. Therefore the LCL has a built in list of ignored properties. 3) I also like that codeexplorer options are now integrated with the common dialog, however: 3a) Maybe 'Enable figures' checkbox should be moved to or duplicated on the 'Figures' page? Yes. But I'm biased about duplicate or move. 3b) Maybe option 'parameters', lice line/procedure counts, should be placed near the corresponding checkboxes? 3c) What is the reason for 'search char constants' option? I think it should just be always on. IMO char constants like #10, #13, 'a' or ' ' don't need to be listed. 3d) I think '' (empty string) should be added to the default list of ignored constants. IMO no one wants to see empty string constants in this list, so no need for an option. 4) A few wishes/feature requests: 4a) 'Empty procedures' should not trigger if the procedure has comment in the body, to take care of a common idiom: procedure TMyClass.Proc; begin // do noting end; The figures are hints, not warnings. I already found with this feature some empty methods with comments that were useless and could be removed. 4b) Add 'Unsorted procedures' similar to 'unsorted members' I rarely have seen units where all procedure are sorted alphabetically. Same for enums, types, variables and constants. 4c) Add 'Empty begin..end' block, probably with the same check for the comments as in (4a) 4d) Add 'Single statement in begin..end block' 4e) Add 'Too many nesting statements' and 'Too many nesting procedures' 4f) Add 'Line loo long' with default limit of perhaps 80 or 90 characters. 4g) Add 'Incorrect indentation' for the cases where indentation does not correctly represent statement nesting. Are you joking or are you a grammar nazi? 4h) Add 'Fixme' similar to 'TODO' AFAIK the todo list is not yet customizable. If you extend it, the code explorer will be extended too. 4i) This is probably an unrelated issue, but 'TODO' is only recognized inside multi-line {} comments, not inside single-line (//) ones. Fixed. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Figures in code explorer
On Mon, 20 Apr 2009 02:03:30 +1100 Alexander Klenin kle...@gmail.com wrote: On Mon, Apr 20, 2009 at 01:28, Paul Ishenin webpi...@mail.ru wrote: Martin Friebe wrote: Hm, while some of them probably are most likely to be used to find possible issues, there is no need to see them as an problem indicator only. So point 1 is correct as they are a collecion of numbers figures Still, maybe they would be better named as statistics? (maybe analytics ?) I would call them IDE Hints or Code Hints. But Figures are also ok for me. My main point with the name is usability. The name should convey at least something about the named object to an unprepared reader -- this is an important rule both in programming and interface design. So yes, 'code hints', 'analytics' -- anything suggested in this thread is better than 'figures'. (Not 'statistics', however, which, by the way, would be another interesting feature) I thought about 'statistics', 'hints' and some more and IMO they are all misleading. The new section should sum up and/or list all kinds of noteworthy numbers, places, lines, structures and facts of the current unit, that don't fit into the other categories. These combine several different types of categories like: -unoptimized code/left over: e.g. empty methods -code formatting: e.g. unsorted members -readability/needs refactoring: e.g. long procedures, unnamed constants -comments: e.g. todos -... About 'statistics': statistics are about summarizing and interpretation. None of the current categories fit into this description. About 'hints': Theoretically you can define 'hint' very generic: some message about a pascal source. But then the term 'hint' becomes almost meaningless and every time a user user reads about 'hint' he doesn't know whether it means fpc hint or lazarus hint. Just like the word 'package' has more than five meanings on this mailing list. IMHO the term 'hint' has already enough meanings. Modelmaker has a similar feature called 'live metrics', which fits, because they mostly list code formatting and readability categories. But IMO the category 'code formatting' is questionable. All other categories list things, that need some manual attention - the programmer must decide if and how to change it. OTOH 'code formatting' can be applied safely. If you don't like long lines, then you need a tool to break them. When such a tool exists, you don't need a tool to show where the long lines are, you just need a flag: this unit needs code formatting. Instead of adding code explorer categories 'unsorted procedures' it makes more sense to improve the jedi code formatter and its lazarus integration. In fact, I added the 'unsorted members' categories just as demonstration and speed test. Another argument for 'figures' is this: At the moment the items are listed in the tree. Eventually the lists should be moved to a second tree below, where some context buttons are shown. Additionally this would waste less space and update time. Then the current tree will only list the available categories and the total numbers, which is afaik often called in English 'figures'. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Figures in code explorer
On Mon, 20 Apr 2009 00:00:07 +1100 Alexander Klenin kle...@gmail.com wrote: On Sun, Apr 19, 2009 at 22:02, Mattias Gaertner nc-gaert...@netcologne.de wrote: A few questions/suggestions for improvement: 1) Where did the name came from? It is totally meaningless for me. See http://www.askoxford.com/concise_oed/figure?view=uk Hm. I'll quote that: figure, noun: 1 a number or numerical symbol. 2 an amount of money. 3 a person’s bodily shape, especially that of a woman. 4 a person seen indistinctly. 5 an artistic representation of a human or animal form. 6 a shape defined by one or more lines. 7 a diagram or illustrative drawing. 8 (Music) a short succession of notes producing a single impression. Not one meaning correspond to 'a hint about possible problem in the code'. Maybe 'Stylistic notes' or 'Style' or something along these lines? Not all are about style. At least it will give user a vague idea what it is ;-) How about simply 'hints'? See my other mail why not using 'hints'. 2) What is wrong with published properties without default? See http://wiki.freepascal.org/User_Changes_2.2.4#Default_property_values If a property is streamed without need it 1. increases the size of the lfm 2. makes updating error prone, because even useless properties are streamed. For example if a property was introduced and later removed/renamed it is still in the lfm and the compiler does not notice. The LCL had the last case a few times in the last years and every time you have to check all lfm files. Therefore the LCL has a built in list of ignored properties. These are all good arguments, but _against_ the removal of 'default default' property values. IMHO the FPC's team decision is wrong, but I think it is too late ;-( Now I have to to bloat my code with 'default false' lines, which were not necessary before. Both ways are not optimal, but now it is at least Delphi compatible. I see the reason for the hint now -- but I think it should be made a FPC warning then. A warning will annoy more than it helps. 3b) Maybe option 'parameters', lice line/procedure counts, should be placed near the corresponding checkboxes? 3c) What is the reason for 'search char constants' option? I think it should just be always on. IMO char constants like #10, #13, 'a' or ' ' don't need to be listed. Maybe, but how about #34 or 'ё'? Char constant may be just as magical as any other ;) That's why it is optional. 3d) I think '' (empty string) should be added to the default list of ignored constants. IMO no one wants to see empty string constants in this list, so no need for an option. But it _is_ shown now. Where? 4b) Add 'Unsorted procedures' similar to 'unsorted members' I rarely have seen units where all procedure are sorted alphabetically. Same for enums, types, variables and constants. Well, same for methods and properties. True. Although private sections are mostly created by class code completion, which sorts. Does LCL have one unit where 'unsorted members' list is empty? IMO alphabetical sorting makes only sense if you have no obvious logical sorting, OR if you prefix every member, so that alphabetically and logically sorting produce the same results. Still, this list is IMO useful and so it is for procedures. See my other mail why such things are better be done elsewhere. 4c) Add 'Empty begin..end' block, probably with the same check for the comments as in (4a) 4d) Add 'Single statement in begin..end block' 4e) Add 'Too many nesting statements' and 'Too many nesting procedures' 4f) Add 'Line loo long' with default limit of perhaps 80 or 90 characters. 4g) Add 'Incorrect indentation' for the cases where indentation does not correctly represent statement nesting. Are you joking or are you a grammar nazi? Well, 'grammar nazi' can not exist for a compiled language, since compiler will simply reject grammatically incorrect source. So you probably mean 'stylistic nazi'. Well, yes, actually I am ;-) ;) And you want the IDE to be a stylistic nazi like yourself. Well in some way I understand you. I don't like macros and I will eventually add a category to list all macros. But IMO it is more important to provide a tool to help fixing these things. Which means for the examples you gave ... [...code formatting like indentation, empty or long lines...] ... a code formatter. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Figures in code explorer
On Mon, 20 Apr 2009 00:56:06 +0200 Marc Weustink m...@dommelstein.net wrote: Mattias Gaertner wrote: On Sun, 19 Apr 2009 20:28:31 +1100 Alexander Klenin kle...@gmail.com wrote: 4b) Add 'Unsorted procedures' similar to 'unsorted members' I rarely have seen units where all procedure are sorted alphabetically. Then you have never seen mine. In order to find way in my code I tend to sort all my methods. :) For me alphabetically sorting is like the index at the end of a book. Logical sorting is like the directory at the beginning of a book. Both are useful, although with current search tools you hardly need the index anymore. The problem with logically sorting is that it is still hard to implement. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] AutoCreate with Forms from a Package (.lpk)
On Sat, 18 Apr 2009 15:45:25 -0300 Osvaldo Filho arquivos...@gmail.com wrote: Is it possible i use AutoCreate statement ( and component comunication like datasource-dataset) with a form in a package? One project use a package (.lpk) Forms on project use datamodules components in a package. At runtime it should already work. It does not yet work at designtime. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DOM and GTK 12: how to set encoding?
On Fri, 17 Apr 2009 15:13:37 +0200 Marc Santhoff m.santh...@web.de wrote: [...] 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. [...] How can make GTK 2 show those chars as in GTK 1? convert the xml file to UTF-8 OR convert the xml file before passing it to the xml reader OR convert the strings before passing them to the LCL See unit lconvencoding GuessEncoding and ConvertEncoding. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Notes on 'remove unused units' codetool
On Sun, 12 Apr 2009 13:21:47 +1100 Alexander Klenin kle...@gmail.com wrote: I tried a new 'remove unused units' refactoring, and in general I like it. A few nits: 1) Tree nodes should not be editable. Fixed. 2) After removing first unit in the uses clause, the extraneous space is left before the next unit name. Fixed. 3) A 'select all' button would probably be useful Added. 4) Icons used are strange. I think standard 'unit' icon should be used instead of current one. 'Implementation' icon is good, but 'Interface' icon is totally unrecognizable for me. Same icons as in the code explorer. Make a proposal. 5) I think this should be a project-wide feature, not unit-wide. Beware: The algorithm does not check recursively (e.g. the inherited initialization sections) and the .lpr file contains a lot of 'unused' units. For example the thread manager, the memory manager or the 'interfaces' unit of the LCL. If someone uses this dialog and simply removes all 'unused' he will make his program unrunnable. I am not sure how hard it is to implement, I know a good IDE. but I see two interface variants: 5a) (Preferably) A common tree of all units in project, with subtrees for each unit. Sounds like the unit dependencies window. 5b) A combobox to select a unit, with a tree for the unit selected. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OT: Namespaces?
On Tue, 7 Apr 2009 15:32:28 +0200 zeljko zel...@holobit.net wrote: On Tuesday 07 April 2009 15:11, Mattias Gärtner wrote: AFAIK under Delphi the 'in' modifier has two purposes: - mark the unit as part of the project - use a unit from a directory which can not be added to the unit search path, because there is a duplicate. Lazarus uses same logic isn't it ? It does not. What belongs to the project is stored in the .lpi. The codetools support the 'in' modifier and so does the lazarus IDE a bit. But the IDE does not update the 'in' file names and it does not have any special consistency checks for them. So use them only if you know what you are doing. The converter for delphi projects supports them (fix the file cases, adds them to the lpi). I already have such projects where I must use in like in delphi. Please give a complete example. Maybe you are doing something wrong. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Large program size - 1.8 MB for empty GUI project
On Tue, 07 Apr 2009 17:32:58 +0200 Bogusław Brandys bran...@o2.pl wrote: Marc Weustink wrote: Graeme Geldenhuys wrote: 2009/4/7 Mattias Gärtner nc-gaert...@netcologne.de: Uses sections in implementation sections are buggy as long as I know fpc. The problems are known but apparently too hard to track and fix. The bugs appear at random and with various degrees depending on platform and fpc version. In some years you think the bugs are fixed, and then they come back. You have been warned: Don't use the imp sections. I thought this was known: http://wiki.lazarus.freepascal.org/DesignGuidelines This is the first I here of this. I was always taught to limit the usage of the Interface section's uses clause, so you can prevent circular unit issues. So is FPC the opposite of Delphi in this regards? No, but the problem is caused by the way fpc stores info in the .ppu Somehow it is possible that the checksum of the interface part stored in the .ppu is affected by the implementation section. When editing sources this can lead to strange results, the compiler might think in some cases an interface is changed or not. When Lazarus started we put a lot in the uses section of the implementation part. When some source was changed, sometimes a 3 or fourtime compile attempt was needed to compile the while LCL, since everytime the compiler thought a unit was changed whil it was not. Restarting compilation (and keeping the existing units) in most cases resulted in a compiled LCL. To avoid this and to make the LCL usabole as library, most unit cirles were removed. One way to ensure that is by putting all uses in the interface section. I have used FPC since 2.0.2 under Linux and Windows and haven't had any issues. I limit the usage of interface uses clause as much as possible. I believed that is why the smartlinking works so well with fpGUI - I can create a GUI application that is only 340KB in size. It might depend on how you compile fpGUI. Anyway, back to the subject, I cannot imagine why FPC when smartlinking makes a difference between interface and implementation uses. Especially if you use an external linker, like on linux. Marc Doesn't it require anyway recompilation of all lcl units with -CX option (smart linkable) ? 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 file. Such feature would be very useful as compilation option for example. Write a lineinfo unit that supports the external file. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Loading a from layout from external file
On Tue, 7 Apr 2009 00:04:47 +0300 ik ido...@gmail.com wrote: Hello, Is there a way to load a form layout (lfm) on runtime ? See here http://wiki.lazarus.freepascal.org/Streaming_components#Writing_and_Reading_components_from.2Fto_LFM Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Building Lazarus SVN on Mac OS X 10.4 intel
On Tue, 31 Mar 2009 22:03:12 +0200 Roland Turcan k...@rotursoft.sk wrote: Hello lazarus project! How should I call compiler to get Lazarus IDE running on MacOS X 10.4. I can build lazarus fine, but after start it shows: dyld: Library not loaded: /usr/lib/libiconv.2.dylib Referenced from: /usr/local/share/lazarus/lazarus.app/Contents/MacOS/lazarus Reason: Incompatible library version: lazarus requires version 7.0.0 or later, but libiconv.2.dylib provides version 5.0.0 See here: http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips#Compiling_under_10.5_for_10.4_and_below Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Unable to find the unit if the component class TNoBackPage
On Wed, 11 Mar 2009 11:30:52 +0100 Roland Turcan k...@rotursoft.sk wrote: Hello lazarus project! I have my own component, which successfully installed into Lazarus. When I use this component on any form after reopening/reloading form it reports an error. That is a simple notebook implementation with no background to get pages transparent. That component's unit contains: unit NoBackNotebook; INTERFACE USES LMessages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, LCLType; TYPE TNoBackPage = class(TCustomControl) private ... TNoBackNotebook = class(TCustomControl) private FPageList: TList; FAccess: TStrings; FPageIndex: Integer; ... IMPLEMENTATION type TNoBackPageAccess = class(TStrings) private PageList: TList; Notebook: TNoBackNotebook; constructor TNoBackNotebook.Create(AOwner: TComponent); const SDefault = 'Default'; begin inherited Create(AOwner); Width := 150; Height := 150; FPageList := TList.Create; FAccess := TNoBackPageAccess.Create(FPageList, Self); FPageIndex := -1; FAccess.Add(SDefault); PageIndex := 0; Exclude(FComponentStyle, csInheritable); if not Registered then begin Classes.RegisterClasses([TNoBackPage]); Registered := True; end; end; -- LFM file contains of form contains: ... object NoBackNotebook1: TNoBackNotebook Left = 184 Height = 150 Top = 104 Width = 150 TabOrder = 1 object TNoBackPage Left = 0 Top = 0 Caption = 'Default' end end ... --- When Lazarus starts this is reported: TMainIDE.ParseCmdLineOptions: PrimaryConfigPath=/Users/test/.lazarus SecondaryConfigPath=/etc/lazarus NOTE: help options config file not found - using defaults TMainIDE.DoLoadLFM A /usr/local/share/lazarus/rotursoft/tests/components/unit1.pas IsPartOfProject=True QuickCheckLFMBuffer LFMBuffer=/usr/local/share/lazarus/rotursoft/tests/components/unit1.lfm FindMissingClass :TNoBackPage IsInherited=False TMainIDE.DoLoadLFM loading nested class TNoBackPage needed by /usr/local/share/lazarus/rotursoft/tests/components/unit1.pas TMainIDE.DoLoadComponentDependencyHidden /usr/local/share/lazarus/rotursoft/tests/components/unit1.pas AComponentClassName=TNoBackPage AComponentClass=nil TCarbonBitBtn.SetFocus Error: SetKeyboardFocus failed with result -30585 TCarbonBit --- The fact is, that this component was working in October 2008 when I used my project, but latest build I am using not. Thanks for all ideas what I can change. Have you tried to register the class TNoBackPage earlier, for example in a Register procedure? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] speed of SynEdit [Re: Wiki pages suggestion - feature comparison]
On Tue, 24 Feb 2009 11:36:25 +0100 Marco van de Voort mar...@stack.nl wrote: On Tue, Feb 24, 2009 at 05:43:37AM +0100, Hans-Peter Diettrich wrote: I think the problem that is bigger than such a cache is mem management. SynEdit keeps allocating/deallocating a lot = that leads to fragments in the fpc mem-mgmt = and that could cause a slow down.. Now I could spot the trouble source: it's fpdoc! Interesting, I'm just optimizing a part of that. http://bugs.freepascal.org/view.php?id=12953 What exactly is slow in fpdoc? I guess he meant the fpdoc editor in the IDE, not the fpdoc program. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] speed of SynEdit [Re: Wiki pages suggestion - feature comparison]
On Tue, 24 Feb 2009 16:01:07 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Marco van de Voort schrieb: Now I could spot the trouble source: it's fpdoc! Interesting, I'm just optimizing a part of that. http://bugs.freepascal.org/view.php?id=12953 What exactly is slow in fpdoc? IMO it's the search for documentation information about the current identifier in the edit window, started for almost every move of the caret. If that's the reason for the excessive slowdown of the editor, the search should be performed by a background thread, so that the editor is not blocked. The search should be terminated immediately, when the caret moves to an different identifier. At the moment the fpdoc editor is updated on idle in several steps. Maybe the update should be started after a short delay. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] speed of SynEdit [Re: Wiki pages suggestion - feature comparison]
On Tue, 24 Feb 2009 05:43:37 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Martin Friebe schrieb: I think the problem that is bigger than such a cache is mem management. SynEdit keeps allocating/deallocating a lot = that leads to fragments in the fpc mem-mgmt = and that could cause a slow down.. Now I could spot the trouble source: it's fpdoc! Why do you think so? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Design Surface
On Sat, 21 Feb 2009 20:02:33 -0500 Lee Jenkins l...@datatrakpos.com wrote: Is there anyway re-use the designer surface of the IDE? I have a component for this in delphi, but I'm thinking of trying the project in Lazarus. There is a LCL function GetDesignerDC to get a DC to paint over everything on the form. Other features like markers, grid, selection, moving, popup menu are part of the IDE and not re-usable. Of course you can copy IDE code under the terms of the GPL. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Please help with strings dissappearing - because of funny non-ascii chars
On Sun, 22 Feb 2009 17:49:01 +0200 Reenen Laurie rlau...@gmail.com wrote: This solution worked... s := stringReplace(s,chr(148),'',[rfReplaceAll, rfIgnoreCase]); s := stringReplace(s,chr(147),'',[rfReplaceAll, rfIgnoreCase]); s := stringReplace(s,chr(150),'--',[rfReplaceAll, rfIgnoreCase]); s := stringReplace(s,chr(146),,[rfReplaceAll, rfIgnoreCase]); However this car is also giving me issues: é There is not equivalent... only e... Or is that é and alt 130 (é) different? But this must be a problem that's happened a lot before? Not so? The LCL unit lconvencoding contains a function to convert CP1250 to UTF8: CP1250ToUTF8 Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] StringGrid.Options: goSmoothScroll vs goThumbTracking
On Thu, 19 Feb 2009 10:31:01 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Thu, Feb 19, 2009 at 10:18 AM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: But what do they do on there own? goSmoothScroll - I first thought this is what I wanted as described above, but on it's own it don't do that. goThumbTracking - isn't this supposed to be the same as goSmoothScroll, compared to jumping columns or rows at a time. OK, I think I figured it out. goSmoothScrolling - scrolls pixels at a time, not columns/rows. goThumbTracking - gives you a like preview of the contents as you move the scrollbar. Now isn't it a bit pointless having goSmoothScrolling enabled, but goThumbTracking disabled by default? The content might scroll per pixel, but you don't see any content updating until _after_ you release the scrollbar thumb button. I would think the more logical default would be to have both there options enabled by default. I'm using 0.9.26 and they are not both enabled by default. PS: If my description of these options are correct, I'll update the Grid docs and send a patch. Has Delphi goThumbTracking and what is it the default value there? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking and Layout managers
On Mon, 09 Feb 2009 23:03:47 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Mattias Gärtner schrieb: At least 90% of TWinControl is about its child controls. The rest is mostly key, mouse and focus handling. I guestimate, TContainerControl will have about 1-3kloc code, 500loc will stay in TWinControl and the remaining 4-6kloc will go to the new docking/layout classes. There is no question, that such a big change is Delphi incompatible. Not at all. Do you mean: a) There no question at all that it will be Delphi incompatible b) It will not at all be Delphi incompatible, because TWinControl will not change ? The question is how much: - A lot of code (outside the LCL) relies on the fact, that AControl.Parent is a TWinControl and has a handle (exact: can have a handle). When a GUI is made of traditional components, then the parents will be TWinControls, of course. A form will continue to inherit from TWinControl... I didn't doubt that. Maybe you can give more details how the gt protected props/methods of TWinControl should change? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking and Layout managers
On Sun, 08 Feb 2009 07:50:50 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: I'd suggest a layout layer, between TControl and TWinControl, dealing with child controls (e.g. TContainerControl). As Paul pointed out, a TWinControl uses system resources (handles), which are not required for layout (and docking) managers. TWinControl has childs, TControl has not. This is usually tested with if AControl is TWinControl then If a TContainerControl that is not a TWinControl has childs this test will break. Then it would be possible to have lightweight panels, where currently TPanel or similar TWinControl descendants have to be used for grouping controls together. Delphi compatibility is not broken by such a layer. When the layout management is implemented by a LayoutManager hook, as is already used for DockManager, less (memory) resources are required for typical (button...) components, which do not normally have child controls, but inherit all the data members and other bloat from TWinControl. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Space preference for assignment
On Sun, 08 Feb 2009 23:06:16 +0100 Micha Nelissen mi...@neli.hopto.org wrote: Hi, How can I specify I prefer spaces around assignment operators? In the options window I can select several tokens, but not assignment operator, or did I miss it? A:=B+C; to A := B+C; How about operators? A := B + C; Insert space before and after 'symbols'. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Unicode data
On Tue, 27 Jan 2009 11:02:28 +0100 theo x...@theo.ch wrote: Hello Could somebody apply the attached patch? It contains the new file: lcl/lclunicodedata.pas Changes to: ide/charactermapdlg.pas lcl/Makefile.fpc lcl/alllclunits.pp I have never added a new unit to the LCL before, so I can only hope this is correct / enough. Thanks. Applied. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determine OS at runtime
On Tue, 27 Jan 2009 13:01:04 -0500 Lee Jenkins l...@datatrakpos.com wrote: Dumb question: What is the best way to determine the OS platform at runtime? You can already at compile time. http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Useful_compiler_variables_.2F_defines_.2F_macros I would like to be able to position things like dialog form buttons dependent on the OS. For common buttons you can use TButtonPanel. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Determine OS at runtime
On Tue, 27 Jan 2009 15:10:33 -0500 Lee Jenkins l...@datatrakpos.com wrote: [...] I would like to be able to position things like dialog form buttons dependent on the OS. For common buttons you can use TButtonPanel. Thanks I will look at this. Does this rearrange itself depending on the OS? Is that what you are saying? Yes. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Unicode data
On Mon, 26 Jan 2009 15:33:41 +0100 theo x...@theo.ch wrote: In the charactermapdlg.pas unit (IDE) we use some code from unicode.org. Since we should add unicode.org copyright notice to this file, I've created a patch for this file: http://www.theo.ch/lazarus/mypatchlic.diff What parts are form unicode.org? Vincent suggested to put the relevant code into a separate unit of the LCL. Good idea. Now Im asking if /lcl is the right place and what would the best name for it? unicodedata.pas lclunicodedata.pas lunicodedata.pas lclunicodedata.pas Any thoughts about this? Is there currently more code in the LCL which should go there? I don't know any. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sun, 25 Jan 2009 14:24:50 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Sun, Jan 25, 2009 at 2:25 AM, Mattias Gaertner nc-gaert...@netcologne.de wrote: Form.Create Form.OnResize OnCustomAlignPosition OnCustomAlignInsertBefore each components.OnResize etc MiGLayout does all the above in one location - easy to find, edit and maintain. Let's stay realistic. There will always be cases where you need methods/events to override. For example: Changes to the content of a control. For example the columns of a TStringGrid. I'm talking about the space components take up, not the internals of a specific component. eg: A panel with three buttons in a horizontal line. You might be able to AutoSize the buttons if there captions change. But the Panel will not auto size to fit the new larger buttons. The buttons will simply get clipped. Why not? It is done on most IDE dialogs. Make no mistake, LCL has much better anchoring and alignment than Delphi - but there are still many areas of concern. True. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Free Open Source Diagram Components for Lazarus?
On Sun, 25 Jan 2009 22:41:47 +0100 Thierry Coq t...@free.fr wrote: I'm looking for a diagramming components for Lazarus, to draw circles, rectangles, and connectors between them that are resized or moved when the components are moved. This would be used to create graph editors, for example for designing dynamic models. Do you have ideas about a mature component I could use for this purpose? I've been thinking about using GLScene as a 2D layer, but it seems to be overkill for my purpose (although 3D diagrams... hum.) I'm interested in that too. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sat, 24 Jan 2009 18:18:09 +0200 Reenen Laurie rlau...@gmail.com wrote: Yes they can be, but *I* am not able to get them to work without them flickering 10x a second during resizing. This can be reduced with DisableAlign, EnableAlign. Do I put it in the parent's OnResize? Or the child's? I added some hints to the help description. For example this line Label1.Width:=GroupBox1.ClientWidth; must be put into the GroupBox1.OnResize. Using any other OnResize for the above line will create cases where your label is not resized properly. So, normally you need to set several every OnResize event of every parent that has special childs. Also, for each of my panels I must write a new onresize code. Yes, unless the childs can be setup with the normal TControl properties. BUT the anchoring system can be modified to do this... Select (for each anchor) 2 points, and a %. So: Panel1 contains 2 listboxes... Listbox1 Topanchor = Panel1.Top, Panel1.Height, 1% Listbox1.BottomAnchor = Panel1.Top, Panel1.Height, 33% This is probably not the most eliquent, but shouldbe able to work? procedure ... Panel1Resize(...); begin with ListBox1 do SetBounds(Left,Parent.ClientWidth div 100, Width,Parent.ClientWidth div 3); end; Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sun, 25 Jan 2009 00:19:14 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Sat, Jan 24, 2009 at 1:40 PM, Michael Van Canneyt mich...@freepascal.org wrote: What's the big fuss all about ? * the layout manager can do complex layout without nesting panels or other layout managers. Panel = group of controls You create the groups in MiG via the properties. So, yes, you create nested groups, but you can not access the groups itself. This has pros and cons. MiG layout is a flow/table/rule based layout manager - like gtk. You avoid fixed positions and define everything relative. This avoids overlapping and gives good adaption to various themes and fonts. Contrary to the nesting rules of gtk, MiG uses hundreds of properties and flags. The learning curve is therefore quite steep. MiG solved the complex setup with parameters in text list format. So it is great for source code (means: less typing), but it is hard to create a good graphical designer, let alone an intuitive one. I hope you have some good ideas. * Auto resize of components so translation text NEVER gets clipped. I have fixed things like this a 100 times in Lazarus, until the next person edits something in that form, or somebody changes something in the widgetset code. With LCL as used in Lazarus IDE, such things are always broken. 1. Can you give the bug report number for the broken layouts, where the translation overlap in the IDE? 2. You can overlap in MiG too. * No over lapping components (a constant issue in Lazarus IDE) bug report? * Automatic button order based on the platform - built into the layout manager. No extra components required like the ButtonPanel in LCL. ... instead it needs some extra properties for that. It is semi automatic. * Automatic border and spacing widths based on the platform - built into the layout manager. eg: Mac OS-X has bigger form borders that Windows, GTK etc.. Yes, that's an advantage of rule based layout managers. * Totally screen resolution independent. Max / Min and Preferred components sizes are taken into account. Well. Which layout manager does not take Min/Max/Preferred into account? ;) * DPI independent. * Unit sizes can be specificed in %, inches, cm, pixels, mm, etc.. * The original Java MiG Layout is toolkit independent. It's very simple to add new toolkit support. I hope to make the port the same. Great. * Built-in debug mode, to help with layout design and debugging. Do you mean the red and green borders? That does not help much. IMHO a good designer should visualize the dependencies. Like the guide lines in Lazarus but MiG's hundreds of flags need much more. .the list goes on! ;-) Yes, the hundreds of flags and properties is a problem. The syntax may look strange in the beginning, but it's quite easy to learn. Also you would probably only use a handy full of syntax commands to complete most layouts. The rest of the supported syntax is for more advanced designs and features, but not required to be able to use the layout manager. It is like the many linux daemon config files. You can setup a server with a few lines, but you never get a good gui. The more the gui supports, the less intuitive it becomes. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sun, 25 Jan 2009 00:22:47 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: 2009/1/24 Reenen Laurie rlau...@gmail.com: For me, all I really want that's not supported via Lazarus at the moment is the % of parent statement... Otherwise, I'm pretty happy at the moment. So how do you handle DPI changes or runtime language translation in LCL? Not all LCL components have autosize, preferred / min / max sizes. LCL still has many features missing compared to MiG Layout. If a control does not provide good Min, Max and preferred size, then MiG layout will fail too - it can only be as good as its input. It's true that the current LCL properties are only pixel based and have no properties for cm, inches, percentages, That's a feature of MiG. OTOH I never saw an example where this was extensively required. If you only need that at a few places you could use OnResize. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Sun, 25 Jan 2009 00:28:33 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Sat, Jan 24, 2009 at 6:05 PM, Marc Weustink m...@dommelstein.net wrote: These kind of calculations are easy in the OnResize event of the parent. A OnResize is also much more flexible, because you can keep some childs fixed and others proportional etc. Also the in between child space is preferred to be fixed e.g. 6 pixels or so. I think there are many variations on the 'proportional theme' to be liked that they cannot be put into a 'choose pull-down' property editor. Or (as I recently discovered) you can set the align to alCustom and handle all your custon stuff in OnCustomAlignPosition / OnCustomAlignInsertBefore And this is exactly where something like MiG Layout makes the stask much easier. So no in LCL we have the following location where layout code could be placed. Form.Create Form.OnResize OnCustomAlignPosition OnCustomAlignInsertBefore each components.OnResize etc MiGLayout does all the above in one location - easy to find, edit and maintain. Let's stay realistic. There will always be cases where you need methods/events to override. For example: Changes to the content of a control. For example the columns of a TStringGrid. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Wed, 21 Jan 2009 14:11:53 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: [...] Yes, options are possible. But I have no idea how Java or any others layout manager works. Maybe Mattias will help you here. The question is: what interface will be required? The TDockManager class was given by Delphi, for layout managers we may have to look at the widgetsets... Why at the widgetsets? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docking manager implementation
On Wed, 21 Jan 2009 16:11:53 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Mattias Gaertner schrieb: [...] Yes, options are possible. But I have no idea how Java or any others layout manager works. Maybe Mattias will help you here. The question is: what interface will be required? The TDockManager class was given by Delphi, for layout managers we may have to look at the widgetsets... Why at the widgetsets? Java has layout managers, and the modern widgetsets also have layout managers, which might be usable even with Lazarus. How? The LCL needs an widgetset independent layout manager. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Saving user created component structure to LFM file
On Mon, 12 Jan 2009 10:57:20 + Martin Friebe laza...@mfriebe.de wrote: [...] Thanks, I think I found a better way. The outer container has no nested components of it's own. It seems I can hook into (override) TComponent.WriteState which is calling WriteComponentData (properties, then Children). Since no children are there, I can make my own calls to WriteComponent from there, supplying all the components, of all the helper objects. On Read, I can Hook into ReadState. I can let the reader add them normally, and sort them out/once they have been read by the reader. The remaining question is: Does that look like something that will stay compatible with future code? The generated LFM file definitely looks like any LFM file (it has a component, with properties first then other nested Components) To store a property that is a component and which is not owned by the Lookuproot (form, datamodule, frame) you must set the csSubComponent flag in ComponentStyle. To store a list use TCollection. If you can not use TCollection please explain why not. To store data of arbitrary length/format, use DefineProperties. This has a drawback: In case of an error the IDE can not help fixing it. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Does Lazarus have sizer or layout objects?
On Sun, 11 Jan 2009 16:49:10 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: Felipe Monteiro de Carvalho schrieb: What's the base class for an layout manager? There is none specific. I would suggest trying TCustomControl if you also want to draw borders or TControl if you just want to position childs. That doesn't answer the question, how to marry controls and layout manager. How will the form designer interact with the layout manager... At the moment this is completely in the LCL. Controls can override various methods to alter that behavior and applications can set events. For example you can create a component that sets all OnResize/OnChangeBounds events. There is no global or form based possibility to override. You are welcome to make a proposal. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Error when compiling for GTK2 (on Linux)
On Thu, 8 Jan 2009 18:20:08 +0100 Bart bartjun...@gmail.com wrote: Hi, Since today, when I want to compile any (even a new and empty project (just 1 form, no controls on it)) I get the following error: Free Pascal Compiler version 2.2.2 [2008/07/29] for i386 Copyright (c) 1993-2008 by Florian Klaempfl Target OS: Linux for i386 Compiling /tmp/project1.lpr PPU Loading /usr/lib/lazarus/lcl/units/i386-linux/gtk2/gtkwsgrids.ppu PPU Source: gtkwsgrids.pp not found Recompiling GtkWSGrids, checksum changed for Grids gtkwsgrids.pp(11,42) Fatal: Can't find unit GtkWSGrids used by GtkInt The file gtkwsgrids.pp is actually there (the IDE opens it for me on the error). What did I do before this happened? I did a make clean all (because I altered maskedit.pp in lcl directory). This seemed to go well, no error were issued. (I have done this before (make clean all) and AFAIK after that I still was able to swict between compiling for GTK1 and GTK2) Any help? Have you tried compiling lazarus clean? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Error when compiling for GTK2 (on Linux)
On Fri, 9 Jan 2009 02:08:51 +0100 Bart bartjun...@gmail.com wrote: Have you tried compiling lazarus clean? Yeah, this all happened after a make clean all. I noticed that it rebuilds the gtk1 ppu's but not the gtk2 ppu's (the gtk2 ppu's have dates from 3 days before) Yes, gtk1 is the default for 0.9.26. If you want to build the gtk2 ppu with 0.9.26, then you need make LCL_PLATFORM=gtk2 Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TButton: Bug or User-Error?
On Fri, 2 Jan 2009 18:59:55 +0100 Thomas Moritz thm...@thmoritz.de wrote: Hello and Happy New Year, my system (linux): x86_64, fpc 2.2.3, lazarus 0.9.27 SVN 18055 Button1.Enabled:=False; //works fine :-) Button1.Enabled:=True; //bug or user-error? Sample: Set the mouse over Button1 and press left mouse-key - fine :-) Do not move the mouse! If counter 50 and 'Button1.Enabled' press left mouse.key! ...no effect First you must move the mouse beside. Button1 is default: Press Return-Key If counter 50 and 'Button1.Enabled' press 'Return-Key' ...no effect //- procedure TForm1.Button1Click(Sender: TObject); var n: integer; begin Button1.Enabled:=False; for n:=0 to 50 do begin sysutils.sleep(10); Label1.Caption:=inttostr(n); Application.ProcessMessages; end; Button1.Enabled:=True; end; //-- Please create a bug report. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Intercept clipboard operations
On Sun, 28 Dec 2008 00:53:33 +0100 Bart bartjun...@gmail.com wrote: Hi, I ran into a problem with the MaskEdit unit that I'm working on. I want to intercept clipboard operations (like when the users presses Ctrl-V, Ctrl-X or uses the mouse-equivalent) before the text in the editcontrol gets changed. Currently I have TCustomMaskEdit = Class(TCustomEdit) ... procedure LMPasteFromClip(var Message: TLMessage); message LM_PASTE; procedure LMCutToClip(var Message: TLMessage); message LM_CUT; procedure LMClearSel(var Message : TLMessage); message LM_CLEAR; ... However, when these procedures are called, the text in the control has already been overwritten. I especially want to validate the content of the pasted text before it is pasted into the control. Is this (in a cross-platform way) possible at all? No. Unless you implement LM_BeforePaste messages for all widgetsets. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] console gets crazy
On Fri, 26 Dec 2008 12:55:01 +0100 Sebastian Kraft sebastian_kr...@gmx.de wrote: Hello, after one of my applications has finished my console output gets corrupted. Looks like this after pressing return... no carriage return is made, just one big line. das...@daseeb-laptop:~/devel/cactusjukebox$ das...@daseeb-laptop:~/devel/cactusjukebox$ das...@daseeb-laptop:~/devel/cactusjukebox$ das...@daseeb-laptop:~/devel/cactusjukebox$ das...@daseeb-laptop:~/devel/cactusjukebox$ Any text I enter is not shown. Where do I have to look for to solve this problem? It only occurs when I load an external library... but no seg fault or anything. Just a corrupted console after exit. Any ideas where I have to look for? Try typing resetenter Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] console gets crazy
On Fri, 26 Dec 2008 14:44:09 +0100 Sebastian Kraft sebastian_kr...@gmx.de wrote: Any ideas where I have to look for? Try typing resetenter This works... Thanks! But where does this behaviour come from? Is there a problem with my program? How could I solve this at the root? Some shells reacts to special characters (#32). Check if you are writing special characters. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] about gif images
On Tue, 23 Dec 2008 16:14:03 +0100 Lord Satan reimg...@web.de wrote: On Tue, 23 Dec 2008 14:11:44 +0100 Mattias Gärtner nc-gaert...@netcologne.de wrote: I just sent a gif reader based on Laurent's to Michael VC. It needs to be extended to read multiple images and the animation attributes. This goes into the fpc source and can be used with fpimage, right? right Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Error while compiling resources
On Tue, 23 Dec 2008 14:12:55 -0300 Leonardo M. Ramé l.r...@griensu.com wrote: Some times I need to create simple proof of concept apps with only a main form, without saving anithing. In Delphi to accomplish this I create an application then Run it. If I try this in Lazarus without saving the project, an Error while compiling resources message appears. This message doesn't help, is there a possibility to improve this by letting Lazaurs explain a little more what is causing the error? or better, let it compile the project without needing to save. It works under linux and os x, so I guess it is something windows specific. You can see all messages by right clicking on the messages window and save. Maybe you can give the complete message, so that the filter can be extended to show the important message. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] reading a little endian long.
On Sun, 21 Dec 2008 10:26:41 +0200 Dave Coventry dgcoven...@gmail.com wrote: Is there any documentation on this? would the following: longv:=LEtoN(@buffer[5]); longv:=LEtoN(PLongint(@buffer[5])^); be the same as: longv:=buffer[5]; longv+=buffer[6] shl 8; longv+=buffer[7] shl 16; longv+=buffer[8] shl 24; Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] reading a little endian long.
On Sun, 21 Dec 2008 12:04:37 +0200 Dave Coventry dgcoven...@gmail.com wrote: Hi Mattias, Is there an equivalent for shortv:=buffer[5]; shortv+=buffer[6] shl 8; shortv:=LEtoN(PSmallInt(@buffer[5])^); Mattias longv:=LEtoN(PLongint(@buffer[5])^); be the same as: longv:=buffer[5]; longv+=buffer[6] shl 8; longv+=buffer[7] shl 16; longv+=buffer[8] shl 24; ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] reading a little endian long.
On Mon, 22 Dec 2008 01:11:38 +0100 Marc Weustink m...@dommelstein.net wrote: Dave Coventry wrote: Wow. If I can push a little more: Can I read in an eight-byte IEEE double using the same trick? The example below is not complete, you need to cast. MyDouble:=LEtoN(PDouble(@buffer[5])^); Use codejumping (find declaration) on LEtoN to see what variants exist. AFAIK LEToN does not exist for double. You have to write one. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] about gif images
On Sat, 20 Dec 2008 13:13:34 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Tue, Dec 16, 2008 at 2:47 PM, Héctor Fiandor Rosario hfian...@infomed.sld.cu wrote: I catch an icon of a chetahh (or other animal) animated as a gif and I want to use in my forms. For fpGUI I created a simple Animation component. I reads in a composite bitmap (images forming the animation in a horizontal large [single] image). I can then set a few properties like timing, looping etc... I simply read the image, split in into separate frames and display them one after the other. Very simply, but it works very nice for some animation on a form. It should be very simple to port to LCL. Do you have a fpimage reader for gif? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] flickering on statusbar panel
On Fri, 19 Dec 2008 11:52:18 +0100 Andrea Mauri andrea.mauri...@gmail.com wrote: The code I wrote in the e-mail is just a sample! Anyway, create a new project, drop a label, a statusbar and a button on the form. Create a panel on the statusbar. On buttonclick drop the following code: procedure TForm1.Button1Click(Sender: TObject); var i: integer; begin i:= 0; while i 1 do begin // Application.ProcessMessages; label1.Caption:= Format('Number: %d', [i]); statusbar1.Panels[0].Text:= Format('Number: %d', [i]); Inc(i); end; Clicking on the button the text in the statusbar panel start to be updated, and it flickers. The text in the caption is updated only at the end of the while do cycle. Great. There you have the bug. The statusbar should not update, just like the label. If I uncomment the line Application.ProcessMessages both texts in label and in statusbar panel are updated during the while do cycle. The text in the label does not flicker while the text in the statusbar panel flickers. It probably flickers because of above bug. I tested it on WinXP with lazarus v0.9.27 r17856 i386-win32-win32/win64 and fpc 2.2.2 The same code works on Linux with lazarus svn and fpc 2.2.2 (statusbar and label do not flicker). I hope that I well explained the problem. Yes, although I'm not a win32 intf developer. Please create a bug report with the above example. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] My daemon no stop under Linux...
On Thu, 18 Dec 2008 12:11:18 -0500 Liyuán García Caballero liy...@cav.desoft.cu wrote: Hi people, I have an application daemon when is sending the signal TERM in Unix platform does not end, I attach the code. [...] procedure Twands.DataModuleStop(Sender: TCustomDaemon; var OK: Boolean); begin If Assigned(FThread) then begin FThread.Terminate; // Let the thread die silently. If (FThreadNil) then FThread.OnTerminate:=Nil; end; OK:=FThread=Nil; end; FThread.Terminate does not wait until the thread has died. Check that your thread checks for Terminated=true and ends itself. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] flickering on statusbar panel
On Thu, 18 Dec 2008 14:58:58 +0100 Andrea Mauri andrea.mauri...@gmail.com wrote: But why, same monitor, same application, labels do not flicker while statusbar flickers? If statusbar text and properties do not change and it still flickers when it is repainted, then there is a bug in the double buffering. Please create a bug report. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Had a look at control.inc..
On Sun, 14 Dec 2008 06:48:58 -0800 (PST) Samuel Herzog sam_her...@yahoo.com wrote: Hi folks, I had some minutes of sparetime and went through control.inc. Two things I d' like to ask: 1.) sometimes parent/FParent are checked for nil, before the method access it, and sometime not. Is this by purpose or are this potential Access-Violation candidates. For example? 2.) In my programming-style I often check the conditions of input parameters at the begin of the method and leave with exit-statement if the conditions do not match the current needs. As for example like here: procedure TControl.ParentFontChanged; begin if csLoading in ComponentState then exit; Such things make the code much better readable. I also use this in situations like this: procedure TControl.SetColor(value : TColor); begin if FColor Value then begin FColor := Value; FParentColor := False; Invalidate; end; end; There is no need for begin/end-statement. if FColor=Value then exit; Are there any rules for lazarus in this case or can everyone handle this as he likes ? Some people consider 'exit', break' and 'continue' as harder to read. IMO it is a matter of taste and both are equally readable, so both should be allowed. see http://wiki.lazarus.freepascal.org/DesignGuidelines Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Had a look at control.inc..
On Sun, 14 Dec 2008 08:48:48 -0800 (PST) Samuel Herzog sam_her...@yahoo.com wrote: For example: procedure TControl.ParentFontChanged; begin if csLoading in ComponentState then exit; if FParentFont then begin Font := FParent.Font; FParentFont := true; end; end; Called by parent, so Parentnil. or procedure TControl.AnchorAsAlign(TheAlign: TAlign; Space: Integer); begin Parent.DisableAlign; try If Parent=nil then user made an error. or procedure TControl.CMParentColorChanged(var Message: TLMessage); begin if csLoading in ComponentState then exit; if FParentColor then begin Color := FParent.Color; FParentColor := true; end; Called by parent, so Parentnil. or procedure TControl.CMParentShowHintChanged(var Message: TLMessage); begin if FParentShowHint then begin ShowHint := FParent.ShowHint; FParentShowHint := true; end; end; Called by parent, so Parentnil. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TAChart: double-buffering (issue 0012377) questions
On Fri, 12 Dec 2008 19:38:55 +1000 Alexander Klenin kle...@gmail.com wrote: In issue http://bugs.freepascal.org/view.php?id=12377, reporter said: Painting to an Bitmap and paint this on the Canvas would be much faster This assertion is, of course, incorrect. I assume that the reporter's problem is actually that the TChart flickers when repainted. The flickering is caused by two sources: 1) The TChart is TGraphicControl, so Parent control erases chart's background before every repaint. 2) TChart itself draws directly to screen, first clearing the canvas. First source obviously needs fixing, and I attached to the issue a patch which fixes it. The only caveat is that TChart is now TWinControl -- can it lead to some undesirable consequences I am not aware of? All direct TWinControl descendants must be implemented in all widgetsets. You can use TCustomControl. The second source can also easily be fixed by double-buffering, but before I do that, I have two questions: 1) TWinControl.WMPaint already contains double-buffering code, but it is protected by {$ifdef BUFFERED_WMPAINT}. What is the reason of this? Is there some ongoing work to implement double-buffering globally? It was an idea to implement double buffering, but it does not work on all platforms. Gladfully most widgetsets have double buffering themselves. 2) If double-buffering will be implemented in TAChart itself, it will have some negative performance impact. So, should I make it optional via DoubleBuffer property? Please try first TCustomControl. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Using Win32 Lazarus to cross-compile to arm-linux?
On Thu, 11 Dec 2008 13:10:34 +1100 Paul Nicholls [EMAIL PROTECTED] wrote: - Original Message - From: Paul Nicholls [EMAIL PROTECTED] Newsgroups: gmane.comp.ide.lazarus.general To: Lazarus@lazarus.freepascal.org Sent: Wednesday, December 10, 2008 11:00 AM Subject: Using Win32 Lazarus to cross-compile to arm-linux? Hi all, I appologise if this is an obvious question, but I have looked in these forums, and online and I can't seem to find out how to setup Lazarus (under Win32) so it can call my arm-linux freepascal cross-compiler to compile programs for my GP2X (arm-linux handheld computer). So far, I have to do this manually via batch file. If this is possibe, it would be very nice :) PS. My Win32 to arm-linux freepascal cross-compiler has it's own fpc.cfg file if this makes a difference. PS. I do realise that I most likely couldn't debug but still it would be better than now if I can use the IDE to compile to Win32 and also arm-linux. Thanks for your time, Cheers, Paul. Does ANYONE have any clues or hints for me on this matter? At the moment: use two different lpi files. What is in your batch file? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Cross platform development (not compiling)
On Wed, 10 Dec 2008 11:11:59 +0200 Graeme Geldenhuys graemeg.li...@gmail.com wrote: On Tue, Dec 9, 2008 at 7:33 PM, Felipe Monteiro de Carvalho Ummm, now I see ... but they could be the same thing. Some kind of mode where certain compiler options or debugger options are overriden. That would be very handy! MSEide has a very simple design/screen for this. And it works very well. The Project menu contains the following options: Make Build Make 1 Make 2 Make 3 Make 4 You can setup each of those with the following screen. See attached image. Simply add a new row, tick which Build or Make it should apply to, and select the menu from the Project menu. Quick, Easy and Effective! Yes. Now we need some nice ideas how to extend this for: - search paths (editing paths via typing is error prone) - depending values. For example: if LCLWidgetSet=win32 Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Changed Compilers Options, Run, Build versus Build All
On Thu, 11 Dec 2008 22:33:21 +0100 Tom Verhoeff t.verho...@tue.nl wrote: [...] Here is another issue. When working on a program involving multiple units, it may turn out that the Use AnsiStrings was not set consistently. Students are advised to enable this globally in the Compiler Options, but they sometimes forget. Some (given/generated) units also contain their own {$H+}, others don't. Is this a student bug or an IDE bug? This may give rise to inconsistencies (usually flagged by the compiler, but not understood by beginners). When you change Compiler Options later, and then do Run, the relevant unit may not be (re)compiled, because its source code did not change. One is required to do a Build All first. But a beginner will not be aware of this. Yes, that's why the IDE adds -B when the compiler parameters changed (except for search path changes). 0.9.26 has this feature. 0.9.24 not. Is it possible to have the IDE suggest a Build All when doing Run, if the Compiler Options were changed after the previous build? It does. Please provide an example, where it does not work. Or even better have a three-way global setting: When doing Run and the Compiler Options changed after the previous build: * Always do a Build All -- this would be better for beginners * Always ask to either Build or Build All (the latter as default choice) * Always do a Build -- this seems to be the current situation Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TCodeTools not working correctly.
On Mon, 8 Dec 2008 15:24:39 +0100 Raymond van Venetië [EMAIL PROTECTED] wrote: Can you try to add a line CodeToolBoss.SimpleInit(ConfigFilename); writeln('IncPath=',CodeToolBoss.GetIncludePathForDirectory('C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32')); What is IncPath for you? With last rev, I get the following output (including that writeln): C:\lazarus\components\codetools\examplesgetcontext TCodeToolManager.SimpleInit Config=codetools.config TCodeToolManager.SimpleInit PP=C:\FPC\2.2.2\bin\i386-win32\fpc.exe FPCDIR=C:\FPC\fpcbuild-2.2.2\fpcsrc LAZARUSDIR=C:\lazarus FPCTARGET=win32 IncPath=;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\objpas\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\objpas\sysutils;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\objpas\classes;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\inc\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\inc\graph\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\i386;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\i386\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\i386\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\wininc;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\i386\;C:\FPC\fpcbuild-2.2.2\fpcsrcrtl\win\wininc;C:\FPC\fpcbuild-2.2.2\fpcsrcrtl\win;C:\FPC\fpcbuild-2.2.2\fpcsrcrtl\freebsd Ah. Missing PathDelim at end. Fixed in svn 17729. Please test. ### TCodeToolManager.HandleException: include file not found base.inc at Lin e=33 Col=5 in C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\windows.pp Contexts not found: include file not found base.inc When I Find the base.inc in the IDE, it turns out to be this path: C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win\wininc\base.inc But as you can see, that path isn't in the IncPath.. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TCodeTools not working correctly.
On Mon, 8 Dec 2008 16:48:54 +0100 Raymond van Venetië [EMAIL PROTECTED] wrote: Ah. Missing PathDelim at end. Fixed in svn 17729. Please test. The windows unit now indeed works! But now there's another problem, unfortunately. Now it suddenly stops finding SysUtils. C:\lazarus\components\codetools\examplesgetcontext TCodeToolManager.SimpleInit Config=codetools.config TCodeToolManager.SimpleInit PP=C:\FPC\2.2.2\bin\i386-win32\fpc.exe FPCDIR=C:\FPC\fpcbuild-2.2.2\fpcsrc LAZARUSDIR=C:\lazarus FPCTARGET=win32 Scanning FPC sources may take a while ... Note: TDefinePool.CreateFPCSrcTemplate UnitSearchPath emptyIncPath=;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\objpas\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\objpas\sysutils;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\objpas\classes;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\inc\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\inc\graph\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\i386;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\i386\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\i386\;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\wininc;C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\i386\ ### TCodeToolManager.HandleException: unit not found: SysUtils at Line=8 Col=21 in C:\lazarus\components\codetools\examples\scanexamples\getcontextexample.pas Contexts not found: unit not found: SysUtils Sorry. Please try svn 17732. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TShellTreeView and TTreeView
On Mon, 8 Dec 2008 16:03:37 -0200 Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote: Hello, I am trying to implement TShellTreeView. It is a treeview which shows the directory structure in the prefered way of the operating system. In Windows that would start with My Computer, etc... One problem now is with the design. Should it read all existing directories (which will cause a delay) or only those visible, or one or two levels at once... what do you think? Reading everything may be problematic with removable media. Very problematic. Especially with the linux automounting. The best would be using a separate thread and only check the visible files. Another problem is using TTreeView. I searched by I can't find how I would implement this behavior, for example, having the root and 1 level visible and then when the user clicks the + symbol the subitems for this item are loaded. Should I use the OnExpanding event? In the event handler I would create the subitems? A tutorial would be great... You already figured it out. OnExpanding and OnCollapsing are the events. Feel free to start a tutorial. See as example: ide/unitdependencies.pas TUnitDependenciesView.UnitTreeViewExpanding Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TCodeTools not working correctly.
On Sun, 7 Dec 2008 22:08:10 +0100 Raymond van Venetië [EMAIL PROTECTED] wrote: Hello, I've been trying to implent the CodeTools component in my application, but unsuccessfully. The problem comes up when I try to CodeTool a unit which has Windows in the uses clause. Codetools will return with this error code: include file not found base.inc. We can easily reproduce this error by editing one of the codetools examples: Open the getcontext.lpr' project in the directory lazarus\components\codetools\example. Now change the paths half-way the code correctly, mine are like these: Options.FPCPath:='C:\FPC\2.2.2\bin\i386-win32\fpc.exe'; Options.FPCSrcDir:='C:\FPC\fpcbuild-2.2.2\fpcsrc'; Options.LazarusSrcDir:='C:\lazarus'; If you would execute the program right now, it would run fine. Now open getcontextexample.pas in the dir lazarus\components\codetools\examples\scanexamples. And add the windows unit (might occur with different units as well, haven't found out yet). Your unit clause should look like: Windows,Classes, SysUtils; now. Now restart the program ,getcontext, and you should see there occured an error. It works here under linux. (I extended the example so that you can now set the FPCTARGET environment variable to see the 'cross compile' results. I set FPCTARGET to win32, so I browsed the sources as if under windows). Do you use the same paths in the IDE and does it work there? For example can you add the 'windows' unit to a uses section and find the windows.pp? And then find the base.inc? (find = via find declaration) The output for me looks like this: C:\lazarus\components\codetools\examplesgetcontext ### TCodeToolManager.HandleException: include file not found base.inc at Line=33 Col=5 in C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\windows.pp Contexts not found: include file not found base.inc Now I've googled around a bit, and appreantly this error occured in the IDE, but got fixed. (Here is the link: http://www.mail-archive.com/[EMAIL PROTECTED]/msg06397.html). I'm kind of stuck at the moment, so I decided to ask if someone could help me out. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TCodeTools not working correctly.
On Mon, 8 Dec 2008 00:10:22 +0100 Raymond van Venetië [EMAIL PROTECTED] wrote: Date: Sun, 7 Dec 2008 23:43:58 +0100 From: [EMAIL PROTECTED] To: lazarus@lazarus.freepascal.org Subject: Re: [Lazarus] TCodeTools not working correctly. On Sun, 7 Dec 2008 22:08:10 +0100 Raymond van Venetië [EMAIL PROTECTED] wrote: It works here under linux. (I extended the example so that you can now set the FPCTARGET environment variable to see the 'cross compile' results. I set FPCTARGET to win32, so I browsed the sources as if under windows). Do you use the same paths in the IDE and does it work there? Yes, the same paths. For example can you add the 'windows' unit to a uses section and find the windows.pp? And then find the base.inc? (find = via find declaration) Yep, in the IDE that works like a charm. I've updated my Lazarus, and it looked like everything was working, until I removed the {$IFDEF MSWindows}{$ENDIF} directives from getcontextexample.pas. Ah, yes, sorry. It must be IFDEF windows. After that I had the same output as before (not exactly the same output, but the same error). C:\lazarus\components\codetools\examplesgetcontext TCodeToolManager.SimpleInit Config=codetools.config TCodeToolManager.SimpleInit PP=C:\FPC\2.2.2\bin\i386-win32\fpc.exe FPCDIR=C:\FPC\fpcbuild-2.2.2\fpcsrc LAZARUSDIR=C:\lazarus FPCTARGET=win32 ### TCodeToolManager.HandleException: include file not found base.inc at Lin e=33 Col=5 in C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32\windows.pp Contexts not found: include file not found base.inc So I guess that the codetoolmanager just skips the {$IFDEF MSWindows} part.. Here is the output with the compiler directives in getcontextexample.pas. C:\lazarus\components\codetools\examplesgetcontext TCodeToolManager.SimpleInit Config=codetools.config TCodeToolManager.SimpleInit PP=C:\FPC\2.2.2\bin\i386-win32\fpc.exe FPCDIR=C:\FPC\fpcbuild-2.2.2\fpcsrc LAZARUSDIR=C:\lazarus FPCTARGET=win32 Contexts found: Count=22 Unrelated output here Can you try to add a line CodeToolBoss.SimpleInit(ConfigFilename); writeln('IncPath=',CodeToolBoss.GetIncludePathForDirectory('C:\FPC\fpcbuild-2.2.2\fpcsrc\rtl\win32')); What is IncPath for you? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus on Mac OS 10.5, 10.4
On Fri, 5 Dec 2008 08:59:24 + Geoffrey Barton [EMAIL PROTECTED] wrote: Mattias Gartner [EMAIL PROTECTED]: I installed the apple developer tools on a 10.5, installed laz and fpc and compiled lazarus without cwstring unit. The produced LCL applications run on 10.4 and 10.5. I didn't even alter the linker options or library paths as described in the wiki. So apparently a simple LCL app does not need much. Maybe some special controls need some special libs? If I had installed Lazarus (0.9.26) on a machine running OS 10.4, presumably it would compile and run programs ok? I don't know. I have no 10.4 to compile. It would be great if someone can test. What I am getting at is, if Lazarus installs, runs and compiles on 10.4 then there either must be some configuration which gets set somehow, or nothing is required. If not, is there a list of what needs changing? I have not seen one. Personally, I do not know how to compile Lazarus at all, so certainly would not now how to compile without cwstrings, and this would be true for anybody meeting lazarus for the first time on a recent Mac, which will be either 10.4 or 10.5. I think a lot of Macs are still on 10.4. As Felipe already said: Formerly compiling on Mac was quite difficult because of the many linker issues. The FPC team did a great job, so there are only a few issues left. As I said: Normally a user should not need to know about cwstrings. Maybe I will implement a more 'dynamic' widestring manager. Then this problem will be gone. If you can't wait and want to have it now, then see the wiki. The installation page describes how to get the lazarus svn sources and to compile them. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Wed, 03 Dec 2008 09:17:11 +0100 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gärtner ha escrit: Zitat von Luca Olivetti [EMAIL PROTECTED]: En/na Mattias Gärtner ha escrit: The installation packages install Lazarus always in the same location. There was no need yet to auto update paths. Can you explain what the problem is when upgrading? To have the extra packages/components installed in the previous version available in the new one. Just start the IDE, compile and restart it. This will install the last package set. I normally use lazbuild, but as a test I followed your advice: 1) I copied my c:\lazarus-0.9.26 directory to to a new directory c:\laztest 2) make clean bigide in c:\laztest There is a misunderstanding. Upgrading: replace old version with a newer one. One config directory is enough. Multiple lazarus: one config per version is recommended. 3) start the new lazarus, change environment options to point to c:\laztest (otherwise the ide build lazarus would build the old one) 4) Add a bogus property to TChart in the new directory (tchart is shipped with lazarus but it isn't installed by default) 5) Tools-Configure Build Lazarus-Build Ide With Packages-Build 6) Put a TChart on a form to check in the object inspector if the new bogus property is there 7) The new property isn't there, unsurprisingly since lazarus compiled the component from the old directory QED It proves, that multiple lazarus versions requires multiple config directories and that it is not enough to copy a config directory and change *only one* path. As I said, it would be nice if there is a tool to help change some more paths. Here's a a diff between idemake.cfg from the old and the newly built ide. As you can see lazarus adjusted the paths only for synedit,ideintf,lcl,codetools and packager, but it used the same as before for all other components. Yes. These are the at the moment hard coded packages. It is planned to change this. And to add some mechanism to load all used packages from the other source directory. You get the same problem with all package collections. [...] Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Mon, 01 Dec 2008 09:08:19 +0100 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: http://news.gmane.org/find-root.php?message_id=%3c48F836DE.2080402%40wetron.es%3e Well, yes and no. It is not a bug, because to use two different settings the --pcp option exists (See my answer to the above mail). And yes, lazbuild does not have an option to override the lazarus source directory. The same is true for many other options. Sharing a lazarus config directory by two different lazarus versions can give trouble. Better use two different lazarus config directories. I'm not sure what settings you want to share. I don't really want to share them, I just want to build lazarus with my selection of components, regardless of the lazarus version I'm using. Suppose I use svn and 0.9.26, suppose also that, as you suggest, I use --pcp to keep the configuration different. Now, suppose that while I'm using the svn version, I install a component bundled with lazarus, say, rx. What I want is, when I rebuild 0.9.26, it also has rx installed, but obviously compiling it from the 0.9.26 source directory, and without having to manually install it in the ide. Most important, when I update to 0.9.28 I also want to rebuild it and have rx included. Of course, it wouldn't be an issue if you only have a couple of components installed, but it is when you have 10 or 20. As of now, the only way to do it is to copy the configuration files from one version to the other and manually edit the paths of the components that are under the lazarus source directory. Well, the important point is: without having to manually install it in the ide. If you don't want to use the IDE, then yes, you have to manually edit the config files. What you need is a (command line) tool to copy some part of the config directory to another config directory (here: the list of installed package names and the paths that are not in the lazarus directory). The IDE allows to save the list of installed package names and load them (Packages / congfigure installed packages / import,export). If this list is extended with the paths then you have a tool. But you have to start the IDE for that. At the moment you have to manually open each new package once. Keep in mind that sharing one config with two different lazarus versions is not supported. A newer lazarus can read the older configs. But the other way does not work always, so you can loose some settings. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Mon, 01 Dec 2008 11:34:10 +0100 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: On Mon, 01 Dec 2008 09:08:19 +0100 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: http://news.gmane.org/find-root.php?message_id=%3c48F836DE.2080402%40wetron.es%3e Well, yes and no. It is not a bug, because to use two different settings the --pcp option exists (See my answer to the above mail). And yes, lazbuild does not have an option to override the lazarus source directory. The same is true for many other options. Sharing a lazarus config directory by two different lazarus versions can give trouble. Better use two different lazarus config directories. I'm not sure what settings you want to share. I don't really want to share them, I just want to build lazarus with my selection of components, regardless of the lazarus version I'm using. Suppose I use svn and 0.9.26, suppose also that, as you suggest, I use --pcp to keep the configuration different. Now, suppose that while I'm using the svn version, I install a component bundled with lazarus, say, rx. What I want is, when I rebuild 0.9.26, it also has rx installed, but obviously compiling it from the 0.9.26 source directory, and without having to manually install it in the ide. Most important, when I update to 0.9.28 I also want to rebuild it and have rx included. Of course, it wouldn't be an issue if you only have a couple of components installed, but it is when you have 10 or 20. As of now, the only way to do it is to copy the configuration files from one version to the other and manually edit the paths of the components that are under the lazarus source directory. Well, the important point is: without having to manually install it in the ide. Actually, without having to *re* install it in the ide. I'm perfectly fine with the ide for the first time I install a new package. After that I simply want to use make to rebuild lazarus. If you don't want to use the IDE, then yes, you have to manually edit the config files. What you need is a (command line) tool to copy some part of the config directory to another config directory (here: the list of installed package names and the paths that are not in the lazarus directory). Actually, the paths that *are* in the lazarus directory, adjusting them for the *different* lazarus directory. Components outside of the lazarus tree are no problem. ;) Actually lazarus knows the paths to the packages inside the lazarus sources, because they have packager/globallinks/*.lpl files. When you setup a second config directory it needs to know the outside packages. Maybe the solution could be to simply use relative paths if they are under the lazarus directory. Yes, but that would make using packages from other lazarus source directories impossible. So it is not that simple. The IDE allows to save the list of installed package names and load them (Packages / congfigure installed packages / import,export). If this list is extended with the paths then you have a tool. If it is extended with the path it would probably have the same problem: components outside the lazarus directory will be fine, components in the lazarus directory will point to the old one once imported. Again, maybe the solution could be the use of relative paths. Yes, you need a filter option for the import/export. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Mon, 01 Dec 2008 12:40:19 +0100 Hans-Peter Diettrich [EMAIL PROTECTED] wrote: Luca Olivetti schrieb: Sharing a lazarus config directory by two different lazarus versions can give trouble. Better use two different lazarus config directories. I'm not sure what settings you want to share. I don't really want to share them, I just want to build lazarus with my selection of components, regardless of the lazarus version I'm using. I want to build lazarus from a different source (SVN), too. The instructions for a Windows installation look outdated, the directories do not match the current distribution or SVN, and I'm missing the final step: how to build the new Lazarus at all. Where? I will add it. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Mon, 01 Dec 2008 14:45:55 +0100 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gaertner ha escrit: ;) Actually lazarus knows the paths to the packages inside the lazarus sources, because they have packager/globallinks/*.lpl files. When you setup a second config directory it needs to know the outside packages. Well, when I switched from svn to 0.9.28, and built it with lazbuild, I ended up with components and the lcl from svn instead of 0.9.28. This happens when you use only one config directory instead of two. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Mon, 01 Dec 2008 23:49:04 +0100 Hans-Peter Diettrich [EMAIL PROTECTED] wrote: Mattias Gaertner schrieb: The instructions for a Windows installation look outdated, the directories do not match the current distribution or SVN, and I'm missing the final step: how to build the new Lazarus at all. Where? E.g.: http://wiki.lazarus.freepascal.org/index.php/Getting_Lazarus This page should be renamed to something like how to get the development sources of lazarus. And the other hints should be moved to the installation page: http://wiki.lazarus.freepascal.org/Installing_Lazarus There the compilation of the IDE is described. I will add it. Fine :-) I added link. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Thu, 27 Nov 2008 08:45:21 +0100 Luca Olivetti [EMAIL PROTECTED] wrote: En/na Mattias Gärtner ha escrit: Zitat von Luca Olivetti [EMAIL PROTECTED]: En/na Mattias Gaertner ha escrit: IMO it should go to development documentation, because these files are almost only edited by the IDE itself. I never edited them myself manually. I would even say: If you need to edit/inspect them, then you found a bug. Then I found a bug ;-) I reported here before that, when switching lazarus version I ended up mixing bundled components from the old version to the new one, so I had to manually edit those files to fix the paths. What components, what paths? http://news.gmane.org/find-root.php?message_id=%3c48F836DE.2080402%40wetron.es%3e Well, yes and no. It is not a bug, because to use two different settings the --pcp option exists (See my answer to the above mail). And yes, lazbuild does not have an option to override the lazarus source directory. The same is true for many other options. Sharing a lazarus config directory by two different lazarus versions can give trouble. Better use two different lazarus config directories. I'm not sure what settings you want to share. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to unset bookmarks in the editor?
On Wed, 26 Nov 2008 00:38:48 +0200 Graeme Geldenhuys [EMAIL PROTECTED] wrote: On Tue, Nov 25, 2008 at 11:43 PM, Hans-Peter Diettrich [EMAIL PROTECTED] wrote: I just noticed that I'm using (on Delphi) the old style ctrl-K-# (set) and ctrl-Q-# (goto) commands. I dunno remember whether there is or was a corresponding ctrl-H-# or similar (hide/remove) command in some key mapping. My major problem is finding a suitable (comfortable) set of keyboard shortcuts due to the fact that I use the Programmer Dvorak keyboard layout. By default I need to press Shift to access the numbers on the top row keps, so obviously the standard bookmark shortcuts don't work for me. :-) Programmer Dvorak is a blessing and a pain. It's great for typing source code, but it's a pain with any program that has many default shortcuts. Luckily Lazarus IDE is configurable. I had to sit for a while and reconfigure all my most used shortcuts in Lazarus IDE so they are more comfortable to type. A once off pain, but I'm pretty happy now. :-) Maybe you want to post your dvorak key mapping for laz somewhere. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to unset bookmarks in the editor?
On Tue, 25 Nov 2008 22:23:33 +0100 Hans-Peter Diettrich [EMAIL PROTECTED] wrote: Graeme Geldenhuys schrieb: I see no special advantage in removing bookmarks. In detail not when Delphi doesn't remember bookmarks across sessions :-( I see no special advantage in remembering bookmarks across sessions. :-) Since my Delphi 4 days, I have always used bookmarks as a quick way to jump to section of code - that are relevant to what I am currently working on. Tomorrow or a week from now that code will not be relevant anymore, because I will be working on a different section of the project. An IDE should not guess about what is how long important to the user. When I quit today, and want to resume my work tomorrow, I appreciate to have my current bookmarks as I left them. I also would like persistent folding. I second that. Such session information is a big time saver for me. Also, I can see a potential problem with Lazarus's persistent bookmarks. What if I set bookmark 1 in Unit2.pas. Then remove (delete) Unit2.pas from the project. What happens now if I press Ctrl+Shift+1 while I am in Unit1.pas? Nothing. If a unit is closed its bookmarks are removed. When the unit is reopened the bookmarks are restored (unless you changed them). You can see the active bookmarks in the popup menu of the source editor. Depends on the context. Breakpoints, bookmarks and folding can be seen as project specific, but they also can be seen as file specific. Every IDE will have to specify the implemented handling, depending on reasonable thoughts. The best solution would make everything configurable by the user, with according save/recall features ;-) Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Jump to end of method
On Wed, 26 Nov 2008 11:05:03 +0200 Graeme Geldenhuys [EMAIL PROTECTED] wrote: Hi, Is there a way to jump to the end of the method? For example: I might have a long method. Using Ctrl+Shift+[up|down] jumps from Interface to implementation. But when it jumps to the implementation, I am at the beginning of that method implementation. I often find I need to make some changes at the end of that method. So I need to manually scroll or PgDn until I find it. Search for 'end;' also doesn't work, because the method might have many begin..end blocks. Maybe: move cursor on 'begin' and press Ctrl-Shift-B Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Sat, 22 Nov 2008 19:51:10 +0100 Tom Verhoeff [EMAIL PROTECTED] wrote: I was unable to find (in the wiki/FAQ) where Lazarus stores its global settings/options (the ones that are not project-specific and don't go into *.lpi). Because no one needed general information about them yet. See below. Where does Lazarus look for these options, in what order? This is most likely platform dependent. On my Mac, they appear to be stored in several XML files located in ~/.lazarus/ Yes. (There are some ideas to change this to a more mac like directory.) If I find out, where would be an appropriate place to document this in the wiki? It is something to put in IDE documentation, but I had also hoped to find it under development documentation. IMO it should go to development documentation, because these files are almost only edited by the IDE itself. I never edited them myself manually. I would even say: If you need to edit/inspect them, then you found a bug. To get some more detailed picture, can someone comment on each of the following files/directories that I find in ~/.lazarus/ bin/ - the IDE compiles itself here, if the source directory is readonly cleandirectorydialog.xml - the dlg wih the same name codeexploreroptions.xml - the wnd with the same name compilertest.pas- auto generated, used to test/query compiler editoroptions.xml - Environment options Editor ... environmentoptions.xml - Environment options general ... helpoptions.xml - Help Configure help ... idemake.cfg - the fpc cfg used for compiling the IDE includelinks.xml - what files were included by what file, needed to find the unit of an include file inputhistory.xml - various history lists of comboboxes/edit fields lazarus.dci Environment Code templates ... lib/ - if a package is readonly the IDE uses this directory instead for output miscellaneousoptions.xml - IDE build options and some minors packagefiles.xml - View IDE internals protocol.xml - IDE start log, used to not crash a second time due to a buggy project/package staticpackages.inc - the installed packages as uses section Some packages create their own config files. For example: templates/ - used by the projecttemplates package. Tools Project templates options Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] LHelp missing unit + codetools bug
On Mon, 24 Nov 2008 12:38:05 +0200 Stephano [EMAIL PROTECTED] wrote: Compiling lhelp project produces the following error: chmspecialparser.pas(1,1) Fatal: Can't find unit chmFIftiMain used by chmcontentprovider Additionally, the source editor shows unit ChmSpecialParser and highlights the first line (a comment block) instead of showing unit chmcontentprovider and highlighting the uses clause. However, a 2nd compilation will highlight the right offending line! Lazarus v0.9.27 r17528 i386-win32-win32/win64 FPC 2.2.2 Any suggestions? I improved the message beautifier, so that now the source editor should jump directly to the right place. lhelp compiles here. Maybe your svn is not up2date or contains local changes? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where does Lazarus store/look for global settings/options?
On Mon, 24 Nov 2008 18:04:38 +0100 Tom Verhoeff [EMAIL PROTECTED] wrote: On Mon, Nov 24, 2008 at 11:38:54AM +0100, Mattias Gaertner wrote: On Sat, 22 Nov 2008 19:51:10 +0100 Tom Verhoeff [EMAIL PROTECTED] wrote: On my Mac, they appear to be stored in several XML files located in ~/.lazarus/ Yes. (There are some ideas to change this to a more mac like directory.) Where do they go under Windows and Linux? Linux, BSD, Solaris: $HOME/.lazarus Windows: depends on the installation. I'm not sure if GetAppConfigDir depends on windows version. Maybe Vincent can tell. You can see the config directory, when starting the IDE on the console. If I find out, where would be an appropriate place to document this in the wiki? It is something to put in IDE documentation, but I had also hoped to find it under development documentation. IMO it should go to development documentation, because these files are almost only edited by the IDE itself. I never edited them myself manually. I would even say: If you need to edit/inspect them, then you found a bug. OK, I'll see if I can find some time to add the information. Thanks. For the plain user, it is still useful to know where Lazarus stores options and settings (e.g. for backup, permission issues). Internal details should indeed go into developer documentation. Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] gtk2 warning
On Sat, 22 Nov 2008 13:49:42 +0100 Marc Weustink [EMAIL PROTECTED] wrote: Paul Ishenin wrote: Mattias Gaertner wrote: I get this at every start: [WARNING] Out of OEM specific VK codes, changing to unassigned [WARNING] Out of unassigned VK codes, assigning $FF Is this known? I see them too. Is that something bad? Yes, this is bad. It means that some keypresses wont get reported anymore. Each key reported by X should get a VK_xxx number assigned to report to the LCL. Based on some lookups, an attempt is made to asign a VK which is constant between widgetsets and is compatible with windows (and thus the VCL and thus the LCL). As a result of this the A key gets the VK_A and the F5 key VK_F5 etc. However problems arise for other keys like the ones with []\;',./-= For known combos, a VK_OEM_ value is assigned (see lcltype.pp for combos). Based on a Microsoft keyboard layout tool, I covered most combos. When no existing VK_ value can be found, values from the unassinged range are assigned first, then from the reserved range and then just $FF since there are no more values to choose from. I wonder what keyboard layouts generate this. ubuntu 8.10, layout USA, generic 105-key(intl) PC Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] gtk2 warning
I get this at every start: [WARNING] Out of OEM specific VK codes, changing to unassigned [WARNING] Out of unassigned VK codes, assigning $FF Is this known? Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Cross compile: Linux - win32 (r17408)
On Mon, 17 Nov 2008 19:35:51 +0100 Vincent Snijders [EMAIL PROTECTED] wrote: 2008/11/17, Osvaldo Filho [EMAIL PROTECTED]: What is wrong? Environment: Ubuntu 8.04.1 FPC: 2.2.3 Lazarus: r17408 in /usr/share/lazarus/ command: make all OS_TARGET=win32 (same with clean) Output: = make -C lcl all make[1]: Entrando no diretório `/usr/share/lazarus/lcl' /bin/rm -f units/i386-win32/alllclunits.ppu /usr/bin/ppc386 -Twin32 -XPi386-win32- -Xr -gl -Fu. -Fuforms -Fuwidgetset -Fu/usr/lib/fpc/2.2.3/units/i386-win32/rtl -Fiinclude -FE. -FUunits/i386-win32 -di386 alllclunits.pp Free Pascal Compiler version 2.2.3 [2008/11/16] for i386 Copyright (c) 1993-2008 by Florian Klaempfl Target OS: Win32 for i386 Compiling alllclunits.pp 76 lines compiled, 1.2 sec 1 note(s) issued make -C interfaces all make[2]: Entrando no diretório `/usr/share/lazarus/lcl/interfaces' make -C win32 all make[3]: Entrando no diretório `/usr/share/lazarus/lcl/interfaces/win32' /bin/rm -f ../../units/i386-win32/win32/interfaces.ppu \ ../../units/i386-win32/win32/interfaces.o /usr/bin/ppc386 -Twin32 -XPi386-win32- -Xr -gl -Fu../../units/i386-win32 -Fu. -Fu/usr/lib/fpc/2.2.3/units/i386-win32/rtl -FE. -FU../../units/i386-win32/win32 -di386 interfaces.pp Free Pascal Compiler version 2.2.3 [2008/11/16] for i386 Copyright (c) 1993-2008 by Florian Klaempfl Target OS: Win32 for i386 Compiling interfaces.pp Compiling win32int.pp win32int.pp(27,26) Warning: User defined: Fix implicit pointer conversions Compiling win32wsextdlgs.pp win32wsextdlgs.pp(239,1) Error: resource compiler not found, switching to external mode win32wsextdlgs.pp(239,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[3]: ** [interfaces.ppu] Erro 1 make[3]: Saindo do diretório `/usr/share/lazarus/lcl/interfaces/win32' make[2]: ** [win32_all] Erro 2 make[2]: Saindo do diretório `/usr/share/lazarus/lcl/interfaces' make[1]: ** [interfaces] Erro 2 make[1]: Saindo do diretório `/usr/share/lazarus/lcl' make: ** [lcl] Erro 2 Compile with OPT='-va' (redirect output to file) to find out where the compiler is looking for the resource compiler. Try to create a link: sudo ln -s /usr/bin/windres /usr/bin/i386-win32-windres Mattias ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus