Jump to content

dummzeuch

Members
  • Content Count

    2650
  • Joined

  • Last visited

  • Days Won

    92

Everything posted by dummzeuch

  1. There is the structure view which displays all classes, fields, methods etc., global types, variables and constants as well as the uses clause (of the interface section only WTF?)
  2. dummzeuch

    GExperts SourceExport problem

    I just tried to reproduce this, but I could not. The RTF-code saved to a file looks fine to me and pasting into Wordpad and Libre Office Writer also works as expected. So this might be a MS Word specific issue. I don't own any MS Word license that I could use for the test. I tried Delphi 2007 and 10.3 since you did not mention your version. Does anybody know of a tool that can display RTF clipboard contents as text (I only found some that strip RTF formatting from the text) or do I have to write one myself? @PeterPanettone what about the bug report? Maybe it's something in your file(s) that causes the problem.
  3. dummzeuch

    Best delphi so far?

    If that's true, the IDE quality must have been atrocious in later versions, because in my experience XE2 isn't really stable. But maybe that's a matter of how you use them. I still prefer the Delphi 2007 IDE over the later ones, but again that might just be the way I use it. The 10.1 and 10.2 IDEs also seem OK, but I haven't used them much. 10.3 definitively is a step back: It's slow, it's ugly and its buggy.
  4. 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.
  5. dummzeuch

    autosize columns in VirtualStringTree in grid mode

    Since apparently nobody has ans answer and I was unable to find any settings or method to achieve this, here is the code I used: procedure TMyForm.ResizeTree(_vst: TVirtualStringTree); var c: UInt32; ws: WideString; cnv: TCanvas; Fnt: TFont; ThisWidth: UInt32; MinWidth: UInt32; Node: PVirtualNode; r: TRect; s: TSize; begin cnv := _vst.Canvas; for c := 0 to _vst.Header.Columns.Count - 1 do begin ws := _vst.Header.Columns[c].Text; GetTextExtentPoint32W(cnv.Handle, PWideChar(ws), Length(ws), s); MinWidth := s.cx + 10; Fnt := _vst.Font; Node := _vst.RootNode.FirstChild; while Assigned(Node) do begin _vst.GetTextInfo(Node, c, Fnt, r, ws); ThisWidth := r.Right - r.Left + 10; if MinWidth < ThisWidth then MinWidth := ThisWidth; Node := Node.NextSibling; end; _vst.Header.Columns[c].Width := MinWidth; end; end; It's probably not perfect but it worked for me (until I dropped the VirtualStringTree because it just added too much complexity for what I wanted to achieve, and replaced it with the much simpler TdzVirtualTreeView which I had to extend for my use case.) I particular I don't like the constant 10 pixels in the code.
  6. dummzeuch

    GExperts SourceExport problem

    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.
  7. dummzeuch

    GExperts SourceExport problem

    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.
  8. 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/
  9. 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.
  10. That works only for private fields, not for private methods.
  11. I'll check it out, thanks.
  12. Unfortunately that only works in class helpers.
  13. So, are you seeing the error I described in the blog post?
  14. dummzeuch

    Laufleistung

    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.
  15. dummzeuch

    Laufleistung

    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?
  16. In my case it's not Windows 10 but Windows 8.1.
  17. dummzeuch

    Laufleistung

    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. 😉 )
  18. dummzeuch

    Laufleistung

    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).
  19. dummzeuch

    Laufleistung

    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).
  20. dummzeuch

    Looking for beta testers of TFrameStand and TFormStand

    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.
  21. 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.
  22. The Delphi IDE has the quite useful option to add custom entries to the Tools menu. These entries call external programs with some “Macros” that reference the current IDE status, e.g. the currently active project or source file and some of their properties like the output directory or the current editor column and row. GExperts already enhances the Tools Properties dialog by adding auto completion for the file name and the working directory (for Delphi 6 and 7 it also adds support for Drag and Drop, but that doesn’t work for later versions). It has always irked me that there was no easy way to port these custom tools entries from one Delphi version or installation to another. I always had to copy and paste four fields to achieve that. GExperts now adds two new buttons to export and import the current entry: Read on in my blog post https://blog.dummzeuch.de/2019/06/08/new-gexperts-ide-enhancement-export-and-import-entries-for-the-tools-menu/
  23. 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.
  24. dummzeuch

    Passing back a string from an external program

    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.
×