Re: [Lazarus] default visibility for class members
On 27.02.2013 08:40, xrfang wrote: Hi All, My class looks like this: TMyClass = class FField1: Integer; private FField2: string; public FField3: string; end; Question is, is FField1 private or public or protected? For all lcl classes, I see a lot of fields above private, it looks like they are same as public, because I can access them from outside. But why allow them to be put there instead of directly under public? The default visiblity of classes is public EXCEPT they are declared inside when {$M+} was given or a parent class was declared that way (e.g. Classes.TPersistant). In that case the default visiblity is published. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] polymophic function pointers
On Wed, 27 Feb 2013, xrfang wrote: Hi, Is it possible to do the following: === example === program test; type TMyClass = class type TDataFilter = function public Value : Double; Filter: TDataFilter; procedure ViewData; end; procedure TMyClass.ViewData; begin if Filter = nil then WriteLn(Value) else WriteLn(Filter(Value)); end; var t : TMyClass; begin t := TMyClass.Create; t.Value = 2; t.Filter := @sqr; //this does not work t.Filter := @ln; //this does not work either nbs p; t.ViewData; t.Free; end. = The problem is, while assign function pointers to Filter, I would like to make it accept all numeric functions. That is, if I define it to accept Double, it should accept Single and Integers, and if I define it to accept Extended, it should accept all numbers. Possible? No. Michael.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Recent Problem with program compile
On Tue, 26 Feb 2013 22:29:45 -0600 Andrew Brunner atbrun...@aurawin.com wrote: This process is called my a linux service. Required Packages only list as LCLBase and LazUtils. When I remove LCLBase the project compiles. However, if I follow the wiki suggestions I compile just fine but the program terminates abnormally when launched as a process from the LazDaemon. Error: Compiling resource /Developer/Source/Builds/Aurawin/SCS/Linux/64/.Output/AuProcess.or Linking AuProcess /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /Developer/Lazarus/lcl/units/x86_64-linux/wsimglist.o: In function `REGISTERCUSTOMIMAGELIST': The unit wsimglist is in LCLBase. It has abstract functions and requires the package LCL for the implementation. You wrote that the project compiles without LCLBase. This means something else is passing a search path to the LCLBase units. Please check the project's Other Source Files. It must *not* contain directories of the LCLBase, nor LCL, nor LazUtils. Did something recently changed with Lazarus from SVN/trunk to AUTOMATICALLY include LCLBase? AFAIK the package LCLBase was added inadvertently. And a previous revision of my project shows it is not there. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] global operator overloading
On 02/26/2013 03:07 PM, Sven Barth wrote: The critical difference between records and classes besides the ability of records to reside on the stack is that they don't allow inheritance and they support variable parts. The don't allow inheritance is important, because otherwise you'll have a certain overhead like virtual method resolution. I see. But this does not force that a synonyme for record could be a certain type of class, so that class in a straight forward and thus more future-compatible way can be used for any combination of fields of multiple types. (of course keeping the record syntax for compatibility) AFAIK even old style Turbo-Pascal Objects are still in place That could be a certain type of class as well. Yes, objects still exist as well and I still don't really understand why Borland didn't revive them instead of adding methods to records... I suppose they already marked Object as obsolete and did not want to admit the bad decision. (Of course more sensible would have been to extend the count of class specifier keywords.) Nevertheless objects are between records and classes: they can also be located on the stack (and be initialized as a constant) like records, yet they support (if you need it) inheritance and virtual methods. They can't implement interfaces though and there is no base object type (similar to TObject). Also they don't support RTTI (though I might change this with the extended RTTI). All three types, records, objects and classes have their purposes and uses and one can select the one that is most fitting in a given situation. Yep. All in fact are sensible but the multiple syntax is rather queer (disregarding the history that led to it). -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Forward declare (modern) records [was: Re: global operator overloading]
On 02/26/2013 04:18 PM, Sven Barth wrote: You CAN NOT have the record used as a field inside itself, Using a pointer to this type within a record does make a lot of sense for creating linked lists. I do this all the time in C. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Forward declare (modern) records [was: Re: global operator overloading]
On 02/26/2013 05:27 PM, ListMember wrote: User code needs to create and destroy classes. With records, there's no need for any of that. This is because right now a class instance needs to reside on the heap. But this does not mean it does not make sense to define an additional class flavor (using a specifier maybe in a similar way as helper) to define such a beast. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Did anybody else use retinizer for Macbook Retina on lazarus before?
On Sun, 17 Feb 2013 20:45:07 +0100 Michael Ring m...@michael-ring.org wrote: The fonts of lazarus look very ugly on my Macbook Retina, a few weeks ago I found the tool retinizer http://retinizer.mikelpr.com/ and used it on lazarus, the results were amazing, very nicecrisp fonts! Nice. How does it achieve that? I would now like to create the necessary ressources for lazarus so that it uses retina out of the box without the need of using retinizer, main problem for me is that I do not use the graphical designer at all, I am using lazarus for embedded systems only, so I cannot really tell if switching lazarus to retina mode breaks anything in the GUI. Anybody else any experience ? Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Forward declare (modern) records [was: Re: global operator overloading]
Am 27.02.2013 10:51, schrieb Michael Schnell: On 02/26/2013 04:18 PM, Sven Barth wrote: You CAN NOT have the record used as a field inside itself, Using a pointer to this type within a record does make a lot of sense for creating linked lists. I do this all the time in C. This is not what is being talked about. It's about defining record types that use each other in their properties or functions without defining a pointer type. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] CRM and MVC
On Wed, Feb 27, 2013 at 12:23 AM, Pablo R. Digonzelli pdigonze...@softsargentina.com wrote: Hi all, i am interested on Lazarus. I want to know if there are ORMs for it? Which is the better in your opinion. Other question is if there are MVC or MVP frameworks for Lazarus. Any answer will be apreciated .. Sorry for my english. As Graeme said in other mail, the tiOPF is a good solution. If you want to know about other alternatives, maybe more simpler, please take a look at Greyhound Project: github.com/mdbs99/Greyhound Best regards, Marcos Douglas -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] CRM and MVC
Thanks a lot . I will see it Ing. Pablo Digonzelli Sofware Solutions IP Soluciones SRL 25 de Mayo 521. Entrepiso A email: pdigonze...@softsargentina.com email: pdigonze...@gmail.com twitter: @pdigonzelli Tel: 0381 4227378 Cel: 0381 155982714 - Mensaje original - De: Graeme Geldenhuys gra...@geldenhuys.co.uk Para: lazarus@lists.lazarus.freepascal.org Enviados: Miércoles, 27 de Febrero 2013 4:53:35 Asunto: Re: [Lazarus] CRM and MVC On 2013-02-27 03:23, Pablo R. Digonzelli wrote: Hi all, i am interested on Lazarus. I want to know if there are ORMs for it? Which is the better in your opinion. Other question is if there are MVC or MVP frameworks for Lazarus. Take a look at tiOPF version 2 (http://www.tiopf.com). It is an open source Object Persistence Framework that has been around since 1999. It eases the mapping of object oriented business classes to a relation database. It also has a Model-GUI-Mediator (very similar to MVC idea) which allows you to make any standard UI widget object aware. It has support for all the populate relation databases, and has support for many different database components. tiOPF works with Delphi and FPC, and the MGM has support for VCL, LCL and fpGUI Toolkit. The source code repository is hosted on SourceForge. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TDD
thaks vincent ! Ing. Pablo Digonzelli Sofware Solutions IP Soluciones SRL 25 de Mayo 521. Entrepiso A email: pdigonze...@softsargentina.com email: pdigonze...@gmail.com twitter: @pdigonzelli Tel: 0381 4227378 Cel: 0381 155982714 - Mensaje original - De: Vincent Snijders vincent.snijd...@gmail.com Para: Lazarus mailing list lazarus@lists.lazarus.freepascal.org Enviados: Miércoles, 27 de Febrero 2013 3:47:15 Asunto: Re: [Lazarus] TDD 2013/2/27 Pablo R. Digonzelli pdigonze...@softsargentina.com: Hi , another question . Wich are TDD frameworks for Lazarus? http://wiki.lazarus.freepascal.org/fpcunit There are others too. Vincent -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TDD
No such a framework yet, but we have unit testing frameworks on which you can do TDD on top of. FPCUnit is distributed along, while FPTest is 3rd party. -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-TDD-tp4029488p4029507.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] CRM and MVC
tiOPF and Greyhound (+ my ghORM) are two frameworks I've ever used. There are others, but I never touch them. -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-CRM-and-MVC-tp4029487p4029508.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TDD
On 27-2-2013 14:54, leledumbo wrote: No such a framework yet, but we have unit testing frameworks on which you can do TDD on top of. FPCUnit is distributed along, while FPTest is 3rd party. Yep. And if you want to automatically store your fpcunit test results in a database for easy comparison etc, you can use testdbwriter: https://bitbucket.org/reiniero/testdbwriter /shameless self promotion -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Forward declare (modern) records [was: Re: global operator overloading]
Am 27.02.2013 13:22 schrieb ListMember listmem...@letterboxes.org: Referring to your other post, you gave this example: === example begin === type SomeType1 = record; SomeType2 = record; SomeType1 = record // ... property SomeProperty: SomeType2 read ... write ... end; SomeType2 = record // ... property SomeProperty: SomeType1 read ... write ... end; === example end === While it does capture the idea, let me make it more detailed/clearer. To be honest: I left out the methods, because of lazyness :) I only (wish to) use the forward declared record types in methods/getters/setters/properties. Correct me if I am wrong, but this way we can eliminate the possiblity of introducing infinite recursion (that would arise if we used forward declared record types as fields). Is there still any logical flaw in this? After having slept about it a bit, I came to the conclusion that your proposal is at least a valid one considering that we already differentiate between record field or not for the type itself. As a forward declaration needs to be resolved in the same type section we don't need to bother about global variable or function declarations either. What could be a bit counterintuitive though is if there is a class, interface or object declaration inbetween and that one uses the record as well... Depending on when the sizes of the instances and parameters are calculated, we can either allow or need to forbid its usage... You can create a feature request on the bugtracker. I don't know yet whether we'll definitely implement it or not, but this way it's up for discussion. And please state there again that you don't want to use it for fields. Regards, Sven -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ValueListEditor: feedback needed from Delphi users
Delphi 2010 Pro: Per default property Keyoptions is empty and nothing happens pressing insert, delete ... You can only select the value and edit it. Am 26.02.2013 19:03, schrieb Bart: Hi all, I'm currently working on the ValueListEditor. I have some questions on the behaviour of the KeyOptions property that I cannot find an answer to, simply because my Delphi is too old, and it does not have a TValueListEditor at all, and the Embarcadero DocWiki (http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.ValEdit.TKeyOptions) doesn't provide clear answers either. So, for anyone that has a recent Delphi here are my questions: 1) keyDelete: The user can delete the selected name/value pair by pressing the Delete key. When does this happen. - If the user presses Delete in key column, or also in value column? If property keyoptions is [keyEdit,keyAdd,keyDelete,keyUnique] and you press Control plus keyDelete, the whole line is deleted. Doesn't matter which column is selected! - Does it happen if the user is editing the cell (if keyEdit is set)? YES !!! 2) keyDelete: the Embarcadero docwiki does not specify: must keyEdit be set in order to set keyDelete (like it is, for keyAdd)? keyDelete can be set, even if keyedit is false ! 3) keyAdd: if the user presses Insert, an empty row is added. (first attempt at implementing this in r40418) - if you are in an empty row, does it still insert a new one? No ! You just hit the insert key and get ONE new row next to current row. Please only provide answer obtained by black box testing. Just build a Delpi app and see how it functions. Do NOT, I repeat do NOT, look at the Delphi source code. Our implementation needs to be clean. Thanks in advance. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] ValueListEditor: feedback needed from Delphi users
On 2/27/13, John Landmesser joh...@online.de wrote: Per default property Keyoptions is empty and nothing happens pressing insert, delete ... You can only select the value and edit it. Same in Lazarus If property keyoptions is [keyEdit,keyAdd,keyDelete,keyUnique] and you press Control plus keyDelete, the whole line is deleted. Doesn't matter which column is selected! So, you must press Ctrl+Delete? (Delphi DocWiki says Delete, which IMHO is rather odd). - Does it happen if the user is editing the cell (if keyEdit is set)? YES !!! OK keyDelete: the Embarcadero docwiki does not specify: must keyEdit be set in order to set keyDelete (like it is, for keyAdd)? keyDelete can be set, even if keyedit is false ! Strange, but I'll make it so. keyAdd: if the user presses Insert, an empty row is added. (first attempt at implementing this in r40418) - if you are in an empty row, does it still insert a new one? No ! You just hit the insert key and get ONE new row next to current row. OK, just like Lazarus behaves now. Thank you very much for your feedback!! Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TOpenGLControl: multisampling not working (Linux/GLX)
On Tue, 26 Feb 2013 19:42:32 +0100 Mattias Gaertner nc-gaert...@netcologne.de wrote: On Tue, 26 Feb 2013 19:10:53 +0100 Reimar Grabowski reimg...@web.de wrote: On Tue, 26 Feb 2013 16:53:25 +0100 Mattias Gaertner nc-gaert...@netcologne.de wrote: A quick look at the gtkglext-1.2.0 sources didn't reveal anything special about multisampling. It is very possible that no 'special' support is needed. The first noticeable thing of gtkglext code is the special color map. This could be the difference as multisampling in GLX is handled the same as for example alpha bits or color bits. The color map functions are in gdk/x11/gdkglconfig-x11.c. The C looks simple, but I guess it needs some time to understand all the X calls and flags. Reimar sent me a patch that allocates a simple colormap, instead of the sophisticated gtkglext colormap. That seems to be enough for multisampling. :) Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Licensing info missing!?
Hi all, ($LazarusDir)/images does not contain any license info about the image files that are there. ($LazarusDir)/COPYING.txt does not mention the license situation. What are the licenses for the images in that directory? Raised as http://bugs.freepascal.org/view.php?id=23780 Thanks, Reinier -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus