fix for enter processing of owner-drawn buttons

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-12-01 01:13:20 +00:00
parent 55842641bb
commit 3e79ed960a

View File

@@ -1557,7 +1557,18 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
}
else if ( lDlgCode & DLGC_BUTTON )
{
// buttons want process Enter themselevs
// let IsDialogMessage() handle this for all
// buttons except the owner-drawn ones which it
// just seems to ignore
long style = ::GetWindowLong(msg->hwnd, GWL_STYLE);
if ( (style & BS_OWNERDRAW) == BS_OWNERDRAW )
{
// emulate the button click
wxWindow *btn = wxFindWinFromHandle((WXHWND)msg->hwnd);
if ( btn )
btn->MSWCommand(BN_CLICKED, 0 /* unused */);
}
bProcess = FALSE;
}
else