From c0ae81ced755c911e37801bb008f5509c4189e7d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 May 2015 19:17:41 +0200 Subject: [PATCH] No changes, just rename GTKGetCurrentState() to be more clear. Update the name and the comment to explain better that this method returns the state for which the bitmap is currently shown, not necessarily the current state. See #16771. --- include/wx/gtk/anybutton.h | 8 ++++---- src/gtk/anybutton.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/gtk/anybutton.h b/include/wx/gtk/anybutton.h index 69777daef6..ad0357a659 100644 --- a/include/wx/gtk/anybutton.h +++ b/include/wx/gtk/anybutton.h @@ -54,10 +54,10 @@ private: // update the bitmap to correspond to the current button state void GTKUpdateBitmap(); - // return the current button state from m_isXXX flags (which means that it - // might not correspond to the real current state as e.g. m_isCurrent will - // never be true if we don't have a valid current bitmap) - State GTKGetCurrentState() const; + // return the state whose bitmap is being currently shown (so this is + // different from the real current state, e.g. it could be State_Normal + // even if the button is pressed if no button was set for State_Pressed) + State GTKGetCurrentBitmapState() const; // show the given bitmap (must be valid) void GTKDoShowBitmap(const wxBitmap& bitmap); diff --git a/src/gtk/anybutton.cpp b/src/gtk/anybutton.cpp index d64948f55e..f2df6f069b 100644 --- a/src/gtk/anybutton.cpp +++ b/src/gtk/anybutton.cpp @@ -136,7 +136,7 @@ void wxAnyButton::GTKOnFocus(wxFocusEvent& event) GTKUpdateBitmap(); } -wxAnyButton::State wxAnyButton::GTKGetCurrentState() const +wxAnyButton::State wxAnyButton::GTKGetCurrentBitmapState() const { if ( !IsThisEnabled() ) return m_bitmaps[State_Disabled].IsOk() ? State_Disabled : State_Normal; @@ -160,7 +160,7 @@ void wxAnyButton::GTKUpdateBitmap() { // if we do show them, this will return a state for which we do have a // valid bitmap - State state = GTKGetCurrentState(); + State state = GTKGetCurrentBitmapState(); GTKDoShowBitmap(m_bitmaps[state]); } @@ -360,7 +360,7 @@ void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which) // update the bitmap immediately if necessary, otherwise it will be done // when the bitmap for the corresponding state is needed the next time by // GTKUpdateBitmap() - if ( bitmap.IsOk() && which == GTKGetCurrentState() ) + if ( bitmap.IsOk() && which == GTKGetCurrentBitmapState() ) { GTKDoShowBitmap(bitmap); }