mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-26 09:56:32 +08:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user