1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Propert sheet classes implementation
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "prop.h"
16 // For compilers that support precompilation, includes "wx/wx.h".
17 #include "wx/wxprec.h"
36 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValue
, wxObject
)
38 wxPropertyValue::wxPropertyValue(void)
40 m_type
= wxPropertyValueNull
;
45 m_modifiedFlag
= FALSE
;
48 wxPropertyValue::wxPropertyValue(const wxPropertyValue
& copyFrom
)
50 m_modifiedFlag
= FALSE
;
51 Copy((wxPropertyValue
& )copyFrom
);
54 wxPropertyValue::wxPropertyValue(const wxChar
*val
)
56 m_modifiedFlag
= FALSE
;
57 m_type
= wxPropertyValueString
;
59 m_value
.string
= copystring(val
);
65 wxPropertyValue::wxPropertyValue(const wxString
& val
)
67 m_modifiedFlag
= FALSE
;
68 m_type
= wxPropertyValueString
;
70 m_value
.string
= copystring((const wxChar
*)val
);
76 wxPropertyValue::wxPropertyValue(long the_integer
)
78 m_modifiedFlag
= FALSE
;
79 m_type
= wxPropertyValueInteger
;
80 m_value
.integer
= the_integer
;
85 wxPropertyValue::wxPropertyValue(bool val
)
87 m_modifiedFlag
= FALSE
;
88 m_type
= wxPropertyValuebool
;
89 m_value
.integer
= val
;
94 wxPropertyValue::wxPropertyValue(float the_real
)
96 m_modifiedFlag
= FALSE
;
97 m_type
= wxPropertyValueReal
;
98 m_value
.real
= the_real
;
103 wxPropertyValue::wxPropertyValue(double the_real
)
105 m_modifiedFlag
= FALSE
;
106 m_type
= wxPropertyValueReal
;
107 m_value
.real
= (float)the_real
;
112 // Pointer versions: we have a pointer to the real C++ value.
113 wxPropertyValue::wxPropertyValue(wxChar
**val
)
115 m_modifiedFlag
= FALSE
;
116 m_type
= wxPropertyValueStringPtr
;
118 m_value
.stringPtr
= val
;
124 wxPropertyValue::wxPropertyValue(long *val
)
126 m_modifiedFlag
= FALSE
;
127 m_type
= wxPropertyValueIntegerPtr
;
128 m_value
.integerPtr
= val
;
133 wxPropertyValue::wxPropertyValue(bool *val
)
135 m_modifiedFlag
= FALSE
;
136 m_type
= wxPropertyValueboolPtr
;
137 m_value
.boolPtr
= val
;
142 wxPropertyValue::wxPropertyValue(float *val
)
144 m_modifiedFlag
= FALSE
;
145 m_type
= wxPropertyValueRealPtr
;
146 m_value
.realPtr
= val
;
151 wxPropertyValue::wxPropertyValue(wxList
*the_list
)
153 m_modifiedFlag
= FALSE
;
154 m_type
= wxPropertyValueList
;
157 m_value
.first
= NULL
;
159 wxNode
*node
= the_list
->First();
162 wxPropertyValue
*expr
= (wxPropertyValue
*)node
->Data();
170 wxPropertyValue::wxPropertyValue(wxStringList
*the_list
)
172 m_modifiedFlag
= FALSE
;
173 m_type
= wxPropertyValueList
;
176 m_value
.first
= NULL
;
178 wxNode
*node
= the_list
->First();
181 char *s
= (char *)node
->Data();
182 Append(new wxPropertyValue(s
));
188 wxPropertyValue::~wxPropertyValue(void)
192 case wxPropertyValueInteger
:
193 case wxPropertyValuebool
:
194 case wxPropertyValueReal
:
198 case wxPropertyValueString
:
200 delete[] m_value
.string
;
203 case wxPropertyValueList
:
205 wxPropertyValue
*expr
= m_value
.first
;
208 wxPropertyValue
*expr1
= expr
->m_next
;
216 case wxPropertyValueNull
: break;
220 void wxPropertyValue::Append(wxPropertyValue
*expr
)
222 m_modifiedFlag
= TRUE
;
224 m_value
.first
= expr
;
227 m_last
->m_next
= expr
;
231 void wxPropertyValue::Insert(wxPropertyValue
*expr
)
233 m_modifiedFlag
= TRUE
;
234 expr
->m_next
= m_value
.first
;
235 m_value
.first
= expr
;
242 void wxPropertyValue::Delete(wxPropertyValue
*node
)
244 wxPropertyValue
*expr
= GetFirst();
246 wxPropertyValue
*previous
= NULL
;
247 while (expr
&& (expr
!= node
))
250 expr
= expr
->GetNext();
256 previous
->m_next
= expr
->m_next
;
258 // If node was the first in the list,
259 // make the list point to the NEXT one.
260 if (GetFirst() == expr
)
262 m_value
.first
= expr
->m_next
;
265 // If node was the last in the list,
266 // make the list 'last' pointer point to the PREVIOUS one.
267 if (GetLast() == expr
)
274 m_modifiedFlag
= TRUE
;
280 void wxPropertyValue::ClearList(void)
282 wxPropertyValue
*val
= GetFirst();
284 m_modifiedFlag
= TRUE
;
288 wxPropertyValue
*next
= val
->GetNext();
292 m_value
.first
= NULL
;
296 wxPropertyValue
*wxPropertyValue::NewCopy(void) const
300 case wxPropertyValueInteger
:
301 return new wxPropertyValue(m_value
.integer
);
302 case wxPropertyValuebool
:
303 return new wxPropertyValue((bool) (m_value
.integer
!= 0));
304 case wxPropertyValueReal
:
305 return new wxPropertyValue(m_value
.real
);
306 case wxPropertyValueString
:
307 return new wxPropertyValue(m_value
.string
);
308 case wxPropertyValueList
:
310 wxPropertyValue
*expr
= m_value
.first
;
311 wxPropertyValue
*new_list
= new wxPropertyValue
;
312 new_list
->SetType(wxPropertyValueList
);
315 wxPropertyValue
*expr2
= expr
->NewCopy();
316 new_list
->Append(expr2
);
321 case wxPropertyValueIntegerPtr
:
322 return new wxPropertyValue(m_value
.integerPtr
);
323 case wxPropertyValueRealPtr
:
324 return new wxPropertyValue(m_value
.realPtr
);
325 case wxPropertyValueboolPtr
:
326 return new wxPropertyValue(m_value
.boolPtr
);
327 case wxPropertyValueStringPtr
:
328 return new wxPropertyValue(m_value
.stringPtr
);
330 case wxPropertyValueNull
:
332 cerr
<< "Should never get here!\n";
339 void wxPropertyValue::Copy(wxPropertyValue
& copyFrom
)
341 m_type
= copyFrom
.Type();
345 case wxPropertyValueInteger
:
346 (*this) = copyFrom
.IntegerValue();
349 case wxPropertyValueReal
:
350 (*this) = copyFrom
.RealValue();
353 case wxPropertyValueString
:
354 (*this) = wxString(copyFrom
.StringValue());
357 case wxPropertyValuebool
:
358 (*this) = copyFrom
.BoolValue();
362 case wxPropertyValueboolPtr
:
363 (*this) = copyFrom
.BoolValuePtr();
365 case wxPropertyValueRealPtr
:
366 (*this) = copyFrom
.RealValuePtr();
368 case wxPropertyValueIntegerPtr
:
369 (*this) = copyFrom
.IntegerValuePtr();
371 case wxPropertyValueStringPtr
:
373 wxChar
** s
= copyFrom
.StringValuePtr();
374 // what is this? are you trying to assign a bool or a string? VA can't figure it out..
375 #if defined(__VISAGECPP__)
383 case wxPropertyValueList
:
385 m_value
.first
= NULL
;
388 wxPropertyValue
*expr
= copyFrom
.m_value
.first
;
391 wxPropertyValue
*expr2
= expr
->NewCopy();
397 case wxPropertyValueNull
:
399 cerr
<< "Should never get here!\n";
405 // Return nth argument of a clause (starting from 1)
406 wxPropertyValue
*wxPropertyValue::Arg(wxPropertyValueType type
, int arg
) const
408 wxPropertyValue
*expr
= m_value
.first
;
409 for (int i
= 1; i
< arg
; i
++)
413 if (expr
&& (expr
->m_type
== type
))
419 // Return nth argument of a list expression (starting from zero)
420 wxPropertyValue
*wxPropertyValue::Nth(int arg
) const
422 if (m_type
!= wxPropertyValueList
)
425 wxPropertyValue
*expr
= m_value
.first
;
426 for (int i
= 0; i
< arg
; i
++)
437 // Returns the number of elements in a list expression
438 int wxPropertyValue::Number(void) const
440 if (m_type
!= wxPropertyValueList
)
444 wxPropertyValue
*expr
= m_value
.first
;
453 void wxPropertyValue::WritePropertyClause(wxString
& stream
) // Write this expression as a top-level clause
455 if (m_type
!= wxPropertyValueList
)
458 wxPropertyValue
*node
= m_value
.first
;
461 node
->WritePropertyType(stream
);
462 stream
.Append( _T("(") );
468 stream
.Append( _T(" ") );
469 node
->WritePropertyType(stream
);
472 stream
.Append( _T(",\n" ) );
475 stream
.Append( _T(").\n\n") );
479 void wxPropertyValue::WritePropertyType(wxString
& stream
) // Write as any other subexpression
484 case wxPropertyValueInteger
:
486 tmp
.Printf( _T("%ld"), m_value
.integer
);
487 stream
.Append( tmp
);
490 case wxPropertyValueIntegerPtr
:
492 tmp
.Printf( _T("%ld"), *m_value
.integerPtr
);
493 stream
.Append( tmp
);
496 case wxPropertyValuebool
:
499 stream
.Append( _T("True") );
501 stream
.Append( _T("False") );
504 case wxPropertyValueboolPtr
:
506 if (*m_value
.integerPtr
)
507 stream
.Append( _T("True") );
509 stream
.Append( _T("False") );
512 case wxPropertyValueReal
:
514 double d
= m_value
.real
;
515 tmp
.Printf( _T("%.6g"), d
);
516 stream
.Append( tmp
);
519 case wxPropertyValueRealPtr
:
521 double d
= *m_value
.realPtr
;
522 tmp
.Printf( _T("%.6g"), d
);
523 stream
.Append( tmp
);
526 case wxPropertyValueString
:
528 stream
.Append( m_value
.string
);
531 case wxPropertyValueStringPtr
:
533 wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
536 int len = strlen(*(m_value.stringPtr));
537 for (i = 0; i < len; i++)
539 char ch = *(m_value.stringPtr)[i];
545 case wxPropertyValueList
:
548 stream
.Append( _T("[]") );
551 wxPropertyValue
*expr
= m_value
.first
;
553 stream
.Append( _T("[") );
556 expr
->WritePropertyType(stream
);
559 stream
.Append( _T(", ") );
561 stream
.Append( _T("]") );
565 case wxPropertyValueNull
: break;
569 wxString
wxPropertyValue::GetStringRepresentation(void)
572 WritePropertyType(str
);
576 void wxPropertyValue::operator=(const wxPropertyValue
& val
)
578 m_modifiedFlag
= TRUE
;
579 Copy((wxPropertyValue
&)val
);
582 // void wxPropertyValue::operator=(const char *val)
583 void wxPropertyValue::operator=(const wxString
& val1
)
585 const wxChar
*val
= (const wxChar
*)val1
;
587 m_modifiedFlag
= TRUE
;
588 if (m_type
== wxPropertyValueNull
)
589 m_type
= wxPropertyValueString
;
591 if (m_type
== wxPropertyValueString
)
594 m_value
.string
= copystring(val
);
596 m_value
.string
= NULL
;
598 else if (m_type
== wxPropertyValueStringPtr
)
600 if (*m_value
.stringPtr
)
601 delete[] *m_value
.stringPtr
;
603 *m_value
.stringPtr
= copystring(val
);
605 *m_value
.stringPtr
= NULL
;
614 void wxPropertyValue::operator=(const long val
)
616 m_modifiedFlag
= TRUE
;
617 if (m_type
== wxPropertyValueNull
)
618 m_type
= wxPropertyValueInteger
;
620 if (m_type
== wxPropertyValueInteger
)
621 m_value
.integer
= val
;
622 else if (m_type
== wxPropertyValueIntegerPtr
)
623 *m_value
.integerPtr
= val
;
624 else if (m_type
== wxPropertyValueReal
)
625 m_value
.real
= (float)val
;
626 else if (m_type
== wxPropertyValueRealPtr
)
627 *m_value
.realPtr
= (float)val
;
633 void wxPropertyValue::operator=(const bool val
)
635 m_modifiedFlag
= TRUE
;
636 if (m_type
== wxPropertyValueNull
)
637 m_type
= wxPropertyValuebool
;
639 if (m_type
== wxPropertyValuebool
)
640 m_value
.integer
= (long)val
;
641 else if (m_type
== wxPropertyValueboolPtr
)
642 *m_value
.boolPtr
= val
;
648 void wxPropertyValue::operator=(const float val
)
650 m_modifiedFlag
= TRUE
;
651 if (m_type
== wxPropertyValueNull
)
652 m_type
= wxPropertyValueReal
;
654 if (m_type
== wxPropertyValueInteger
)
655 m_value
.integer
= (long)val
;
656 else if (m_type
== wxPropertyValueIntegerPtr
)
657 *m_value
.integerPtr
= (long)val
;
658 else if (m_type
== wxPropertyValueReal
)
660 else if (m_type
== wxPropertyValueRealPtr
)
661 *m_value
.realPtr
= val
;
667 void wxPropertyValue::operator=(const wxChar
**val
)
669 m_modifiedFlag
= TRUE
;
670 m_type
= wxPropertyValueStringPtr
;
673 m_value
.stringPtr
= (wxChar
**)val
;
675 m_value
.stringPtr
= NULL
;
682 void wxPropertyValue::operator=(const long *val
)
684 m_modifiedFlag
= TRUE
;
685 m_type
= wxPropertyValueIntegerPtr
;
686 m_value
.integerPtr
= (long *)val
;
691 void wxPropertyValue::operator=(const bool *val
)
693 m_modifiedFlag
= TRUE
;
694 m_type
= wxPropertyValueboolPtr
;
695 m_value
.boolPtr
= (bool *)val
;
700 void wxPropertyValue::operator=(const float *val
)
702 m_modifiedFlag
= TRUE
;
703 m_type
= wxPropertyValueRealPtr
;
704 m_value
.realPtr
= (float *)val
;
709 long wxPropertyValue::IntegerValue(void) const
711 if (m_type
== wxPropertyValueInteger
)
712 return m_value
.integer
;
713 else if (m_type
== wxPropertyValueReal
)
714 return (long)m_value
.real
;
715 else if (m_type
== wxPropertyValueIntegerPtr
)
716 return *m_value
.integerPtr
;
717 else if (m_type
== wxPropertyValueRealPtr
)
718 return (long)(*m_value
.realPtr
);
722 long *wxPropertyValue::IntegerValuePtr(void) const
724 return m_value
.integerPtr
;
727 float wxPropertyValue::RealValue(void) const {
728 if (m_type
== wxPropertyValueReal
)
730 else if (m_type
== wxPropertyValueRealPtr
)
731 return *m_value
.realPtr
;
732 else if (m_type
== wxPropertyValueInteger
)
733 return (float)m_value
.integer
;
734 else if (m_type
== wxPropertyValueIntegerPtr
)
735 return (float)*(m_value
.integerPtr
);
739 float *wxPropertyValue::RealValuePtr(void) const
741 return m_value
.realPtr
;
744 bool wxPropertyValue::BoolValue(void) const {
745 if (m_type
== wxPropertyValueReal
)
746 return (m_value
.real
!= 0.0);
747 if (m_type
== wxPropertyValueRealPtr
)
748 return (*(m_value
.realPtr
) != 0.0);
749 else if (m_type
== wxPropertyValueInteger
)
750 return (m_value
.integer
!= 0);
751 else if (m_type
== wxPropertyValueIntegerPtr
)
752 return (*(m_value
.integerPtr
) != 0);
753 else if (m_type
== wxPropertyValuebool
)
754 return (m_value
.integer
!= 0);
755 else if (m_type
== wxPropertyValueboolPtr
)
756 return (*(m_value
.boolPtr
) != 0);
760 bool *wxPropertyValue::BoolValuePtr(void) const
762 return m_value
.boolPtr
;
765 wxChar
*wxPropertyValue::StringValue(void) const {
766 if (m_type
== wxPropertyValueString
)
767 return m_value
.string
;
768 else if (m_type
== wxPropertyValueStringPtr
)
769 return *(m_value
.stringPtr
);
773 wxChar
**wxPropertyValue::StringValuePtr(void) const
775 return m_value
.stringPtr
;
779 * A property (name plus value)
782 IMPLEMENT_DYNAMIC_CLASS(wxProperty
, wxObject
)
784 wxProperty::wxProperty(void)
786 m_propertyRole
= wxEmptyString
;
787 m_propertyValidator
= NULL
;
788 m_propertyWindow
= NULL
;
792 wxProperty::wxProperty(wxProperty
& copyFrom
)
794 m_value
= copyFrom
.GetValue();
795 m_name
= copyFrom
.GetName();
796 m_propertyRole
= copyFrom
.GetRole();
797 m_propertyValidator
= copyFrom
.GetValidator();
798 m_enabled
= copyFrom
.IsEnabled();
799 m_propertyWindow
= NULL
;
802 wxProperty::wxProperty(wxString nm
, wxString role
, wxPropertyValidator
*ed
):m_name(nm
), m_propertyRole(role
)
804 m_propertyValidator
= ed
;
805 m_propertyWindow
= NULL
;
809 wxProperty::wxProperty(wxString nm
, const wxPropertyValue
& val
, wxString role
, wxPropertyValidator
*ed
):
810 m_value(val
), m_name(nm
), m_propertyRole(role
)
812 m_propertyValidator
= ed
;
813 m_propertyWindow
= NULL
;
817 wxProperty::~wxProperty(void)
819 if (m_propertyValidator
)
820 delete m_propertyValidator
;
823 wxPropertyValue
& wxProperty::GetValue(void) const
825 return (wxPropertyValue
&) m_value
;
828 wxPropertyValidator
*wxProperty::GetValidator(void) const
830 return m_propertyValidator
;
833 wxString
& wxProperty::GetName(void) const
835 return (wxString
&) m_name
;
838 wxString
& wxProperty::GetRole(void) const
840 return (wxString
&) m_propertyRole
;
843 void wxProperty::SetValue(const wxPropertyValue
& val
)
848 void wxProperty::SetValidator(wxPropertyValidator
*ed
)
850 m_propertyValidator
= ed
;
853 void wxProperty::SetRole(wxString
& role
)
855 m_propertyRole
= role
;
858 void wxProperty::SetName(wxString
& nm
)
863 void wxProperty::operator=(const wxPropertyValue
& val
)
869 * Base property view class
872 IMPLEMENT_DYNAMIC_CLASS(wxPropertyView
, wxEvtHandler
)
874 wxPropertyView::wxPropertyView(long flags
)
876 m_buttonFlags
= flags
;
877 m_propertySheet
= NULL
;
878 m_currentValidator
= NULL
;
879 m_currentProperty
= NULL
;
882 wxPropertyView::~wxPropertyView(void)
886 void wxPropertyView::AddRegistry(wxPropertyValidatorRegistry
*registry
)
888 m_validatorRegistryList
.Append(registry
);
891 wxPropertyValidator
*wxPropertyView::FindPropertyValidator(wxProperty
*property
)
893 if (property
->GetValidator())
894 return property
->GetValidator();
896 wxNode
*node
= m_validatorRegistryList
.First();
899 wxPropertyValidatorRegistry
*registry
= (wxPropertyValidatorRegistry
*)node
->Data();
900 wxPropertyValidator
*validator
= registry
->GetValidator(property
->GetRole());
907 if (!wxDefaultPropertyValidator)
908 wxDefaultPropertyValidator = new wxPropertyListValidator;
909 return wxDefaultPropertyValidator;
917 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet
, wxObject
)
919 wxPropertySheet::wxPropertySheet(const wxString
& name
)
920 :m_properties(wxKEY_STRING
),m_name(name
)
924 wxPropertySheet::~wxPropertySheet(void)
929 void wxPropertySheet::UpdateAllViews( wxPropertyView
*WXUNUSED(thisView
) )
934 void wxPropertySheet::AddProperty(wxProperty
*property
)
936 m_properties
.Append((const wxChar
*) property
->GetName(), property
);
939 // Get property by name
940 wxProperty
*wxPropertySheet::GetProperty(const wxString
& name
) const
942 wxNode
*node
= m_properties
.Find((const wxChar
*) name
);
946 return (wxProperty
*)node
->Data();
949 bool wxPropertySheet::SetProperty(const wxString
& name
, const wxPropertyValue
& value
)
951 wxProperty
* prop
= GetProperty(name
);
953 prop
->SetValue(value
);
960 void wxPropertySheet::RemoveProperty(const wxString
& name
)
962 wxNode
*node
= m_properties
.Find(name
);
965 wxProperty
*prop
= (wxProperty
*)node
->Data();
967 m_properties
.DeleteNode(node
);
971 bool wxPropertySheet::HasProperty(const wxString
& name
) const
973 return (GetProperty(name
)?TRUE
:FALSE
);
976 // Clear all properties
977 void wxPropertySheet::Clear(void)
979 wxNode
*node
= m_properties
.First();
982 wxProperty
*prop
= (wxProperty
*)node
->Data();
983 wxNode
*next
= node
->Next();
990 // Sets/clears the modified flag for each property value
991 void wxPropertySheet::SetAllModified(bool flag
)
993 wxNode
*node
= m_properties
.First();
996 wxProperty
*prop
= (wxProperty
*)node
->Data();
997 prop
->GetValue().SetModified(flag
);
1003 * Property validator registry
1007 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValidatorRegistry
, wxHashTable
)
1009 wxPropertyValidatorRegistry::wxPropertyValidatorRegistry(void):wxHashTable(wxKEY_STRING
)
1013 wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void)
1018 void wxPropertyValidatorRegistry::RegisterValidator(const wxString
& typeName
, wxPropertyValidator
*validator
)
1020 Put((const wxChar
*) typeName
, validator
);
1023 wxPropertyValidator
*wxPropertyValidatorRegistry::GetValidator(const wxString
& typeName
)
1025 return (wxPropertyValidator
*)Get((const wxChar
*) typeName
);
1028 void wxPropertyValidatorRegistry::ClearRegistry(void)
1032 while ((node
= Next()) != NULL
)
1034 delete (wxPropertyValidator
*)node
->Data();
1039 * Property validator
1043 IMPLEMENT_ABSTRACT_CLASS(wxPropertyValidator
, wxEvtHandler
)
1045 wxPropertyValidator::wxPropertyValidator(long flags
)
1047 m_validatorFlags
= flags
;
1048 m_validatorProperty
= NULL
;
1051 wxPropertyValidator::~wxPropertyValidator(void)
1054 bool wxPropertyValidator::StringToFloat (wxChar
*s
, float *number
) {
1056 bool ok
= StringToDouble (s
, &num
);
1057 *number
= (float) num
;
1061 bool wxPropertyValidator::StringToDouble (wxChar
*s
, double *number
) {
1064 *number
= wxStrtod (s
, &value_ptr
);
1066 int len
= wxStrlen (value_ptr
);
1067 for (int i
= 0; i
< len
; i
++) {
1068 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1069 if (!ok
) return FALSE
;
1075 bool wxPropertyValidator::StringToInt (wxChar
*s
, int *number
) {
1077 bool ok
= StringToLong (s
, &num
);
1078 *number
= (int) num
;
1082 bool wxPropertyValidator::StringToLong (wxChar
*s
, long *number
) {
1085 *number
= wxStrtol (s
, &value_ptr
, 10);
1087 int len
= wxStrlen (value_ptr
);
1088 for (int i
= 0; i
< len
; i
++) {
1089 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1090 if (!ok
) return FALSE
;
1096 wxChar
*wxPropertyValidator::FloatToString (float number
) {
1097 static wxChar buf
[20];
1098 wxSprintf (buf
, _T("%.6g"), number
);
1102 wxChar
*wxPropertyValidator::DoubleToString (double number
) {
1103 static wxChar buf
[20];
1104 wxSprintf (buf
, _T("%.6g"), number
);
1108 wxChar
*wxPropertyValidator::IntToString (int number
) {
1109 return ::IntToString (number
);
1112 wxChar
*wxPropertyValidator::LongToString (long number
) {
1113 return ::LongToString (number
);