applied patch #931719: "ESC closes dialog instead of combobox dropdown" (closes patch #931709)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2004-05-07 10:46:19 +00:00
parent 4da39c9646
commit 4b17d2e361
2 changed files with 18 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ protected:
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// update the height of the drop down list to fit the number of items we

View File

@@ -175,6 +175,22 @@ bool wxChoice::Create(wxWindow *parent,
style, validator, name);
}
bool wxChoice::MSWShouldPreProcessMessage(WXMSG *pMsg)
{
MSG *msg = (MSG *) pMsg;
// don't preprocess "ESC" if combobox is dropped down
if ( msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE )
{
if (::SendMessage(GetHwndOf(this), CB_GETDROPPEDSTATE, 0, 0))
{
return false;
}
}
return wxControl::MSWShouldPreProcessMessage(pMsg);
}
WXDWORD wxChoice::MSWGetStyle(long style, WXDWORD *exstyle) const
{
// we never have an external border