changed WM_GETDLGCODE handling so that all windows get WM_CHARs by default
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -204,6 +204,11 @@ public:
|
|||||||
WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; }
|
WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||||
void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
||||||
|
|
||||||
|
// return TRUE if the window is of a standard (i.e. not wxWindows') class
|
||||||
|
//
|
||||||
|
// to understand why does it work, look at SubclassWin() code and comments
|
||||||
|
bool IsOfStandardClass() const { return m_oldWndProc != NULL; }
|
||||||
|
|
||||||
wxWindow *FindItem(long id) const;
|
wxWindow *FindItem(long id) const;
|
||||||
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
|
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
|
||||||
|
|
||||||
|
@@ -313,7 +313,7 @@ void wxWindowMSW::Init()
|
|||||||
|
|
||||||
// MSW specific
|
// MSW specific
|
||||||
m_isBeingDeleted = FALSE;
|
m_isBeingDeleted = FALSE;
|
||||||
m_oldWndProc = 0;
|
m_oldWndProc = NULL;
|
||||||
m_useCtl3D = FALSE;
|
m_useCtl3D = FALSE;
|
||||||
m_mouseInWindow = FALSE;
|
m_mouseInWindow = FALSE;
|
||||||
m_lastKeydownProcessed = FALSE;
|
m_lastKeydownProcessed = FALSE;
|
||||||
@@ -991,7 +991,10 @@ void wxWindowMSW::SubclassWin(WXHWND hWnd)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// don't bother restoring it neither
|
// don't bother restoring it neither: this also makes it easy to
|
||||||
|
// implement IsOfStandardClass() method which returns TRUE for the
|
||||||
|
// standard controls and FALSE for the wxWindows own windows as it can
|
||||||
|
// simply check m_oldWndProc
|
||||||
m_oldWndProc = NULL;
|
m_oldWndProc = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2525,11 +2528,19 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
|
|||||||
#endif // defined(WM_DRAWITEM)
|
#endif // defined(WM_DRAWITEM)
|
||||||
|
|
||||||
case WM_GETDLGCODE:
|
case WM_GETDLGCODE:
|
||||||
if ( GetWindowStyleFlag() & wxWANTS_CHARS )
|
if ( !IsOfStandardClass() )
|
||||||
{
|
{
|
||||||
// want everything: i.e. all keys and WM_CHAR message
|
// we always want to get the char events
|
||||||
rc.result = DLGC_WANTARROWS | DLGC_WANTCHARS |
|
rc.result = DLGC_WANTCHARS;
|
||||||
DLGC_WANTTAB | DLGC_WANTMESSAGE;
|
|
||||||
|
if ( GetWindowStyleFlag() & wxWANTS_CHARS )
|
||||||
|
{
|
||||||
|
// in fact, we want everything
|
||||||
|
rc.result |= DLGC_WANTARROWS |
|
||||||
|
DLGC_WANTTAB |
|
||||||
|
DLGC_WANTALLKEYS;
|
||||||
|
}
|
||||||
|
|
||||||
processed = TRUE;
|
processed = TRUE;
|
||||||
}
|
}
|
||||||
//else: get the dlg code from the DefWindowProc()
|
//else: get the dlg code from the DefWindowProc()
|
||||||
|
Reference in New Issue
Block a user