Jump to content
dormky

How do I close a modal form without ModalResult being set to mrCancel ?

Recommended Posts

3 hours ago, dormky said:

Yes, and I established that it does it _internally_ and that you don't have a single flag serving two purposes, as you do in Delphi.

Well, you don't know how Windows is implemented internally. Not that it matters. Conceptually it's the same mechanism. 

Share this post


Link to post
3 hours ago, David Heffernan said:

Well, you don't know how Windows is implemented internally. Not that it matters. Conceptually it's the same mechanism. 

If they implemented it in the same way (a single flag serving two purposes), I would levy the same critique. With the caveat that it least it doesn't make the API more confusing since it's internal.

Whereas as far as I'm aware, Delphi had no obligation to implement it in the same way, although it might have been a volition at the time to do a one-to-one of Windows. Which could be critiqued in itself, of course.

Share this post


Link to post
4 hours ago, dormky said:

If they implemented it in the same way (a single flag serving two purposes), I would levy the same critique. With the caveat that it least it doesn't make the API more confusing since it's internal.

Whereas as far as I'm aware, Delphi had no obligation to implement it in the same way, although it might have been a volition at the time to do a one-to-one of Windows. Which could be critiqued in itself, of course.

This makes no sense. It's logically identical. 

Share this post


Link to post
On 2/1/2025 at 4:02 AM, David Heffernan said:
On 2/1/2025 at 1:33 AM, David Schwartz said:

Setting ModalResult can be overridden

Really, how ? 

 

procedure TMain_form.WebFormClose(Sender: TObject; var Action: TCloseAction);
begin
   Action := caNone;
end;

 

Clearly obvious to even the most casual observer, right?

 

 

Edited by David Schwartz

Share this post


Link to post
On 2/3/2025 at 12:28 AM, dormky said:

Of course, I never would have chosen Delphi for a new project. But there's a lot of old 90's projects out there for which it's not cost-effective to move to a more efficient platform, so Delphi sticks around.

I use TMS WEB Core to build web apps in Delphi. They run in the browser, and don't require any knowledge of javascript.

 

I'm also learning how to use Latenode to build proxies to 3rd-party services that I can call from my client app so I don't need to implement them in a dedicated back-end service. It's similar to Zapier and Make, but I think more powerful and generalized.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×