lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] wxDialog::OnOK() removed from wx


From: Vadim Zeitlin
Subject: Re: [lmi] wxDialog::OnOK() removed from wx
Date: Mon, 25 Sep 2006 01:08:50 +0200

On Sun, 24 Sep 2006 22:47:37 +0000 Greg Chicares <address@hidden> wrote:

GC> Vadim--A few weeks ago, you mentioned that wxDialog::OnOK() has
GC> been removed from the latest version of wx, and said there were
GC> two ways to deal with situations where 'lmi' calls that function:
GC> 
GC> (1) Rewrite the code that calls it.
GC> 
GC> The 'lmi' trunk's wxID_OK handler is indeed not necessary, but
GC> the 'skeleton' trunk does need it--so this is not the universal
GC> solution, and we need to consider the alternative....

 I'm looking at skeleton code right now and I found 2 places where OnOK()
is used:

1. in about_dialog.cpp, but there it seems to have nothing to do with
   wxID_OK button handler

2. in mvc_controller.cpp and there I think the same solution applies:
   it's better to move the code from UponOk() to TransferDataFromWindow()
   instead of conflating closing the dialog and validating data in it in
   the same handler. I can make a patch doing this if you'd like.

GC> (2) Write its body inline. In wxmsw, this is simply
GC> 
GC>   if ( Validate() && TransferDataFromWindow() )
GC>   {
GC>       EndDialog(wxID_OK);
GC>   }
GC> 
GC> However, in the 20060605 wx snapshot that we're still using in
GC> production, there are numerous instances of that function:
...
GC> not all of which are identical.

 This was, in fact, one of the reasons behind removing wxDialog::OnOK():
different ports behaved similarly, but not quite identically, which was
confusing. In the latest wx sources this method is not present at all, of
course, which takes care of these discrepancies nicely :-)

 Regards,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]