}    if(0 == FindFocus()) { warning() << "No window has focus." << LMI_FLUSH; SetFocus(); } else if(!FindFocus()->IsEnabled()) { warning() << "Disabled window has focus." << LMI_FLUSH; SetFocus();
void XmlNotebook::OnUpdateGUI(wxUpdateUIEvent& event){    // Do nothing until the notebook has been fully created.    if(updates_blocked_)        {        return;        }    // Exit immediately if nothing changed. The library calls this    // function continually in idle time, and it's pointless to fret    // over inputs that didn't change on this update because they've    // already been handled. Complex processing of many inputs has    // been observed to consume excessive CPU time when a malloc    // debugger is running, so this optimization is significant.    CurrentPage().TransferDataFromWindow();    if(cached_transfer_data_ == transfer_data_)        {        return;        }    cached_transfer_data_ = transfer_data_;    DiagnosticsWindow().SetLabel("");    std::vector<std::string>::const_iterator i;    std::vector<std::string> names_of_changed_controls;    for(i = input_.member_names().begin(); i != input_.member_names().end(); ++i)        {        try            {//            if(input_[*i].str() != transfer_data_[*i])            if                (   input_[*i].str() != transfer_data_[*i]                &&  CurrentPage().FindWindow(XRCID(i->c_str()))                )                {                names_of_changed_controls.push_back(*i);                input_[*i] = transfer_data_[*i];                }            }        catch(std::exception const& event)            {            DiagnosticsWindow().SetLabel(*i + ": " + event.what());            }        }/*    // Experimental. It is hypothesized that EVT_UPDATE_UI events    // occur frequently enough that two control changes cannot be    // simultaneous.TODO ?? ...except for changes the framework itself makes, whichought to be forced through somehow.    if(1 < names_of_changed_controls.size())        {        warning() << "Contents of more than one control changed, namely\n";        std::vector<std::string>::const_iterator i;        for            (i = names_of_changed_controls.begin()            ;i != names_of_changed_controls.end()            ;++i            )            {            warning() << *i << " changed" << '\n';            }        warning() << LMI_FLUSH;        }*/    input_.Harmonize();    // TODO ?? Experimental. A general solution is wanted instead.    transfer_data_["GeneralAccountRate"] = input_["GeneralAccountRate"].str();    ConditionallyEnable();}