}
}
-wxString wxFontProperty::GetValueAsString( int argFlags ) const
+wxString wxFontProperty::ValueToString( wxVariant& value,
+ int argFlags ) const
{
- return wxPGProperty::GetValueAsString(argFlags);
+ return wxPGProperty::ValueToString(value, argFlags);
}
bool wxFontProperty::OnEvent( wxPropertyGrid* propgrid, wxWindow* WXUNUSED(primary),
return m_choices.GetLabel(index);
}
-wxString wxSystemColourProperty::GetValueAsString( int argFlags ) const
+wxString wxSystemColourProperty::ValueToString( wxVariant& value,
+ int WXUNUSED(argFlags) ) const
{
- wxColourPropertyValue val = GetVal();
-
- int ind = GetIndex();
-
- // Always show custom colour for textctrl-editor
- if ( val.m_type == wxPG_COLOUR_CUSTOM ||
- ind == GetCustomColourIndex() ||
- (argFlags & wxPG_PROPERTY_SPECIFIC) )
- {
- return ColourToString(val.m_colour, wxNOT_FOUND);
- }
-
- if ( ind == -1 )
- return wxEmptyString;
+ wxColourPropertyValue val = GetVal(&value);
- return ColourToString(val.m_colour, ind);
+ return ColourToString(val.m_colour, m_choices.Index(val.m_type));
}
SetIndex( ind );
}
-wxString wxColourProperty::GetValueAsString( int argFlags ) const
+wxString wxColourProperty::ValueToString( wxVariant& value,
+ int argFlags ) const
{
const wxPGEditor* editor = GetEditorClass();
if ( editor != wxPGEditor_Choice &&
editor != wxPGEditor_ComboBox )
argFlags |= wxPG_PROPERTY_SPECIFIC;
- return wxSystemColourProperty::GetValueAsString(argFlags);
+ return wxSystemColourProperty::ValueToString(value, argFlags);
}
wxColour wxColourProperty::GetColour( int index ) const
m_pBitmap = NULL;
}
+ wxFileName filename = GetFileName();
+
// Create the image thumbnail
- if ( m_filename.FileExists() )
+ if ( filename.FileExists() )
{
- m_pImage = new wxImage( m_filename.GetFullPath() );
+ m_pImage = new wxImage( filename.GetFullPath() );
}
}
void wxMultiChoiceProperty::OnSetValue()
{
- GenerateValueAsString();
+ GenerateValueAsString(m_value, &m_display);
}
-wxString wxMultiChoiceProperty::GetValueAsString( int ) const
+wxString wxMultiChoiceProperty::ValueToString( wxVariant& value,
+ int argFlags ) const
{
- return m_display;
+ // If possible, use cached string
+ if ( argFlags & wxPG_VALUE_IS_CURRENT )
+ return m_display;
+
+ wxString s;
+ GenerateValueAsString(value, &s);
+ return s;
}
-void wxMultiChoiceProperty::GenerateValueAsString()
+void wxMultiChoiceProperty::GenerateValueAsString( wxVariant& value,
+ wxString* target ) const
{
wxArrayString strings;
- if ( m_value.GetType() == wxPG_VARIANT_TYPE_ARRSTRING )
- strings = m_value.GetArrayString();
+ if ( value.GetType() == wxPG_VARIANT_TYPE_ARRSTRING )
+ strings = value.GetArrayString();
- wxString& tempStr = m_display;
+ wxString& tempStr = *target;
unsigned int i;
unsigned int itemCount = strings.size();
return false;
}
-wxString wxDateProperty::GetValueAsString( int argFlags ) const
+wxString wxDateProperty::ValueToString( wxVariant& value,
+ int argFlags ) const
{
const wxChar* format = (const wxChar*) NULL;
- wxDateTime dateTime = m_value.GetDateTime();
+ wxDateTime dateTime = value.GetDateTime();
if ( !dateTime.IsValid() )
return wxT("Invalid");