Use bool constants instead of BOOL ones in propgrid sample.

s/FALSE/false/ and s/TRUE/true for the sake of consistency.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2015-02-08 12:48:43 +00:00
parent 0dc98a7d23
commit a5718923ad
3 changed files with 19 additions and 19 deletions

View File

@@ -739,7 +739,7 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event )
wxPGProperty* property = event.GetProperty(); wxPGProperty* property = event.GetProperty();
if ( property ) if ( property )
{ {
m_itemEnable->Enable( TRUE ); m_itemEnable->Enable( true );
if ( property->IsEnabled() ) if ( property->IsEnabled() )
m_itemEnable->SetItemLabel( wxT("Disable") ); m_itemEnable->SetItemLabel( wxT("Disable") );
else else
@@ -747,7 +747,7 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event )
} }
else else
{ {
m_itemEnable->Enable( FALSE ); m_itemEnable->Enable( false );
} }
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
@@ -2029,7 +2029,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
menuTools1->AppendSeparator(); menuTools1->AppendSeparator();
m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"), m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
wxT("Toggles item's enabled state.") ); wxT("Toggles item's enabled state.") );
m_itemEnable->Enable( FALSE ); m_itemEnable->Enable( false );
menuTools1->Append(ID_HIDE, "Hide", "Hides a property" ); menuTools1->Append(ID_HIDE, "Hide", "Hides a property" );
menuTools1->Append(ID_SETREADONLY, "Set as Read-Only", menuTools1->Append(ID_SETREADONLY, "Set as Read-Only",
"Set property as read-only" ); "Set property as read-only" );
@@ -2974,7 +2974,7 @@ void FormMain::OnMisc ( wxCommandEvent& event )
wxVariant list; wxVariant list;
list.NullList(); list.NullList();
list.Append( wxVariant((long)1234,wxT("VariantLong")) ); list.Append( wxVariant((long)1234,wxT("VariantLong")) );
list.Append( wxVariant((bool)TRUE,wxT("VariantBool")) ); list.Append( wxVariant(true,wxT("VariantBool")) );
list.Append( wxVariant(wxT("Test Text"),wxT("VariantString")) ); list.Append( wxVariant(wxT("Test Text"),wxT("VariantString")) );
m_pPropGridManager->GetGrid()->SetPropertyValues(list); m_pPropGridManager->GetGrid()->SetPropertyValues(list);
} }

View File

@@ -42,7 +42,7 @@
// Dummy comparison required by value type implementation. // Dummy comparison required by value type implementation.
bool operator == (const wxFontData&, const wxFontData&) bool operator == (const wxFontData&, const wxFontData&)
{ {
return FALSE; return false;
} }
// Custom version of wxFontProperty that also holds colour in the value. // Custom version of wxFontProperty that also holds colour in the value.
@@ -299,9 +299,9 @@ bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value )
if ( dlg.ShowModal() == wxID_OK ) if ( dlg.ShowModal() == wxID_OK )
{ {
value = dlg.GetPath(); value = dlg.GetPath();
return TRUE; return true;
} }
return FALSE; return false;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -384,22 +384,22 @@ bool wxArrayDoubleEditorDialog::ArrayInsert( const wxString& str, int index )
{ {
double d; double d;
if ( !str.ToDouble(&d) ) if ( !str.ToDouble(&d) )
return FALSE; return false;
if (index<0) if (index<0)
m_array.Add(d); m_array.Add(d);
else else
m_array.Insert(d,index); m_array.Insert(d,index);
return TRUE; return true;
} }
bool wxArrayDoubleEditorDialog::ArraySet( size_t index, const wxString& str ) bool wxArrayDoubleEditorDialog::ArraySet( size_t index, const wxString& str )
{ {
double d; double d;
if ( !str.ToDouble(&d) ) if ( !str.ToDouble(&d) )
return FALSE; return false;
m_array[index] = d; m_array[index] = d;
return TRUE; return true;
} }
void wxArrayDoubleEditorDialog::ArrayRemoveAt( int index ) void wxArrayDoubleEditorDialog::ArrayRemoveAt( int index )
@@ -468,7 +468,7 @@ bool wxArrayDoubleEditorDialog::Create(wxWindow *parent,
bool operator == (const wxArrayDouble& a, const wxArrayDouble& b) bool operator == (const wxArrayDouble& a, const wxArrayDouble& b)
{ {
if ( a.GetCount() != b.GetCount() ) if ( a.GetCount() != b.GetCount() )
return FALSE; return false;
size_t i; size_t i;
@@ -478,10 +478,10 @@ bool operator == (const wxArrayDouble& a, const wxArrayDouble& b)
if ( fabs(a[i] - b[i]) > 0.0000000001 ) if ( fabs(a[i] - b[i]) > 0.0000000001 )
{ {
//wxLogDebug(wxT("%f != %f"),a[i],b[i]); //wxLogDebug(wxT("%f != %f"),a[i],b[i]);
return FALSE; return false;
} }
} }
return TRUE; return true;
} }
WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(wxArrayDouble) WX_PG_IMPLEMENT_VARIANT_DATA_DUMMY_EQ(wxArrayDouble)

View File

@@ -626,7 +626,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
pgman->SetPropertyValue(wxT("StringProperty"),wxT("Text1")); pgman->SetPropertyValue(wxT("StringProperty"),wxT("Text1"));
pgman->SetPropertyValue(wxT("IntProperty"),1024); pgman->SetPropertyValue(wxT("IntProperty"),1024);
pgman->SetPropertyValue(wxT("FloatProperty"),1024.0000000001); pgman->SetPropertyValue(wxT("FloatProperty"),1024.0000000001);
pgman->SetPropertyValue(wxT("BoolProperty"),FALSE); pgman->SetPropertyValue(wxT("BoolProperty"),false);
pgman->SetPropertyValue(wxT("EnumProperty"),120); pgman->SetPropertyValue(wxT("EnumProperty"),120);
pgman->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_1); pgman->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_1);
wxColour emptyCol; wxColour emptyCol;
@@ -648,7 +648,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_FAILURE(); RT_FAILURE();
if ( pg->GetPropertyValueAsDouble(wxT("FloatProperty")) != 1024.0000000001 ) if ( pg->GetPropertyValueAsDouble(wxT("FloatProperty")) != 1024.0000000001 )
RT_FAILURE(); RT_FAILURE();
if ( pg->GetPropertyValueAsBool(wxT("BoolProperty")) != FALSE ) if ( pg->GetPropertyValueAsBool(wxT("BoolProperty")) != false )
RT_FAILURE(); RT_FAILURE();
if ( pg->GetPropertyValueAsLong(wxT("EnumProperty")) != 120 ) if ( pg->GetPropertyValueAsLong(wxT("EnumProperty")) != 120 )
RT_FAILURE(); RT_FAILURE();
@@ -678,7 +678,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
pg->SetPropertyValue(wxT("StringProperty"),wxT("Text2")); pg->SetPropertyValue(wxT("StringProperty"),wxT("Text2"));
pg->SetPropertyValue(wxT("IntProperty"),512); pg->SetPropertyValue(wxT("IntProperty"),512);
pg->SetPropertyValue(wxT("FloatProperty"),512.0); pg->SetPropertyValue(wxT("FloatProperty"),512.0);
pg->SetPropertyValue(wxT("BoolProperty"),TRUE); pg->SetPropertyValue(wxT("BoolProperty"),true);
pg->SetPropertyValue(wxT("EnumProperty"),80); pg->SetPropertyValue(wxT("EnumProperty"),80);
pg->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_2); pg->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_2);
pg->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxWHITE); pg->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxWHITE);
@@ -699,7 +699,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
RT_FAILURE(); RT_FAILURE();
if ( pgman->GetPropertyValueAsDouble(wxT("FloatProperty")) != 512.0 ) if ( pgman->GetPropertyValueAsDouble(wxT("FloatProperty")) != 512.0 )
RT_FAILURE(); RT_FAILURE();
if ( pgman->GetPropertyValueAsBool(wxT("BoolProperty")) != TRUE ) if ( pgman->GetPropertyValueAsBool(wxT("BoolProperty")) != true )
RT_FAILURE(); RT_FAILURE();
if ( pgman->GetPropertyValueAsLong(wxT("EnumProperty")) != 80 ) if ( pgman->GetPropertyValueAsLong(wxT("EnumProperty")) != 80 )
RT_FAILURE(); RT_FAILURE();
@@ -1139,7 +1139,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
{ {
RT_START_TEST(SetPropertyBackgroundColour) RT_START_TEST(SetPropertyBackgroundColour)
wxCommandEvent evt; wxCommandEvent evt;
evt.SetInt(1); // IsChecked() will return TRUE. evt.SetInt(1); // IsChecked() will return true.
evt.SetId(ID_COLOURSCHEME4); evt.SetId(ID_COLOURSCHEME4);
OnCatColours(evt); OnCatColours(evt);
OnColourScheme(evt); OnColourScheme(evt);