Re: [Lazarus] Watch List shows absolute rubbish
On 2016-10-14 20:45, Martin Frb via Lazarus wrote: > Ok, thats a first, never seen that before. I finally found the cause of the problem. I don’t use build modes in Lazarus, so only ever looked at the “Project Options -> Compiler Options -> Compilation and Linking” screen. That’s where I set the -O- option, and I also set other debugging options in the “Compiler Options -> Debugging” screen, like the -gl and -gh options. What I didn’t realize was that inside “Compiler Options -> Additions and Overrides”, there was a “Stored in IDE” custom option (there are actually a few defined), and one of the active options was -O2. And that optimisation option is what caused all the trouble. Lovely conflicting options with no warning. Personally I think the Compiler Options screens in Lazarus is a huge confusing mess. The IDE dialog designers should take some cues from MSEide’s Project Options dialog. In MSEide all build/make option are located in one place/screen with an instant overview of all build modes. What you see is what you get. No hidden settings from other screens. Anyway. Thank you very much Martin for taking the time in trying to help me. I apologise for my heated messages from earlier. At that point I wasted so many hours, and were at boiling point for some time. That probably wasn’t the best time to write a message either. Regards, Graeme -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Watch List shows absolute rubbish
On 14/10/2016 19:14, Graeme Geldenhuys via Lazarus wrote: On 2016-10-14 18:45, Martin Frb via Lazarus wrote: And the same compiler settings? Both have the exact same compiler settings... -l -Mobjfpc -Sh -Sc -Si -gl -O- -gh -dUseCThreads -viewn I excluded the unit paths from the above list of compiler options. Ok, thats a first, never seen that before. Can you produce a logfile http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session If you open the "locals" window, it should have "i", same error? What happens in mseide, if you type/watch uppercase I or FSHOWDELETED ? For info, some previous gdb, did not find some variables, unless they where uppercased. Normally gdb ignores case, so Lazarus uppercases all vars, and that worked fine in the past. Maybe gdb 7.11[.1] has an issue with this? Btw, I have no idea why some are grey. I would think either selection or focus? -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Watch List shows absolute rubbish
On 2016-10-14 18:45, Martin Frb via Lazarus wrote: > And the same compiler settings? Both have the exact same compiler settings... -l -Mobjfpc -Sh -Sc -Si -gl -O- -gh -dUseCThreads -viewn I excluded the unit paths from the above list of compiler options. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Watch List shows absolute rubbish
On 14/10/2016 17:02, Graeme Geldenhuys via Lazarus wrote: On 2016-10-14 16:48, Graeme Geldenhuys via Lazarus wrote: How the hell is one supposed to do debugging like this?? I guess the answer is to simply use MSEide to debug LCL applications (and all other applications too). Attached is a screenshot of the same watch list and also in the first iteration of the for loop. NOTE that MSEide does just fine displaying the _real_ values in the Watch List window. MSEide was running under the exact same environment as what my Lazarus IDE did. Using the same FPC compiler and GDB debugger. And the same compiler settings? Both on -O1 ? (or whatever level) Such incorrect results are sometimes caused by -O1, while -O- will be fine. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Windows 10 force any non-white background color to White
Am 14.10.2016 11:10 schrieb "Dennis via Lazarus" < lazarus@lists.lazarus-ide.org>: > > I have a program written in lazarus running normally in windows 7. > When run in windows 10, the green color of the Frame/Form is changed by Windows 10 to white. Can you reproduce this in a small example program so that differences regarding the project settings can be avoided? Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] TPageControl cannot change parent
On Fri, 14 Oct 2016 12:16:25 +0200 Torsten Bonde Christiansen via Lazarus wrote: >[...] > In the designer it is not posible to use the builtin feature of "Change > Parent" (from the context menu) with a TPageControl. Other controls > seems to work fine (although i have not tested all of them). > > To recreate the problem slap a TPanel and a TPageControl on the mainform > and add a single tabsheet. Use "Change Parent" on the Pagecontrol and > change it to the panel - and bang. >[...] > This is as far as it goes. Please create a bug report. > On a side node - it IS posible to select a tabsheet and change the > parent to the panel, which IMO should not be posible. And for that too. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Fri, 14 Oct 2016 16:24:04 +0100 Lukasz Sokol via Lazarus wrote: > D'oh, really. > D'oh, really? (fixed that for you) Answer: No (well actually the part about matlab I meant serious) Reminder to myself: The interwebz dozn't get sarcazm The interwebz dozn't get sarcazm The interwebz dozn't get sarcazm R. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Watch List shows absolute rubbish
On 2016-10-14 16:48, Graeme Geldenhuys via Lazarus wrote: > How the hell is one supposed to do debugging like this?? I guess the answer is to simply use MSEide to debug LCL applications (and all other applications too). Attached is a screenshot of the same watch list and also in the first iteration of the for loop. NOTE that MSEide does just fine displaying the _real_ values in the Watch List window. MSEide was running under the exact same environment as what my Lazarus IDE did. Using the same FPC compiler and GDB debugger. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Watch List shows absolute rubbish
Hi, Is it a known issue that the Watch List shows absolute rubbish from time to time??? Or at least that you can't trust the details is does show? Take a look at the screenshot attached. Look at the code, and the Watch window. Note the value of "i" and "FShowDeleted" in the Watch window. It is the first iteration in the "for i ..." loop, so "i" should be Zero. Now take a look at what the Watch List shows! In the second case, the FShowDeleted is a boolean field variable and currently has the value False, but again, look at what the Watch window shows. How the hell is one supposed to do debugging like this?? I've just wasted hours debugging code, thinking that the information in the Watch List is reliable. WTF. Sorry, but I'm fuming mad at this point [if you haven't guessed]. I'm running FreeBSD 10.3 (64-bit) with 64-bit FPC 2.6.4 and Lazarus from trunk (updated 2 weeks ago). GDB version 7.11.1. If FreeBSD is not a supported environment for Lazarus, then please state so clearly and I'll stop using Lazarus under it. ps: Why are some lines painted in grey in the Watch List? Does that have anything to do with this issue? Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 13/10/16 15:48, Reimar Grabowski via Lazarus wrote: > On Thu, 13 Oct 2016 10:37:53 -0300 Adrian De Armas via Lazarus > wrote: > >> Introducing GUI is an efford to make the module more attractive to >> the students (the droupout rate is high). The module is taught as a >> basic science. All my students will be civil, environmental or bio >> engineers but not computer engineers. > > And nonetheless you think replacing matlab with pascal (or any other > language) is a good idea? If you just want a GUI to make it more > fancy matlab can provide that, too. > > If you want modern, teach them Java and let the programs run on their > phones or keep doing console programs and do the GUI in JS (aka web > applications). ^^ > D'oh, really. I recall the couple of days when i downloaded Android Studio and tried modifying the Bluetooth Chat example to do what I want... I only wanted to put a couple of tracking sliders (for 'analog' direction and speed control). and make it send characters repeatedly to the serial Bluetooth device on the other side of the link... It did work in the end though, but any attempts to mod out the existing gui controls in any way were mostly greeted by app crash. I ended up trying to squeeze my controls into available space... I still haven't recovered from the experience. > R. > -L. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 2016-10-14 15:10, Jürgen Hestermann via Lazarus wrote: > desperately click on this and that and some have luck and suddenly it works > (more or less). > But they do not know why and they also do not know why the performance is so > bad, > but hey, as long as it more or less works Straight from the Visual Basic 6 manual. :-p [okay, I'll stop bashing VB for now] Regards, Graeme -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
El 13/10/2016 a las 23:11, Giuliano Colla via Lazarus escribió: > but then one should always select the most "appropriate" technology, > and not be influenced by what is "modern". More modern means maybe with a few extra features. And in this context I suppose that "modern" also means more popular. Both points are important, being popular is also important, network effect is important. More users means more libraries, more beta testers, more information, more tools. So, better frameworks. Don't underestimate the "popular factor". -- Saludos Santiago A. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
Am 2016-10-14 um 15:52 schrieb Michael Schnell via Lazarus: > On 14.10.2016 13:01, Graeme Geldenhuys via Lazarus wrote: >> They will be thrown into the deep end and sink. > I don't think so. You can learn to drive a car even if you don't know how the engine is constructed. > At first you can just use the GUI and later you can find out how it works. In most cases they never get to the step "find out how it works". If it works, nobody wants to invest time anymore to look under the hood. So they always operate on the surface and repeat the same subobtimal programming over and over again because they don't know how to do it better. The problem is, that often it does *not* work (or at least not as good as expected) because of the lack of knowledge. Then such people without background knowledge desperately click on this and that and some have luck and suddenly it works (more or less). But they do not know why and they also do not know why the performance is so bad, but hey, as long as it more or less works -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Fri, Oct 14, 2016 at 6:52 AM, Michael Schnell via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 14.10.2016 13:01, Graeme Geldenhuys via Lazarus wrote: > > They will be thrown into the deep end and sink. > > I don't think so. You can learn to drive a car even if you don't know how > the engine is constructed. > > At first you can just *use* the GUI and later you can find out how it > works. > > -Michael > > -- > ___ > > My life is consumed in teaching . I had started as an elementary school teacher means that my profession was teaching ( not a university graduate , and then a professor , knowing approximately nothing about teaching since they are not a graduate of "Faculty of Education" ) . Then I went to University and become an instructor to teach computer programming ( mainly ) . Your opinion about how to teach programming ( i.e. , start from GUI , then teach ( if you can ) programming ) is physically wrong . Please think the situation from the point of view of students , not with respect to yourself . Mehmet Erol Sanliturk -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 14.10.2016 13:01, Graeme Geldenhuys via Lazarus wrote: They will be thrown into the deep end and sink. I don't think so. You can learn to drive a car even if you don't know how the engine is constructed. At first you can just *use* the GUI and later you can find out how it works. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 10/14/2016 07:04 AM, Graeme Geldenhuys via Lazarus wrote: On 2016-10-14 12:01, Graeme Geldenhuys via Lazarus wrote: and maybe incite them every now and again Oops, that meant to read: "...and maybe entice them..." incite works, too :) -- NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list* unless private contact is specifically requested and granted. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Fri, Oct 14, 2016 at 5:05 AM, Martin Schreiber via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On Friday 14 October 2016 13:08:13 Mehmet Erol Sanliturk via Lazarus wrote: > > > > > In previous years > > > > https://sourceforge.net/projects/mseide-msegui/ > > > > was limited to Linux . > > MSEide+MSEgui runs on Windows and Linux from start at 1999. Since several > years it runs on FreeBSD too. > > Martin > -- > ___ > I am sorry that I did not include Windows . My intention was to say "other than Windows" , but remained incomplete . Mehmet Erol Sanliturk -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Thu, 13 Oct 2016 23:11:31 +0200 Giuliano Colla via Lazarus wrote: > Il 13/10/2016 16:48, Reimar Grabowski via Lazarus ha scritto: > > > If you want modern, teach them Java and let the programs run on their > > phones or keep doing console programs and do the GUI in JS (aka web > > applications). ^^ > > I find very unlikely that ... ^^ = ;) R. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Friday 14 October 2016 13:08:13 Mehmet Erol Sanliturk via Lazarus wrote: > > In previous years > > https://sourceforge.net/projects/mseide-msegui/ > > was limited to Linux . MSEide+MSEgui runs on Windows and Linux from start at 1999. Since several years it runs on FreeBSD too. Martin -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Friday 14 October 2016 10:50:28 Michael Schnell via Lazarus wrote: > > With a more careful design it's absolutely possible to do "non RAD" > programs by doing "GUI units" and "business code Units" that interact > via Objects with functions, properties and events (callback-properties) . > Separating GUI and program logic is also possible with RAD. See for example MSEkicadBOM, the application I am currently working on. https://gitlab.com/mseide-msegui/mseuniverse/tree/master/tools/kicad/bom It is a component and footprint database program for KiCad. It consists of a datamodule with the program logic and the database and action components: http://mseide-msegui.sourceforge.net/pics/kicadbommainmo.png a mainform with the mainmenu, GUI actions and the main datagrid: http://mseide-msegui.sourceforge.net/pics/kicadbommainfo.png and several editforms: http://mseide-msegui.sourceforge.net/pics/kicadbomcomponented.png The editforms inherit from a common base editform with base functionality (datasource, navigator, timestamp display, window close logic...) and have no or GUI-code only. The connection GUI<>datamodule is made with TDataSource, action- and ifi-dataendpoint-components. If done right the RAD-approach is productive and convenient, the projects are easily extendable and maintainable. Martin -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 2016-10-14 12:08, Mehmet Erol Sanliturk wrote: > program can not be compiled as a Lazarus program or an fpGUI program as it > is like compiling the same program by Delphi ( with required compiler > directives ) . It is necessary either use Lazarus or fpGUI programming . I am yet to see that in reality! [excluding all but he most basic "Hello World" programs] I've never come across a real-world Delphi project that can simply be opened in Lazarus IDE and compiles 100% correctly first time. As proof of that, it would also explain why Lazarus IDE includes the "Tools -> Delphi conversion" set of menu items, which does a one-way conversion (thus you can't go back to Delphi). Saying that, yes it is partly possible to have a single project that is compilable in both Delphi and Lazarus, but it requires significant amounts of changes and compromises. I don't see any benefit in having dual compiler and dual toolkit support in a single project. > As an example , I want to convert my program to fpGUI . If I can do it , it > may be more easy to convert it to C program. To convert it to fpGUI > program is a hard problem because it is necessary to convert all of the GUI > related parts. And you think moving to C with a totally different GUI toolkit is any easier? I seriously doubt that. I think it is pretty straight forward to convert a Lazarus project to fpGUI - I've done it many times with components and whole applications. It's not a 5 minute job, but will be significantly less effort that moving to C/C++ and using GTK, Qt or wxWidgets etc. > was limited to Linux . I do not know whether the same program can be > compiled as a Lazarus or MSEide program . GUI programs - definitely not. Lazarus LCL and MSEgui are very different toolkits. Much more so than LCL vs fpGUI. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Fast-small utilities for common javascript tasks, anyone?
El 12/10/16 a las 10:50, Michael Van Canneyt escribió: On Wed, 12 Oct 2016, Leonardo M. Ramé via Lazarus wrote: El 08/10/16 a las 05:18, Michael Van Canneyt via Lazarus escribió: Hi Michael, could you post jsmin.pas here?. I added it to FPC SVN. packages/fcl-js, unit jsminifier. I included an example program. Improvements and suggestions welcome. Michael. Thanks Michael, that's great!. BTW, I've found also a CSS Minifier, developed by Udo Schmal (http://www.gocher.me/CSSMin) I'll ask him if he allow us to add it to fcl-js. Great, that would come in handy as well !! Michael. Michael, I've got the answer from Udo Schmal, he gave permission to include the unit in fcl-js, here's his answer: > Hi Leonardo, > I've updated the code so that it doesn't need the two additional units as in > the old version. The code I published is based on some RegExp and is therefore > slow. Unfortunately I did not have time to change the code similar to the jsmin > function. > But, feel free to share the code. > > Regards, > Udo Schmal > http://www.gocher.me This is the link to the unit: http://www.gocher.me/code/css.pas -- Leonardo M. Ramé http://leonardorame.blogspot.com -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Fri, Oct 14, 2016 at 3:48 AM, Graeme Geldenhuys via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 2016-10-13 23:13, Erwin van den Bosch via Lazarus wrote: > > The problem is that you should separate your business logic and > > the GUI. With Delphi like RAD it's very difficult to do that. (but it is > > possible) Everything is coded in events and connected to database aware > > GUI controls. (In the case of a database application) > > Exactly why I use tiOPF for every application I write - even > non-Database applications. Also exactly why I implemented the MGM > (Model-GUI-Mediator) design pattern for use with VCL, LCL and fpGUI > Toolkit - also included in the tiOPF repository. > > All my form units are now VERY empty as all the real functionality lives > in mediators. This also makes unit testing of my code much easier. > > > > Another problem with the RAD way is that a lot is stored in forms (.lfm > > files) and it's difficult to see/notice changes to those files. > > And exactly why I designed the fpGUI Visual Forms Designer to generate > actual Object Pascal code in a AfterCreate() method, instead of using > *.lfm or *.dfm files. I now have one unit in my source code revision > system that shows all changes (no need review two files for form > changes), I can easily do a search & replace for form components and > other code, and I also don't need to fire up a visual form designer if I > just want to make one small tweak to a property. > > > Regards, > Graeme > > -- > fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal > http://fpgui.sourceforge.net/ > > My public PGP key: http://tinyurl.com/graeme-pgp > -- > ___ > I am reading/studying the fpGUI system . The problem here is that it is NOT an alternative to , let's say , Lazarus , in the sense that , the SAME program can not be compiled as a Lazarus program or an fpGUI program as it is like compiling the same program by Delphi ( with required compiler directives ) . It is necessary either use Lazarus or fpGUI programming . As an example , I want to convert my program to fpGUI . If I can do it , it may be more easy to convert it to C program . To convert it to fpGUI program is a hard problem because it is necessary to convert all of the GUI related parts ( because all of the unit names are different , I did not study their contents very much ) . In previous years https://sourceforge.net/projects/mseide-msegui/ was limited to Linux . I do not know whether the same program can be compiled as a Lazarus or MSEide program . During teaching , it is necessary to take care about such differences . Mehmet Erol Sanliturk -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 2016-10-14 12:01, Graeme Geldenhuys via Lazarus wrote: > and maybe incite them every now and again Oops, that meant to read: "...and maybe entice them..." Regards, Graeme -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Windows 10 force any non-white background color to White
On Fri, 14 Oct 2016 17:10:38 +0800 Dennis via Lazarus wrote: > I have a program written in lazarus running normally in windows 7. > When run in windows 10, the green color of the Frame/Form is changed by > Windows 10 to white. > > Now my customer is complaining the bright white is hurting his eyes. > > Can anyone help? I googled and the only articles is about changing the > title bar color, not the form's color. This works here: When I set the Form1.Color to clGreen I see green background on Win10. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 2016-10-14 09:18, Michael Schnell via Lazarus wrote: > The OP explained that his main purpose is to introduce more fun in the > education. That can be done by plunging into programming directly with > GUI development. So for somebody that doesn't know anything about programming, then suddenly using a Visual Form Designer, but when they look at the code that was generated they have NO idea what is going on. The don't know what a Class is, they don't know what Inheritance is. They don't know what Event Handlers are, what Properties are, what's the difference between 'var' and 'const' parameters etc. They will be thrown into the deep end and sink. The result - if they keep their head above water - they become "programmers" like that rubbish Visual Basic generation we saw in the late 90's, early 2000's. Writing horrific code because they actually don't have a clue what they are doing. Yeah, that sounds great! [major sarcasm] Start with the fundamentals, and maybe incite them every now and again with the same example done in a GUI environment. Just enough to keep them interested and excited in programming, but you have to get those fundamentals down, otherwise they have no base to build on. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 2016-10-13 23:13, Erwin van den Bosch via Lazarus wrote: > The problem is that you should separate your business logic and > the GUI. With Delphi like RAD it's very difficult to do that. (but it is > possible) Everything is coded in events and connected to database aware > GUI controls. (In the case of a database application) Exactly why I use tiOPF for every application I write - even non-Database applications. Also exactly why I implemented the MGM (Model-GUI-Mediator) design pattern for use with VCL, LCL and fpGUI Toolkit - also included in the tiOPF repository. All my form units are now VERY empty as all the real functionality lives in mediators. This also makes unit testing of my code much easier. > Another problem with the RAD way is that a lot is stored in forms (.lfm > files) and it's difficult to see/notice changes to those files. And exactly why I designed the fpGUI Visual Forms Designer to generate actual Object Pascal code in a AfterCreate() method, instead of using *.lfm or *.dfm files. I now have one unit in my source code revision system that shows all changes (no need review two files for form changes), I can easily do a search & replace for form components and other code, and I also don't need to fire up a visual form designer if I just want to make one small tweak to a property. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Fri, Oct 14, 2016 at 1:50 AM, Michael Schnell via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 14.10.2016 00:13, Erwin van den Bosch via Lazarus wrote: > >> >> I'm not a big fan of the RAD development way any more. (I was years ago). >> The problem is that you should separate your business logic and the GUI. >> > This is absolutely true especially when doing large systems or (embedded) > systems that don't are tightly bundled with the GUI. But even there using > RAD for testing/debugging is a way for speed up the development. > > " > And here the addressees are non-computer engineers who most likely will > not do large systems on their own, but just should understand what > programming means to enable them to talk decently with their colleagues who > will do the programming for appropriate projects. > > " The above paragraph is not correct very much , because the computer engineers and the other engineers are different professions . The other engineers are using computer programming to solve their own problems , the computer engineers are using computer programming to solve other people's problems . Mehmet Erol Sanliturk > So a fast way ("RAD") to do and test a rather simple working project and > understand the basics > > With Delphi like RAD it's very difficult to do that. (but it is possible) >> Everything is coded in events and connected to database aware GUI controls. >> (In the case of a database application) >> > I don't think so. > > With a more careful design it's absolutely possible to do "non RAD" > programs by doing "GUI units" and "business code Units" that interact via > Objects with functions, properties and events (callback-properties) . > > I believe this is not more effort that using an external GUI designer. > > I did this for embedded projects using the GUI units for debugging and > testing and then replacing them by dummies without needing to modify the > business code units and hence being able to start testing again at any > time, while the "GUI-stripped" executable can used on a "headless" target > system > > -Michael > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus-ide.org > http://lists.lazarus-ide.org/listinfo/lazarus > -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On Fri, Oct 14, 2016 at 1:18 AM, Michael Schnell via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On 13.10.2016 10:20, Graeme Geldenhuys via Lazarus wrote: > >> +1 >> That would be the best solution. GUI programming is based on >> fundamentals than need to be understood first. >> > > -1 !! > > The OP explained that his main purpose is to introduce more fun in the > education. That can be done by plunging into programming directly with GUI > development. > > This is why RAD had been invented. > > Of course there are decent drawbacks regarding relying too much on RAD and > about not really understanding the fundamentals behind it. > > But in the end the addressees are non-computer engineers. > > -Michael > -- > ___ > As an engineer , they need to write programs for doing computations not available in ready-made packages . Therefore , they need to a sufficient knowledge to write programs . This can be achieved in a good balance of learning programming itself and GUI application . Mehmet Erol Sanliturk -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Windows 10 force any non-white background color to White
On 2016-10-14 11:01, Giuliano Colla via Lazarus wrote: > My best suggestion is to encourage your customer to downgrade to Windows 7. Yeah right - that will never happen! All that effort just for one application, because LCL doesn't support the most basic of theming. Regards, Graeme -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Windows 10 force any non-white background color to White
Am 14.10.2016 um 11:10 schrieb Dennis via Lazarus: Can anyone help? I googled and the only articles is about changing the title bar color, not the form's color. Dennis Maybe a TPanel can help. Ingo -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Windows 10 force any non-white background color to White
Am 14.10.2016 um 11:10 schrieb Dennis via Lazarus: I have a program written in lazarus running normally in windows 7. When run in windows 10, the green color of the Frame/Form is changed by Windows 10 to white. Hi, I can't confirm that for Windows 10 1610 32bit with Lazarus 1.6/ FPC 3.0 and Lazarus/FPC Trunk. Form shows colour correctly (see pic) and frame seems to be transparent. Ingo -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] TPageControl cannot change parent
Hi List. In the designer it is not posible to use the builtin feature of "Change Parent" (from the context menu) with a TPageControl. Other controls seems to work fine (although i have not tested all of them). To recreate the problem slap a TPanel and a TPageControl on the mainform and add a single tabsheet. Use "Change Parent" on the Pagecontrol and change it to the panel - and bang. I use: Lazarus trunk: r53105 Fpc: 3.0.0 (release) x86_64 Lazarus does a hard crash - even the stack-trace is halted: torsten@Rainier:~/FreePascal/lazarus$ ./startlazarus is a file TLazarusManager.Run starting /home/torsten/FreePascal/lazarus/lazarus ... Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/torsten/.lazarus" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus" Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 FPC=True LCL=False TComponentTreeView.SetSelection: Updating component node values. AddComponent TPanel Parent=Form1:TForm1 23,15,269,625 Parent is 'Form1:TForm1' Hint: (lazarus) [TPkgManager.AddUnitDependenciesForComponentClasses] Extending Uses unit1.pas ExtCtrls AddComponent TPageControl Parent=Form1:TForm1 326,26,470,604 Parent is 'Form1:TForm1' Hint: (lazarus) [TPkgManager.AddUnitDependenciesForComponentClasses] Extending Uses unit1.pas ComCtrls TComponentTreeView.SetSelection: Selection.ForceUpdate encountered. TComponentTreeView.SetSelection: Selection.ForceUpdate encountered. TApplication.HandleException Access violation Stack trace: $7FE443665D86 This is as far as it goes. On a side node - it IS posible to select a tabsheet and change the parent to the panel, which IMO should not be posible. Kind regards Torsten -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Windows 10 force any non-white background color to White
Il 14/10/2016 11:10, Dennis via Lazarus ha scritto: I have a program written in lazarus running normally in windows 7. When run in windows 10, the green color of the Frame/Form is changed by Windows 10 to white. My best suggestion is to encourage your customer to downgrade to Windows 7. Hewlett Packard, when you select a professional grade laptop or desktop, as of today is still providing Windows 7 professional preinstalled, and includes an upgrade DVD to Windows 10, which you may decide to use, but at your own risk. They know better! Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Windows 10 force any non-white background color to White
I have a program written in lazarus running normally in windows 7. When run in windows 10, the green color of the Frame/Form is changed by Windows 10 to white. Now my customer is complaining the bright white is hurting his eyes. Can anyone help? I googled and the only articles is about changing the title bar color, not the form's color. Dennis -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 14/10/16 08:30, Michael Schnell via Lazarus wrote: Of course there are decent drawbacks regarding relying too much on RAD and about not really understanding the fundamentals behind it. But in the end the addressees are non-computer engineers. Seconded. If I could make a general observation: when teaching/supporting Pascal-style languages I've found it useful to completely decouple pointers, records and dynamic memory, irrespective of the fact that most books lump them in together by talking about linked lists and trees. Records are a useful general-purpose way of organising data. Pointers are something that refer to e.g. a block of known format returned by the operating system, but are used much less in OO systems than they used to be. Only after those are understood should dynamic memory be introduced, if ever. -- 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-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 14.10.2016 00:13, Erwin van den Bosch via Lazarus wrote: I'm not a big fan of the RAD development way any more. (I was years ago). The problem is that you should separate your business logic and the GUI. This is absolutely true especially when doing large systems or (embedded) systems that don't are tightly bundled with the GUI. But even there using RAD for testing/debugging is a way for speed up the development. And here the addressees are non-computer engineers who most likely will not do large systems on their own, but just should understand what programming means to enable them to talk decently with their colleagues who will do the programming for appropriate projects. So a fast way ("RAD") to do and test a rather simple working project and understand the basics With Delphi like RAD it's very difficult to do that. (but it is possible) Everything is coded in events and connected to database aware GUI controls. (In the case of a database application) I don't think so. With a more careful design it's absolutely possible to do "non RAD" programs by doing "GUI units" and "business code Units" that interact via Objects with functions, properties and events (callback-properties) . I believe this is not more effort that using an external GUI designer. I did this for embedded projects using the GUI units for debugging and testing and then replacing them by dummies without needing to modify the business code units and hence being able to start testing again at any time, while the "GUI-stripped" executable can used on a "headless" target system -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] TDBEdit, TStringField Size, DataSize, DisplayWidth and MaxLength
Dňa 14.10.2016 o 10:08 Tony Whyman via Lazarus napísal(a): On 14/10/16 06:43, LacaK via Lazarus wrote: I do not know IBX, but don't you use overriden TDataSet.InternalInitFieldDefs ? It will allow you put extra info into FieldDef and then use overriden TDataSet.CreateFields, which will allow you pass extra info from TIBFieldDef into TIBStringField for example ... (AFAICS Zeos do it in this way also) That is basically what IBX does. Not only IBX I think ;-) I suppose that all TDataSet descendants must follow this, because in Delphi is TFieldDef.CreateField also not virtual. Probably there is logic, why it is designed as is (may be CreateFields/BindFields should care about TFieldDef->TField). My point is that it would be better to put the passing of the extra info into a subclassed TFieldDef rather than have it in TIBCustomDataSet. I understand, but I think, that you must care also about persistent fields, where you must hook into BindFields (in all cases there are only 3 lines of code in CreateFields which iteratte over FieldDefs and create field so IMO no big problem override it) -Laco. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Teaching Pascal at College
On 13.10.2016 10:20, Graeme Geldenhuys via Lazarus wrote: +1 That would be the best solution. GUI programming is based on fundamentals than need to be understood first. -1 !! The OP explained that his main purpose is to introduce more fun in the education. That can be done by plunging into programming directly with GUI development. This is why RAD had been invented. Of course there are decent drawbacks regarding relying too much on RAD and about not really understanding the fundamentals behind it. But in the end the addressees are non-computer engineers. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Most efficient way for polling (TTimer, OnIdle, TIdleTimer, TThread)
On 14.10.2016 00:18, Luiz Americo Pereira Camara via Lazarus wrote: I have a component that needs to poll a SimpleIPC server repeatedly (at each 1s or so). While I do think that polling once a second will not do any noticeable harm, a better design might be to push some kind of message from the other site and wait for same in a function that does an appropriate OS call. (E.g a TThread doing a blocking wait for a pipe and then using TThread.Queue to call an event handler function in the main thread.) -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] TDBEdit, TStringField Size, DataSize, DisplayWidth and MaxLength
On 14/10/16 06:43, LacaK via Lazarus wrote: I do not know IBX, but don't you use overriden TDataSet.InternalInitFieldDefs ? It will allow you put extra info into FieldDef and then use overriden TDataSet.CreateFields, which will allow you pass extra info from TIBFieldDef into TIBStringField for example ... (AFAICS Zeos do it in this way also) That is basically what IBX does. My point is that it would be better to put the passing of the extra info into a subclassed TFieldDef rather than have it in TIBCustomDataSet. After all, isn't the whole point of OO programming to group related functionality into the same class. If you recommend subclassing the TFieldDef then surely it makes sense to make CreateField a virtual method. -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus