]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
implement wxListBox::EnsureVisible() in wxGTK; add a test for it to the widgets sample
[wxWidgets.git] / src / common / wincmn.cpp
index 477c4d8c9d6473256520cc0b8682fbbf788202c1..fd92806261b8434bb85f0c2759bfc0ad05738918 100644 (file)
@@ -317,10 +317,12 @@ wxWindowBase::~wxWindowBase()
     // we weren't a dialog class
     wxTopLevelWindows.DeleteObject((wxWindow*)this);
 
+#if wxUSE_MENUS
     // The associated popup menu can still be alive, disassociate from it in
     // this case
     if ( wxCurrentPopupMenu && wxCurrentPopupMenu->GetInvokingWindow() == this )
         wxCurrentPopupMenu->SetInvokingWindow(NULL);
+#endif // wxUSE_MENUS
 
     wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
 
@@ -2733,6 +2735,13 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move)
     return win ? win->GetMainWindowOfCompositeControl() : NULL;
 }
 
+bool wxWindowBase::HasFocus() const
+{
+    wxWindowBase *win = DoFindFocus();
+    return win == this ||
+           win == wxConstCast(this, wxWindowBase)->GetMainWindowOfCompositeControl();
+}
+
 // ----------------------------------------------------------------------------
 // global functions
 // ----------------------------------------------------------------------------