-
Content Count
143 -
Joined
-
Last visited
Posts posted by Steve Maughan
-
-
-
16 hours ago, Remy Lebeau said:Is there an error message? And you didn't answer my question - which version of Delphi are you using? Nothing in the code you have shown should be accessing any monitor-specific functionality, AFAIK.
Yes.
Hi Remy,
I'm using Delphi 10.4.2.
We have been unsuccessful in replicating the problem, although I did see it for myself on a Zoom call. At this point I'm going to move on and class it as a strange setup issue.
Thanks — Steve
-
2 minutes ago, Anders Melander said:So you haven't tried to reproduce the problem with two monitors...?
Yes.
If you had looked at the source you would have seen that TControl.ClientToScreen calls TControl.GetClientOrigin which ends up calling Winapi.Windows.ClientToScreen(Handle, Result);
The ClientToScreen API function returns the coordinates relative to the top left corner of the primary monitor, which is what you'd want.
I don't have an extra monitor but a colleague has one so we're trying to reproduce. It seem the problem occurs in a configuration of two monitors above the main screen / laptop screen.
-
1 minute ago, Remy Lebeau said:Which version of Delphi are you using? TControl.ClientToScreen() does not take 2 integers as input, it takes either a TPoint or a TRect.
But, fixing that, the rest of the code shown works fine for me on my 2-monitor system. So, unless there is a bug in your Delphi's VCL, this should work just fine, since ClientToScreen() returns screen coordinates, and Popup() takes screen coordinates. Screen coordinates are within the Virtual Screen, not any particular monitor.
Thanks Remy, I am actually passing a TPoint (my error when creating the code example). The user is reporting that the application crashes when they right click, and it's corrected when they only have one monitor. Does ClientToScreen work in all cases when the extra monitor is above, below, left and right of the main screen?
Steve
-
2 minutes ago, Bill Meyer said:I found this but it seems to be FMX and, I should have said, my application is VCL.
But thanks — Steve
-
I have a popup menu on a TPaintBox. Up to now I've used the simple code:
PopupPoint := PaintBox.ClientToScreen(X, Y); RadialMenu.Popup(PopupPoint.X, PopupPoint.Y);
It seem this doesn't work on multi-monitor systems — the Radial Menu isn't visible after the popup and the user thinks the application has crashed.
How do I adjust this so it works with multiple monitors? Thanks!
Steve
-
Hi Felix,
For those unaware of the subject area, I assume you're talking about the chess engine Stockfish.
You're going to need to run a console app (stockfish) and then capture the output. For VCL apps you can use DOS Command. It's in GetIt. I'm not sure of this is available for Firemonkey.
I hope this helps.
Steve
-
1
-
-
We use OnGuard. It's free and in the GetIt repository. It works perfectly and we haven't been cracked (although our application is not a mass-market consumer product)
Steve
-
40 minutes ago, Remy Lebeau said:Have you read Delphi's JSON documentation yet? Particularly the "Reading a JSON With Different Frameworks" examples in the Readers and Writers JSON Framework section. Also see Readers and Writers JSON Framework: Reading JSON Objects
Thanks Remy — yes, I've take a look. The examples are threadbare to say the least.
Steve
-
I need to read and parse a large JSON file (of geographic data) as fast as possible. I'd prefer to use Delphi's own classes but I'm not adverse using a third party component if it's measurably faster.
What's the best way to do this?
Thanks,
Steve
-
I've added a TNotification to my application. After it completes a relatively computationally intensive task it creates and displays the notification using the following code:
//-- Create it xNotification := NotificationCenter.CreateNotification; try //-- Process if assigned if assigned(xNotification) then begin xNotification.Name := 'Optimizer'; xNotification.Title := 'AlignMix AI Optimizer'; xNotification.AlertBody := IntToStr(OptScope.TerritoryCount) + ' ' + Project.Alignment.Territory.TerritoryNamePlural + ' created in ' + FormatFloat('#,##0.0', StopWatch.ElapsedMilliseconds / 1000) + ' seconds'; NotificationCenter.PresentNotification(xNotification); end; finally xNotification.Free; end;
However, when the EXE is run for the first time outside the IDE the notification has a rather odd caption "Embarcadero.DesktopToasts.02911170" (see image attached). On subsequent runs it has the executable name, minus the ".exe" extension (see image attached).
How can I customize the notification caption? I'd like it to simply say "AlignMix"
Thanks,
Steve
-
1 minute ago, David Schwartz said:I did not use the Migration Tool for either 10.4.x upgrade and everything worked as expected, except this one deleted but did not re-install the GetIt libs. (My TMS libs remained intact.)
Hi David,
Does your app target Win64 or just Win32? My Win32 component path was fine, it was my Win64 component path that was scrubbed.
Steve
-
10 minutes ago, FredS said:Right, it will simply NOT inline that function and that means there is a Jump.. inline is faster..
So it's a speed thing. Thanks!
-
-
I have a confession: I'm terrible at ensuring there are no Hints or Warnings in my code. That's all got to stop now that I have switched to 10.4.2 — the IDE now scream at me to fix these Hint and Warning (that's a good thing)!
One hint that crops up a lot in my code is H2443 Inline function. Typically it says something like:
H2443 Inline function: TOptimizer.Execute has been expanded because unit 'TAnneal' is not included in the USES list
What is this all about? Clearly the code runs without TAneal in the USES list and I like to minimize the number of units in the USES list. The hint goes away if I add TAnneal to the USES list but what's the advantage of including it — my code is cleaner and runs just fine if I don't include it.
Also, does anyone have a tutorial on getting rid of Delphi Hints and Warnings? Some are obvious, others (like this one) are not so obvious.
Thanks,
Steve
-
As I posted elsewhere, the new install scrubbed my Win64 library path. That was the only problem I encountered. Overall it seems like an excellent, quality orientated upgrade. I ran my mapping application through some speed tests and it definitely seems to be running faster when compiled with the latest version — about +4% faster.
Steve
-
1
-
-
I made the mistake of updating as soon as it was released. After installing (all default option) I found it had scrubbed my Win64 component path. The Win32 path is in tact but it'll be a right old pain to manually copy between the two. Also had to re-install OnGuard and Konopka components via GetIt (a modest pain).
Be warned,
Steve
-
1 hour ago, Rollo62 said:I believe so too, but DeepBlue is worth mentioning, isn't it ?
Isn't this evolving too, with never versions, or is it a complete dead project now ?
At least it was the first beating the human chess wolrd champion, should be a little honoured IMHO.
Deep Blue was IBM’s pet project from the late 90’s and has never been available for public scrutiny. It’s estimated strength is about 2800 ELO. To put this in context, if the latest Stockfish, running on a iPhone, played 100 games against Deep Blue it would win at least 95.
-
1
-
-
I'm reasonably well know in the field of computer chess and competed in the 2015 World Computer Chess Championships. Although Delphi is my first language, my engine was written in plain old "C". However, there are a number of strong open source chess programs written in Delphi. Here are a few:
Booot:
booot6_4_release.rar (dropbox.com)
Open-Critter:
GitHub - rchastain/open-critter: UCI chess engine written in Pascal by Richard Vida
Durandal:
GitHub - rchastain/durandal: UCI chess engine written in Pascal
Steve
-
2
-
-
5 minutes ago, Kryvich said:One aspect I appreciate is some attention to the compiler's output. It seems 10.5 will finally get some floating point optimization!!
Steve
-
Brilliant! Thanks for this.
-
3 minutes ago, Vandrovnik said:Oh, please nothing special, just make 10.4.x usable first.
It's a roadmap not a punch-list!
-
Maybe something special is brewing! If I had to guess maybe it would be RAD WebAssembly
-
1
-
-
On 10/14/2020 at 4:30 PM, Anders Melander said:Try disabling the MadExcept "IDE exception catching". Just to eliminate MadExcept as the cause.
I disabled MadExcept IDE exception catching and that didn't fix the problem. It was a good idea.
Thanks — Steve
TChromeTabs for Delphi 11?
in Delphi Third-Party
Posted
Has anyone been able to install TChromeTabs for Delphi 11.1? It's missing a *.groupproj file for Delphi 11. Any steps would be appreciated.
It was in GetIt but isn't anymore.
Thanks, Steve