Re: [fpc-pascal] TField.DataType and ftBlob type
On Monday 27 July 2009 13:29:56 Graeme Geldenhuys wrote: Is there any way to find out the Sub-Type of a ftBlob in SqlDB? I would like to distinguish between binary data and long text data stored in a Blob field. In isc_blob_text is mapped to ftMemo (MSEgui, probably the same in original SqlDB, not tested). TBlobField has the property BlobType, seems not to be used in fcl-db. Martin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Question about fcl-image package
I've looked through the source of this thing and the means it has for scaling an image does not appear to be anti-aliased as I would require for my usage which is for icon scaling to a consistent dimension. From what I can tell, a C library called Imlib2 appears to provide what I need, but fcl-image appears to be preferred over this, but it does not appear to have everything I need. Am I overlooking a feature in fcl-image that would give me the scaling quality that I need? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Question about fcl-image package
On Tue, 28 Jul 2009, James Buren wrote: I've looked through the source of this thing and the means it has for scaling an image does not appear to be anti-aliased as I would require for my usage which is for icon scaling to a consistent dimension. From what I can tell, a C library called Imlib2 appears to provide what I need, but fcl-image appears to be preferred over this, but it does not appear to have everything I need. Am I overlooking a feature in fcl-image that would give me the scaling quality that I need? Well, no doubt you saw that there are various scaling algorithms. You can select the one you need, and if none of the available mechanisms suits you, you could write your own ? Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] $IF conditional compilation
Hi all, Say I had a constant declared in a unit... const AValue = true; In another unit which uses the above unit, I want to have conditional compilation based on the above constant... {$IF AValue} Do something... {$ELSE} Do something else... {$IFEND} I know it's possible in Delphi. But, is it possible in FPC? Using the above construct, I always got an 'Internal error 200501152' message. Is it a bug or something? FYI I'm using FPC v.2.2.5 on Mac. TIA. -- -Bee- ...making buzzes at http://twitter.com/beezing ...writing stories at http://beeography.wordpress.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Lazarus
Lazarus has not met its goal of 'write once and compile and run anywhere' and is taking far too long to develop. Should it be abandoned and replaced with a new graphical user interface library based on the Java Swing toolkit? I would be interested in your comments on this matter. Brian Prentice ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus
2009/7/28 Brian Prentice bprent...@webenet.net: Lazarus has not met its goal of 'write once and compile and run anywhere' and is taking far too long to develop. Should it be abandoned and replaced with a new graphical user interface library based on the Java Swing toolkit? I would be interested in your comments on this matter. Maybe you should send this to the lazarus mailing list? Does the Java Swing toolkit have c-style bindings? I expect it doesn't, which would mean that you will have to write an interface library, like lazarus uses with qt. You are welcome to develop a new lcl interface that targets swing. I personally see no point in inserting a useless layer in between lazarus and the (native) widgetset. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus
On Tue, 28 Jul 2009, Brian Prentice wrote: Lazarus has not met its goal of 'write once and compile and run anywhere' and is taking far too long to develop. Should it be abandoned and replaced with a new graphical user interface library based on the Java Swing toolkit? I would be interested in your comments on this matter. And why has it not met it's goal according to you ? It works fine for me on the 2 platforms I use... In each case, using Java is not an option, since I don't think there are C bindings. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $IF conditional compilation
On 28 Jul 2009, at 14:42, Bee wrote: In another unit which uses the above unit, I want to have conditional compilation based on the above constant... {$IF AValue} Do something... {$ELSE} Do something else... {$IFEND} I know it's possible in Delphi. But, is it possible in FPC? Using the above construct, I always got an 'Internal error 200501152' message. Is it a bug or something? The internal error is due to the fact that your {$if ...} construct appears right after your uses clause: http://bugs.freepascal.org/view.php?id=8611 Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus
On 28 Jul 2009, at 15:00, Henry Vermaak wrote: 2009/7/28 Brian Prentice bprent...@webenet.net: Lazarus has not met its goal of 'write once and compile and run anywhere' and is taking far too long to develop. Should it be abandoned and replaced with a new graphical user interface library based on the Java Swing toolkit? I would be interested in your comments on this matter. Maybe you should send this to the lazarus mailing list? Yes, indeed. This topic is not suitable for this list, and given the highly controversial statements I'm blocking it on this list before it gets completely out of hand. Jonas FPC mailing lists admin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus
On 28 Jul 2009, at 15:40, Graeme Geldenhuys wrote: Jonas Maebe wrote: Yes, indeed. This topic is not suitable for this list, I beg to differ The original poster is not happy with Lazarus, so this list is probably a good place to ask for alternatives. Well, that's how I understood it. I would not imagine the Lazarus mailing list being a good place to ask for alternatives to Lazarus. Do you? The fpc-pascal list is for getting help with using FPC and with programming in Pascal. This kind of discussion, especially if started in such a provocative way, can very easily drown any other kind of discussion. Therefore I do not consider it appropriate for this list. It can however also be discussed on the fpc-other list. So how to I know if my message went through, which proposes two alternative projects for Brian to try out? I will not silently discard other messages in this thread, but I will reject them (so you'll get a bounce). Jonas FPC mailing lists admin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $IF conditional compilation
The internal error is due to the fact that your {$if ...} construct appears right after your uses clause: http://bugs.freepascal.org/view.php?id=8611 So, it's a bug. Since 2007? :( Thanks for the hint. I'll find a workaround for that. Any suggestion? TIA. -- -Bee- ...making buzzes at http://twitter.com/beezing ...writing stories at http://beeography.wordpress.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $IF conditional compilation
On 28 Jul 2009, at 16:47, Bee wrote: The internal error is due to the fact that your {$if ...} construct appears right after your uses clause: http://bugs.freepascal.org/view.php?id=8611 So, it's a bug. Since 2007? :( Rewriting the unit loading system isn't exactly a trivial task. Thanks for the hint. I'll find a workaround for that. Any suggestion? TIA. No idea, sorry. Maybe adding a dummy constant declaration between the uses clause and the {$if ...} expression would help? Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $IF conditional compilation
Rewriting the unit loading system isn't exactly a trivial task. I understand. I just wonder why this bug didn't got priority since it's pretty basic feature for pascal compiler. No idea, sorry. Maybe adding a dummy constant declaration between the uses clause and the {$if ...} expression would help? That's what came first to my mind. I'll try it out. TIA. -- -Bee- ...making buzzes at http://twitter.com/beezing ...writing stories at http://beeography.wordpress.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Is there a way to avoid class casting?
Hi, I am building from some time a OPF, that is working fine for me, but I´d like to avoid the big amount of castings I am using... I have one class on each unit. Each class contains the properties that represent´s it :-) One property kind is TLinkedObjectProperty. This class has a property that returns a TObject, pointing to the object the property is referencing... TLinkedObjectProperty has another property called LinkedObjectClass that has the class of the linked object. Is there a way that, each time I reference (by code) ... mylinkedproperty.obj ... this obj is taken by the compiler of its linkedobjectclass class? so, I can use... mylinkedproperty.obj.[prop] ... beeing [prop] any property of the object that is of class LinkedObjectClass, and avoiding to type TMyLinkeddObjectClass(mylinkedproperty.obj).[prop] ??? Sorry for my poor english and I hope you understand what I mean. Thanks in advance Horacio from Argentina. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Is there a way to avoid class casting?
Horacio Jamilis wrote: so, I can use... mylinkedproperty.obj.[prop] ... beeing [prop] any property of the object that is of class LinkedObjectClass, and avoiding to type TMyLinkeddObjectClass(mylinkedproperty.obj).[prop] ??? You can define TMyLinkeddObjectClass and override the property types so casting is only done in that class's implementation. All your instances of TMyLinkeddObjectClass doesn't have to do casting then. eg: // you base class of your OPF framework. TtiObjectList = class(TtiObject) private protected functionGetItems(i: integer): TtiObject; virtual; procedure SetItems(i: integer; const Value: TtiObject); virtual; public propertyItems[i:integer]: TtiObject read GetItems write SetItems; functionAdd(const AObject: TtiObject): integer; virtual; published end; // Your custom object list class which defines correct class types TMyLinkeddObjectClassList = class(TtiObjectList) private protected functionGetItems(i: integer): TMyLinkeddObjectClass; reintroduce; procedure SetItems(i: integer; const Value: TMyLinkeddObjectClass); reintroduce; public propertyItems[i:integer]: TMyLinkeddObjectClass read GetItems write SetItems; functionAdd(const AObject: TMyLinkeddObjectClass): integer; reintroduce; published end; Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $IF conditional compilation
On 28 Jul 2009, at 16:56, Bee wrote: Rewriting the unit loading system isn't exactly a trivial task. I understand. I just wonder why this bug didn't got priority since it's pretty basic feature for pascal compiler. You cannot get bugs fixed in a project like FPC by giving them priority. They only get fixed if someone is interested in fixing them, for whatever reason. Moreover, most of the time the unit loading works fine. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Is there a way to avoid class casting?
Horacio Jamilis wrote: Even if I create a descending class for each TLinkedObjectProperty... I will not be able to use them... Could you post the Interface section of your classes and mention what units they are in. Alternatively look at the tiOPF framework and the source code examples. The following website mentions how to get the source code. http://tiopf.sourceforge.net --[ tiObject.pas ]- // you base class of your OPF framework. TtiObjectList = class(TtiObject) ... end; The following is custom classes in your application. --[ customer.pas ]--- TCustomerList = class(TtiObjectList) ... end; ---[ orders.pas ]-- TOrderList = class(TtiObjectList) ... end; If you want many-to-many relationships (though you did not mention this in your first posting), then you need to use base classes and to casting. Or pick a master class our of the two relationships. The master class, lets say TCustomer will contains TOrderList property. But the TOrderList will contain base class and casting. This minimizes casting. Or use something like the Relationship Manager design pattern. Relationship Manager can also be found in the tiOPF source code: https://tiopf.svn.sourceforge.net/svnroot/tiopf/tiOPF2/Trunk/Quarantine/RelationshipManager As another alternative, you can implement relationships using Interfaces. The class definition will only mention the Interface name, not the concrete class type. I don´t see a solution... except keeping casting :-( Like I said, if you can post the interfaces definitions of your classes, it will be easier to see how you use your classes and what solution can be applied. Remember to also mention which class definitions are in which units. Regards, - Graeme - fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal