move default button handling code from wxControlContainer to wxTLW (patch 1524441)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -962,15 +962,10 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
|
||||
if ( !(m_windowStyle & wxTE_MULTILINE) )
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
while ( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL )
|
||||
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
|
||||
if ( tlw && tlw->GetDefaultItem() )
|
||||
{
|
||||
parent = parent->GetParent() ;
|
||||
}
|
||||
|
||||
if ( parent && parent->GetDefaultItem() )
|
||||
{
|
||||
wxButton *def = wxDynamicCast(parent->GetDefaultItem(), wxButton);
|
||||
wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
|
||||
if ( def && def->IsEnabled() )
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
|
||||
|
Reference in New Issue
Block a user