* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: XML: modify values from index number
« Last post by rretamar on Today at 10:09:44 pm »
Work fine !!!!

Thanks.  :)
2
General / Re: Compile Photoshop Pascal Code
« Last post by Nitorami on Today at 09:51:21 pm »
Why would you need a constructor ? It is only required to build the VMT which is necessary for inheritance & virtual methods which advanced records don't support.

Objects are really like Classes, except they are static and need not be allocated, hence it is not necessary to "create" them. Only if you are using inheritance, then you need a constructor. That is my understanding. I don't know about type helpers.

I had started my own program based on objects, but came to a point where things went wrong. I don't know whether "Delphi broke objects", but have the feeling the developers neglected them, once Classes had been implemented. So I changed to Classes, but still use simple objects to capsule simple data and methods. But I don't use constructors / inheritance on objects anymore, neither properties... I remember they seemed to be buggy.
The advantage of objects is that access to their fields may be a little bit faster than for Classes, although that only matters in tight loops.
3
GTK / Re: Lazarus and GTK2 x GTK3 x GTK4 x GTK5
« Last post by palacs on Today at 09:39:40 pm »
It would be better not to see GTK3 and GTK4 as advancements of GTK2 but as completely different toolkits. Because they are. GTK3 is not necessarily better than GTK2. In some situations it's slower, wastes more resources, has many stability and incompatibility problems, especially with composition managers. It contains "tabletized" widgets which is basically a mockery of the corporate-idealist, dumbed down "material" concept carried out by Google. Its UI elements make GTK3 apps harder to use on a classic desktop PC environment. Many projects (e.g. audacious) has already dropped GTK3 in favor of GTK2 because of these issues. GTK2 is mature enough in LCL and its should not be dropped from LCL. It should be kept and maintained, like Windows MFC.
4
General / Re: Compile Photoshop Pascal Code
« Last post by ASerge on Today at 09:30:04 pm »
Compare advanced records and objects:
1. Advanced records support type helper (static polymorphism).
2. Objects support virtual function (dynamic polymorphism) and inheritance (static polymorphism).
All other properties are the same.
5
Third party / Re: TGIFViewer component
« Last post by BeanzMaster on Today at 09:16:10 pm »
New update

Following Alextp recommandation :

(see updated GIFView demo)
  • Begin translate french comments to english in interface parts
  • Made some minors change

Translate in action: https://www.youtube.com/watch?v=tRI7Kw2RTw8

Hi BeanzMaster,

When the component is stable enough let me know so I can add it to OPM.

PS: I ran a few test and works fine.

Hi GetMem, Thanks for testing it. And thanks for add it to OPM.  It's enough stable at this stage .But Take your time and have good hollidays before   ;)

Cheers
6
General / Re: Compile Photoshop Pascal Code
« Last post by VTwin on Today at 08:52:00 pm »
To clarify my question, I do not like the fact that advanced records do not have constructors. This makes me write code like this:

Code: Pascal  [Select]
  1. type
  2.   TMyRecord = record
  3.     MaxAllowed: integer;
  4.     MinAllowed: integer;
  5.     procedure Init;
  6.   end;
  7.  
  8. procedure TMyRecord.Init;
  9. begin
  10.   MaxAllowed := 100;
  11.   MinAllowed := 0;
  12. end
  13.  
  14. var
  15.   r : TMyRecord;
  16. begin
  17.   r.Init;
  18. end.
  19.  
  20.  

I would prefer to use a constructor. Having learned that Delphi "broke" them, I have stayed away from objects. I am curious as to what other folks do.
7
General / Re: Compile Photoshop Pascal Code
« Last post by VTwin on Today at 08:23:43 pm »
Useless since Mac Pascal "object" is not necessary to object in other modes (including TP/Delphi), as the following program demonstrates:

Interesting. It seems that what they are depends on the mode. That makes me nervous. Should I not use them then?
8
General / Re: Compile Photoshop Pascal Code
« Last post by VTwin on Today at 08:17:51 pm »
Objects can be declared with fields and methods, similar to Classes, but have no constructors or destructors, and are not allocated.
Сarried away by belittling the capabilities of the object type? They can have a constructor and a destructor.

Sorry, I did not mean to belittle them. I was disappointed to learn that Delphi "broke" them. I use advanced records a lot, and would prefer to use objects. I was using objects, but moved to advanced records. Thank you for pointing out my error, perhaps I should start using them again. Do many here folks still use objects?
9
General / Re: Compile Photoshop Pascal Code
« Last post by marcov on Today at 08:10:32 pm »
From Delphi docs:

Useless since Mac Pascal "object" is not necessary to object in other modes (including TP/Delphi), as the following program demonstrates:

Code: Pascal  [Select]
  1.  
  2. {$mode macpas}
  3.  
  4. type TSomething = object
  5.                     l1,l2,l3: integer;
  6.  
  7.                        end;
  8.  
  9. var x : TSomething;
  10.  
  11. begin
  12.  writeln(sizeof(x));   // In mode macpas prints 4 on 32-bits systems, a reference!  Change to mode Delphi and see the value change to 12
  13. end.
  14.  
10
General / Re: Compile Photoshop Pascal Code
« Last post by ASerge on Today at 08:03:44 pm »
Objects can be declared with fields and methods, similar to Classes, but have no constructors or destructors, and are not allocated.
Сarried away by belittling the capabilities of the object type? They can have a constructor and a destructor.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus