use bool expression rather than implicit conversion

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett 2009-02-18 18:02:53 +00:00
parent 3051a44a73
commit c4021a7920
6 changed files with 23 additions and 23 deletions

View File

@ -397,7 +397,7 @@ class wxEventFunctorMethod
<
Class,
EventArg,
wxConvertibleTo<Class, wxEvtHandler>::value
wxConvertibleTo<Class, wxEvtHandler>::value != 0
>
{
private:

View File

@ -30,7 +30,7 @@ public:
// default copy ctor and dtor are ok
// accessors
virtual bool IsOk() const { return m_cgColour; }
virtual bool IsOk() const { return m_cgColour != NULL; }
virtual WXDLLIMPEXP_INLINE_CORE ChannelType Red() const { return m_red; }
virtual WXDLLIMPEXP_INLINE_CORE ChannelType Green() const { return m_green; }

View File

@ -202,7 +202,7 @@ class wxWeakRef : public
#ifdef USE_ONLY_STATIC_WEAKREF
wxWeakRefStatic<T>
#else
wxWeakRefImpl<T, wxIsStaticTrackable<T>::value>
wxWeakRefImpl<T, wxIsStaticTrackable<T>::value != 0>
#endif
{
public:

View File

@ -1074,15 +1074,15 @@ template<typename T> void InitMouseEvent(wxWindowGTK *win,
T *gdk_event)
{
event.SetTimestamp( gdk_event->time );
event.m_shiftDown = gdk_event->state & GDK_SHIFT_MASK;
event.m_controlDown = gdk_event->state & GDK_CONTROL_MASK;
event.m_altDown = gdk_event->state & GDK_MOD1_MASK;
event.m_metaDown = gdk_event->state & GDK_META_MASK;
event.m_leftDown = gdk_event->state & GDK_BUTTON1_MASK;
event.m_middleDown = gdk_event->state & GDK_BUTTON2_MASK;
event.m_rightDown = gdk_event->state & GDK_BUTTON3_MASK;
event.m_aux1Down = gdk_event->state & GDK_BUTTON4_MASK;
event.m_aux2Down = gdk_event->state & GDK_BUTTON5_MASK;
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK) != 0;
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK) != 0;
event.m_altDown = (gdk_event->state & GDK_MOD1_MASK) != 0;
event.m_metaDown = (gdk_event->state & GDK_META_MASK) != 0;
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK) != 0;
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK) != 0;
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK) != 0;
event.m_aux1Down = (gdk_event->state & GDK_BUTTON4_MASK) != 0;
event.m_aux2Down = (gdk_event->state & GDK_BUTTON5_MASK) != 0;
wxPoint pt = win->GetClientAreaOrigin();
event.m_x = (wxCoord)gdk_event->x - pt.x;
@ -1992,16 +1992,16 @@ wxMouseState wxGetMouseState()
ms.SetX(x);
ms.SetY(y);
ms.SetLeftDown(mask & GDK_BUTTON1_MASK);
ms.SetMiddleDown(mask & GDK_BUTTON2_MASK);
ms.SetRightDown(mask & GDK_BUTTON3_MASK);
ms.SetAux1Down(mask & GDK_BUTTON4_MASK);
ms.SetAux2Down(mask & GDK_BUTTON5_MASK);
ms.SetLeftDown((mask & GDK_BUTTON1_MASK) != 0);
ms.SetMiddleDown((mask & GDK_BUTTON2_MASK) != 0);
ms.SetRightDown((mask & GDK_BUTTON3_MASK) != 0);
ms.SetAux1Down((mask & GDK_BUTTON4_MASK) != 0);
ms.SetAux2Down((mask & GDK_BUTTON5_MASK) != 0);
ms.SetControlDown(mask & GDK_CONTROL_MASK);
ms.SetShiftDown(mask & GDK_SHIFT_MASK);
ms.SetAltDown(mask & GDK_MOD1_MASK);
ms.SetMetaDown(mask & GDK_META_MASK);
ms.SetControlDown((mask & GDK_CONTROL_MASK) != 0);
ms.SetShiftDown((mask & GDK_SHIFT_MASK) != 0);
ms.SetAltDown((mask & GDK_MOD1_MASK) != 0);
ms.SetMetaDown((mask & GDK_META_MASK) != 0);
return ms;
}

View File

@ -117,7 +117,7 @@ void wxCheckListBox::SetValueCallback( unsigned int n, wxListWidgetColumn* col ,
{
if ( col == m_checkColumn )
{
Check( n, value.GetIntValue() );
Check( n, value.GetIntValue() != 0 );
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId() );
event.SetInt( n );

View File

@ -97,7 +97,7 @@ void wxRadioButton::SetValue(bool val)
bool wxRadioButton::GetValue() const
{
return m_peer->GetValue();
return m_peer->GetValue() != 0;
}
void wxRadioButton::Command(wxCommandEvent& event)