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
:
331 wxFAIL_MSG( _T("Should never get here!\n" ) );
337 void wxPropertyValue::Copy(wxPropertyValue
& copyFrom
)
339 m_type
= copyFrom
.Type();
343 case wxPropertyValueInteger
:
344 (*this) = copyFrom
.IntegerValue();
347 case wxPropertyValueReal
:
348 (*this) = copyFrom
.RealValue();
351 case wxPropertyValueString
:
352 (*this) = wxString(copyFrom
.StringValue());
355 case wxPropertyValuebool
:
356 (*this) = copyFrom
.BoolValue();
360 case wxPropertyValueboolPtr
:
361 (*this) = copyFrom
.BoolValuePtr();
363 case wxPropertyValueRealPtr
:
364 (*this) = copyFrom
.RealValuePtr();
366 case wxPropertyValueIntegerPtr
:
367 (*this) = copyFrom
.IntegerValuePtr();
369 case wxPropertyValueStringPtr
:
371 wxChar
** s
= copyFrom
.StringValuePtr();
372 // what is this? are you trying to assign a bool or a string? VA can't figure it out..
373 #if defined(__VISAGECPP__) || defined( __VISUALC__ )
381 case wxPropertyValueList
:
383 m_value
.first
= NULL
;
386 wxPropertyValue
*expr
= copyFrom
.m_value
.first
;
389 wxPropertyValue
*expr2
= expr
->NewCopy();
395 case wxPropertyValueNull
:
396 wxFAIL_MSG( _T("Should never get here!\n" ) );
401 // Return nth argument of a clause (starting from 1)
402 wxPropertyValue
*wxPropertyValue::Arg(wxPropertyValueType type
, int arg
) const
404 wxPropertyValue
*expr
= m_value
.first
;
405 for (int i
= 1; i
< arg
; i
++)
409 if (expr
&& (expr
->m_type
== type
))
415 // Return nth argument of a list expression (starting from zero)
416 wxPropertyValue
*wxPropertyValue::Nth(int arg
) const
418 if (m_type
!= wxPropertyValueList
)
421 wxPropertyValue
*expr
= m_value
.first
;
422 for (int i
= 0; i
< arg
; i
++)
433 // Returns the number of elements in a list expression
434 int wxPropertyValue::Number(void) const
436 if (m_type
!= wxPropertyValueList
)
440 wxPropertyValue
*expr
= m_value
.first
;
449 void wxPropertyValue::WritePropertyClause(wxString
& stream
) // Write this expression as a top-level clause
451 if (m_type
!= wxPropertyValueList
)
454 wxPropertyValue
*node
= m_value
.first
;
457 node
->WritePropertyType(stream
);
458 stream
.Append( _T("(") );
464 stream
.Append( _T(" ") );
465 node
->WritePropertyType(stream
);
468 stream
.Append( _T(",\n" ) );
471 stream
.Append( _T(").\n\n") );
475 void wxPropertyValue::WritePropertyType(wxString
& stream
) // Write as any other subexpression
480 case wxPropertyValueInteger
:
482 tmp
.Printf( _T("%ld"), m_value
.integer
);
483 stream
.Append( tmp
);
486 case wxPropertyValueIntegerPtr
:
488 tmp
.Printf( _T("%ld"), *m_value
.integerPtr
);
489 stream
.Append( tmp
);
492 case wxPropertyValuebool
:
495 stream
.Append( _T("True") );
497 stream
.Append( _T("False") );
500 case wxPropertyValueboolPtr
:
502 if (*m_value
.integerPtr
)
503 stream
.Append( _T("True") );
505 stream
.Append( _T("False") );
508 case wxPropertyValueReal
:
510 double d
= m_value
.real
;
511 tmp
.Printf( _T("%.6g"), d
);
512 stream
.Append( tmp
);
515 case wxPropertyValueRealPtr
:
517 double d
= *m_value
.realPtr
;
518 tmp
.Printf( _T("%.6g"), d
);
519 stream
.Append( tmp
);
522 case wxPropertyValueString
:
524 stream
.Append( m_value
.string
);
527 case wxPropertyValueStringPtr
:
529 wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
532 int len = strlen(*(m_value.stringPtr));
533 for (i = 0; i < len; i++)
535 char ch = *(m_value.stringPtr)[i];
541 case wxPropertyValueList
:
544 stream
.Append( _T("[]") );
547 wxPropertyValue
*expr
= m_value
.first
;
549 stream
.Append( _T("[") );
552 expr
->WritePropertyType(stream
);
555 stream
.Append( _T(", ") );
557 stream
.Append( _T("]") );
561 case wxPropertyValueNull
: break;
565 wxString
wxPropertyValue::GetStringRepresentation(void)
568 WritePropertyType(str
);
572 void wxPropertyValue::operator=(const wxPropertyValue
& val
)
574 m_modifiedFlag
= TRUE
;
575 Copy((wxPropertyValue
&)val
);
578 // void wxPropertyValue::operator=(const char *val)
579 void wxPropertyValue::operator=(const wxString
& val1
)
581 const wxChar
*val
= (const wxChar
*)val1
;
583 m_modifiedFlag
= TRUE
;
584 if (m_type
== wxPropertyValueNull
)
585 m_type
= wxPropertyValueString
;
587 if (m_type
== wxPropertyValueString
)
590 m_value
.string
= copystring(val
);
592 m_value
.string
= NULL
;
594 else if (m_type
== wxPropertyValueStringPtr
)
596 if (*m_value
.stringPtr
)
597 delete[] *m_value
.stringPtr
;
599 *m_value
.stringPtr
= copystring(val
);
601 *m_value
.stringPtr
= NULL
;
610 void wxPropertyValue::operator=(const long val
)
612 m_modifiedFlag
= TRUE
;
613 if (m_type
== wxPropertyValueNull
)
614 m_type
= wxPropertyValueInteger
;
616 if (m_type
== wxPropertyValueInteger
)
617 m_value
.integer
= val
;
618 else if (m_type
== wxPropertyValueIntegerPtr
)
619 *m_value
.integerPtr
= val
;
620 else if (m_type
== wxPropertyValueReal
)
621 m_value
.real
= (float)val
;
622 else if (m_type
== wxPropertyValueRealPtr
)
623 *m_value
.realPtr
= (float)val
;
629 void wxPropertyValue::operator=(const bool val
)
631 m_modifiedFlag
= TRUE
;
632 if (m_type
== wxPropertyValueNull
)
633 m_type
= wxPropertyValuebool
;
635 if (m_type
== wxPropertyValuebool
)
636 m_value
.integer
= (long)val
;
637 else if (m_type
== wxPropertyValueboolPtr
)
638 *m_value
.boolPtr
= val
;
644 void wxPropertyValue::operator=(const float val
)
646 m_modifiedFlag
= TRUE
;
647 if (m_type
== wxPropertyValueNull
)
648 m_type
= wxPropertyValueReal
;
650 if (m_type
== wxPropertyValueInteger
)
651 m_value
.integer
= (long)val
;
652 else if (m_type
== wxPropertyValueIntegerPtr
)
653 *m_value
.integerPtr
= (long)val
;
654 else if (m_type
== wxPropertyValueReal
)
656 else if (m_type
== wxPropertyValueRealPtr
)
657 *m_value
.realPtr
= val
;
663 void wxPropertyValue::operator=(const wxChar
**val
)
665 m_modifiedFlag
= TRUE
;
666 m_type
= wxPropertyValueStringPtr
;
669 m_value
.stringPtr
= (wxChar
**)val
;
671 m_value
.stringPtr
= NULL
;
678 void wxPropertyValue::operator=(const long *val
)
680 m_modifiedFlag
= TRUE
;
681 m_type
= wxPropertyValueIntegerPtr
;
682 m_value
.integerPtr
= (long *)val
;
687 void wxPropertyValue::operator=(const bool *val
)
689 m_modifiedFlag
= TRUE
;
690 m_type
= wxPropertyValueboolPtr
;
691 m_value
.boolPtr
= (bool *)val
;
696 void wxPropertyValue::operator=(const float *val
)
698 m_modifiedFlag
= TRUE
;
699 m_type
= wxPropertyValueRealPtr
;
700 m_value
.realPtr
= (float *)val
;
705 long wxPropertyValue::IntegerValue(void) const
707 if (m_type
== wxPropertyValueInteger
)
708 return m_value
.integer
;
709 else if (m_type
== wxPropertyValueReal
)
710 return (long)m_value
.real
;
711 else if (m_type
== wxPropertyValueIntegerPtr
)
712 return *m_value
.integerPtr
;
713 else if (m_type
== wxPropertyValueRealPtr
)
714 return (long)(*m_value
.realPtr
);
718 long *wxPropertyValue::IntegerValuePtr(void) const
720 return m_value
.integerPtr
;
723 float wxPropertyValue::RealValue(void) const {
724 if (m_type
== wxPropertyValueReal
)
726 else if (m_type
== wxPropertyValueRealPtr
)
727 return *m_value
.realPtr
;
728 else if (m_type
== wxPropertyValueInteger
)
729 return (float)m_value
.integer
;
730 else if (m_type
== wxPropertyValueIntegerPtr
)
731 return (float)*(m_value
.integerPtr
);
735 float *wxPropertyValue::RealValuePtr(void) const
737 return m_value
.realPtr
;
740 bool wxPropertyValue::BoolValue(void) const {
741 if (m_type
== wxPropertyValueReal
)
742 return (m_value
.real
!= 0.0);
743 if (m_type
== wxPropertyValueRealPtr
)
744 return (*(m_value
.realPtr
) != 0.0);
745 else if (m_type
== wxPropertyValueInteger
)
746 return (m_value
.integer
!= 0);
747 else if (m_type
== wxPropertyValueIntegerPtr
)
748 return (*(m_value
.integerPtr
) != 0);
749 else if (m_type
== wxPropertyValuebool
)
750 return (m_value
.integer
!= 0);
751 else if (m_type
== wxPropertyValueboolPtr
)
752 return (*(m_value
.boolPtr
) != 0);
756 bool *wxPropertyValue::BoolValuePtr(void) const
758 return m_value
.boolPtr
;
761 wxChar
*wxPropertyValue::StringValue(void) const {
762 if (m_type
== wxPropertyValueString
)
763 return m_value
.string
;
764 else if (m_type
== wxPropertyValueStringPtr
)
765 return *(m_value
.stringPtr
);
769 wxChar
**wxPropertyValue::StringValuePtr(void) const
771 return m_value
.stringPtr
;
775 * A property (name plus value)
778 IMPLEMENT_DYNAMIC_CLASS(wxProperty
, wxObject
)
780 wxProperty::wxProperty(void)
782 m_propertyRole
= wxEmptyString
;
783 m_propertyValidator
= NULL
;
784 m_propertyWindow
= NULL
;
788 wxProperty::wxProperty(wxProperty
& copyFrom
)
790 m_value
= copyFrom
.GetValue();
791 m_name
= copyFrom
.GetName();
792 m_propertyRole
= copyFrom
.GetRole();
793 m_propertyValidator
= copyFrom
.GetValidator();
794 m_enabled
= copyFrom
.IsEnabled();
795 m_propertyWindow
= NULL
;
798 wxProperty::wxProperty(wxString nm
, wxString role
, wxPropertyValidator
*ed
):m_name(nm
), m_propertyRole(role
)
800 m_propertyValidator
= ed
;
801 m_propertyWindow
= NULL
;
805 wxProperty::wxProperty(wxString nm
, const wxPropertyValue
& val
, wxString role
, wxPropertyValidator
*ed
):
806 m_value(val
), m_name(nm
), m_propertyRole(role
)
808 m_propertyValidator
= ed
;
809 m_propertyWindow
= NULL
;
813 wxProperty::~wxProperty(void)
815 if (m_propertyValidator
)
816 delete m_propertyValidator
;
819 wxPropertyValue
& wxProperty::GetValue(void) const
821 return (wxPropertyValue
&) m_value
;
824 wxPropertyValidator
*wxProperty::GetValidator(void) const
826 return m_propertyValidator
;
829 wxString
& wxProperty::GetName(void) const
831 return (wxString
&) m_name
;
834 wxString
& wxProperty::GetRole(void) const
836 return (wxString
&) m_propertyRole
;
839 void wxProperty::SetValue(const wxPropertyValue
& val
)
844 void wxProperty::SetValidator(wxPropertyValidator
*ed
)
846 m_propertyValidator
= ed
;
849 void wxProperty::SetRole(wxString
& role
)
851 m_propertyRole
= role
;
854 void wxProperty::SetName(wxString
& nm
)
859 void wxProperty::operator=(const wxPropertyValue
& val
)
865 * Base property view class
868 IMPLEMENT_DYNAMIC_CLASS(wxPropertyView
, wxEvtHandler
)
870 wxPropertyView::wxPropertyView(long flags
)
872 m_buttonFlags
= flags
;
873 m_propertySheet
= NULL
;
874 m_currentValidator
= NULL
;
875 m_currentProperty
= NULL
;
878 wxPropertyView::~wxPropertyView(void)
882 void wxPropertyView::AddRegistry(wxPropertyValidatorRegistry
*registry
)
884 m_validatorRegistryList
.Append(registry
);
887 wxPropertyValidator
*wxPropertyView::FindPropertyValidator(wxProperty
*property
)
889 if (property
->GetValidator())
890 return property
->GetValidator();
892 wxNode
*node
= m_validatorRegistryList
.First();
895 wxPropertyValidatorRegistry
*registry
= (wxPropertyValidatorRegistry
*)node
->Data();
896 wxPropertyValidator
*validator
= registry
->GetValidator(property
->GetRole());
903 if (!wxDefaultPropertyValidator)
904 wxDefaultPropertyValidator = new wxPropertyListValidator;
905 return wxDefaultPropertyValidator;
913 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet
, wxObject
)
915 wxPropertySheet::wxPropertySheet(const wxString
& name
)
916 :m_properties(wxKEY_STRING
),m_name(name
)
920 wxPropertySheet::~wxPropertySheet(void)
925 void wxPropertySheet::UpdateAllViews( wxPropertyView
*WXUNUSED(thisView
) )
930 void wxPropertySheet::AddProperty(wxProperty
*property
)
932 m_properties
.Append((const wxChar
*) property
->GetName(), property
);
935 // Get property by name
936 wxProperty
*wxPropertySheet::GetProperty(const wxString
& name
) const
938 wxNode
*node
= m_properties
.Find((const wxChar
*) name
);
942 return (wxProperty
*)node
->Data();
945 bool wxPropertySheet::SetProperty(const wxString
& name
, const wxPropertyValue
& value
)
947 wxProperty
* prop
= GetProperty(name
);
949 prop
->SetValue(value
);
956 void wxPropertySheet::RemoveProperty(const wxString
& name
)
958 wxNode
*node
= m_properties
.Find(name
);
961 wxProperty
*prop
= (wxProperty
*)node
->Data();
963 m_properties
.DeleteNode(node
);
967 bool wxPropertySheet::HasProperty(const wxString
& name
) const
969 return (GetProperty(name
)?TRUE
:FALSE
);
972 // Clear all properties
973 void wxPropertySheet::Clear(void)
975 wxNode
*node
= m_properties
.First();
978 wxProperty
*prop
= (wxProperty
*)node
->Data();
979 wxNode
*next
= node
->Next();
986 // Sets/clears the modified flag for each property value
987 void wxPropertySheet::SetAllModified(bool flag
)
989 wxNode
*node
= m_properties
.First();
992 wxProperty
*prop
= (wxProperty
*)node
->Data();
993 prop
->GetValue().SetModified(flag
);
999 * Property validator registry
1003 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValidatorRegistry
, wxHashTable
)
1005 wxPropertyValidatorRegistry::wxPropertyValidatorRegistry(void):wxHashTable(wxKEY_STRING
)
1009 wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void)
1014 void wxPropertyValidatorRegistry::RegisterValidator(const wxString
& typeName
, wxPropertyValidator
*validator
)
1016 Put((const wxChar
*) typeName
, validator
);
1019 wxPropertyValidator
*wxPropertyValidatorRegistry::GetValidator(const wxString
& typeName
)
1021 return (wxPropertyValidator
*)Get((const wxChar
*) typeName
);
1024 void wxPropertyValidatorRegistry::ClearRegistry(void)
1028 while ((node
= Next()) != NULL
)
1030 delete (wxPropertyValidator
*)node
->Data();
1035 * Property validator
1039 IMPLEMENT_ABSTRACT_CLASS(wxPropertyValidator
, wxEvtHandler
)
1041 wxPropertyValidator::wxPropertyValidator(long flags
)
1043 m_validatorFlags
= flags
;
1044 m_validatorProperty
= NULL
;
1047 wxPropertyValidator::~wxPropertyValidator(void)
1050 bool wxPropertyValidator::StringToFloat (wxChar
*s
, float *number
) {
1052 bool ok
= StringToDouble (s
, &num
);
1053 *number
= (float) num
;
1057 bool wxPropertyValidator::StringToDouble (wxChar
*s
, double *number
) {
1060 *number
= wxStrtod (s
, &value_ptr
);
1062 int len
= wxStrlen (value_ptr
);
1063 for (int i
= 0; i
< len
; i
++) {
1064 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1065 if (!ok
) return FALSE
;
1071 bool wxPropertyValidator::StringToInt (wxChar
*s
, int *number
) {
1073 bool ok
= StringToLong (s
, &num
);
1074 *number
= (int) num
;
1078 bool wxPropertyValidator::StringToLong (wxChar
*s
, long *number
) {
1081 *number
= wxStrtol (s
, &value_ptr
, 10);
1083 int len
= wxStrlen (value_ptr
);
1084 for (int i
= 0; i
< len
; i
++) {
1085 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1086 if (!ok
) return FALSE
;
1092 wxChar
*wxPropertyValidator::FloatToString (float number
) {
1093 static wxChar buf
[20];
1094 wxSprintf (buf
, _T("%.6g"), number
);
1098 wxChar
*wxPropertyValidator::DoubleToString (double number
) {
1099 static wxChar buf
[20];
1100 wxSprintf (buf
, _T("%.6g"), number
);
1104 wxChar
*wxPropertyValidator::IntToString (int number
) {
1105 return ::IntToString (number
);
1108 wxChar
*wxPropertyValidator::LongToString (long number
) {
1109 return ::LongToString (number
);