From c0d6c58bd0d7d6b7dae707b2a78c7f917f98da77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Wed, 24 Nov 1999 15:11:29 +0000 Subject: [PATCH] fixed setfocus() flicker in listctrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/listctrl.h | 7 ++++++- include/wx/menuitem.h | 5 ++++- src/gtk/window.cpp | 2 +- src/gtk1/window.cpp | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 5d191352b2..69dfcd94d2 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -607,7 +607,12 @@ class WXDLLEXPORT wxListCtrl: public wxControl bool DoPopupMenu( wxMenu *menu, int x, int y ) { return m_mainWin->PopupMenu( menu, x, y ); } void SetFocus() - { m_mainWin->SetFocus(); } + { + /* The test in window.cpp fails as we are a composite + window, so it checks against "this", but not m_mainWin. */ + if(FindFocus() != this) + m_mainWin->SetFocus(); + } // implementation diff --git a/include/wx/menuitem.h b/include/wx/menuitem.h index 63b3137ec0..6fda4bd30d 100644 --- a/include/wx/menuitem.h +++ b/include/wx/menuitem.h @@ -45,7 +45,6 @@ class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxMenuItemBase : public wxObject { public: - wxMenuItemBase() { } // creation static wxMenuItem *New(wxMenu *parentMenu = (wxMenu *)NULL, @@ -118,6 +117,10 @@ protected: bool m_isCheckable; // can be checked? bool m_isChecked; // is checked? bool m_isEnabled; // is enabled? + + // some compilers need a default constructor here, do not use + wxMenuItemBase() + { } }; // ---------------------------------------------------------------------------- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index fb0fb302c4..d09ee10763 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2475,7 +2475,7 @@ void wxWindow::GetTextExtent( const wxString& string, void wxWindow::SetFocus() { wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); - + if (m_wxwindow) { if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index fb0fb302c4..d09ee10763 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2475,7 +2475,7 @@ void wxWindow::GetTextExtent( const wxString& string, void wxWindow::SetFocus() { wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); - + if (m_wxwindow) { if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) -- 2.45.2