else // not a button itself
{
#if wxUSE_BUTTON
- wxButton *btn = wxDynamicCast(GetDefaultItem(),
- wxButton);
- if ( btn && btn->IsEnabled() )
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+ if ( tlw )
{
- // if we do have a default button, do press it
- btn->MSWCommand(BN_CLICKED, 0 /* unused */);
+ wxButton *btn = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
+ if ( btn && btn->IsEnabled() )
+ {
+ // if we do have a default button, do press it
+ btn->MSWCommand(BN_CLICKED, 0 /* unused */);
- return true;
+ return true;
+ }
}
else // no default button
#endif // wxUSE_BUTTON
return 0;
}
-bool wxWindowMSW::HandlePrintClient(WXHDC hDC)
+bool wxWindowMSW::HandlePrintClient(WXHDC WXUNUSED(hDC))
{
// TODO: handle wxBG_STYLE_CUSTOM and/or wxBG_STYLE_COLOUR here so when
// DrawParentThemeBackground() from uxtheme.dll is called we don't get