Merge the changes from 3.0 branch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -365,30 +365,21 @@ END_EVENT_TABLE()
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Find an item given the MS Windows id
|
||||
wxWindow *wxWindowMSW::FindItem(long id) const
|
||||
wxWindow *wxWindowMSW::FindItem(long id, WXHWND hWnd) const
|
||||
{
|
||||
#if wxUSE_CONTROLS
|
||||
wxControl *item = wxDynamicCastThis(wxControl);
|
||||
if ( item )
|
||||
{
|
||||
// is it us or one of our "internal" children?
|
||||
if ( item->GetId() == id
|
||||
#ifndef __WXUNIVERSAL__
|
||||
|| (item->GetSubcontrols().Index(id) != wxNOT_FOUND)
|
||||
#endif // __WXUNIVERSAL__
|
||||
)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_CONTROLS
|
||||
// First check for the control itself and its Windows-level children which
|
||||
// are mapped to the same wxWindow at wx level.
|
||||
wxWindow *wnd = MSWFindItem(id, hWnd);
|
||||
if ( wnd )
|
||||
return wnd;
|
||||
|
||||
// Then check wx level children.
|
||||
wxWindowList::compatibility_iterator current = GetChildren().GetFirst();
|
||||
while (current)
|
||||
{
|
||||
wxWindow *childWin = current->GetData();
|
||||
|
||||
wxWindow *wnd = childWin->FindItem(id);
|
||||
wnd = childWin->FindItem(id, hWnd);
|
||||
if ( wnd )
|
||||
return wnd;
|
||||
|
||||
@@ -675,7 +666,8 @@ wxWindowMSW::MSWShowWithEffect(bool show,
|
||||
unsigned timeout)
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if ( effect == wxSHOW_EFFECT_NONE )
|
||||
if ( effect == wxSHOW_EFFECT_NONE ||
|
||||
(GetParent() && !GetParent()->IsShownOnScreen()) )
|
||||
return Show(show);
|
||||
|
||||
if ( !wxWindowBase::Show(show) )
|
||||
@@ -5323,7 +5315,7 @@ bool wxWindowMSW::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND control)
|
||||
// try the id
|
||||
if ( !win )
|
||||
{
|
||||
win = FindItem(id);
|
||||
win = FindItem(id, control);
|
||||
}
|
||||
|
||||
if ( win )
|
||||
|
Reference in New Issue
Block a user