diff --git a/include/wx/glcanvas.h b/include/wx/glcanvas.h index 0e03fecaf4..23d026af5d 100644 --- a/include/wx/glcanvas.h +++ b/include/wx/glcanvas.h @@ -258,11 +258,6 @@ public: // as a parameter wxGLContextAttrs& GetGLCTXAttrs() { return m_GLCTXAttrs; } -#ifdef __WXUNIVERSAL__ - // resolve the conflict with wxWindowUniv::SetCurrent() - virtual bool SetCurrent(bool doit) { return wxWindow::SetCurrent(doit); } -#endif - protected: // override this to implement SetColour() in GL_INDEX_MODE // (currently only implemented in wxX11) diff --git a/include/wx/univ/bmpbuttn.h b/include/wx/univ/bmpbuttn.h index 440e31ba24..4a743482c9 100644 --- a/include/wx/univ/bmpbuttn.h +++ b/include/wx/univ/bmpbuttn.h @@ -50,7 +50,7 @@ public: virtual bool Enable(bool enable = true) override; - virtual bool SetCurrent(bool doit = true) override; + virtual bool WXMakeCurrent(bool doit = true) override; virtual void Press() override; virtual void Release() override; diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h index a0bd19aa52..5910e35ca8 100644 --- a/include/wx/univ/window.h +++ b/include/wx/univ/window.h @@ -126,7 +126,7 @@ public: int GetStateFlags() const; // set the "highlighted" flag and return true if it changed - virtual bool SetCurrent(bool doit = true); + virtual bool WXMakeCurrent(bool doit = true); #if wxUSE_SCROLLBAR // get the scrollbar (may be null) for the given orientation diff --git a/include/wx/vlbox.h b/include/wx/vlbox.h index e4e1e0d7fc..ce65ec9252 100644 --- a/include/wx/vlbox.h +++ b/include/wx/vlbox.h @@ -95,6 +95,12 @@ public: bool IsCurrent() const { return wxVScrolledWindow::IsCurrent(); } #endif + // get current item + int GetCurrent() const { return m_current; } + + // set current item + void SetCurrent(int current) { DoSetCurrent(current); } + // is this item selected? bool IsSelected(size_t item) const; diff --git a/interface/wx/vlbox.h b/interface/wx/vlbox.h index 3ec265b884..0782efd1b1 100644 --- a/interface/wx/vlbox.h +++ b/interface/wx/vlbox.h @@ -183,6 +183,23 @@ public: */ bool IsCurrent(size_t item) const; + /** + Get the current item or @c wxNOT_FOUND if there is no + current item. + + @since 3.3.0 + */ + int GetCurrent() const; + + /** + Set the specified item as the current item, if it is wxNOT_FOUND + the current item is unset. The current item will be automatically + scrolled into view if it isn't currently visible. + + @since 3.3.0 + */ + void SetCurrent(int current); + /** Returns @true if this item is selected, @false otherwise. */ diff --git a/src/univ/anybutton.cpp b/src/univ/anybutton.cpp index b87cf0823c..79e2370c21 100644 --- a/src/univ/anybutton.cpp +++ b/src/univ/anybutton.cpp @@ -249,7 +249,7 @@ bool wxStdAnyButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer, m_winHasMouse = false; // we do have a pressed button, so release it - consumer->GetInputWindow()->SetCurrent(false); + consumer->GetInputWindow()->WXMakeCurrent(false); consumer->PerformAction(wxACTION_BUTTON_RELEASE); return true; @@ -263,7 +263,7 @@ bool wxStdAnyButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer, // we did have a pressed button which we released when leaving the // window, press it again - consumer->GetInputWindow()->SetCurrent(true); + consumer->GetInputWindow()->WXMakeCurrent(true); consumer->PerformAction(wxACTION_BUTTON_PRESS); return true; diff --git a/src/univ/bmpbuttn.cpp b/src/univ/bmpbuttn.cpp index 221c098c94..f2f7893fe7 100644 --- a/src/univ/bmpbuttn.cpp +++ b/src/univ/bmpbuttn.cpp @@ -106,11 +106,11 @@ bool wxBitmapButton::Enable(bool enable) return true; } -bool wxBitmapButton::SetCurrent(bool doit) +bool wxBitmapButton::WXMakeCurrent(bool doit) { ChangeBitmap(doit ? GetBitmapFocus() : GetBitmapLabel()); - return wxButton::SetCurrent(doit); + return wxButton::WXMakeCurrent(doit); } void wxBitmapButton::OnSetFocus(wxFocusEvent& event) diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index b5c9b0a0fc..9e0eb1428d 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -2587,11 +2587,11 @@ bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control, { if ( event.Entering() ) { - control->GetInputWindow()->SetCurrent(true); + control->GetInputWindow()->WXMakeCurrent(true); } else if ( event.Leaving() ) { - control->GetInputWindow()->SetCurrent(false); + control->GetInputWindow()->WXMakeCurrent(false); } else { diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index c060c93142..4b561e8d12 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -557,7 +557,7 @@ bool wxWindow::IsCurrent() const return m_isCurrent; } -bool wxWindow::SetCurrent(bool doit) +bool wxWindow::WXMakeCurrent(bool doit) { if ( doit == m_isCurrent ) return false;