Re: [Lazarus] Please test this page
2015-11-19 2:38 GMT+01:00 ListMember <listmem...@letterboxes.org>: > These are the steps I have performed with each browser. > == > > 1) Got to http://docs.getlazarus.org/ > 2) Write 'TPersist' and select from the dropdown list > 3) Click 'Overview', 'Classes', 'Types' etc. on the orange bar at the top. > > Here is what happens with each browser > == > > -- Chromium 16.0.877.0 (Developer Build 100581 Windows) > 1) Works > 2) Shows nothing below the line with text "Base class for streaming system > and persistent properties." > 3) None of these are available for click. All grayed/disabled. > > -- IE 11 11.0.25 > 1) Works > 2) Works. > 3) Shows blank page (except for 'Search' bar at the top) so test wasn't > performed. > > -- PaleMoon 25.8.0 (x64) > 1) Works > 2) Works > 3) Works but does a self-refresh to show scrollbars. > > -- Waterfox 40.1.0 (x64) > 1) Works > 2) Works > 3) Works but does a self-refresh to show scrollbars. > > -- Firefox 42.0 > 1) Works > 2) Works > 3) Works but does a self-refresh to show scrollbars. > FWIW, I tested on my Windows 7 64 bits -- Chromium Portable 43.0.2357.18 64-bit 3) No self-refresh. -- IE 11 11.0.9600.18059 3) Clicking on any menu item clears the menu and gives a blank page. -- Firefox 42.0 3) No self-refresh. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Please test this page
2015-11-19 12:13 GMT+01:00 Anthony Walter <sys...@gmail.com>: > Frederic, I made a minor correction. Can you try on IE11 again? > Minor correction but big results :-) It works now. So that I can now tell that I don't see any refresh in IE either, not even on "Index". -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] WinCE call for testers
2015-10-15 11:15 GMT+02:00 Sven Barth <pascaldra...@googlemail.com>: > Am 15.10.2015 10:20 schrieb "patspiper" <patspi...@gmail.com>: > > > > Hi, > > > > The bug reporting/testing/fixing cycle for WinCE has been severely > impacted by the ever dwindling number of WinCE users. I therefore ask all > interested users to identify themselves so that we are able to communicate > more closely in order to test/apply provided patches, especially that what > may work for one device and use case might not work somewhere else or even > break something else in other use cases. > > I might not use it actively anymore and also not for work, but I still > have three Windows Mobile devices available to me which I could use for > testing. > > Regards, > Sven > Same for me, I have one HP still used for games. I never develop in mobile devices, but I guess I could load and run a program on it, if it is useful. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Close tabs on double click
2015-08-06 21:50 GMT+02:00 Václav Valíček vac...@valicek.name: Hi, middle button/wheel click isn't enough? Works almost everywhere in windows and linux afaik. Václav Valíčekvac...@valicek.name Dne 6.8.2015 v 18:37 Aradeonas napsal(a): Hi, Is this option available? It very easy to use and good,I think CNWizard for Delphi have this option and its very good. If there isnt is there any close button for faster closing that right click and close?! I never use this command, I am not personally interested, but how do you do a middle button / wheel click on a touch pad? Or with a trackball? And I don't see how you could do it on a Mac either (but I confess I only use my daughter's Mac to launch a song or a movie). -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Capturing the output from a command using TPorcess
2015-07-20 21:41 GMT+02:00 Richard Mace richard.m...@gmail.com: Hi All, I hope this question is going to make sense. I am trying to obtain the MAC Address of a remote PC, using psexec \\pcname and running the command ipconfig /all. If I run the psexec command from my machine via a command prompt, ipconfig /all is successfully run on the remote machine, and I can see it's MAC address, however, if I run it via TProcess, in Lazarus, the output I get from TProcess is the output from psexec (successfully run and exited with error code 0) rather than the output from ipconfig. How can I code TProcess, so that it shows me the output from the ipconfig /all command instead? Hello, This is not exactly what you asked for, but you could simply redirect the output with something like ipconfig /all ipconfig..txt then read the contents of ipconfig.txt (or whatever name you gave to the output file). You must take care where you put the output file, though: you must have the rights to write in that folder. Of course my solution is only a quick trick, the answer to your question would be much cleaner and much more interesting. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OOP - where do you start?
2015-06-26 13:30 GMT+02:00 Graeme Geldenhuys mailingli...@geldenhuys.co.uk : Hi, Hello, Last night I was working on a relatively new project. This got me thinking... How do others tackle such a task? So here is my question: When faced with a new database related project, where do you start? Do you first design the database schema, then build the BOM (Business Objects) accordingly? Or, do you first design the BOM, then design the database schema to fit. Personally, most of my project were started by first creating the database schema. Don't ask me why, that is just what I did. Maybe it was because many of the tools I use, can write much of the boiler plate code for me, and they do that by querying a database structure. But I've been thinking that with my next project, I'm going to start with the BOM first, and see how it goes. I'm assuming the end result should be the same, no matter which part I tackled first. What's your thoughts? IMO, it depends on the complexity of the project. In simple projects (a few tables), usually the BOM maps exactly to the database, so I do both at the same time. But in complex projects, BOM can be significantly different from the database structure. For example, the BOM could include things which would actually map to aggregated views. Usually I first design the BOM according to the requirements, then I rework the database structure, including for example things which were not requested but which I feel will be useful later (timestamps, history tables, intermediate calculation steps, future developments...). One classical example: if I am asked to create a table with name and address, I actually create a table with the name and a separate table with the addresses, so that when (this always happens) the client discovers that people have more than one address, the database structure is ready, but also the code using that structure is ready too, or at least the modifications to that code are going to be simpler. In my example, the BOM still has the address included in the same object as the name, and the UI can behave as if this was physically true. In a way, separating BOM from physical structure brings the same kind of advantages that structured programming does. Just as I can look at a piece of code from a higher level or right at the deepest code in the deepest routine, depending on my needs, I can look at the data from a wide point (usually using views or complex queries) or break the data in smaller parts and look at the physical data directly in the tables. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Docked Form
2015-06-12 8:53 GMT+02:00 Ondrej Pokorny laza...@kluug.net: Hello Sandro, this seems to be a problem with (your) gmail spam filter. Ondrej On 12.06.2015 08:04, Sandro Cumerlato wrote: Hello Balázs, unfortunately this mail has been marked as SPAM by gmail. Are you registered to the mailing list? Do other members have received the message? I use the GMail web interface too and I often have this spam issue with mails coming from yahoo (among others). I solved the issue by entering a filter in the GMail web interface telling it never to consider as spam mails with - list:fpc-pascal.lists.freepascal.org - list:lazarus.lists.lazarus.freepascal.org - list:fpc-devel.lists.freepascal.org -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] (no subject)
2015-05-07 17:54 GMT+02:00 Sandro Cumerlato sandro.cumerl...@gmail.com: I'd like to recommend you to STRIP and UPX executables under Windows. Initial executables size: lazarus.exe 170859359 bytes (*) lazbuild.exe 52797635 bytes startlazarus.exe 15897492 bytes after STRIP and UPX: lazarus.exe 4093952 bytes (*) lazbuild.exe 1653760 bytes startlazarus.exe 1653760 bytes executables size is reduced to: lazarus.exe 2% of the original size lazbuild.exe 3% of the original size startlazarus.exe 10% of the original size ...and Lazarus (*) starts as a real cheetah! :) Just my 2 cents. Some anti-virus software consider UPXed executables as potentially dangerous. So while this idea often works, I suggest it is better left as an option to the users. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] virus in lazarus-1.2.6-fpc-2.6.4-win32.exe?
2014-12-12 14:25 GMT+01:00 Kostas Michalopoulos badsectorac...@gmail.com: I've found that virustotal quite often marks programs made with FPC as having viruses. Usually one or two of the checkers there (and avast sometimes is one of them). Messing with compiler flags (like how DLLs are being used) tends to make them go away. You can download an ISO with Windows directly from Microsoft, put it on a VM like VirtualBox, install FPC, make a small program, upload it to virustotal and have some of the antiviruses there tell you that there are viruses on the program :-P On Fri, Dec 12, 2014 at 10:08 AM, Frederic Da Vitoria davito...@gmail.com wrote: 2014-12-12 9:47 GMT+01:00 Dr Engelbert Buxbaum engelbert_buxb...@web.de : Hi, Avast reports that several files from the win executable of Lazarus are infected with win64 evo-gen. Is this a problem of Lazarus or of Avast? Sincerely Engelbert Do you mean the IDE lazarus.exe file or an executable compiled by Lazarus/fpc? When did the Avast message appear? When you installed /upgraded Lazarus or after Avast upgraded it's virus database (which happens quite frequently IIRC)? I have downloaded and installed Lazarus 1.2.6, and my AVG didn't say anything. Still doesn't say anything now, actually. You could have a mutating virus on your system which Avast could not detect before but has later infected your Lazarus executable, but I guess this is a false positive. You could check with https://www.virustotal.com/ Yes, that's the price to pay for heuristics and less-than-exact virus signature determination. VirusTotal exists because no antivirus is completely reliable, all of them think sometimes there are virus where there is none and of course all antivirus miss other viruses. One of the things VirusTotal can help you for is deciding whether your antivirus is right or has detected a false positive. This is usually what I do when my AVG tells it has found a virus: I check on VirusTotal and if VirusTotal leads me to believe it is a false positive, I send a message to AVG asking them to check. I don't know about Avast, but with AVG a get an answer in a few days, and usually the answer is that it was indeed a false positive and that they upgraded their signature files. It seems Avast has a similar procedure: http://www.avast.com/contact-form.php?subject=VIRUS-FILE . I suggest you send false positives to them. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] virus in lazarus-1.2.6-fpc-2.6.4-win32.exe?
2014-12-12 9:47 GMT+01:00 Dr Engelbert Buxbaum engelbert_buxb...@web.de: Hi, Avast reports that several files from the win executable of Lazarus are infected with win64 evo-gen. Is this a problem of Lazarus or of Avast? Sincerely Engelbert Do you mean the IDE lazarus.exe file or an executable compiled by Lazarus/fpc? When did the Avast message appear? When you installed /upgraded Lazarus or after Avast upgraded it's virus database (which happens quite frequently IIRC)? I have downloaded and installed Lazarus 1.2.6, and my AVG didn't say anything. Still doesn't say anything now, actually. You could have a mutating virus on your system which Avast could not detect before but has later infected your Lazarus executable, but I guess this is a false positive. You could check with https://www.virustotal.com/ -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus and Application.ProcessMessages
2014-12-04 18:20 GMT+01:00 Paul Breneman list2...@brenemanlabs.com: On 12/03/2014 04:51 PM, Paul Breneman wrote: On 12/03/2014 04:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. So I used a loop like the following: EndTime := Now + EncodeTime(0, 0, 15, 0); While Now EndTime do Application.ProcessMessages; The problem is that the core this process runs on is running 60-80% cpu utilization. Is there away to do something like this and not max the core out? This computer is an i5 Desktop running Linux Mint 17-64. Thanks in advance,T. The quickest thing to do is to put Sleep(10) inside the while loop. That will help you get longer battery life on a laptop and a cooler CPU! But I would normally use a separate thread. There are a number of examples here (see ExThread---): http://turbocontrol.com/APro.htm If you search CodeNewsFast you might be able to turn up a number on explanations on why I recommend using a separate thread. Regards, Paul www.TurboControl.com I'm replying a second time as my first reply didn't get posted (yet). Here is a message that has my (old) summary: :) http://codenewsfast.com/cnf/article/0/permalink.art-ng1824q786 FWIW, your previous message did reach me: Received: by 10.152.234.229 with SMTP id uh5csp19639lac; Wed, 3 Dec 2014 14:51:27 -0800 (PST) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-12-01 19:29 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: On Mon, Dec 1, 2014 at 8:11 PM, Frederic Da Vitoria davito...@gmail.com wrote: Properties : NVDA doesn't announce the property names in the Object inspector. This is a tough one. The property names are just text, not controls. Accessibility support should be explicitly built into OI. Felipe may know how big job it would be. I looked a little around to try to find how TCheckbox manages to be properly recognized by NVDA. I am guessing it has something to do with TLazAccessibleObject. But as I don't see TCheckbox doing anything in order to make it work, so that I am at a loss to tell why TCheckboxThemed does not work too. If someone has some more information on how this works, I could try to fix it. As explained earlier, TCheckbox binds to native (WinAPI) widget. TCheckboxThemed is a custom drawn component. Contributions are welcome. Good luck! Juha OK, I'll work on it. but I'm a slow worker, I have lots of completely different things to do at the same time. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-29 18:23 GMT+01:00 Frederic Da Vitoria davito...@gmail.com: 2014-11-29 15:35 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: On Thu, Nov 27, 2014 at 3:31 PM, Frederic Da Vitoria davito...@gmail.com wrote: That's how it is supposed to work. But I remember that Delphi controls were based on Windows controls too, but they weren't recognized by at least one screen reader. But this may be this specific screen reader's fault, which maybe did not gather information using the Microsoft recommended method. Yes, there may be issues which I do not know about. Felipe knows this topic best. Sometimes lots of glue code is needed between LCL component and the widgetset which makes them partly custom drawn components. I thought a Checkbox is an easy one but maybe not. I plan to commit the new component from Vojtěch Čihák and use it in Object Inspector Boolean editor, but initially enclosed in IFDEFs as an alternative for the current TCheckBox. Frederic Da Vitoria, can you later test accessibility related issues? I think they are important. I'll try to. It has been a long time since I ran this software, but I have a friend who is still using it sometimes, he should be able to help me. Here are my results using NVDA 2014.4 on Windows 7 64 bits Properties : NVDA doesn't announce the property names in the Object inspector. This is not related to the new checkboxes, but it may influence how corrections are prioritized. Because the property names are not told (sorry, I can't decide how this should be said in English: would one say something (name, property, label...) is enunciated, told, said, announced...?) TCheckBoxThemed : design mode : NVDA won't say the control name in the form editor, whether I select it by clicking on it or by tabulating to it. Same for a standard TCheckbox. Afterthought; Because the Objecct inspector does not currently tell the property names, I guess most blind users wouldn't use a form designer but would edit directly the lfm file with a text editor. But this is only my guess, I don't know any blind developer who uses a IDE, although I am sure there are lots of them. run mode : NVDA tells the control name, but it won't say if it is checked or not. When pressing the space bar, NVDA says only space, and does not react at all when clicking on the TCheckboxThemed. This works perfectly with a TCheckBox. I am sorry to conclude that TCheckboxThemed is currently unusable for a blind user. I looked a little around to try to find how TCheckbox manages to be properly recognized by NVDA. I am guessing it has something to do with TLazAccessibleObject. But as I don't see TCheckbox doing anything in order to make it work, so that I am at a loss to tell why TCheckboxThemed does not work too. If someone has some more information on how this works, I could try to fix it. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-29 15:35 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: On Thu, Nov 27, 2014 at 3:31 PM, Frederic Da Vitoria davito...@gmail.com wrote: That's how it is supposed to work. But I remember that Delphi controls were based on Windows controls too, but they weren't recognized by at least one screen reader. But this may be this specific screen reader's fault, which maybe did not gather information using the Microsoft recommended method. Yes, there may be issues which I do not know about. Felipe knows this topic best. Sometimes lots of glue code is needed between LCL component and the widgetset which makes them partly custom drawn components. I thought a Checkbox is an easy one but maybe not. I plan to commit the new component from Vojtěch Čihák and use it in Object Inspector Boolean editor, but initially enclosed in IFDEFs as an alternative for the current TCheckBox. Frederic Da Vitoria, can you later test accessibility related issues? I think they are important. I'll try to. It has been a long time since I ran this software, but I have a friend who is still using it sometimes, he should be able to help me. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-27 0:20 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: On Wednesday, November 26, 2014, Vojtěch Čihák vojtech.ci...@atlas.cz wrote: I considered other solution. Create a new simple visual component (TCheckBoxThemed or so). It will have class method: class procedure PaintSelf(ACanvas: TCanvas; AChecked: Boolean); Ok, the class paint method allows drawing non-active checkboxes without an overhead. It is a good idea. Sandro Cumerlato was planning for something similar, a white background and clicking anywhere on a selected row would change the state. Please communicate with him if you plan to implement it. You both are custom component wizards. Hmm, would such a control be screen-reader friendly? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-27 11:43 GMT+01:00 Vojtěch Čihák vojtech.ci...@atlas.cz: Hi, what does it mean? __ Od: Frederic Da Vitoria davito...@gmail.com Komu: Lazarus mailing list lazarus@lists.lazarus.freepascal.org Datum: 27.11.2014 09:37 Předmět: Re: [Lazarus] OI Checkboxes 2014-11-27 0:20 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: On Wednesday, November 26, 2014, Vojtěch Čihák vojtech.ci...@atlas.cz wrote Hmm, would such a control be screen-reader friendly? See https://en.wikipedia.org/wiki/Screen_reader . Screen readers allow blind or visually impaired users to use computers. In order to work, screen readers must know what a control is, in order to be able to speak or display in braille what is going on. In our specific situation, a screen reader would need to know that TCheckBoxThemed is a checkbox. I guess that the screen reader wouldn't need to be able to distinguish the new TCheckBoxThemed from a standard checkbox, pixel-level alignment considerations are usually not very significant to blind users. I see 2 ways to achieve this: - either TCheckBoxThemed is derived the standard Windows checkbox in such a way that the screen reader will directly see and interpret the standard control - or TCheckBoxThemed is a brand new control created from scratch, which means a blind user would have to teach his screen reader that this new control is a check box (if the screen reader offers such a functionality). Obviously, this second solution isn't as good as the first one. I don't know how screen-reader-friendly is the LCL's TCheckbox, using it to derive TCheckBoxThemed could be a good solution or not. I don't have or use any screen reader software, but I know at least one (NVDA) which I could install to check on Windows. Because screen readers use quite different methods for gathering information, any tests I would do with NVDA would not necessarily apply to other software or OS. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-27 12:53 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: I don't know how screen-reader-friendly is the LCL's TCheckbox, using it to derive TCheckBoxThemed could be a good solution or not. Frederic, you apparently don't know how LCL components work. They bind into native widgets. In case of Windows it means Windows GUI controls. It means the screen reader support and all comes as an automatic bonus. That's how it is supposed to work. But I remember that Delphi controls were based on Windows controls too, but they weren't recognized by at least one screen reader. But this may be this specific screen reader's fault, which maybe did not gather information using the Microsoft recommended method. You suggested that a checkbox be derived directly from standard Windows checkbox. Obviously it is not possible because this is a cross-platform system. Yes, of course, I forgot about that :-P A custom drawn widget library must implement screen reader support by itself. Now Object Inspector uses LCL's TCheckbox on the selected row. I guess it is screen-reader friendly then. The new planned custom drawn control may indeed break it. The support must be implemented somehow but I have no idea how. This particular situation is what I was trying to draw attention to :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Maybe a bug: click on TImage behind another control with SetShape
2014-11-22 13:40 GMT+01:00 Fabio Luis Girardi fluisgira...@gmail.com: Polyline is a different control. The area of line is the area of the control, other area will be full transparent and must pass the events to controls behind. If you click on line, the click must be fired on Polyline object, otherwise, it must be fired on the first control behind of polyline. The bug here is: I have two TImages and one polyline. The uppermost is TImage is positioned in a removed area (transparent) of polyline and the other TImage is the background. When I click on uppermost TImage click isn't fired on it nor on background TImage. It's fired on TForm! The same behavior happens if polyline is the uppermost control. From your description, this looks indeed like a bug. Maybe someone else has ideas about this? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] UTF8 RTL for Windows
2014-11-25 14:45 GMT+01:00 Mattias Gaertner nc-gaert...@netcologne.de: On Tue, 25 Nov 2014 11:53:00 +0100 Hans-Peter Diettrich drdiettri...@aol.com wrote: [...] Correction: *This* Char type needs to be extended. Please specify. The ThousandSeparator type is Char, which does not work with Russian in UTF-8. Well, at least if you want the non breakable space instead of the normal space. French uses non-breakable space too. According to several sources, the correct character should actually be narrow no-break space https://en.wikipedia.org/wiki/Thin_space. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Maybe a bug: click on TImage behind another control with SetShape
I may be wrong, but this seems different from the problem you are describing: in the bugtracker issue, the click triggers the Form handler instead of being sent to a Control. In your problem, from your description, I thought the click triggered the polyline control while you would have wanted it to be handled by the TImage which is behind the polyline. In a way, your problem is not enough transparency (in terms of who gets to handle the click event) while the bugtracker bug is too much transparency. Or did I misunderstand you? 2014-11-22 10:01 GMT+01:00 Fabio Luis Girardi fluisgira...@gmail.com: Here is it: http://bugs.freepascal.org/view.php?id=20381 2014-11-21 22:24 GMT-02:00 Fabio Luis Girardi fluisgira...@gmail.com: I found this bug on bug tracker. I followed your idea and send a patch that solves this. I'll try another approach tomorrow. Thank you very much! Em 21/11/2014 20:48, Frederic Da Vitoria davito...@gmail.com escreveu: 2014-11-21 16:01 GMT+01:00 Frederic Da Vitoria davito...@gmail.com: 2014-11-20 19:21 GMT+01:00 Fabio Luis Girardi fluisgira...@gmail.com: I don't know if this is a bug or not. I created a control from a TCustomControl that draws a polyline with a transparent background. The transparent effect has been using SetShape procedure using a bitmap of 1 bit color depth. The bug (I don't know if this is a bug) is that a TImage behind of a instance of my polyline control don't receive the click messages, but a TButton instance receives. So, I don't know if this is a bug or I have to do something in my control to send these messages to TImage behind. I had once a similar issue with a tPanel behind another control, in Delphi. IIRC, I indeed had to forward the messages in some way to the tPanel. I can check in my archives, if you want, but I won't be able to do it before tomorrow. I just checked. Sorry, my memory was wrong, I did use TButtons. But it makes sense that the uppermost control would prevent any deeper control from receiving clicks, even if the uppermost control is visually transparent. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PScanner tkComment token type
2014-11-21 0:58 GMT+01:00 Mattias Gaertner nc-gaert...@netcologne.de: On Fri, 21 Nov 2014 00:24:11 +0100 Frederic Da Vitoria davito...@gmail.com wrote: [...] Note: In FPC default $mode FPC and Lazarus default $mode ObjFPC nested comments are allowed. It is not allowed in $mode Delphi. Ah, the fourth way I wrote about :-) Yes, I could try this. but I am a bit anxious at the idea of switching mode now. Couldn't there be code which would still compile but with different results, thus creating unexpected bugs? I guess yes. Although it is unlikely, because mode ObjFPC is usually more strict than mode Delphi. Oh well, I could try. I have enough test cases to be reasonably sure. So I am less anxious to change something in the scanner, but wouldn't something like what I suggested still be an improvement? I'm not familiar with the fpprofiler code, so I can't help you here. Thanks for trying :-) I thought that PScanner was outside of fpprofiler, but I just saw that it is actually part of fpprofiler, so I should feel free to implement the modifications I want, provided of course that I don't lose any functionality. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Maybe a bug: click on TImage behind another control with SetShape
2014-11-20 19:21 GMT+01:00 Fabio Luis Girardi fluisgira...@gmail.com: I don't know if this is a bug or not. I created a control from a TCustomControl that draws a polyline with a transparent background. The transparent effect has been using SetShape procedure using a bitmap of 1 bit color depth. The bug (I don't know if this is a bug) is that a TImage behind of a instance of my polyline control don't receive the click messages, but a TButton instance receives. So, I don't know if this is a bug or I have to do something in my control to send these messages to TImage behind. I had once a similar issue with a tPanel behind another control, in Delphi. IIRC, I indeed had to forward the messages in some way to the tPanel. I can check in my archives, if you want, but I won't be able to do it before tomorrow. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Maybe a bug: click on TImage behind another control with SetShape
2014-11-21 16:01 GMT+01:00 Frederic Da Vitoria davito...@gmail.com: 2014-11-20 19:21 GMT+01:00 Fabio Luis Girardi fluisgira...@gmail.com: I don't know if this is a bug or not. I created a control from a TCustomControl that draws a polyline with a transparent background. The transparent effect has been using SetShape procedure using a bitmap of 1 bit color depth. The bug (I don't know if this is a bug) is that a TImage behind of a instance of my polyline control don't receive the click messages, but a TButton instance receives. So, I don't know if this is a bug or I have to do something in my control to send these messages to TImage behind. I had once a similar issue with a tPanel behind another control, in Delphi. IIRC, I indeed had to forward the messages in some way to the tPanel. I can check in my archives, if you want, but I won't be able to do it before tomorrow. I just checked. Sorry, my memory was wrong, I did use TButtons. But it makes sense that the uppermost control would prevent any deeper control from receiving clicks, even if the uppermost control is visually transparent. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-20 14:28 GMT+01:00 Juha Manninen juha.mannine...@gmail.com: If 3d effect is needed as Frederic wrote, it can be added. My point of view may be old school :-) But I feel that controls should in some way visually hint if they are editable or not. In software which ignore this, the only way to check if a control is editable or not is to click on it. And sometimes clicking on a control can have irreversible consequences. In old Windows versions, this was achieved using 2D/3D, but newer versions of Windows (I have not checked the Microsoft recommendations for years) could use another clue (rounded/square angles, color...). Anyhow, Sandro's design definitely suggests to me that the checkbox is non-editable. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] PScanner tkComment token type
Hello, I am starting to use fpprofiler. Because I did not know what parameters should be sent to fpc, I decided to use fppinsert. At least one type of instrumented code fails to compile: // some code { some comment } is wrongly changed into { some code { some comment } } which does not compile. AFAICS the issue comes from the fact that PScanner only has the tkComment type, so that when fppinsert tries to rebuild the code, it has no way to know if it should use '//' or '{ }'. Of course, I can't simply replace tkComment with 2 new distinct types, there is probably some other code somewhere, not even in the Lazarus repository, which uses the current set of token types. I see at least 3 ways to solve my issue 1 - change fppinsert so that if it finds a bracket in the token, it should use '//' - I don't like much this solution 2 - use a flag in TPascalScanner (something like CommentType) allowing to know the type of comment if needed 3 - add 2 types tkCommentSlash and tkCommentBrackets into TToken plus an option to TPOptions so that the calling code could choose to use the simple tkComment or the more specific tkCommentSlash and tkCommentBrackets I like the third method best, but I may be missing some drawbacks in these options, so what would be the preferred way to do it? Maybe a fourth idea? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] PScanner tkComment token type
2014-11-20 23:51 GMT+01:00 Mattias Gaertner nc-gaert...@netcologne.de: On Thu, 20 Nov 2014 23:39:59 +0100 Frederic Da Vitoria davito...@gmail.com wrote: Hello, I am starting to use fpprofiler. Because I did not know what parameters should be sent to fpc, I decided to use fppinsert. At least one type of instrumented code fails to compile: // some code { some comment } is wrongly changed into { some code { some comment } } which does not compile. Note: In FPC default $mode FPC and Lazarus default $mode ObjFPC nested comments are allowed. It is not allowed in $mode Delphi. Ah, the fourth way I wrote about :-) Yes, I could try this. but I am a bit anxious at the idea of switching mode now. Couldn't there be code which would still compile but with different results, thus creating unexpected bugs? Oh well, I could try. I have enough test cases to be reasonably sure. So I am less anxious to change something in the scanner, but wouldn't something like what I suggested still be an improvement? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OI Checkboxes
2014-11-19 22:19 GMT+01:00 Sandro Cumerlato sandro.cumerl...@gmail.com: It would be nice to have a framed checkbox, look at the attachment rendered image, the entire area should respond to mouse click. I am not so sure about that. I always felt that 3d controls meant that user interaction was allowed while 2d controls were not editable. Your boxed checkbox is 2d... -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OT: Fast image viewer
2014-11-05 13:24 GMT+01:00 Leonardo M. Ramé l.r...@griensu.com: Hi, I'm lookig for a fast-small JPEG/BMP image viewer with Zoom, Pan, and Print (if possible), to be launched from my application and passing a File param or better a Stream to be opened. Can anyone recommend such viewer?. I need it for Windows. Maybe JPEGView? http://sourceforge.net/projects/jpegview/ If you want something better in terms of usability: http://www.faststone.org/ , but definitely not as small as JPEGView -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Having more than 32 elements in a set (TGridOptions of TCustomGrid)
2014-11-05 18:35 GMT+01:00 Rik van Kekem r...@graficalc.nl: So it's not that the set can't hold more than 32 items... It's just you can't use *default* for a property if the set's base has more than 32 values. This is from the Delphi manual (but I'm sure it also applies to FPC): quote The default and nodefault directives are supported only for ordinal types and for set types, *provided the upper and lower bounds of the set's base type have ordinal values between 0 and 31;* /quote Source: http://docwiki.embarcadero.com/RADStudio/XE6/en/Properties So the error message is not misleading at all ;) quote Error: Property can’t have a default value Set properties or indexed properties cannot have a default value. /quote This may be me misunderstanding English, but I feel that it is misleading: To me, Set properties cannot have a default value means that even a set with 2 elements could not have a default value. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Find dialog too tight for translations
2014-10-24 23:34 GMT+02:00 Giuliano Colla giuliano.co...@fastwebnet.it: Il 24/10/2014 17:19, waldo kitty ha scritto: On 10/24/2014 4:39 AM, Jürgen Hestermann wrote: Why is the Direction box placed on the right of all other options? IMO it is just another option as all the others so it should be put below these other options. This would also avoid the problem of moving this box when text becomes long. this is similar to my suggestion posted previously ;) Taking into account all suggestions, I came out with two possible layouts: Option 1 = Buttons at the bottom of the form (like in my previous version) Option 2 = Buttons at the right of the form (like in the original version) (there's also a help button, which is not visible by default, but it may become visible, if the appropriate option is selected. It would go either at the extreme right, or at the bottom, moving nearby button right or up because of anchoring): http://www.bononiadocta.it/Lazarus/Dialogues/Dialogues.png I've put in the image also a localized version, to see what it looks like when strings become much longer. I'd choose option 2 because bottom line risks to become crowded if the help button is added, but I'd like to hear other opinions. Giuliano I believe there is another difference in your layouts: the width of the input fields is different, so that the screen copies are misleading, if the input zones had the same width, the version with buttons at the right would be always wider than the version with buttons at the bottom. I prefer putting the buttons at the bottom because of this: it either allows to have a window less wide (I prefer to have this dialog high than wide because I feel it has less chances of getting in the way) or it allows to make the input zone wider, which is nice when inputting large search strings. I don't have Lazarus here now, so that I can't check: are these dialogues real dialogues (non-resizable) or can they be resized? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus saves source files implicitly
2014-10-24 14:54 GMT+02:00 Juha Manninen juha.mannine...@gmail.com: You had unsaved changes in the unit source. Juha In this situation IMO, there is an update conflict. Couldn't Lazarus detect it and ask the developer what it should do? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] FPC options - cool!
2014-10-20 11:36 GMT+02:00 Reinier Olislagers reinierolislag...@gmail.com: Just wanted to thank whoever wrote the project options/other tool to select fpc options... very nicely done, including the search functionality. Now I don't need to remember that I need -Xe but can search for linker ;) Yes, being able to search into the options is really nice! -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Error messages: cannot versus can't
2014-10-17 12:11 GMT+02:00 Michael Schnell mschn...@lumino.de: On 10/17/2014 11:58 AM, Reinier Olislagers wrote: contractions like cannot=can't are discouraged, IMHO a bad idea. Error messages should be as short as possible (while clearly understandable). In this particular example, File bla.txt not found avoids the problem and is shorter :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Redundant text on project buttons
2014-10-14 20:02 GMT+02:00 Juha Manninen juha.mannine...@gmail.com: There is also a report about it : http://bugs.freepascal.org/view.php?id=22278 Clearly there should be an option for Icon only / Text Only / Both. It should be respected by all IDE windows and not only Project Inspector. Yes, I think '+' and '-' signs are more understandable than most other icons. In many situations I notice hovering my mouse cursor over speedbuttons just to see their hints because the icon itself is not informative enough. Then it is better if there is text already without hovering. Juha Same for me -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 1.2.6 Release
2014-10-14 17:12 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de: The Lazarus team is glad to announce the release of Lazarus 1.2.6. This release was built with fpc 2.6.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.6_.28Merged.29 http://wiki.lazarus.freepascal.org/User_Changes_2.6.4 On Windows the installer now allows 2 independent installations. http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Installation_of_multiple_Lazarus The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the Lazarus 1.2.6 directory. Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29 for more details. Minimum requirements: Windows: 98 FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit Mac OS X: 10.5 for Intel cpus, 10.4 for PowerPC, LCL only 32bit, non LCL apps can be 64bit The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2_6 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias I downloaded 1.2.6 32 bits and installed it over 1.2.4 (standard installation). When I launch Lazarus, the welcome window says 1.2.4 and then get the Configure Lazarus IDE dialog which tells me: warning: wrong version in ide\version.inc: 1.2.6. All the other tabs seem ok. I'm a bit confused, what should I do? I am running Windows 7 64 bits, -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 1.2.6 Release
2014-10-14 19:17 GMT+02:00 Frederic Da Vitoria davito...@gmail.com: 2014-10-14 17:12 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de: The Lazarus team is glad to announce the release of Lazarus 1.2.6. This release was built with fpc 2.6.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.6_.28Merged.29 http://wiki.lazarus.freepascal.org/User_Changes_2.6.4 On Windows the installer now allows 2 independent installations. http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Installation_of_multiple_Lazarus The release is available for download on SourceForge: http://sourceforge.net/projects/lazarus/files/ Choose your CPU, OS, distro and then the Lazarus 1.2.6 directory. Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29 for more details. Minimum requirements: Windows: 98 FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit Mac OS X: 10.5 for Intel cpus, 10.4 for PowerPC, LCL only 32bit, non LCL apps can be 64bit The svn tag is http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2_6 For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at: ftp://freepascal.dfmk.hu/pub/lazarus/releases/ and later at (after some time for synchronization) http://michael-ep3.physik.uni-halle.de/Lazarus/releases/ and http://mirrors.iwi.me/lazarus/ Mattias I downloaded 1.2.6 32 bits and installed it over 1.2.4 (standard installation). When I launch Lazarus, the welcome window says 1.2.4 and then get the Configure Lazarus IDE dialog which tells me: warning: wrong version in ide\version.inc: 1.2.6. All the other tabs seem ok. I'm a bit confused, what should I do? I am running Windows 7 64 bits, I just checked: lazarus.exe is 2.6.4 from 2014-06-14. Something must have gone wrong during the update. I'm going to stop Lazarus, check there are no hidden tasks left and restart the update. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus 1.2.6 Release
2014-10-14 19:27 GMT+02:00 Mattias Gaertner nc-gaert...@netcologne.de: On Tue, 14 Oct 2014 19:17:08 +0200 Frederic Da Vitoria davito...@gmail.com wrote: [...] I downloaded 1.2.6 32 bits and installed it over 1.2.4 (standard installation). When I launch Lazarus, the welcome window says 1.2.4 and then get the Configure Lazarus IDE dialog which tells me: warning: wrong version in ide\version.inc: 1.2.6. All the other tabs seem ok. I'm a bit confused, what should I do? I am running Windows 7 64 bits, Maybe you have a custom built IDE left. Check View / IDE Internals / About IDE, then in page General under Global IDE Options / Primary Config Directory. This gives you a directory. Search a lazarus.exe (for example bin\lazarus.exe). Close the IDE. Delete the bin\lazarus.exe and start the IDE. Mattias You mean: make fpc compile the IDE from the sources? Nice, I should have thought of that. This is definitely one of the nicest points of Lazarus :-) Out of curiosity, I did not do it thus, though. I redid the upgrade and got the same result. I had previously checked, I did not have any Lazarus task in memory. So I simply moved Lazarus.exe to another partition and redid the upgrade for the third time and this time I got the Upgrade configuration dialog. Conclusion: - I don't know why the upgrade would not overwrite Lazarus.exe (is my anti-virus playing me some silly trick?) - Your way to do it would have certainly have been much faster :-D Thanks for the new version. Now I'm going to play a little with it. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Fwd: New Lazarus pascal conference
2014-10-13 15:04 GMT+02:00 Mark Morgan Lloyd markmll.laza...@telemetry.co.uk: Marc Weustink wrote: FYI Forwarded Message From: Detlef Overbeek edi...@blaisepascal.eu Reply-To: off...@blaisepascal.eu We invite you for the international Pascal conference / workshop on saturday november the 15th 2014. I'd suggest that telling us what country it's in would be a good start. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus I again received the question after the answer. Again I took a llok at the header Received: from mailer.lazarus.freepascal.org (mailer.lazarus.freepascal.org. [80.123.225.56]) by mx.google.com with ESMTPS id t1si17625700wja.121.2014.10.13.06.40.37 for multiple recipients (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 Oct 2014 06:40:38 -0700 (PDT) Received-SPF: none (google.com: lazarus-boun...@lists.lazarus.freepascal.org does not designate permitted sender hosts) client-ip=80.123.225.56; Authentication-Results: mx.google.com; spf=neutral (google.com: lazarus-boun...@lists.lazarus.freepascal.org does not designate permitted sender hosts) smtp.mail=lazarus-boun...@lists.lazarus.freepascal.org Received: from localhost ([127.0.0.1] helo=LazarusTeam32.firmos.at) by LazarusTeam32.firmos.at with esmtp (Exim 4.69 (FreeBSD)) (envelope-from lazarus-boun...@lists.lazarus.freepascal.org) id 1XdfJI-000BLy-BQ; Mon, 13 Oct 2014 15:05:12 +0200 Could the problem be related to version=TLSv1 cipher=RC4-SHA bits=128/128 ? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] IDE key shortcut file
2014-10-01 19:10 GMT+02:00 Rik van Kekem r...@graficalc.nl: Jürgen Hestermann wrote: As already written in my other mail I confused editoroptions.xml with environmentoptions.xml (both start with an e and end on .xml ;-)) Aaaah, your mails arrived here in the wrong order ;) Here too :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] IDE key shortcut file
Actually, I received Rik's first answer before anything else. I don't know for the rest, because I checked my mails just now and my mail client has corrected the order of the mails. I took a look at the headers of the first mail (since this one arrived after Rik's answer, it means it was delayed) and I found this: Received: from mailer.lazarus.freepascal.org (mailer.lazarus.freepascal.org. [80.123.225.56]) by mx.google.com with ESMTPS id m3si1943124wja.113.2014.10.01.09.53.49 for multiple recipients (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 09:53:50 -0700 (PDT) Received-SPF: none (google.com: lazarus-boun...@lists.lazarus.freepascal.org does not designate permitted sender hosts) client-ip=80.123.225.56; Authentication-Results: mx.google.com; spf=neutral (google.com: lazarus-boun...@lists.lazarus.freepascal.org does not designate permitted sender hosts) smtp.mail=lazarus-boun...@lists.lazarus.freepascal.org Received: from localhost ([127.0.0.1] helo=LazarusTeam32.firmos.at) by LazarusTeam32.firmos.at with esmtp (Exim 4.69 (FreeBSD)) (envelope-from lazarus-boun...@lists.lazarus.freepascal.org) id 1XZMdu-0006zw-8r; Wed, 01 Oct 2014 18:20:42 +0200 I don't know why it took more than 30 minutes from LazarusTeam32 to google. 2014-10-01 20:03 GMT+02:00 Frederic Da Vitoria davito...@gmail.com: 2014-10-01 19:10 GMT+02:00 Rik van Kekem r...@graficalc.nl: Jürgen Hestermann wrote: As already written in my other mail I confused editoroptions.xml with environmentoptions.xml (both start with an e and end on .xml ;-)) Aaaah, your mails arrived here in the wrong order ;) Here too :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Obtaining uptime
2014-08-07 10:22 GMT+02:00 Michael Schnell mschn...@lumino.de: On 08/06/2014 08:05 AM, Sven Barth wrote: Just in case: you know that Windows 8 does not really shutdown by default, but merely suspends to provide a faster user experience? (Off Topic: ) Are they crazy ? If you have an SSD, again and again rewriting the huge hibernation file will kill the device. So if there is no user-friendly option to deselect this queer option the users should be bashing them I thought that SSD lifespan was more influenced by the number of writes at the same place than by the volume of writes. I mean : if you overwrite the same file each second the SSD would fail in less time than if you wrote a different file in a different place each second. But I could be wrong. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Where do lazarus apps look for dll's?
2014-08-01 2:02 GMT+02:00 Reinier Olislagers reinierolislag...@gmail.com: On 01/08/2014 01:38, Donald Ziesig wrote: I will double check, but why would it change over night? No idea but at least putting 32 bit libs in System32 or 64 bits in syswow64 as you said you have done is a big no-no. So it's a good idea to make sure you clean up incorrect bitness dlls... This http://stackoverflow.com/questions/195590/locating-a-file-on-the-path should enable you to check if the dll can be accessed from your Lazarus app's working directory. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus/FPC for Web Development only
2014-02-05 silvioprog silviop...@gmail.com: Guys, I saw this thread in: http://lists.lazarus.freepascal.org/pipermail/lazarus/2014-February/085622.html And I noticed that I'm not getting all messages. I have some problem or lock in my account list? :( Strange things keep happening in this list, mostly answers which arrive minutes or even hours before the question :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus/FPC for Web Development only
2014-02-05 Mattias Gaertner nc-gaert...@netcologne.de: On Wed, 5 Feb 2014 17:52:23 +0100 Frederic Da Vitoria davito...@gmail.com wrote: 2014-02-05 silvioprog silviop...@gmail.com: [...] Strange things keep happening in this list, mostly answers which arrive minutes or even hours before the question :-) This happens for me less than every 100th mail. I did not count, this list is pretty busy, maybe it happens at the same frequency for me too. But I'd say it happens around once or twice a day. But I may be wrong. I'll keep track of this from now on. Check the mail headers. It contains exact times, where your mail was delayed. Mattias Good idea. I'll check. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Wiki
2014/1/24 Antonio Fortuny a.fort...@sitasoftware.lu Le 21/01/2014 20:52, Johannes W. Dietrich a écrit : You could begin with http://wiki.lazarus.freepascal.org/Components_and_Code_examples#Packages.2FPrograms_for_FPC.2FLazarus_.28not_hosted_here.29 Yeah, right. But, hem, how to create a new page into the wiki ? :-[ First think carefully the title you want to give to your page. Think carefully because in a wiki changing a page name after it was created is often tricky. Then go to the page where you want your new page to be accessible from (for example Components and Code examples). Edit this page to add at the correct place a link (with double angle brackets) to your new page. The link contents should be the title you chose before. After saving this, clicking on the link to your new page will lead you to a form prompting you to create it. I did not try this in the Lazarus wiki, but this is how it usually works in wikis. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Lazarus Wiki
2014/1/20 Reinier Olislagers reinierolislag...@gmail.com On 20/01/2014 16:06, Antonio Fortuny wrote: Hi Folks. I need some help (only once) on how to make a new topic in the Lazarus wiki and link it to whatever page sounds the best to be its ancestor. If you search for a page on the wiki whose title does not yet exist, you are prompted if you want to create a page with that title which apparently is the way to create new wiki pages (it works, but it took me some getting used to). This concerns a new object I made (TFPTimer based, thread safe and thread independant). I'll embed it into a native Lazarus conventional package and publish some help and hints on howto use the component (and maintaing the pages whenever the component behaviour changes, of course. I would simply create a page named after the package (AntonioTimer)... perhaps there are others who have better proposals. As far as the template is concerned: I don't know very much about that; I usually copy the content of another page and just keep the headers etc. In this case you could use e.g. the headers of the fpcup page and replace with your own version. I'm sure the real wiki experts like Dodi will be able to give more info! I guess you should also edit some other page so that the new page is linked to at least once. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Adding shapes to TShape
Hello, For a game, I need to be able to draw geometric shapes. TShape is perfect except for one missing feature: TShape only draws triangles pointing up, and I need also triangles pointing left, right and down. My first reaction was to create a derived class, and try to somehow add the missing shapes by overriding TShape.Paint and in the overriding method just handle the new shapes. But TShape is designed in such a way that I can't figure out how to do it. Then I thought that I'd create a derived class but that this class Paint method would draw all the possible shapes (including the 3 new ones) and that for that I'd override the Paint method with a modified implementation of TShape.Paint. Much less clean, not really oo-ish, but it should at least work. Should, because when I tried this, I discovered that it would be much more difficult that I had hoped, so that I decided to stop trying and ask here first. Does anybody have a good suggestion about how to handle this? Should I forget about deriving TShape and should I directly modify TShape's code? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Convert does not remove WinTypes from uses
Hello, When converting from Delphi using 1.2 RC1 and trunk, the reference to WinTypes in the uses clause is not removed. I checked, in my unit replacement list, I see WinTypes - LCLIntf, LCLType, LMessages and the unit replacement mode is set to Automatic, so that I guess references to WinTypes should disappear. In 1.0.14, the replacement for WinTypes is blank and WinTypes is properly removed. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Jedi Code Format barfs on an Octal number
2013/12/17 Jürgen Hestermann juergen.hesterm...@gmx.de Am 2013-12-17 02:42, schrieb waldo kitty: yes, but it is not available in TP/BP and (IIRC) Delphi... I am wondering why octal numbers are not allowed in these modes. Why not allow them in all modes? I can't see how this would cause problems. It would only avoid them. Maybe because these modes could be used to ensure that the developer is able to switch back to TP/BP or Delphi. If these modes accepted features which TP/BP or Delphi don't understand, switching back would become difficult. Or you could create a source file which you want to be compatible with FPC and with TP. If you use octal, it won't work. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Win services
2013/12/11 Reinier Olislagers reinierolislag...@gmail.com On 11/12/2013 16:31, Antonio Fortuny wrote: Le 11/12/2013 16:23, Reinier Olislagers a écrit : On 11/12/2013 16:17, Antonio Fortuny wrote: I guess that someone should read tha changes before they are published. I'd suggest you just write what you know. If there are errors, they're easily corrected. That's the idea of a wiki. For my information, are there some users who check the wiki modifications globally, or should unsure users post here when they edit the wiki? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] 1.2RC1, Incompatible type and overload
Hello, I posted this on the forum, but maybe the forum is not the best place, so I post it here too. I have an Incompatible type error which I can't figure out program DominoMo; {$MODE Delphi} uses Globals in 'GLOBALS.PAS', Parametr in 'PARAMETR.PAS'; begin end. unit GLOBALS ; {$MODE Delphi} interface uses Laz2_Dom, Laz_XmlRead, Laz_XmlWrite ; const XML_FILE_NAME = 'DominoMot.xml' ; var XmlWordLists : TXmlDocument ; implementation initialization {16} ReadXmlFile (XmlWordLists, XML_FILE_NAME) end. unit PARAMETR ; {$MODE Delphi} interface uses SysUtils, XmlWrite, GLOBALS; implementation procedure InitAndShowModal ; begin {13} //WriteXmlFile (XmlWordLists, ChangeFileExt (ParamStr (0), '.xml')) end ; end. Using Lazarus 1.2RC1, I get: PARAMETR.PAS(13,69) Error: Incompatible type for arg no. 2: Got AnsiString, expected TStream If I comment out line 16, the project compiles OK. If I put my cursor on ReadXmlFile and press Alt+Up, the editor jumps to the correct overloaded version If I put my cursor on WriteXmlFile and press Alt+Up, the editor skips the string version and jumps to the stream version Using Lazarus 1.0.14, I get: GLOBALS.PAS(16,43) Error: Incompatible type for arg no. 2: Got Constant String, expected TStream If I comment out line 16, the compiler stops on the same error as for 1.2RC1 If I put my cursor on ReadXmlFile and press Alt+Up, the editor skips the string version and jumps to the stream version If I put my cursor on WriteXmlFile and press Alt+Up, the editor skips the string version and jumps to the stream version I can't figure any of those errors: None should occur as far as I can see, as ReadXMLFile and WriteXMLFile both have overloaded versions which take an ansistring for second parameter. Is this a bug or am I missing something? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] 1.2RC1, Incompatible type and overload
2013/12/6 Mattias Gaertner nc-gaert...@netcologne.de On Fri, 6 Dec 2013 11:26:12 +0100 Frederic Da Vitoria davito...@gmail.com wrote: [...] uses Laz2_Dom, Laz_XmlRead, Laz_XmlWrite ; Do not mix version 1 and 2. uses Laz2_Dom, Laz2_XmlRead, Laz2_XmlWrite ; Mattias Ah! This makes more sense :-) Yes, this is the solution. Thanks. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How is XMLConfig supposed to work?
Hello, I am trying to use XmlConfig to store simple configuration data, but I can't make it create a sensible Xml file. This is not really important in my situation, as XmlConfig is able to correctly read back the strange data it wrote, but frustrating. I searched the web but could not find any example. So can anyone offer a working example of creating a xml file with XmlConfig? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How is XMLConfig supposed to work?
2013/11/27 waldo kitty wkitt...@windstream.net On 11/27/2013 6:50 AM, Frederic Da Vitoria wrote: Hello, I am trying to use XmlConfig to store simple configuration data, but I can't make it create a sensible Xml file. This is not really important in my situation, as XmlConfig is able to correctly read back the strange data it wrote, but frustrating. I searched the web but could not find any example. So can anyone offer a working example of creating a xml file with XmlConfig? can you provide a sample of what is being created and what you are expecting to actually see? I'm trying something like (just the minimum code, but I can give the complete sources if it makes things easier): procedure TForm1.Button1Click(Sender: TObject); const FILE_NAME = 'pXmlConfig.xml' ; begin XmlConfig1.Filename := FILE_NAME ; // XmlConfig1.OpenKey ('/CONFIG') ; XmlConfig1.SetValue ('/CONFIG/L5', 'xx') ; XmlConfig1.SetValue ('/L1/L2', 'aa') ; XmlConfig1.SetValue ('/L1/L3', 'bb') ; XmlConfig1.SetValue ('/L1/L2', 'cc') ; XmlConfig1.SetValue ('/L8', 'dd') ; // XmlConfig1.CloseKey ; XmlConfig1.Flush end; (No, it does not make any sense, just me trying to figure out how it works.) And here is the result: ?xml version=1.0 encoding=utf-8? CONFIG L8=dd CONFIG L5=xx/ L1 L2=cc L3=bb/ /CONFIG The only thing which worked as I wanted is that SetValue ('/L1/L2', 'aa') is overwritten by SetValue ('/L1/L2', 'cc') - How do I create third level keys? (or is XmlConfig able to do more than 2 levels?) - Why does XmlConfig create L2, L3 and L5 as attributes (/ usually is a level separator, is it not) ? - More generally, is XmlConfig suited to do more than a simple list (which would be even less than a .ini can do)? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How is XMLConfig supposed to work?
2013/11/27 Sven Barth pascaldra...@googlemail.com Am 27.11.2013 16:30, schrieb Frederic Da Vitoria: 2013/11/27 leledumbo leledumbo_c...@yahoo.co.id From http://wiki.lazarus.freepascal.org/xmlconf, looks like simply setting FileName will do. Yes, that part works. I dislike the way it works (Implicit saving does not seem very Pascal-ish to me), but it does save a file. My issues are rather with the xml, but I'll rather answer to waldo kitty here TIniFile and TMemIniFile do an implicit save as well... (the former during each .Write* the latter during destruction) Regards, Sven Yes. But my Pascal reference is Assign - Reset/Rewrite, Close. I still have difficulties appending File after Assign and Close :-P Now that I think of it, I never tried to do a new AssignFile after the Reset/Rewrite step, but I would be much surprised if it flushed and closed the first file handle. Anyhow, this is not a real problem as long as it is documented, and the effect of changing the name is documented in the wiki. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How is XMLConfig supposed to work?
2013/11/27 Frederic Da Vitoria davito...@gmail.com 2013/11/27 waldo kitty wkitt...@windstream.net On 11/27/2013 6:50 AM, Frederic Da Vitoria wrote: Hello, I am trying to use XmlConfig to store simple configuration data, but I can't make it create a sensible Xml file. This is not really important in my situation, as XmlConfig is able to correctly read back the strange data it wrote, but frustrating. I searched the web but could not find any example. So can anyone offer a working example of creating a xml file with XmlConfig? can you provide a sample of what is being created and what you are expecting to actually see? I'm trying something like (just the minimum code, but I can give the complete sources if it makes things easier): procedure TForm1.Button1Click(Sender: TObject); const FILE_NAME = 'pXmlConfig.xml' ; begin XmlConfig1.Filename := FILE_NAME ; // XmlConfig1.OpenKey ('/CONFIG') ; XmlConfig1.SetValue ('/CONFIG/L5', 'xx') ; XmlConfig1.SetValue ('/L1/L2', 'aa') ; XmlConfig1.SetValue ('/L1/L3', 'bb') ; XmlConfig1.SetValue ('/L1/L2', 'cc') ; XmlConfig1.SetValue ('/L8', 'dd') ; // XmlConfig1.CloseKey ; XmlConfig1.Flush end; (No, it does not make any sense, just me trying to figure out how it works.) And here is the result: ?xml version=1.0 encoding=utf-8? CONFIG L8=dd CONFIG L5=xx/ L1 L2=cc L3=bb/ /CONFIG The only thing which worked as I wanted is that SetValue ('/L1/L2', 'aa') is overwritten by SetValue ('/L1/L2', 'cc') - How do I create third level keys? (or is XmlConfig able to do more than 2 levels?) - Why does XmlConfig create L2, L3 and L5 as attributes (/ usually is a level separator, is it not) ? - More generally, is XmlConfig suited to do more than a simple list (which would be even less than a .ini can do)? Now that I am thinking of it, I may be expecting too much. If XmlConfig handles more than 2 levels, then why stop to 3? And then, how would XmlConfig be different from a full Xml Implementation? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How is XMLConfig supposed to work?
2013/11/27 leledumbo leledumbo_c...@yahoo.co.id From http://wiki.lazarus.freepascal.org/xmlconf, looks like simply setting FileName will do. Yes, that part works. I dislike the way it works (Implicit saving does not seem very Pascal-ish to me), but it does save a file. My issues are rather with the xml, but I'll rather answer to waldo kitty here -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Deleteing a file that has a path that's longer than 256 characters
2013/11/26 Richard Mace richard.m...@gmail.com Hi All, I have an issue where I am unable to delete a file where the path name is longer than 256 characters. Interesting enough, the error as reported from Windows (SysErrorMessage(GetLastError)) reports that Windows is unable to find the path specified. I have even tried renaming the file so that it is shorter (within the full path) but I am unable to do that as Windows complains of the same error message. It lookis like it is a temeporay internet file that explorer has created (if that helps) Any ideas? Lazarus 1.2 RC1 Windows Server 2003 This is a pretty frequent Windows issue. IIRC, you have several options: 1: try to delete the file in a DOS shell using short names (for example replacing My Documents with mydocu~1). This is the best option as it avoids changing anything in your system. But it may not work because even the shortened path may be too long. 2+: see all the options form http://support.microsoft.com/kb/320081 , but I'd use solution 3 before solution 2 if the directory where your file is stored is installed by some software (as is suggested by your mention of temporary internet file. If you have to use solution 2, then be careful to restore the original directory names before running any software which might use this directory. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Deleteing a file that has a path that's longer than 256 characters
2013/11/26 Craig Peterson cr...@scootersoftware.com On Nov 26, 2013, at 7:59 AM, Richard Mace richard.m...@gmail.com wrote: I have an issue where I am unable to delete a file where the path name is longer than 256 characters. You need to call the Unicode variant of the file APIs and add \\?\ to the start of the path in order to interact with paths longer than MAX_PATH. See http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpathfor details. Richard wanted to delete his file programmatically, of course, else he wouldn't be asking his question in this list :-P -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Deleteing a file that has a path that's longer than 256 characters
2013/11/26 Reinier Olislagers reinierolislag...@gmail.com On 26/11/2013 15:43, Frederic Da Vitoria wrote: 2013/11/26 Craig Peterson cr...@scootersoftware.com mailto:cr...@scootersoftware.com On Nov 26, 2013, at 7:59 AM, Richard Mace richard.m...@gmail.com mailto:richard.m...@gmail.com wrote: I have an issue where I am unable to delete a file where the path name is longer than 256 characters. You need to call the Unicode variant of the file APIs and add \\?\ to the start of the path in order to interact with paths longer than MAX_PATH. See http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath for details. Richard wanted to delete his file programmatically, of course, else he wouldn't be asking his question in this list :-P I think Craig understands that - how do you intend to call APIs from the command line? (Yes, rundll probably but ok). Otherwise, could you explain a bit more? BTW: IIRC, there was a huge discussion about using the unicode API for (once again IIRC) exactly the file deletion/manipulation API calls in the FPC list. @Richard: you could have a search through there... Obviously Craing understood, and I did not. I was laughing at myself :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Exception in CreateForm after conversion from Delphi
2013/11/21 Juha Manninen juha.mannine...@gmail.com On Thu, Nov 21, 2013 at 11:01 PM, Frederic Da Vitoria davito...@gmail.com wrote: One bug report? Do you think these issues could be related? Or should I create one report for the lpr+Initialize issue and one report for the .res? Let's start with one report. If you can provide a project that triggers the problem, I will test it. I added the issue. http://mantis.freepascal.org/view.php?id=25354 During my tests, I had a new issue with the converter, which I did not include in Mantis as it seemed distinct. Here is my directory setup: - d:\Delphi\Lazarus_Tests\Memo1_bak contains the files in Delphi version. This is where I edit the files with Notepad++ in order to remove parts of code before copying them to the next folder. d:\Delphi\Lazarus_Tests\Memo1_bak\$ contains the files (units) which I have removed from the original source. - d:\Delphi\Lazarus_Tests\Memo1 is the conversion folder, where I copy the files from above and where the application I ask Lazarus to convert is. During one of the code cleaning iterations, I hadn't cleaned properly Memo1_bak so that the uses still contained a reference to a unit which I thought I had removed from everywhere. I had removed the unit source. My new issue is that the converter found the unit in d:\Delphi\Lazarus_Tests\Memo1_bak\$ and converted it! As you can see, my source does not contain any reference to Memo1_bak, I never opened any file in d:\Delphi\Lazarus_Tests\Memo1_bak nor d:\Delphi\Lazarus_Tests\Memo1_bak\$ with Lazarus, so I don't know how and why it searched there. One last comment: As far as I can see, when checking Delphi support, the converter does not rename the .dpr as .lpr and it keeps the .dfm files. I understand why the converter does this, but I suggest it should be mentioned in the documentation. I had at one point a problem with the dfm files: the project wouldn't compile because they were binary. So I opened the Delphi original project in Delphi 6 and wrote the dfm from binary to text. My guess is that for some reason, the converter did not write the lfm copies, so that the only way to compile was using the dfm, which were binary. I am unable to reproduce the issue (the converter now always writes the lfm files) and sorry, I did not keep a copy of the conversion results, so this remark is only for the record. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Exception in CreateForm after conversion from Delphi
2013/11/22 Juha Manninen juha.mannine...@gmail.com On Fri, Nov 22, 2013 at 1:15 PM, Frederic Da Vitoria davito...@gmail.com wrote: ... with Lazarus, so I don't know how and why it searched there. Ok, this is the fundamental cause of your problems. The converter searches for unit files from project's sibling directories, meaning the directories that are below its parent dir. Don't place copies of the same project there. This is a useful feature because many projects include their libraries there and they are found automatically. Test again without those copied dirs and let me know what happens. Sorry to disappoint your hopes, but after copying the Delphi sources to c:\temp\lazarus_test_memo (no, temp does not contain any other pascal sources, and C: only contains the fpc/lazarus binaries in different subdirectories), I get the same results: issue with .res file and after commenting out the $R *.res directive, running the application triggers an exception. ... and this time I managed to upload the source successfully :-P I had at one point a problem with the dfm files: the project wouldn't compile because they were binary. The converter is able to convert from old binary DFM to text LFM. It should not cause problems. As I explained, I suppose that for some reason, the LFM files were not created that time. I can't be sure because the directory where this happened has been emptied and recreated numerous times since, but this is the best explanation I can suggest. So this LFM problem would be a sporadic and probably unrelated issue. I only mentioned it because my supposition could be wrong and maybe telling this could help you find where the main problem comes from. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Exception in CreateForm after conversion from Delphi
Hello, I am converting a set of old small applications which I probably wrote in Delphi 1 or 2, first version of the sources I have dates from 1996, last version (the version I am converting to Lazarus) from 1999, probably last updated in Delphi 3 I already did the conversion once with Lazarus 1.2 RC1. This first conversion had to be redone because Lazarus signaled an error converting the .res file. I don't remember what I did exactly, but I finally got a conversion without the .res error. Running the new application raised an exception during creation of the main form (this will be explained below), so I decided to start again from a new conversion using Lazarus 20.1.0.14. Lazarus 20.1.0.14 again signals an error while converting the .res file. First compilation shows a few simple warnings about hiding inherited methods. I also get a hint about an exitProc which I'll explain later. So I remove them with hints and recompile. Lazarus hangs at that point, nothing in the output window, impossible to close the IDE (although it is responsive, I can for example open menus). I end up stopping Lazarus forcefully. After reloading Lazarus, I get the same error about the .res file. I overwrite the .res with the one 1.2 RC1 generated, and now it compiles. When running the application, I get again the same exception. So I decide to try to correct some code which is probably not valid any more: I move the contents of an exitProc to the finalization section and remove exitproc handling. I still get the same exception as with 1.2 RC1: error 1407 in Win32WSControls.FinishCreateWindow. This is triggered by the first CreateForm which is in the dpr. If I comment out the CreateForm, I get the same exception for the next CreateForm. The debugger shows that upon calling CreateWindowEx, pClassName contains Window. I found on the Lazarus forum a discussion about error 1407 in 2009. The solution was to add Application.initialize in the lpr. But the converter did not create a lpr file, so I checked the dpr file and indeed found that Application.initialize was missing. Adding it solved my problem. Why didn't the converter create a lpr file? Did I do something in the settings which caused this? I checked the conversion by 1.2 RC1, I did get a lpr, but it did not contain Application.initialize either. Shouldn't the converter add this line? What are those .res conversion errors? The only reference I found is in the Code_Conversion_Guide, but it seems quite outdated, and I could not find reference to the resources files in the converter documentation. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DateDif function needed
, Years, Months, Days) Date2 do Inc (Days) ; while IncDate (date1, Years, Months, Days) Date2 do Dec (Days) ; if IncDate (date1, Years, Months, 0) = DaysInAMonth (y1+Years, m1+Months) then begin Days := d1 - DaysInAMonth (y1+Years, m1+Months) ; if Months = 12 then begin Inc (Years) ; Months := 1 end {then} else Inc (Months) end {then} end {DatesToAge} ; { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var years, months, days: integer; day_count_1, day_count_2: integer ; date1, date2, date3 : TDate ; test_ok : boolean ; begin {TForm1.Button1Click} Memo1.Clear ; test_ok := TRUE ; for day_count_1 := 0 to DaysBetween (EncodeDate (2000, 01, 01), EncodeDate (2005, 12, 31)) do begin date1 := EncodeDate (2000, 01, 01) + day_count_1 ; for day_count_2 := 0 to (365*5) do begin date2 := IncDay (date1, day_count_2) ; DatesToAge(date1, date2, years, months, days) ; date3 := IncDate (date1, years, months, days) ; if (date3 date2) then begin test_ok := FALSE ; Memo1.Append ('--'+DateToStr (date1)+' '+DateToStr (date2)+' Y='+IntToStr (years)+' M='+IntToStr (months)+' D='+IntToStr (days)+' '+DateToStr (date3)); Memo1.Append ('incYear='+DateToStr (IncYear (date1, Years))+', IncMonth+IncYear='+DateToStr (IncMonth (IncYear (date1, years), months))); exit end {then} end {for} end {for} ; if test_ok then Memo1.Append ('Finished OK') else Memo1.Append ('Finished KO') end {TForm1.Button1Click} ; end {uDateDiff}. uDateDiff.lfm : object Form1: TForm1 Left = 1397 Height = 106 Top = 35 Width = 501 Caption = 'Form1' ClientHeight = 106 ClientWidth = 501 LCLVersion = '1.2.0.1' object Button1: TButton Left = 8 Height = 25 Top = 8 Width = 75 Caption = 'Button1' OnClick = Button1Click TabOrder = 0 end object Memo1: TMemo Left = 88 Height = 88 Top = 8 Width = 406 Anchors = [akTop, akLeft, akRight, akBottom] ScrollBars = ssAutoBoth TabOrder = 1 end end -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DateDif function needed
2013/11/18 John Landmesser joh...@online.de On 18.11.2013 13:11, Frederic Da Vitoria wrote: procedure DatesToAge (Date1, Date2: TDate ; out Years, Months, Days: integer); var Hi Frederic, your code works as aspected! Perhaps it's more usual if you change the out Parameters to word? Yes, it would be more usual, but since you seem interested, I will try to create a signed version, which will of course return signed values. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DateDif function needed
2013/11/14 Michael Schnell mschn...@lumino.de On 11/14/2013 03:46 PM, Frederic Da Vitoria wrote: .. and where are we now?? Right in the middle of a very interesting discussion :-) -1 Well, everyone is entitled to his opinions, right, else we would all be doing C :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DateDif function needed
2013/11/14 John Landmesser joh...@online.de Hihi, i asked a question about a DateDiff function for FreePascal, because i wanted to know: how many years, month, days left to work in Office until my pension begins on 01.08.2018. .. and where are we now?? Right in the middle of a very interesting discussion :-) -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] DateDif function needed
2013/11/12 Michael Van Canneyt mich...@freepascal.org On Tue, 12 Nov 2013, Jürgen Hestermann wrote: Am 2013-11-11 17:25, schrieb Michael Van Canneyt: The number of elapsed DAYS between these 2 dates is 60. If the average number of days per month is assumed to be 30.4375, then 2 full months would be 60.875 days. That means that 60 days DOES NOT span 2 full months of 30.4375 days: it falls 0.875 days short for that. Hence, the *intended* result is 1. But dates from the 1st of a month to the 1st of the next month should be considered to span a full month, shouldn't it? If not, of what use would it be? A month is *not* defined to be 30.4375 days. Getting an average months is completely useless IMO. Who wants to get such a result for what purpose? Like I said: you can argue whether the functions are useful. They are there for Delphi compatibility. Feel free to provide other functions, I will happily accept them. If I am not mistaken, Bart just provided one :-) I suggest using another more discriminant name instead of DateDiff, something like AgeBetween or ExactDateDiff. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] [resulved] How to use TRegExpr class (in synregexpr.pas)
2013/10/24 Mark Morgan Lloyd markmll.laza...@telemetry.co.uk FreeMan wrote: Yes Mark, you rigth. This code is working now, Problem was space char in EDT_IP.Text, it comes from format. This is normal, but at this time, why Trim function NOT DELETE space char ? is this bug ? var Q : String;Const WhiteSpace = [#0..' ']; function My_Trim(S : string): String; var I: Integer; begin Result := S; TryI := 1;while ILength(S)do Begin if S[I]in WhiteSpace then Delete(S,I,1) else Inc(I,1); end;// whileResult := S; Except end; end; //copied from /fpc271/rtl/objpas/sysutils/**sysstr.inc line 524 function Trim_(const S: string): string; var Ofs, Len: integer; begin len := Length(S); while (Len0) and (S[Len] in WhiteSpace) dodec(Len); Ofs := 1; while (Ofs=Len) and (S[Ofs] in WhiteSpace) doInc(Ofs); result := Copy(S, Ofs, 1 + Len - Ofs); end ;begin Q := Trim(EDT_IP.Text);// space not deleted Q := Trim_(EDT_IP.Text);// space not deleted Q := My_Trim(EDT_IP.Text); // space DELETED if IP4OK(Q)then begin.. By the time that arrived here its formatting had been completely lost (as you can see above), but it doesn't look to bad in the archive http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-October/084020.htmlso I'm not entirely sure what's going on The formatting seemed correct in GMail. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] VirtualTreeView, Absoluteindex example on freepascal.org
2013/9/11 Jürgen Hestermann juergen.hesterm...@gmx.de On http://wiki.freepascal.org/**VirtualTreeview_Example_for_**Lazarushttp://wiki.freepascal.org/VirtualTreeview_Example_for_Lazarus there is the following example procedure: --**-- procedure TForm1.Button1Click(Sender: TObject); Var Data: PTreeData; XNode: PVirtualNode; Rand: Integer; Begin Randomize; Rand := Random(99); XNode:=VST.AddChild(nil); if VST.AbsoluteIndex(XNode) -1 then Begin Data := VST.GetNodeData(Xnode); Data^.Column0:= 'One ' + IntToStr(Rand); Data^.Column1:= 'Two ' + IntToStr(Rand + 10); Data^.Column2:= 'Three ' + IntToStr(Rand - 10); End; End; --**-- Can someone explain what the line if VST.AbsoluteIndex(XNode) -1 then actually means? The method AbsoluteIndex gives back a Cardinal so how can it be less than 0? Therefore the if statement is completely useless because it is always true. BTW: I was pointed to this because Lazarus (or FPC?) showed me a compiling message that this line will cause a type convertion to 64 bit (well done!). I didn't look at the code, but usually index = -1 means that the item was not found. So maybe AbsoluteIndex's result should actually be signed? In this example, I guess the test is to avoid a bug if AddChild does not manage to insert the root node. I don't know if AddChild could create a node without inserting, but this is what the code seems to be testing. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] VirtualTreeView, Absoluteindex example on freepascal.org
2013/9/12 Jürgen Hestermann juergen.hesterm...@gmx.de Am 2013-09-12 14:50, schrieb Frederic Da Vitoria: Can someone explain what the line if VST.AbsoluteIndex(XNode) -1 then actually means? I didn't look at the code, but usually index = -1 means that the item was not found. So maybe AbsoluteIndex's result should actually be signed? And how would it ever reach the value -1? Obviously there is no code that sets it to this value, otherwise it would not compile with Cardinal type. Once again, I did not look at the code. My remarks only come from my memories of how VirtualTreeView worked with Delphi 6. The code has obviously much changed since. I was only attempting to answer to your question: this is probably the reason. Is it still working? Obviously not. What should be done? I see 2 options: either restore the old functionality if needed or (if indeed this test never had any real use) remove this test from the example. How does code handle when AbsoluteIndex does not find an item? I just took a look at v5.2.0. If I read the code correctly, if the parameter is the root, AbsoluteIndex will answer 0. If the parameter is not found, AbsoluteIndex will answer 0 too. Is this deliberate? In this example, I guess the test is to avoid a bug if AddChild does not manage to insert the root node. I don't know if AddChild could create a node without inserting, but this is what the code seems to be testing. But it is a useless if statement that doesn't test anything. Now yes. Once upon a time maybe not. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] VirtualTreeView, Absoluteindex example on freepascal.org
2013/9/12 Jürgen Hestermann juergen.hesterm...@gmx.de Am 2013-09-12 17:51, schrieb Frederic Da Vitoria: My remarks only come from my memories of how VirtualTreeView worked with Delphi 6. The code has obviously much changed since. Are you sure? The function is quite simple: --**--**- function TBaseVirtualTree.**AbsoluteIndex(Node: PVirtualNode) : Cardinal; begin Result := 0; while Assigned(Node) and (NodeFRoot) do begin if not (vsInitialized in Node.States) then InitNode(Node); if Assigned(Node.PrevSibling) then begin // if there's a previous sibling then add its total count to the result Node := Node.PrevSibling; Inc(Result, Node.TotalCount); end else begin Node := Node.Parent; if NodeFRoot then Inc(Result); end; end; end; --**--**- It's hard to believe that there was a version of VirtualTreeView that used signed intergers *and* had code to set it to -1 *and* then someone has changed it to a non-signed integer *and* also removed or changed the code to now set it to zero. No, I am not sure, as I stated in my first answer, I am answering from memory, all my answers here are mainly guesses. Either my first assumption is right or maybe whoever wrote the the button code example thought that VirtualTreeview behaved like IndexOf (which is what I would have expected too). If you are interested, I still have an old version from 2001 on a backup , I could check it. I see 2 options: either restore the old functionality if needed I don't believe that an old functionality exits. It looks as if it was like that from the beginning. Well then, I can add a variant to my first option: create the functionality (since IMO it should be there). If I read the code correctly, if the parameter is the root, AbsoluteIndex will answer 0. If the parameter is not found, AbsoluteIndex will answer 0 too. Yes. There are 3 cases where the result is 0: 1.) Node is nil 2.) Node is the (invisible) root node 3.) Node is the first (visible) node All of them result in zero so these cases cannot be distinguished by the function result. Is this deliberate? That's the question. But I don't think that it was different at any time. And it seems that as long as this is not changed in VirtualTreeView the if statement in the example on the Free Pascal page is nonsense. In the current state of the code, I agree it is useless. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Congrats on the new project options screen
2013/8/9 waldo kitty wkitt...@windstream.net On 8/7/2013 16:45, Juha Manninen wrote: On Wed, Aug 7, 2013 at 11:18 PM, waldo kittywkitt...@windstream.net wrote: as noted upstream in this thread... w2k-SP4 with all available updates AMD Athlon XP 2800+ 768M RAM and the HD is a WDC WD300BB (at this time)... Yes sorry. Strange, AMD Athlon XP 2800+ should not be so terribly slow. Something slows things down in your machine. after some investigation and time spent archiving, it seems that thunderbird with some 4+ messages in this lazarus folder plus having firefox open were causing my system to consume too much memory and thus using swap... especially when i would open lazarus to do some coding or checking things out from posts in here... after archiving, it seems to have cut down on the amount of memory used so we'll see what happens now... OT, I have found that TB archives are unreliable with large volumes. Not that mails disappear (at least not that I know), but quick search tends to not find all the mails it should. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Subroutine ?
2013/7/31 Hans-Peter Diettrich drdiettri...@aol.com Terry A. Haimann schrieb: I am sure this is a dumb ?, but I want a subroutine that will change all of the components of a form to Enabled := False. How do I do this? This code disables all components owned by form: for i := 0 to form.Components.Count - 1 do form.Components[i].Enabled := False; Untested, eventually Components.Count has to be replaced by ComponentCount. DoDi Previous answers made me wonder: are you sure you meant Component, not Control? If the form contains non-visual components, this could change the result. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Subroutine ?
2013/7/31 Terry A. Haimann te...@haimann.us Interesting and I didn't know you could do that. But, more of what I have in mind is. I have a bunch of database components on a form, I want them to be enabled only after hitting the edit or insert button on the DbNavigator. Since this is going to occur in multiple points in my button procedure, it would be programmatically better if this could be done in a sub procedure. Also, I have fields that are dependent on other fields, so fieldsz only would become active if fieldx has a 'Y' in it. On Wed, 2013-07-31 at 07:45 +0200, Mattias Gaertner wrote: On Tue, 30 Jul 2013 22:53:40 -0500 Terry A. Haimann te...@haimann.us wrote: I am sure this is a dumb ?, but I want a subroutine that will change all of the components of a form to Enabled := False. How do I do this? for i:=0 to ControlCount-1 do Controls[i].Enabled:=false; Mattias Hmm, I am still unsure, are you really speaking of components (in which case you may want to do things like connect conditionally) or of controls (you want only to prevent the user from interacting with the form)? -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Subroutine ?
2013/7/31 Hans-Peter Diettrich drdiettri...@aol.com Frederic Da Vitoria schrieb: This code disables all components owned by form: for i := 0 to form.Components.Count - 1 do form.Components[i].Enabled := False; Untested, eventually Components.Count has to be replaced by ComponentCount. DoDi Previous answers made me wonder: are you sure you meant Component, not Control? If the form contains non-visual components, this could change the result. Components[] contains the components *owned* by the form, while Controls[] contains only the top-level controls, whose *Parent* is the form. OK, but since Components can be Controls or not, they could have an Enabled property or not. So shouldn't the loop actually be something like: for i := 0 to form.Components.Count - 1 do if form.Components[i] is TControl then form.Components[i].Enabled := False; -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Subroutine ?
2013/7/31 Hans-Peter Diettrich drdiettri...@aol.com Frederic Da Vitoria schrieb: 2013/7/31 Hans-Peter Diettrich drdiettri...@aol.com mailto: drdiettri...@aol.com Components[] contains the components *owned* by the form, while Controls[] contains only the top-level controls, whose *Parent* is the form. OK, but since Components can be Controls or not, they could have an Enabled property or not. So shouldn't the loop actually be something like: for i := 0 to form.Components.Count - 1 do if form.Components[i] is TControl then form.Components[i].Enabled := False; then TControl(form.Components[i]).Enabled := False; Yes, I saw I missed that one later :-P -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus