Code cleanup: Define wxPGProperty and wxPropertyGridPageState functions in their own class files
Having definitions of several wxPGProperty and wxPropertyGridPageState functions in wxPropertyGrid header is misleading so they should be moved to the files with their own classes definitions for the sake of clarity.
This commit is contained in:
@@ -2824,6 +2824,54 @@ void wxPGProperty::SubPropsChanged( int oldSelInd )
|
||||
}
|
||||
}
|
||||
|
||||
wxString wxPGProperty::GetHintText() const
|
||||
{
|
||||
wxVariant vHintText = GetAttribute(wxPG_ATTR_HINT);
|
||||
|
||||
#if wxPG_COMPATIBILITY_1_4
|
||||
// Try the old, deprecated "InlineHelp"
|
||||
if ( vHintText.IsNull() )
|
||||
vHintText = GetAttribute(wxPG_ATTR_INLINE_HELP);
|
||||
#endif
|
||||
|
||||
if ( !vHintText.IsNull() )
|
||||
return vHintText.GetString();
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
int wxPGProperty::GetDisplayedCommonValueCount() const
|
||||
{
|
||||
if ( HasFlag(wxPG_PROP_USES_COMMON_VALUE) )
|
||||
{
|
||||
wxPropertyGrid* pg = GetGrid();
|
||||
if ( pg )
|
||||
return (int)pg->GetCommonValueCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxPGProperty::SetDefaultValue(wxVariant& value)
|
||||
{
|
||||
SetAttribute(wxPG_ATTR_DEFAULT_VALUE, value);
|
||||
}
|
||||
|
||||
void wxPGProperty::SetEditor(const wxString& editorName)
|
||||
{
|
||||
m_customEditor = wxPropertyGridInterface::GetEditorByName(editorName);
|
||||
}
|
||||
|
||||
bool wxPGProperty::SetMaxLength(int maxLen)
|
||||
{
|
||||
const wxPGEditor* editorClass = GetEditorClass();
|
||||
if ( editorClass != wxPGEditor_TextCtrl &&
|
||||
editorClass != wxPGEditor_TextCtrlAndButton )
|
||||
return false;
|
||||
|
||||
m_maxLen = wxMax(maxLen, 0); // shouldn't be a nagative value
|
||||
return true;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// wxPGRootProperty
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@@ -2105,6 +2105,16 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
|
||||
VirtualHeightChanged();
|
||||
}
|
||||
|
||||
bool wxPropertyGridPageState::IsDisplayed() const
|
||||
{
|
||||
return (this == m_pPropGrid->GetState());
|
||||
}
|
||||
|
||||
unsigned int wxPropertyGridPageState::GetActualVirtualHeight() const
|
||||
{
|
||||
return DoGetRoot()->GetChildrenHeight(GetGrid()->GetRowHeight());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
#endif // wxUSE_PROPGRID
|
||||
|
||||
Reference in New Issue
Block a user