Implement new wxPGProperty::HasAnyChild() method

There are many checks in the code whether wxPGProperty has any child.
Doing so by checking if GetChildCount() is greater than zero doesn't
seem to express intent simply and clearly. With dedicated method this
could be done simpler and hopefully in a more optimal way.
This commit is contained in:
Artur Wieczorek
2022-12-03 17:15:28 +01:00
parent d0d43165c9
commit 1d85e22543
12 changed files with 69 additions and 56 deletions
+2 -2
View File
@@ -203,7 +203,7 @@ wxSizeProperty::wxSizeProperty( const wxString& label, const wxString& name,
void wxSizeProperty::RefreshChildren()
{
if ( !GetChildCount() ) return;
if ( !HasAnyChild() ) return;
const wxSize& size = wxSizeRefFromVariant(m_value);
Item(0)->SetValue( (long)size.x );
Item(1)->SetValue( (long)size.y );
@@ -241,7 +241,7 @@ wxPointProperty::wxPointProperty( const wxString& label, const wxString& name,
void wxPointProperty::RefreshChildren()
{
if ( !GetChildCount() ) return;
if ( !HasAnyChild() ) return;
const wxPoint& point = wxPointRefFromVariant(m_value);
Item(0)->SetValue( (long)point.x );
Item(1)->SetValue( (long)point.y );