Cancellable events

M

Mr.Tickle

I dont like the concept of cancellable events, why cant we have an event
that we can catch before the event we must cancel?

Take the following example

WM_SYSCOMMAND and SC_CLOSE for the system menu close item or close button,
in WinForms you must cancel the Closing event, isnt that too late? Sure it
works but it seems messy compared to actually catching an event that the
item is selected.


Are these a good idea or just lazy or unthought out designing?
 
J

Justin Weinberg

I think Closing IS the "event before" Close. The event being cancelled is
the Close event.

Given you had a previous event, what other format would you suggest to
specify that you wish to cancel the subsequent chain of events?

Also, suppose in some future OS version new buttons / ways are added to
close a form, or you're working under a different OS. You're code breaks if
you're depending on a specific windows message.
 
M

Mr.Tickle

so how come win32 has the WM_SYSCOMMAND and WM_COMMAND to indicate a
difference on the close buttons

There either is a difference or there isnt. Here the difference is yes
there is in some parts of the libraries and here there isnt any difference.
Lack of consistency.

There is a difference when it comes to painting yet there isnt when it comes
to closing.
 
M

Mr.Tickle

Its also bad when so many people ask the same question, its not bloody
obvious.
 
M

Mr.Tickle

We arnt under other OSs, this is reality what we have today, stop bringing
youre fantasies into this.

We are dependant on window messages anyway, WinForms isnt portable. Go look
at mono, its dependant on windows API mapping layers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top