-
Content Count
3020 -
Joined
-
Last visited
-
Days Won
108
Posts posted by dummzeuch
-
-
I guess you mean the squares on the left hand border? (You should have said so, because i just starred at this picture for several minutes before i noticed them.) Everything else looks fine to me.
-
I have got a VirtualStringTree in grid mode and I would like to autosize the columns so that they are wide enough to display the column text and the column header.
Calling vst.Header.AutoFitColumns works for the column text but not for the header.
I would have thought that this question has been asked and answerted before, but my Google fu is becoming ever weaker. I found lots of hints on how to fit the column text, but not the header.
-
3 hours ago, pyscripter said:You can use a class helper to expose a private method of a parent class.
No, I can't.
14 hours ago, dummzeuch said:Note: Class Helpers and extended RTTI are not an option here. This must work with Delphi 2007.
Edited 14 hours ago by dummzeuch
-
3 minutes ago, Remy Lebeau said:That works only for private fields, not for private methods.
-
-
23 minutes ago, pyscripter said:Use the magic with statement:
With Self do SomeMethod
This works in all version of Delphi including recent ones.
Unfortunately that only works in class helpers.
-
Given the following class:
unit Ancestors; interface type TAncestorClass = class private procedure SomeMethod; end; [... stuff ...]
... and a descendant class that is declared in a different unit:
unit Descendants; interface uses Ancestors; type TDescendant = class(TAncestor) protected procedure SomeOtherMethod; end; // [...] implementation procedure TDescendant.SomeOtherMethod; begin SomeMethod; // <-- this won't compile end;
I need to call the private TAncestor.SomeMethod from TDescendant.SomeOtherMethod. This of course won't compile because TAncestor.SomeMethod is declared as private and I cannot change that declaration (It's part of the Delphi VCL).
My solution so far is to copy the implementation to my unit, but I am pretty sure this would violate Embarcadero's copyright on that (non trivial) code if I were to release that source code. So I am looking for a different solution.
It guess it would be possible to somehow patch my class to call the original code, but I have never done something like that. Is there any documentation / blog post / example code on how to do that? I am aware that I would then possibly have to adapt this patch to every Delphi version.
Any hints?
Edit: Note: Class Helpers and extended RTTI are not an option here. This must work with Delphi 2007.
-
2 hours ago, A.M. Hoornweg said:All my projects have their DCU and build directories on a RAMdisk and I have specifically excluded this drive in the virus scanner.
So, are you seeing the error I described in the blog post?
-
31 minutes ago, Sherlock said:Well then get to it.
The US have switched to the metric system as of June 2013, when the imperial measurements were rebased to depend on their corresponding metric units. Source: Wikipedia
Wow, I totally missed that. (This still doesn't increase the likelyhood of that particular software ever being used in the US.)
Now, if they switched to a sane date and time format, that would be cool. Or did that happen and I missed it too?
-
In my case it's not Windows 10 but Windows 8.1.
-
I have been using two tools to add additional data to my executable files in post build scripts for years:
- assemble.exe from GNUGettext for Delphi
- MakeJclDbg.exe from Project Jedi
Both tools open the freshly built executable and append chunks of data to it. And both started to fail with the error “[project].exe is open in another program” more often lately.
I never managed to find out exactly what causes the problem. First I suspected BitDefender antivirus, but the error still occurs after I have switched to Windows Defender, so it’s not just BitDefender but probably any antivirus software that is causing the trouble.
As a first try I added a 2 seconds delay between the compiling/linking and the execution of each of these tools. It seemed to help, the errors became much less frequently but they still occurred. Also those 4 seconds always felt like eternity (the whole compile usually takes less than 10 seconds, so 4 additional seconds is a whopping 40%).
So, a few days ago I had enough. I’ve got the source code of these tools, so why not simply add several tries to opening the file? That’s what I did: Both tools now try to open the file and if that fails wait for a second and try again. Rinse and repeat up to 10 times. In my tests, it rarely took more than 2 tries, usually the first one succeeded. That means it shaved these 4 seconds off the build time again with the rare exception of adding them again at very few occasions.
Read on (and get download links) in my blog post
https://blog.dummzeuch.de/2019/06/23/project-exe-is-open-in-another-program-errors/
-
By default, the width of the drop down list of a TComboBox is the same as the width of the control itself, and even in the latest Delphi version there apparently is no property to set it.
Why is that so? Good question. There are probably many third party controls that offer this because it is rather simple to implement. But on the other hand, if it is that simple, why isn’t it a feature of the default control? It can really be a pain in the lower back that some entries are just not displayed correctly as seen in the picture above.
Setting the drop down width is as simple as sending the CB_SETDROPPEDWIDTH message to the control’s handle:
1
SendMessage(TheCombobox
.
Handle, CB_SETDROPPEDWIDTH, MinimumWidthInPixels,
0
);
It does not allow to shrink the width of the drop down list though, because it sets the minimum width, not the actual width. There is this answer on StackOverflow for that particular problem. The result isn’t very visually appealing though, because the list is left aligned rather than right.
Read on in my blog post
https://blog.dummzeuch.de/2019/06/22/setting-the-drop-down-width-of-a-combobox-in-delphi/
-
2
-
1
-
-
32 minutes ago, Darian Miller said:(I've been coding in the automotive industry in the U.S. for 20+ years.) IMO, if you want to service the U.S. market and you are displaying the distance a vehicle has traveled to a user then use "Mileage" or "Miles" and convert KM to Miles for display. Very few in the U.S. will want to see KM for vehicle mileage (at least for personal vehicle mileage.)
Thanks, but the US is not a market for this program (and probably will never be, but who knows? It's probably as likely as the US converting to metric. 😉 )
-
I will probably go with "mileage" then, even though that will raise questions whenever some translator stumbles upon it (the next translation will be to Portugese, that's going to be interesting).
-
1 hour ago, WillH said:No. An Odometer is a device to measure mileage. "Odometer value" or something like that would probably be OK for some usages but not in my particular case (which is the "mileage" of a special type of tyre).
-
I need an English translation for the German Word "Laufleistung" (Kilometerleistung), which gives e.g. the distance a car or a tyre has travelled in its lifetime.
Every translation service suggests "mileage", but showing "mileage [km]" (mileage in kilometres) looks wrong to me.
DeepL also suggests "kilometrage", which I had never heard before. Is that really used? Probably not in the US and UK. What about other English speaking countries with a more sane unit system? (Are there any? 😉 )
I would prefer a word that is unit agnostic (Like the German "Laufleistung" which does not include the unit itself).
DeepL also suggested "running performance" but that's even wider than the German word and I have also never heard it before.
-
I mentioned that I am working on the Delphi Tools Manager in my post about GExperts supporting import and export for the Tools menu.
Today I finished the first version of this tool. It supports all Delphi versions from 5 to 10.3 (it is written in Delphi 10.2).
So, what does it do:
- It shows a list of all entries in the Delphi IDE’s tool menu in a similar manner as the Tools Options dialog.
- It allows the same actions as that dialog: Add/Delete/Edit an entry and change the order of the entries.
- It shows the details of each entry when it is selected.
- It allows exporting and importing entries, using the same DTME file format as GExperts
- Dragging one or more DTME files on the form will add them to the list
Read on in the blog post at https://blog.dummzeuch.de/2019/06/16/delphi-tools-manager-1-0-0-released/
-
5
-
Btw: Your github page says:
##Get started
- Have a look at my blog posts about TFrameStand
Unfortunately that link seems to be broken.
http://www.andreamagni.eu/wp/tag/tframestand/
It should probably be
https://blog.andreamagni.eu/tag/tframestand/
instead.
-
1
-
I used a similar hack in an earlier version of my program: Wiggling the mouse pointer. While that worked fine under Windows XP, it doesn't under Windows 10 (no idea about Windows 7 and 8). That was the reason I researched how to do it "right".
Toggling numlock all the time would drive me crazy.
-
1 hour ago, PeterPanettone said:1 hour ago, PeterPanettone said:Is it possible to export/import all Tools entries at once or only one by one?
Only one at a time. There is no API for them and I can't get at the data from the dialog that lists them. It's also not possible to directly modify the registry while Delphi is running, it will simply overwrite the new entries. Also there appear to be two different formats for the registry entries and they reference resource strings in the IDE. It's a veritable mess.
-
19 minutes ago, FredS said:I don't understand the 'race condition'?
If there are multiple instances of program1 and it always uses the same file name when it starts its own instance of program2. These multiple instances would then all write to the same file.
That's a race condition in my opinion.
-
I would like to remind you that I was asking for experience with the IPC methods:
3 hours ago, dummzeuch said:Have you done something like this? If yes, which method did you use and what was your experience?
For now I have implemented it with passing a file name as described in my original post. Does this have any drawbacks (apart from the obvisous one:
It creates a race condition.
I have mitigated this for now by creating a unique temporary directory to place the file in.
-
1 hour ago, Микола Петрівський said:Just create global atom and pass it's code to the caller. Or caller can create empty atom, and then check for changes.
From the description it looks to me that atoms are immutable. So how do you propose to return a string from program2 to program1 via a global atom?
-
I have got two programs, both written in Delphi using the VCL. Program1 excecutes Program2 using CreateProcess, passing some parameters. In some circumstances I would like Program2 to return a string to Program1.
Since CreateProcess only returns an exit code, which is a number, this requires some additional communication.
Converting program2 into a DLL or Package is not an option in this case, neither is integrating the source code of program2 to program1.
The simplest way would probably be that program1 passes a file name to program2, program2 creates that file, writes the string to it and exits.
It could of course be implemented much more complicated, e.g. via sockets, Windows Messages, Shared Memory or even WriteProcessMemory.
Have you done something like this? If yes, which method did you use and what was your experience?
GExperts SourceExport problem
in GExperts
Posted
My guess would be that these are additional line feed characters that word can't handle. But for now that's just a guess. Please file a bug report and include all files you used to create these screenshots.