Fix behaviour of wxComboBox using ID=1000 in wxMSW.
If a wxComboBox was created with ID=1000, clicking in its drop down didn't work. It turns out that the native combobox control always creates its dropdown listbox with the ID of 1000 and that when we were getting LBN_SELCHANGE from it we mishandled this message because our code mistakenly believed that all messages from the ID of the control itself were, in fact, coming from this control, which wasn't the case here. Fix this by adding a special check for this case in wxComboBox. Also virtualize the dynamic cast which was done in wxWindow::FindItem() as this makes the code simpler and allows to get rid of __WXUNIVERSAL__ #ifdef as well. Closes #15647. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -206,7 +206,7 @@ public:
|
||||
// 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, WXHWND hWnd = NULL) const;
|
||||
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
|
||||
|
||||
// MSW only: true if this control is part of the main control
|
||||
@@ -663,6 +663,15 @@ protected:
|
||||
|
||||
bool MSWEnableHWND(WXHWND hWnd, bool enable);
|
||||
|
||||
// Return the pointer to this window or one of its sub-controls if this ID
|
||||
// and HWND combination belongs to one of them.
|
||||
//
|
||||
// This is used by FindItem() and is overridden in wxControl, see there.
|
||||
virtual wxWindow* MSWFindItem(long WXUNUSED(id), WXHWND WXUNUSED(hWnd)) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
Reference in New Issue
Block a user