Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Classic objects — does FPC generate additional code?
« Last post by marcov on Today at 03:18:05 pm »
What OO do you have left then?  Records can contain methods. TP objects only allocate a VMT when virtual methods are defined.

I'm not sure using getmen and freemem handle fields with automated types. You would have to add initialize and finalize calls for that.

I would simply use records and use new and dispose.
2
General / Re: Animated GIF's and Lazarus IDE
« Last post by lainz on Today at 03:11:11 pm »
with bgrabitmao you can draw the gif according to your own timer... just load into memory the gif first so it's loading time is not a problem.

or use a game dedicated tool better...
3
General / Classic objects — does FPC generate additional code?
« Last post by flowCRANE on Today at 03:09:56 pm »
From what I understand, classic objects, i.e. data structures declared with the object keyword, take up the same amount of memory as their record counterparts. We can declare such objects on the stack and on the heap, but unlike records, objects support inheritance. So they are something between records and classes, which gives additional possibilities, which I am happy to use.

In my game engine, I use such classic objects to create simple data structures that contain only fields with data (no methods) and this data can be inherited. Such objects can be used as local variables existing on the stack, but can also be allocated on the heap. When allocated on the heap, memory for them is always allocated using GetMem and freed using FreeMem. That's it in a nutshell.

Assuming that:

  • objects contain only fields, no methods, constructors, destructors or properties,
  • I use GetMem and FreeMem to manage their memory on the heap,
  • if I use an object that exists on the stack, I never use New and Dispose functions.

can someone familiar with FPC internals officially confirm that using objects only with fields and not using the API dedicated to classic objects (constructors, destructors, New, Dispose etc.) makes such objects exactly the same as regular records? So far, I have not found that using them in the manner mentioned above would result in the automatic allocation of additional memory or forces the compiler to generate additional instructions.

Thanks in advance for your answers.
4
General / Re: Adding interfaces to any class (tnx Warfley!)
« Last post by ASerge on Today at 03:05:29 pm »
But how do you convert it back?
What for? If we have an object A, then convert it to B, then why back? Just use A.
5
Hm, tried first with comparing the lpi files from two related projects, where one has Run enabled, and the other not.
Many parameters different of course, but, focusing on those which seem to be potentially relevant, tried to bring them to match step-by-step.
No recognizable effect so far, regarding the enabling.

Then i backuped/removed the lpi file and tried to recreate it from the lpr file.
Drag/drop - how meant?
I did an 'Open with ...' of the lpr file targeting the lazarus.exe. Result:
I see my original project file in the IDE, but at first position additionally a very initial unit1 appears.
When compiling, it compiles to <drive>\Users\<username>\Appdata\Local\temp etc.
When doing 'Save project as ..', it offers a brandnew project1 with an project1.exe being generated then (exe!).
Same when (of course) telling the original project name as target.
With other words: by half a brand-new project will be created (i'd expected to save the existing project maybe as lpi, lpr, lps).
What might i have missed when trying to recreate the lpi file from the lpr file?
Edit: involved versions: Windows 10; Lazarus 3.6 64bit
6
Other / Re: What is the history of disappearance of GNU Pascal?
« Last post by marcov on Today at 02:41:25 pm »
You can go to the maillist archives on the site. Search for the quo vadis thread in 2010. There is also a summary on wikipedia https://en.wikipedia.org/wiki/Gnu_pascal

https://web.archive.org/web/20140714170318/http://fjf.gnu.de/gpc-future.html

https://web.archive.org/web/20150908094319/http://www.g-n-u.de/pipermail/gpc/2010-July/thread.html

In a nutshell, keeping up with major version transitions of GCC was too hard. They were studying on reimplementing using a backend that wrote C, but no news about that was ever brought out. 

There was some support and discussion on the maillist for the versions that were out (gcc 4 based iirc) after that period till say 2015, but after that it has been quite quiet.

The developers in that period also stated that they mostly stopped using Pascal in their daily work, which might have been the final straw.
7
General / Re: Animated GIF's and Lazarus IDE
« Last post by mav on Today at 02:38:21 pm »
I'm using a component made by someone called Escafandra...it works pretty well for me.
I've made an example of how it's used:
8
General / Re: Animated GIF's and Lazarus IDE
« Last post by cdbc on Today at 02:37:30 pm »
Hi
Just a thought...
Why don't you ask how they'd do it, in the 'Castle-Game-Engine' forum, just give them the last explanation from reply #4 in this thread...
They're friends of our forum and Michalis is himself a member here  ;)
Regards Benny
9
macOS / Mac OS X / Re: TvsComPort on MacOS Sierra problem
« Last post by sstvmaster on Today at 02:09:01 pm »
Maybe you must add your user to the dialout group, like under linux? I dont know if this is required under macos. Just a guess.
10
LCL / Re: [SOLVED] TRichMemo and text colour
« Last post by MarkMLl on Today at 01:56:57 pm »
I tried to modify AddRichText.
I have an issue with ABackgroundColour = clDefault - I cannot get the actual colour of the RichMemo.
The ARichMemo.Colour returns clDefault.
I tried with Brush, etc, I still do not get the actual background colour of the RichMemo. Any ideas?

I don't think this is really related to the remainder of this thread, other than that

Quote
...that might depend on the widget set.

I suggest starting a separate thread, with a title that specifically asks how to recover the /actual/ colour of something identified as one of the "specials", i.e. clDefault etc.

However my own suspicion is that this will be heavily dependent on the widget set, including obviously the extent to which a control is implemented by an underlying widget rather than being lovingly handcrafted.

MarkMLl
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018