From e532b3f2343e8fbe4ca263b99a7c62f9deb918a6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 8 May 2014 14:43:27 +0000 Subject: [PATCH] Fix harmless warning about using wxCONTROL_CHECKED in ternary operator. Add wxCONTROL_NONE which is just a symbolic name for 0 and use it in the code to avoid g++ 4.8 warnings about mixing enum and int in conditional expression. Closes #16242. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/renderer.h | 1 + interface/wx/renderer.h | 7 +++++++ src/msw/radiobut.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/wx/renderer.h b/include/wx/renderer.h index 97152e32e3..a6076b5b96 100644 --- a/include/wx/renderer.h +++ b/include/wx/renderer.h @@ -52,6 +52,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindow; // control state flags used in wxRenderer and wxColourScheme enum { + wxCONTROL_NONE = 0x00000000, // absence of any other flags wxCONTROL_DISABLED = 0x00000001, // control is disabled wxCONTROL_FOCUSED = 0x00000002, // currently has keyboard focus wxCONTROL_PRESSED = 0x00000004, // (button) is pressed diff --git a/interface/wx/renderer.h b/interface/wx/renderer.h index ef1d487967..7ff81f43b6 100644 --- a/interface/wx/renderer.h +++ b/interface/wx/renderer.h @@ -12,6 +12,13 @@ */ enum { + /** + Default state, no special flags. + + @since 3.1.0 + */ + wxCONTROL_NONE = 0x00000000, + /** Control is disabled. */ wxCONTROL_DISABLED = 0x00000001, diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 3737df1cc9..74c9062bc6 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -322,7 +322,7 @@ void wxRadioButton::MSWOnButtonResetOwnerDrawn() int wxRadioButton::MSWGetButtonCheckedFlag() const { - return m_isChecked ? wxCONTROL_CHECKED : 0; + return m_isChecked ? wxCONTROL_CHECKED : wxCONTROL_NONE; } void wxRadioButton::MSWDrawButtonBitmap(wxDC& dc, const wxRect& rect, int flags)