Use getter methods to get access to wxPGProperty member variables.

Use GetValueImage() getter to get access to m_valueBitmap data member.
Use GetMaxLength() getter to get access to m_maxLen data member.
Use GetAttributes() getter to get access to m_attributes data member.
Use GetChoices() to get access to m_choices data member.
Use GetDepth() to get access to m_depth member variable.
Use GetBaseName() method to get access to m_name data member
Use GetLabel() method to get access to m_label member variable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2015-01-31 21:45:24 +00:00
parent 9698181b45
commit da0f4ce29e
3 changed files with 19 additions and 19 deletions

View File

@@ -845,8 +845,8 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
} }
// If not drawing a selected popup item, then give property's // If not drawing a selected popup item, then give property's
// m_valueBitmap a chance. // value image a chance.
if ( p->m_valueBitmap && item != pCb->GetSelection() ) if ( p->GetValueImage() && item != pCb->GetSelection() )
useCustomPaintProcedure = false; useCustomPaintProcedure = false;
// If current choice had a bitmap set by the application, then // If current choice had a bitmap set by the application, then
// use it instead of any custom paint procedure // use it instead of any custom paint procedure
@@ -2073,7 +2073,7 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrlAndButton( const wxPoint& pos,
if ( !property->IsValueUnspecified() ) if ( !property->IsValueUnspecified() )
text = property->GetValueAsString(property->HasFlag(wxPG_PROP_READONLY)?0:wxPG_EDITABLE_VALUE); text = property->GetValueAsString(property->HasFlag(wxPG_PROP_READONLY)?0:wxPG_EDITABLE_VALUE);
return GenerateEditorTextCtrl(pos,sz,text,but,property->m_maxLen); return GenerateEditorTextCtrl(pos,sz,text,but,property->GetMaxLength());
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------

View File

@@ -2205,7 +2205,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
// Use basic depth if in non-categoric mode and parent is base array. // Use basic depth if in non-categoric mode and parent is base array.
if ( !(windowStyle & wxPG_HIDE_CATEGORIES) || p->GetParent() != m_pState->m_properties ) if ( !(windowStyle & wxPG_HIDE_CATEGORIES) || p->GetParent() != m_pState->m_properties )
{ {
textMarginHere += ((unsigned int)((p->m_depth-1)*m_subgroup_extramargin)); textMarginHere += ((p->GetDepth()-1)*m_subgroup_extramargin);
} }
// Paint margin area // Paint margin area
@@ -2332,7 +2332,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
bool fontChanged = false; bool fontChanged = false;
// Expander button rectangle // Expander button rectangle
wxRect butRect( ((p->m_depth - 1) * m_subgroup_extramargin) - xRelMod, wxRect butRect( ((p->GetDepth() - 1) * m_subgroup_extramargin) - xRelMod,
y, y,
m_marginWidth, m_marginWidth,
lh ); lh );
@@ -3747,7 +3747,7 @@ wxRect wxPropertyGrid::GetEditorWidgetRect( wxPGProperty* p, int column ) const
} }
else if ( column == 0 ) else if ( column == 0 )
{ {
splitterX += (p->m_depth - 1) * m_subgroup_extramargin; splitterX += (p->GetDepth() - 1) * m_subgroup_extramargin;
} }
return wxRect return wxRect
@@ -3780,7 +3780,7 @@ wxSize wxPropertyGrid::GetImageSize( wxPGProperty* p, int item ) const
wxSize cis = p->OnMeasureImage(item); wxSize cis = p->OnMeasureImage(item);
int choiceCount = p->m_choices.GetCount(); int choiceCount = p->GetChoices().GetCount();
int comVals = p->GetDisplayedCommonValueCount(); int comVals = p->GetDisplayedCommonValueCount();
if ( item >= choiceCount && comVals > 0 ) if ( item >= choiceCount && comVals > 0 )
{ {
@@ -4017,8 +4017,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
/* /*
if (p) if (p)
{ {
wxLogDebug(wxT("SelectProperty( %s (%s[%i]) )"),p->m_label.c_str(), wxLogDebug(wxT("SelectProperty( %s (%s[%i]) )"),p->GetLabel().c_str(),
p->m_parent->m_label.c_str(),p->GetIndexInParent()); p->m_parent->GetLabel().c_str(),p->GetIndexInParent());
} }
else else
{ {
@@ -4781,7 +4781,7 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even
// This is category. // This is category.
wxPropertyCategory* pwc = (wxPropertyCategory*)p; wxPropertyCategory* pwc = (wxPropertyCategory*)p;
int textX = m_marginWidth + ((unsigned int)((pwc->m_depth-1)*m_subgroup_extramargin)); int textX = m_marginWidth + ((pwc->GetDepth()-1)*m_subgroup_extramargin);
// Expand, collapse, activate etc. if click on text or left of splitter. // Expand, collapse, activate etc. if click on text or left of splitter.
if ( x >= textX if ( x >= textX
@@ -5081,7 +5081,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
if ( m_mouseSide == 1 ) if ( m_mouseSide == 1 )
{ {
tipString = m_propHover->m_label; tipString = m_propHover->GetLabel();
space = splitterX-m_marginWidth-3; space = splitterX-m_marginWidth-3;
} }
else if ( m_mouseSide == 2 ) else if ( m_mouseSide == 2 )

View File

@@ -478,7 +478,7 @@ wxPGProperty* wxPropertyGridPageState::BaseGetPropertyByLabel
for ( size_t i=0; i<parent->GetChildCount(); i++ ) for ( size_t i=0; i<parent->GetChildCount(); i++ )
{ {
wxPGProperty* p = parent->Item(i); wxPGProperty* p = parent->Item(i);
if ( p->m_label == label ) if ( p->GetLabel() == label )
return p; return p;
// Check children recursively. // Check children recursively.
if ( p->GetChildCount() ) if ( p->GetChildCount() )
@@ -813,7 +813,7 @@ int wxPropertyGridPageState::GetColumnFitWidth(wxClientDC& dc,
p->GetDisplayInfo(col, -1, 0, &text, (wxPGCell*)NULL); p->GetDisplayInfo(col, -1, 0, &text, (wxPGCell*)NULL);
dc.GetTextExtent(text, &w, &h); dc.GetTextExtent(text, &w, &h);
if ( col == 0 ) if ( col == 0 )
w += ( ((int)p->m_depth-1) * pg->m_subgroup_extramargin ); w += ( (p->GetDepth()-1) * pg->m_subgroup_extramargin );
// account for the bitmap // account for the bitmap
if ( col == 1 ) if ( col == 1 )
@@ -849,7 +849,7 @@ int wxPropertyGridPageState::GetColumnFullWidth( wxClientDC &dc, wxPGProperty *p
int w = dc.GetTextExtent(text).x; int w = dc.GetTextExtent(text).x;
if ( col == 0 ) if ( col == 0 )
w += (int)p->m_depth * m_pPropGrid->m_subgroup_extramargin; w += p->GetDepth() * m_pPropGrid->m_subgroup_extramargin;
// account for the bitmap // account for the bitmap
if ( col == 1 ) if ( col == 1 )
@@ -1507,9 +1507,9 @@ wxVariant wxPropertyGridPageState::DoGetPropertyValues( const wxString& listname
} }
else else
{ {
v.Append( DoGetPropertyValues(p->m_name,p,flags|wxPG_KEEP_STRUCTURE) ); v.Append( DoGetPropertyValues(p->GetBaseName(),p,flags|wxPG_KEEP_STRUCTURE) );
} }
if ( (flags & wxPG_INC_ATTRIBUTES) && p->m_attributes.GetCount() ) if ( (flags & wxPG_INC_ATTRIBUTES) && p->GetAttributes().GetCount() )
v.Append( p->GetAttributesAsList() ); v.Append( p->GetAttributesAsList() );
} }
} }
@@ -1528,7 +1528,7 @@ wxVariant wxPropertyGridPageState::DoGetPropertyValues( const wxString& listname
wxVariant variant = p->GetValue(); wxVariant variant = p->GetValue();
variant.SetName( p->GetName() ); variant.SetName( p->GetName() );
v.Append( variant ); v.Append( variant );
if ( (flags & wxPG_INC_ATTRIBUTES) && p->m_attributes.GetCount() ) if ( (flags & wxPG_INC_ATTRIBUTES) && p->GetAttributes().GetCount() )
v.Append( p->GetAttributesAsList() ); v.Append( p->GetAttributesAsList() );
} }
} }
@@ -1854,9 +1854,9 @@ wxPGProperty* wxPropertyGridPageState::DoInsert( wxPGProperty* parent, int index
} }
// Only add name to hashmap if parent is root or category // Only add name to hashmap if parent is root or category
if ( !property->m_name.empty() && if ( !property->GetBaseName().empty() &&
(parentIsCategory || parentIsRoot) ) (parentIsCategory || parentIsRoot) )
m_dictName[property->m_name] = (void*) property; m_dictName[property->GetBaseName()] = (void*) property;
VirtualHeightChanged(); VirtualHeightChanged();