-
Content Count
2857 -
Joined
-
Last visited
-
Days Won
101
Everything posted by dummzeuch
-
I fixed a bug in the dxgettext executable which made it add wrong ressource string names to the po files which in turn made the msgmergePOT tool select wrong translations. You will have to compile your own executable to get this bugfix. The source code is in the project’s svn repository on SourceForge. Also I added scripts to generate partial German and French translations for Delphi 10, 10.1, 10.2, 10.3 and 10.4 and even added those partial translations for Delphi 10, 10.1, 10.2 and 10.4 (note that 10.3 is missing) to the repository. Warning: These translations may still be faulty.
-
some dxgettext improvements
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Committed. -
All functions for copying / moving the contents of memory from one buffer to another seem to end up calling System.Move. (e.g. Windows.CopyMemory and Windows.MoveMemory). Is that really the fastest way to copy large amounts of data? Edit: This is about the 32 bit compiler for Windows. In my case these are Mono8 bitmaps with a resolution up to 5120x5120 = about 26 MB or BGR8 bitmaps with HD resolution (1920x1080 * 3 bytes = about 6 MB (or even BayerRG16 or Mono16 Bitmaps with up to 5120x5120 * 2 bytes = about 52 MB). These come in a buffer delivered from a camera API which must be returned as fast as possible, so I need to copy these pictures to another buffer for further processing and do it fast. The buffers don't overlap in that case which is something that Move takes into consideration, so there is some small amount of optimization possible. I think it might be possible to make it faster using some MMX/SSE instructions, but I am not familiar with that. I tried to google for this, but Google kept showing showing results for the C function CopyMem, as usual ignoring the "Delphi" part of my query (even when put in quotes).
-
Is Move the fastest way to copy memory?
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
I understood that. I just tried it anyway just because that was easy to do and doesn't hurt. The pictures are huge: 5120 by 2000 with Mono8 pixels, so about 10 MB each. Sometimes they get even bigger: Up to 5120x5120 with RGP8 pixels. But that's very rare so far, so I don't care about performance for these at the moment. But I'm sure, since we have got this camera now, it will be used in more projects. I have already done that, as far as possible: As said before: This time it's a different program but the same basically applies: I try to avoid moving this data if possible at all. Hm, maybe using smaller buffers for only parts of the picture, as you suggested above, could help here. I'll have to think about that one. -
Is Move the fastest way to copy memory?
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
No, not that part. I have simply replaced some part that I thought might contribute a bit to the overall performance and was easy to replace. I timed the result and found that it didn't make any difference. Took me about 30 minutes so not much wasted effort. Through other means (improved algorithm and multithreading) I have already reduced the overall time for one work unit of the program to 1/3 compared to the original code. The program which I now used for the test is not the one I mentioned in the original question. That one has already gone into "production" about a month ago and the performance is "good enough". -
Is Move the fastest way to copy memory?
dummzeuch replied to dummzeuch's topic in RTL and Delphi Object Pascal
I finally came around to trying it with a 32 bit application and found no measurable improvement. Maybe I am doing something wrong, as there are several IFDEFS in the code which I don't understand what they are doing. Or maybe the move operation is simply not that important in the overall performance of the program. I did not do any specific timing for the move operation itself as I think it's pointless if it doesn't improve the performance of the program noticeably. -
some dxgettext improvements
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I just wanted to have a quick look, but you seem to have changed the formatting in many places. This makes it much more difficult to spot any real changes. So this will have to wait until I find some more time. -
some dxgettext improvements
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Yes, that's another option. The most likely outcome will be fragmentation though. Instead of one mostly dead project, there will be several, most of them dead ends, and any prospective users or contributors will wonder which one to use. Moving the project anywhere else won't solve that, though. There are many dead projects on e.g. github too. Unless of course somebody takes up the burden of maintaining the project, which I think is rather unlikely. -
some dxgettext improvements
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
There are two options: Contact Lars Dybdahl, the official maintainer Send these patches my way and I'll have a look and possibly commit them to sourceforge (as far as I know I am the only one left who has write access there, but I have no admin access). By now even the official dxgettext website dxgettext.po.dk no longer works (at least my browser gets redirected to delphi.dk which then only shows an error), it looks as if the project is even more dead than it used to be. Also, I haven't heard from Lars for a long time. So sending them to me is probably the option with the best prospects of success. -
Hm, interesting. I didn't even know this is possible. At a first glance Delphi 2007 doesn't look too bad on a 4K monitor with scaling set to 125% or even 150%. (GExperts has has some problems though). Unfortunately this seems to be a global setting for the executable rather than a setting for a shortcut only which makes it a lot less useful.
-
It will probably work much better for this use case than for the IDE, because you can simply fix the source code rather than trying to patch the executable at runtime. I guess you are aware that instead of setting the Windows compatibility options for an executable you can simply add a manifest to your executable that tells Windows it is HighDPI aware?
-
It was fun playing around with this, but the result is a bit disappointing once you get over the first "wow, it works". Just in case anybody else wants to have a go, here is the result of the last two days of "work". Note that the source checks whether Application.ExeName is 'hbds.exe' to decide whether to install the wizard or not. To get this to work, you will either have to remove that check or copy the bds.* files in the Delphi 2007 bin directory to hbds.* and of course set the Windows compatibility options for that hbds.exe rather than for bds.exe . It will add a new menu "High DPI" to the IDE's main menu with two entries "patch" and "un-patch" which should be self explanatory. Have fun, but remember: I will not fix your computer if you break it. 😉 @Attila Kovacs thanks for that idea which was quite fun to play around with. Take whatever you can use from the attached sources. Delphi2007HighDpi.zip
-
Yes, this seems to work, even when reading it and setting it to the same value. It also makes the OnMeasureItem event redundant. (edit: No that event is still necessary.) That solves the problem for the tree view, but unfortunately not for the TVirtualTreeViews used in grid mode (e.g. the message window or the breakpoint list). There even setting the font size does not make any difference.
-
If you have got more than one monitor with different DPI settings, it makes all lot of sense to change the IDE scaling on the fly. Just imagine moving a window from a 4K monitor with 150% scaling to a HD monitor with 100%. (And guess who has got such a setup...)
-
uses TypInfo; function TAdvancedObject_SetIntProperty(_Instance: TObject; const _Name: string; _Value: Integer): Boolean; var PropInfo: PPropInfo; begin PropInfo := GetPropInfo(_Instance.ClassInfo, _Name); Result := Assigned(PropInfo) and (PropInfo.PropType^.Kind = tkInteger); if Result then TypInfo.SetOrdProp(_Instance, PropInfo, _Value); end; // called as TAdvancedObject_SetIntProperty(AComponent, 'DefaultNodeHeight', FVtNodeHeight);
-
No idea. But I guess they would have overriden if that was necessary.
-
If it is overridden, the correct method should automatically be called. If it is reintroduced, that's bad practice, in particular for such an important base method, and I doubt that any Borland/Codegear developer did this in the code of the IDE.
-
TControl.Invalidate is virtual, so this should call the correct method of any derived class. I'll post the RTTI code tomorrow when I'm back at my computer. It's actually quite simple and will work with any relevant version of Delphi, as long as the property is declared published.
-
Embarcadero 11.1 access violation coreide280.bpl
dummzeuch replied to capi48's topic in Delphi IDE and APIs
This is not an Access Violation. -
That's what I meant by: Oddly enough changing the font size takes effect immediately but still ignores the change to DefaultNodeHeight until I click on a tree node. And even then it only redraws that one tree node and the one that was selected previously.
-
I am seeing two problems: Simply setting the DefaultNodeHeight does not make any difference, regardless whether I use your hack or simply set it via RTTI. When also assigning an OnMeasureItem event (via RTTI) that returns the correct node height, it works, but only when I click on an entry which causes that entry to be redrawn or when I load a new project. I tried to call TWinControl.Invalidate and sent a WM_Paint message to it but it didn't make any difference. I have also temporarily disabled all experts which did not make any difference. There is one difference between what your expert did and what I am currently trying: I want to have menu entries to turn this functionality on and off. I also want to make it use the "correct" size depending on the current DPI and the design DPI.
-
As you might have guessed I am playing around with this code. It works fine for the object inspector (I have added code to also increase the font size). But it does nothing for the TVirtualTreeViews e.g. the Project Manager. As far as I understand it, it should set the DefaultNodeHeight by directly calling some method whose address is hard coded as you wrote above. My installation should contain all patches, but it doesn't work. How did you determine that address? Edit: I also tried to set the DefaultNodeHeight property via RTTI. It also didn't make any difference. But in the IDE Explorer the correct value was shown.
-
-
As for having the option to start with or without high DPI awareness: I just copied the bds.* files in my Delphi 2007 bin directory to hbds.* and created an entry for that under HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers for it. Now I can start the IDE as bds.exe with System High DPI settings and hbds.exe with Application High DPI settings. I also tried to simply edit the application manifest of hbds.exe but that didn't work, unfortunately. Not sure whether this will work with newer IDEs though, because Embarcadero "improved" their detection of tampering with the licensing.
-
Just in case anybody else is interested: The setting @Attila Kovacs was talking about is stored in the registry: HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers There are entries with the full path of the executable. In my case for Delphi 2007: C:\Delphi\Delphi2007\bin\bds.exe And a text value. which seems to contain entries separated by a space. Enabling the "High DPI scaling override" option adds a "HIGHDPIAWARE" value to that entry, Disbling it removes that entry I'm not sure where the selection from the combo box is stored though. Possibly under HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store There are again entries with the full path of the executable, but this time the data is binary so it's not easy to decode. All entries start with the letters SACP, whatever that means. EDIT: No, changing that option did not make any difference there. The selection in the combo box decides what is stored there too. Enabling the "High DPI scaling override" option and selecting "Application" adds a "HIGHDPIAWARE" value selecting "System" adds a "DPIUNAWARE" value selecting "System (enhanced)" adds "GDIDPISCALING DPIUNAWARE" Disabling it removes these values. As the entries refer to the absolute path of the executable rather than the shortcut, there seems to be no way to create separate entries for different shortcuts to an executable which is a bit inconvenient. Maybe we should move this part of the conversation to a new thread? "Making older Delphi IDEs partially High DPI aware" or something?