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"
33 #if defined(__WXMSW__) && !defined(__GNUWIN32__)
36 #include <strstream.h>
42 #include "wx/window.h"
48 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValue
, wxObject
)
50 wxPropertyValue::wxPropertyValue(void)
52 m_type
= wxPropertyValueNull
;
57 m_modifiedFlag
= FALSE
;
60 wxPropertyValue::wxPropertyValue(const wxPropertyValue
& copyFrom
)
62 m_modifiedFlag
= FALSE
;
63 Copy((wxPropertyValue
& )copyFrom
);
66 wxPropertyValue::wxPropertyValue(const wxChar
*val
)
68 m_modifiedFlag
= FALSE
;
69 m_type
= wxPropertyValueString
;
71 m_value
.string
= copystring(val
);
77 wxPropertyValue::wxPropertyValue(const wxString
& val
)
79 m_modifiedFlag
= FALSE
;
80 m_type
= wxPropertyValueString
;
82 m_value
.string
= copystring((const wxChar
*)val
);
88 wxPropertyValue::wxPropertyValue(long the_integer
)
90 m_modifiedFlag
= FALSE
;
91 m_type
= wxPropertyValueInteger
;
92 m_value
.integer
= the_integer
;
97 wxPropertyValue::wxPropertyValue(bool val
)
99 m_modifiedFlag
= FALSE
;
100 m_type
= wxPropertyValuebool
;
101 m_value
.integer
= val
;
106 wxPropertyValue::wxPropertyValue(float the_real
)
108 m_modifiedFlag
= FALSE
;
109 m_type
= wxPropertyValueReal
;
110 m_value
.real
= the_real
;
115 wxPropertyValue::wxPropertyValue(double the_real
)
117 m_modifiedFlag
= FALSE
;
118 m_type
= wxPropertyValueReal
;
119 m_value
.real
= (float)the_real
;
124 // Pointer versions: we have a pointer to the real C++ value.
125 wxPropertyValue::wxPropertyValue(wxChar
**val
)
127 m_modifiedFlag
= FALSE
;
128 m_type
= wxPropertyValueStringPtr
;
130 m_value
.stringPtr
= val
;
136 wxPropertyValue::wxPropertyValue(long *val
)
138 m_modifiedFlag
= FALSE
;
139 m_type
= wxPropertyValueIntegerPtr
;
140 m_value
.integerPtr
= val
;
145 wxPropertyValue::wxPropertyValue(bool *val
)
147 m_modifiedFlag
= FALSE
;
148 m_type
= wxPropertyValueboolPtr
;
149 m_value
.boolPtr
= val
;
154 wxPropertyValue::wxPropertyValue(float *val
)
156 m_modifiedFlag
= FALSE
;
157 m_type
= wxPropertyValueRealPtr
;
158 m_value
.realPtr
= val
;
163 wxPropertyValue::wxPropertyValue(wxList
*the_list
)
165 m_modifiedFlag
= FALSE
;
166 m_type
= wxPropertyValueList
;
169 m_value
.first
= NULL
;
171 wxNode
*node
= the_list
->First();
174 wxPropertyValue
*expr
= (wxPropertyValue
*)node
->Data();
182 wxPropertyValue::wxPropertyValue(wxStringList
*the_list
)
184 m_modifiedFlag
= FALSE
;
185 m_type
= wxPropertyValueList
;
188 m_value
.first
= NULL
;
190 wxNode
*node
= the_list
->First();
193 char *s
= (char *)node
->Data();
194 Append(new wxPropertyValue(s
));
200 wxPropertyValue::~wxPropertyValue(void)
204 case wxPropertyValueInteger
:
205 case wxPropertyValuebool
:
206 case wxPropertyValueReal
:
210 case wxPropertyValueString
:
212 delete[] m_value
.string
;
215 case wxPropertyValueList
:
217 wxPropertyValue
*expr
= m_value
.first
;
220 wxPropertyValue
*expr1
= expr
->m_next
;
228 case wxPropertyValueNull
: break;
232 void wxPropertyValue::Append(wxPropertyValue
*expr
)
234 m_modifiedFlag
= TRUE
;
236 m_value
.first
= expr
;
239 m_last
->m_next
= expr
;
243 void wxPropertyValue::Insert(wxPropertyValue
*expr
)
245 m_modifiedFlag
= TRUE
;
246 expr
->m_next
= m_value
.first
;
247 m_value
.first
= expr
;
254 void wxPropertyValue::Delete(wxPropertyValue
*node
)
256 wxPropertyValue
*expr
= GetFirst();
258 wxPropertyValue
*previous
= NULL
;
259 while (expr
&& (expr
!= node
))
262 expr
= expr
->GetNext();
268 previous
->m_next
= expr
->m_next
;
270 // If node was the first in the list,
271 // make the list point to the NEXT one.
272 if (GetFirst() == expr
)
274 m_value
.first
= expr
->m_next
;
277 // If node was the last in the list,
278 // make the list 'last' pointer point to the PREVIOUS one.
279 if (GetLast() == expr
)
286 m_modifiedFlag
= TRUE
;
292 void wxPropertyValue::ClearList(void)
294 wxPropertyValue
*val
= GetFirst();
296 m_modifiedFlag
= TRUE
;
300 wxPropertyValue
*next
= val
->GetNext();
304 m_value
.first
= NULL
;
308 wxPropertyValue
*wxPropertyValue::NewCopy(void) const
312 case wxPropertyValueInteger
:
313 return new wxPropertyValue(m_value
.integer
);
314 case wxPropertyValuebool
:
315 return new wxPropertyValue((bool) (m_value
.integer
!= 0));
316 case wxPropertyValueReal
:
317 return new wxPropertyValue(m_value
.real
);
318 case wxPropertyValueString
:
319 return new wxPropertyValue(m_value
.string
);
320 case wxPropertyValueList
:
322 wxPropertyValue
*expr
= m_value
.first
;
323 wxPropertyValue
*new_list
= new wxPropertyValue
;
324 new_list
->SetType(wxPropertyValueList
);
327 wxPropertyValue
*expr2
= expr
->NewCopy();
328 new_list
->Append(expr2
);
333 case wxPropertyValueIntegerPtr
:
334 return new wxPropertyValue(m_value
.integerPtr
);
335 case wxPropertyValueRealPtr
:
336 return new wxPropertyValue(m_value
.realPtr
);
337 case wxPropertyValueboolPtr
:
338 return new wxPropertyValue(m_value
.boolPtr
);
339 case wxPropertyValueStringPtr
:
340 return new wxPropertyValue(m_value
.stringPtr
);
342 case wxPropertyValueNull
:
344 cerr
<< "Should never get here!\n";
351 void wxPropertyValue::Copy(wxPropertyValue
& copyFrom
)
353 m_type
= copyFrom
.Type();
357 case wxPropertyValueInteger
:
358 (*this) = copyFrom
.IntegerValue();
361 case wxPropertyValueReal
:
362 (*this) = copyFrom
.RealValue();
365 case wxPropertyValueString
:
366 (*this) = wxString(copyFrom
.StringValue());
369 case wxPropertyValuebool
:
370 (*this) = copyFrom
.BoolValue();
374 case wxPropertyValueboolPtr
:
375 (*this) = copyFrom
.BoolValuePtr();
377 case wxPropertyValueRealPtr
:
378 (*this) = copyFrom
.RealValuePtr();
380 case wxPropertyValueIntegerPtr
:
381 (*this) = copyFrom
.IntegerValuePtr();
383 case wxPropertyValueStringPtr
:
385 wxChar
** s
= copyFrom
.StringValuePtr();
390 case wxPropertyValueList
:
392 m_value
.first
= NULL
;
395 wxPropertyValue
*expr
= copyFrom
.m_value
.first
;
398 wxPropertyValue
*expr2
= expr
->NewCopy();
404 case wxPropertyValueNull
:
406 cerr
<< "Should never get here!\n";
412 // Return nth argument of a clause (starting from 1)
413 wxPropertyValue
*wxPropertyValue::Arg(wxPropertyValueType type
, int arg
) const
415 wxPropertyValue
*expr
= m_value
.first
;
416 for (int i
= 1; i
< arg
; i
++)
420 if (expr
&& (expr
->m_type
== type
))
426 // Return nth argument of a list expression (starting from zero)
427 wxPropertyValue
*wxPropertyValue::Nth(int arg
) const
429 if (m_type
!= wxPropertyValueList
)
432 wxPropertyValue
*expr
= m_value
.first
;
433 for (int i
= 0; i
< arg
; i
++)
444 // Returns the number of elements in a list expression
445 int wxPropertyValue::Number(void) const
447 if (m_type
!= wxPropertyValueList
)
451 wxPropertyValue
*expr
= m_value
.first
;
460 void wxPropertyValue::WritePropertyClause(ostream
& stream
) // Write this expression as a top-level clause
462 if (m_type
!= wxPropertyValueList
)
465 wxPropertyValue
*node
= m_value
.first
;
468 node
->WritePropertyType(stream
);
476 node
->WritePropertyType(stream
);
478 if (node
) stream
<< ",\n";
485 void wxPropertyValue::WritePropertyType(ostream
& stream
) // Write as any other subexpression
489 case wxPropertyValueInteger
:
491 stream
<< m_value
.integer
;
494 case wxPropertyValueIntegerPtr
:
496 stream
<< *m_value
.integerPtr
;
499 case wxPropertyValuebool
:
507 case wxPropertyValueboolPtr
:
509 if (*m_value
.integerPtr
)
515 case wxPropertyValueReal
:
517 float f
= m_value
.real
;
518 wxSprintf(wxBuffer
, _T("%.6g"), (double)f
);
522 case wxPropertyValueRealPtr
:
524 float f
= *m_value
.realPtr
;
525 /* Now the parser can cope with this.
526 // Prevent printing in 'e' notation. Any better way?
527 if (fabs(f) < 0.00001)
530 wxSprintf(wxBuffer
, _T("%.6g"), f
);
534 case wxPropertyValueString
:
538 wxWX2MBbuf strbuf
= wxConv_libc
.cWX2MB(m_value
.string
);
539 int len
= strlen(strbuf
);
540 for (i
= 0; i
< len
; i
++)
543 // if (ch == '"' || ch == '\\')
551 case wxPropertyValueStringPtr
:
553 wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
556 int len = strlen(*(m_value.stringPtr));
557 for (i = 0; i < len; i++)
559 char ch = *(m_value.stringPtr)[i];
565 case wxPropertyValueList
:
571 wxPropertyValue
*expr
= m_value
.first
;
576 expr
->WritePropertyType(stream
);
578 if (expr
) stream
<< ", ";
584 case wxPropertyValueNull
: break;
588 wxString
wxPropertyValue::GetStringRepresentation(void)
593 ostrstream
str((char *)buf
, (int)500, ios::out
);
594 WritePropertyType(str
);
598 wxString
theString(buf
);
602 void wxPropertyValue::operator=(const wxPropertyValue
& val
)
604 m_modifiedFlag
= TRUE
;
605 Copy((wxPropertyValue
&)val
);
608 // void wxPropertyValue::operator=(const char *val)
609 void wxPropertyValue::operator=(const wxString
& val1
)
611 const wxChar
*val
= (const wxChar
*)val1
;
613 m_modifiedFlag
= TRUE
;
614 if (m_type
== wxPropertyValueNull
)
615 m_type
= wxPropertyValueString
;
617 if (m_type
== wxPropertyValueString
)
620 m_value
.string
= copystring(val
);
622 m_value
.string
= NULL
;
624 else if (m_type
== wxPropertyValueStringPtr
)
626 if (*m_value
.stringPtr
)
627 delete[] *m_value
.stringPtr
;
629 *m_value
.stringPtr
= copystring(val
);
631 *m_value
.stringPtr
= NULL
;
640 void wxPropertyValue::operator=(const long val
)
642 m_modifiedFlag
= TRUE
;
643 if (m_type
== wxPropertyValueNull
)
644 m_type
= wxPropertyValueInteger
;
646 if (m_type
== wxPropertyValueInteger
)
647 m_value
.integer
= val
;
648 else if (m_type
== wxPropertyValueIntegerPtr
)
649 *m_value
.integerPtr
= val
;
650 else if (m_type
== wxPropertyValueReal
)
651 m_value
.real
= (float)val
;
652 else if (m_type
== wxPropertyValueRealPtr
)
653 *m_value
.realPtr
= (float)val
;
659 void wxPropertyValue::operator=(const bool val
)
661 m_modifiedFlag
= TRUE
;
662 if (m_type
== wxPropertyValueNull
)
663 m_type
= wxPropertyValuebool
;
665 if (m_type
== wxPropertyValuebool
)
666 m_value
.integer
= (long)val
;
667 else if (m_type
== wxPropertyValueboolPtr
)
668 *m_value
.boolPtr
= val
;
674 void wxPropertyValue::operator=(const float val
)
676 m_modifiedFlag
= TRUE
;
677 if (m_type
== wxPropertyValueNull
)
678 m_type
= wxPropertyValueReal
;
680 if (m_type
== wxPropertyValueInteger
)
681 m_value
.integer
= (long)val
;
682 else if (m_type
== wxPropertyValueIntegerPtr
)
683 *m_value
.integerPtr
= (long)val
;
684 else if (m_type
== wxPropertyValueReal
)
686 else if (m_type
== wxPropertyValueRealPtr
)
687 *m_value
.realPtr
= val
;
693 void wxPropertyValue::operator=(const wxChar
**val
)
695 m_modifiedFlag
= TRUE
;
696 m_type
= wxPropertyValueStringPtr
;
699 m_value
.stringPtr
= (wxChar
**)val
;
701 m_value
.stringPtr
= NULL
;
708 void wxPropertyValue::operator=(const long *val
)
710 m_modifiedFlag
= TRUE
;
711 m_type
= wxPropertyValueIntegerPtr
;
712 m_value
.integerPtr
= (long *)val
;
717 void wxPropertyValue::operator=(const bool *val
)
719 m_modifiedFlag
= TRUE
;
720 m_type
= wxPropertyValueboolPtr
;
721 m_value
.boolPtr
= (bool *)val
;
726 void wxPropertyValue::operator=(const float *val
)
728 m_modifiedFlag
= TRUE
;
729 m_type
= wxPropertyValueRealPtr
;
730 m_value
.realPtr
= (float *)val
;
735 long wxPropertyValue::IntegerValue(void) const
737 if (m_type
== wxPropertyValueInteger
)
738 return m_value
.integer
;
739 else if (m_type
== wxPropertyValueReal
)
740 return (long)m_value
.real
;
741 else if (m_type
== wxPropertyValueIntegerPtr
)
742 return *m_value
.integerPtr
;
743 else if (m_type
== wxPropertyValueRealPtr
)
744 return (long)(*m_value
.realPtr
);
748 long *wxPropertyValue::IntegerValuePtr(void) const
750 return m_value
.integerPtr
;
753 float wxPropertyValue::RealValue(void) const {
754 if (m_type
== wxPropertyValueReal
)
756 else if (m_type
== wxPropertyValueRealPtr
)
757 return *m_value
.realPtr
;
758 else if (m_type
== wxPropertyValueInteger
)
759 return (float)m_value
.integer
;
760 else if (m_type
== wxPropertyValueIntegerPtr
)
761 return (float)*(m_value
.integerPtr
);
765 float *wxPropertyValue::RealValuePtr(void) const
767 return m_value
.realPtr
;
770 bool wxPropertyValue::BoolValue(void) const {
771 if (m_type
== wxPropertyValueReal
)
772 return (m_value
.real
!= 0.0);
773 if (m_type
== wxPropertyValueRealPtr
)
774 return (*(m_value
.realPtr
) != 0.0);
775 else if (m_type
== wxPropertyValueInteger
)
776 return (m_value
.integer
!= 0);
777 else if (m_type
== wxPropertyValueIntegerPtr
)
778 return (*(m_value
.integerPtr
) != 0);
779 else if (m_type
== wxPropertyValuebool
)
780 return (m_value
.integer
!= 0);
781 else if (m_type
== wxPropertyValueboolPtr
)
782 return (*(m_value
.boolPtr
) != 0);
786 bool *wxPropertyValue::BoolValuePtr(void) const
788 return m_value
.boolPtr
;
791 wxChar
*wxPropertyValue::StringValue(void) const {
792 if (m_type
== wxPropertyValueString
)
793 return m_value
.string
;
794 else if (m_type
== wxPropertyValueStringPtr
)
795 return *(m_value
.stringPtr
);
799 wxChar
**wxPropertyValue::StringValuePtr(void) const
801 return m_value
.stringPtr
;
805 * A property (name plus value)
808 IMPLEMENT_DYNAMIC_CLASS(wxProperty
, wxObject
)
810 wxProperty::wxProperty(void)
812 m_propertyRole
= wxEmptyString
;
813 m_propertyValidator
= NULL
;
814 m_propertyWindow
= NULL
;
818 wxProperty::wxProperty(wxProperty
& copyFrom
)
820 m_value
= copyFrom
.GetValue();
821 m_name
= copyFrom
.GetName();
822 m_propertyRole
= copyFrom
.GetRole();
823 m_propertyValidator
= copyFrom
.GetValidator();
824 m_enabled
= copyFrom
.IsEnabled();
825 m_propertyWindow
= NULL
;
828 wxProperty::wxProperty(wxString nm
, wxString role
, wxPropertyValidator
*ed
):m_name(nm
), m_propertyRole(role
)
830 m_propertyValidator
= ed
;
831 m_propertyWindow
= NULL
;
835 wxProperty::wxProperty(wxString nm
, const wxPropertyValue
& val
, wxString role
, wxPropertyValidator
*ed
):
836 m_value(val
), m_name(nm
), m_propertyRole(role
)
838 m_propertyValidator
= ed
;
839 m_propertyWindow
= NULL
;
843 wxProperty::~wxProperty(void)
845 if (m_propertyValidator
)
846 delete m_propertyValidator
;
849 wxPropertyValue
& wxProperty::GetValue(void) const
851 return (wxPropertyValue
&) m_value
;
854 wxPropertyValidator
*wxProperty::GetValidator(void) const
856 return m_propertyValidator
;
859 wxString
& wxProperty::GetName(void) const
861 return (wxString
&) m_name
;
864 wxString
& wxProperty::GetRole(void) const
866 return (wxString
&) m_propertyRole
;
869 void wxProperty::SetValue(const wxPropertyValue
& val
)
874 void wxProperty::SetValidator(wxPropertyValidator
*ed
)
876 m_propertyValidator
= ed
;
879 void wxProperty::SetRole(wxString
& role
)
881 m_propertyRole
= role
;
884 void wxProperty::SetName(wxString
& nm
)
889 void wxProperty::operator=(const wxPropertyValue
& val
)
895 * Base property view class
898 IMPLEMENT_DYNAMIC_CLASS(wxPropertyView
, wxEvtHandler
)
900 wxPropertyView::wxPropertyView(long flags
)
902 m_buttonFlags
= flags
;
903 m_propertySheet
= NULL
;
904 m_currentValidator
= NULL
;
905 m_currentProperty
= NULL
;
908 wxPropertyView::~wxPropertyView(void)
912 void wxPropertyView::AddRegistry(wxPropertyValidatorRegistry
*registry
)
914 m_validatorRegistryList
.Append(registry
);
917 wxPropertyValidator
*wxPropertyView::FindPropertyValidator(wxProperty
*property
)
919 if (property
->GetValidator())
920 return property
->GetValidator();
922 wxNode
*node
= m_validatorRegistryList
.First();
925 wxPropertyValidatorRegistry
*registry
= (wxPropertyValidatorRegistry
*)node
->Data();
926 wxPropertyValidator
*validator
= registry
->GetValidator(property
->GetRole());
933 if (!wxDefaultPropertyValidator)
934 wxDefaultPropertyValidator = new wxPropertyListValidator;
935 return wxDefaultPropertyValidator;
943 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet
, wxObject
)
945 wxPropertySheet::wxPropertySheet(const wxString
& name
)
946 :m_properties(wxKEY_STRING
),m_name(name
)
950 wxPropertySheet::~wxPropertySheet(void)
955 bool wxPropertySheet::Save( ostream
& WXUNUSED(str
) )
960 bool wxPropertySheet::Load( ostream
& WXUNUSED(str
) )
965 void wxPropertySheet::UpdateAllViews( wxPropertyView
*WXUNUSED(thisView
) )
970 void wxPropertySheet::AddProperty(wxProperty
*property
)
972 m_properties
.Append((const wxChar
*) property
->GetName(), property
);
975 // Get property by name
976 wxProperty
*wxPropertySheet::GetProperty(const wxString
& name
) const
978 wxNode
*node
= m_properties
.Find((const wxChar
*) name
);
982 return (wxProperty
*)node
->Data();
985 bool wxPropertySheet::SetProperty(const wxString
& name
, const wxPropertyValue
& value
)
987 wxProperty
* prop
= GetProperty(name
);
989 prop
->SetValue(value
);
996 void wxPropertySheet::RemoveProperty(const wxString
& name
)
998 wxNode
*node
= m_properties
.Find(name
);
1001 wxProperty
*prop
= (wxProperty
*)node
->Data();
1003 m_properties
.DeleteNode(node
);
1007 bool wxPropertySheet::HasProperty(const wxString
& name
) const
1009 return (GetProperty(name
)?TRUE
:FALSE
);
1012 // Clear all properties
1013 void wxPropertySheet::Clear(void)
1015 wxNode
*node
= m_properties
.First();
1018 wxProperty
*prop
= (wxProperty
*)node
->Data();
1019 wxNode
*next
= node
->Next();
1026 // Sets/clears the modified flag for each property value
1027 void wxPropertySheet::SetAllModified(bool flag
)
1029 wxNode
*node
= m_properties
.First();
1032 wxProperty
*prop
= (wxProperty
*)node
->Data();
1033 prop
->GetValue().SetModified(flag
);
1034 node
= node
->Next();
1039 * Property validator registry
1043 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValidatorRegistry
, wxHashTable
)
1045 wxPropertyValidatorRegistry::wxPropertyValidatorRegistry(void):wxHashTable(wxKEY_STRING
)
1049 wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void)
1054 void wxPropertyValidatorRegistry::RegisterValidator(const wxString
& typeName
, wxPropertyValidator
*validator
)
1056 Put((const wxChar
*) typeName
, validator
);
1059 wxPropertyValidator
*wxPropertyValidatorRegistry::GetValidator(const wxString
& typeName
)
1061 return (wxPropertyValidator
*)Get((const wxChar
*) typeName
);
1064 void wxPropertyValidatorRegistry::ClearRegistry(void)
1068 while ((node
= Next()))
1070 delete (wxPropertyValidator
*)node
->Data();
1075 * Property validator
1079 IMPLEMENT_ABSTRACT_CLASS(wxPropertyValidator
, wxEvtHandler
)
1081 wxPropertyValidator::wxPropertyValidator(long flags
)
1083 m_validatorFlags
= flags
;
1084 m_validatorProperty
= NULL
;
1087 wxPropertyValidator::~wxPropertyValidator(void)
1090 bool wxPropertyValidator::StringToFloat (wxChar
*s
, float *number
) {
1092 bool ok
= StringToDouble (s
, &num
);
1093 *number
= (float) num
;
1097 bool wxPropertyValidator::StringToDouble (wxChar
*s
, double *number
) {
1100 *number
= wxStrtod (s
, &value_ptr
);
1102 int len
= wxStrlen (value_ptr
);
1103 for (int i
= 0; i
< len
; i
++) {
1104 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1105 if (!ok
) return FALSE
;
1111 bool wxPropertyValidator::StringToInt (wxChar
*s
, int *number
) {
1113 bool ok
= StringToLong (s
, &num
);
1114 *number
= (int) num
;
1118 bool wxPropertyValidator::StringToLong (wxChar
*s
, long *number
) {
1121 *number
= wxStrtol (s
, &value_ptr
, 10);
1123 int len
= wxStrlen (value_ptr
);
1124 for (int i
= 0; i
< len
; i
++) {
1125 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1126 if (!ok
) return FALSE
;
1132 wxChar
*wxPropertyValidator::FloatToString (float number
) {
1133 static wxChar buf
[20];
1134 wxSprintf (buf
, _T("%.6g"), number
);
1138 wxChar
*wxPropertyValidator::DoubleToString (double number
) {
1139 static wxChar buf
[20];
1140 wxSprintf (buf
, _T("%.6g"), number
);
1144 wxChar
*wxPropertyValidator::IntToString (int number
) {
1145 return ::IntToString (number
);
1148 wxChar
*wxPropertyValidator::LongToString (long number
) {
1149 return ::LongToString (number
);