send key up/down events too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -80,45 +80,60 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
|
|||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
if (
|
HWND hwndCombo = ::GetParent(hWnd);
|
||||||
message == WM_CHAR
|
wxWindow *win = wxFindWinFromHandle((WXHWND)hwndCombo);
|
||||||
#if wxUSE_TOOLTIPS
|
|
||||||
|| message == WM_NOTIFY
|
switch ( message )
|
||||||
#endif // wxUSE_TOOLTIPS
|
{
|
||||||
)
|
// forward some messages to the combobox
|
||||||
{
|
case WM_KEYUP:
|
||||||
HWND hwndCombo = ::GetParent(hWnd);
|
case WM_KEYDOWN:
|
||||||
wxWindow *win = wxFindWinFromHandle((WXHWND)hwndCombo);
|
case WM_CHAR:
|
||||||
wxComboBox *combo = wxDynamicCast(win, wxComboBox);
|
{
|
||||||
wxCHECK_MSG( combo, 0, _T("should have combo as parent") );
|
wxComboBox *combo = wxDynamicCast(win, wxComboBox);
|
||||||
|
wxCHECK_MSG( combo, 0, _T("should have combo as parent") );
|
||||||
|
|
||||||
switch ( message )
|
|
||||||
{
|
|
||||||
case WM_CHAR:
|
|
||||||
if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
|
if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if 0
|
||||||
case WM_NOTIFY:
|
case WM_GETDLGCODE:
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( win, 0, _T("should have a parent") );
|
||||||
|
|
||||||
|
if ( win->GetWindowStyle() & wxPROCESS_ENTER )
|
||||||
{
|
{
|
||||||
NMHDR* hdr = (NMHDR *)lParam;
|
// need to return a custom dlg code or we'll never get it
|
||||||
if ( (int)hdr->code == TTN_NEEDTEXT )
|
return DLGC_WANTMESSAGE;
|
||||||
{
|
|
||||||
wxToolTip *tooltip = combo->GetToolTip();
|
|
||||||
if ( tooltip )
|
|
||||||
{
|
|
||||||
TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
|
|
||||||
ttt->lpszText = (wxChar *)tooltip->GetTip().c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
// processed
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
|
#endif // 0
|
||||||
|
|
||||||
|
// deal with tooltips here
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
case WM_NOTIFY:
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( win, 0, _T("should have a parent") );
|
||||||
|
|
||||||
|
NMHDR* hdr = (NMHDR *)lParam;
|
||||||
|
if ( (int)hdr->code == TTN_NEEDTEXT )
|
||||||
|
{
|
||||||
|
wxToolTip *tooltip = win->GetToolTip();
|
||||||
|
if ( tooltip )
|
||||||
|
{
|
||||||
|
TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
|
||||||
|
ttt->lpszText = (wxChar *)tooltip->GetTip().c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// processed
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
#endif // wxUSE_TOOLTIPS
|
#endif // wxUSE_TOOLTIPS
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
|
return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
|
||||||
@@ -130,9 +145,16 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
|
|||||||
|
|
||||||
bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
|
bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
if ( msg == WM_CHAR )
|
switch ( msg )
|
||||||
{
|
{
|
||||||
return HandleChar(wParam, lParam, TRUE /* isASCII */);
|
case WM_CHAR:
|
||||||
|
return HandleChar(wParam, lParam, TRUE /* isASCII */);
|
||||||
|
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
return HandleKeyDown(wParam, lParam);
|
||||||
|
|
||||||
|
case WM_KEYUP:
|
||||||
|
return HandleKeyUp(wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Reference in New Issue
Block a user