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();
374 // what is this? are you trying to assign a bool or a string? VA can't figure it out..
375 #if defined(__VISAGECPP__) || defined( __VISUALC__ )
382 // TODO: check if this is right. MB
389 case wxPropertyValueList
:
391 m_value
.first
= NULL
;
394 wxPropertyValue
*expr
= copyFrom
.m_value
.first
;
397 wxPropertyValue
*expr2
= expr
->NewCopy();
403 case wxPropertyValueNull
:
404 wxFAIL_MSG( _T("Should never get here!\n" ) );
409 // Return nth argument of a clause (starting from 1)
410 wxPropertyValue
*wxPropertyValue::Arg(wxPropertyValueType type
, int arg
) const
412 wxPropertyValue
*expr
= m_value
.first
;
413 for (int i
= 1; i
< arg
; i
++)
417 if (expr
&& (expr
->m_type
== type
))
423 // Return nth argument of a list expression (starting from zero)
424 wxPropertyValue
*wxPropertyValue::Nth(int arg
) const
426 if (m_type
!= wxPropertyValueList
)
429 wxPropertyValue
*expr
= m_value
.first
;
430 for (int i
= 0; i
< arg
; i
++)
441 // Returns the number of elements in a list expression
442 int wxPropertyValue::Number(void) const
444 if (m_type
!= wxPropertyValueList
)
448 wxPropertyValue
*expr
= m_value
.first
;
457 void wxPropertyValue::WritePropertyClause(wxString
& stream
) // Write this expression as a top-level clause
459 if (m_type
!= wxPropertyValueList
)
462 wxPropertyValue
*node
= m_value
.first
;
465 node
->WritePropertyType(stream
);
466 stream
.Append( _T("(") );
472 stream
.Append( _T(" ") );
473 node
->WritePropertyType(stream
);
476 stream
.Append( _T(",\n" ) );
479 stream
.Append( _T(").\n\n") );
483 void wxPropertyValue::WritePropertyType(wxString
& stream
) // Write as any other subexpression
488 case wxPropertyValueInteger
:
490 tmp
.Printf( _T("%ld"), m_value
.integer
);
491 stream
.Append( tmp
);
494 case wxPropertyValueIntegerPtr
:
496 tmp
.Printf( _T("%ld"), *m_value
.integerPtr
);
497 stream
.Append( tmp
);
500 case wxPropertyValuebool
:
503 stream
.Append( _T("True") );
505 stream
.Append( _T("False") );
508 case wxPropertyValueboolPtr
:
510 if (*m_value
.integerPtr
)
511 stream
.Append( _T("True") );
513 stream
.Append( _T("False") );
516 case wxPropertyValueReal
:
518 double d
= m_value
.real
;
519 tmp
.Printf( _T("%.6g"), d
);
520 stream
.Append( tmp
);
523 case wxPropertyValueRealPtr
:
525 double d
= *m_value
.realPtr
;
526 tmp
.Printf( _T("%.6g"), d
);
527 stream
.Append( tmp
);
530 case wxPropertyValueString
:
532 stream
.Append( m_value
.string
);
535 case wxPropertyValueStringPtr
:
537 wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
540 int len = strlen(*(m_value.stringPtr));
541 for (i = 0; i < len; i++)
543 char ch = *(m_value.stringPtr)[i];
549 case wxPropertyValueList
:
552 stream
.Append( _T("[]") );
555 wxPropertyValue
*expr
= m_value
.first
;
557 stream
.Append( _T("[") );
560 expr
->WritePropertyType(stream
);
563 stream
.Append( _T(", ") );
565 stream
.Append( _T("]") );
569 case wxPropertyValueNull
: break;
573 wxString
wxPropertyValue::GetStringRepresentation(void)
576 WritePropertyType(str
);
580 void wxPropertyValue::operator=(const wxPropertyValue
& val
)
582 m_modifiedFlag
= TRUE
;
583 Copy((wxPropertyValue
&)val
);
586 // void wxPropertyValue::operator=(const char *val)
587 void wxPropertyValue::operator=(const wxString
& val1
)
589 const wxChar
*val
= (const wxChar
*)val1
;
591 m_modifiedFlag
= TRUE
;
592 if (m_type
== wxPropertyValueNull
)
593 m_type
= wxPropertyValueString
;
595 if (m_type
== wxPropertyValueString
)
598 m_value
.string
= copystring(val
);
600 m_value
.string
= NULL
;
602 else if (m_type
== wxPropertyValueStringPtr
)
604 if (*m_value
.stringPtr
)
605 delete[] *m_value
.stringPtr
;
607 *m_value
.stringPtr
= copystring(val
);
609 *m_value
.stringPtr
= NULL
;
618 void wxPropertyValue::operator=(const long val
)
620 m_modifiedFlag
= TRUE
;
621 if (m_type
== wxPropertyValueNull
)
622 m_type
= wxPropertyValueInteger
;
624 if (m_type
== wxPropertyValueInteger
)
625 m_value
.integer
= val
;
626 else if (m_type
== wxPropertyValueIntegerPtr
)
627 *m_value
.integerPtr
= val
;
628 else if (m_type
== wxPropertyValueReal
)
629 m_value
.real
= (float)val
;
630 else if (m_type
== wxPropertyValueRealPtr
)
631 *m_value
.realPtr
= (float)val
;
637 void wxPropertyValue::operator=(const bool val
)
639 m_modifiedFlag
= TRUE
;
640 if (m_type
== wxPropertyValueNull
)
641 m_type
= wxPropertyValuebool
;
643 if (m_type
== wxPropertyValuebool
)
644 m_value
.integer
= (long)val
;
645 else if (m_type
== wxPropertyValueboolPtr
)
646 *m_value
.boolPtr
= val
;
652 void wxPropertyValue::operator=(const float val
)
654 m_modifiedFlag
= TRUE
;
655 if (m_type
== wxPropertyValueNull
)
656 m_type
= wxPropertyValueReal
;
658 if (m_type
== wxPropertyValueInteger
)
659 m_value
.integer
= (long)val
;
660 else if (m_type
== wxPropertyValueIntegerPtr
)
661 *m_value
.integerPtr
= (long)val
;
662 else if (m_type
== wxPropertyValueReal
)
664 else if (m_type
== wxPropertyValueRealPtr
)
665 *m_value
.realPtr
= val
;
671 void wxPropertyValue::operator=(const wxChar
**val
)
673 m_modifiedFlag
= TRUE
;
674 m_type
= wxPropertyValueStringPtr
;
677 m_value
.stringPtr
= (wxChar
**)val
;
679 m_value
.stringPtr
= NULL
;
686 void wxPropertyValue::operator=(const long *val
)
688 m_modifiedFlag
= TRUE
;
689 m_type
= wxPropertyValueIntegerPtr
;
690 m_value
.integerPtr
= (long *)val
;
695 void wxPropertyValue::operator=(const bool *val
)
697 m_modifiedFlag
= TRUE
;
698 m_type
= wxPropertyValueboolPtr
;
699 m_value
.boolPtr
= (bool *)val
;
704 void wxPropertyValue::operator=(const float *val
)
706 m_modifiedFlag
= TRUE
;
707 m_type
= wxPropertyValueRealPtr
;
708 m_value
.realPtr
= (float *)val
;
713 long wxPropertyValue::IntegerValue(void) const
715 if (m_type
== wxPropertyValueInteger
)
716 return m_value
.integer
;
717 else if (m_type
== wxPropertyValueReal
)
718 return (long)m_value
.real
;
719 else if (m_type
== wxPropertyValueIntegerPtr
)
720 return *m_value
.integerPtr
;
721 else if (m_type
== wxPropertyValueRealPtr
)
722 return (long)(*m_value
.realPtr
);
726 long *wxPropertyValue::IntegerValuePtr(void) const
728 return m_value
.integerPtr
;
731 float wxPropertyValue::RealValue(void) const {
732 if (m_type
== wxPropertyValueReal
)
734 else if (m_type
== wxPropertyValueRealPtr
)
735 return *m_value
.realPtr
;
736 else if (m_type
== wxPropertyValueInteger
)
737 return (float)m_value
.integer
;
738 else if (m_type
== wxPropertyValueIntegerPtr
)
739 return (float)*(m_value
.integerPtr
);
743 float *wxPropertyValue::RealValuePtr(void) const
745 return m_value
.realPtr
;
748 bool wxPropertyValue::BoolValue(void) const {
749 if (m_type
== wxPropertyValueReal
)
750 return (m_value
.real
!= 0.0);
751 if (m_type
== wxPropertyValueRealPtr
)
752 return (*(m_value
.realPtr
) != 0.0);
753 else if (m_type
== wxPropertyValueInteger
)
754 return (m_value
.integer
!= 0);
755 else if (m_type
== wxPropertyValueIntegerPtr
)
756 return (*(m_value
.integerPtr
) != 0);
757 else if (m_type
== wxPropertyValuebool
)
758 return (m_value
.integer
!= 0);
759 else if (m_type
== wxPropertyValueboolPtr
)
760 return (*(m_value
.boolPtr
) != 0);
764 bool *wxPropertyValue::BoolValuePtr(void) const
766 return m_value
.boolPtr
;
769 wxChar
*wxPropertyValue::StringValue(void) const {
770 if (m_type
== wxPropertyValueString
)
771 return m_value
.string
;
772 else if (m_type
== wxPropertyValueStringPtr
)
773 return *(m_value
.stringPtr
);
777 wxChar
**wxPropertyValue::StringValuePtr(void) const
779 return m_value
.stringPtr
;
783 * A property (name plus value)
786 IMPLEMENT_DYNAMIC_CLASS(wxProperty
, wxObject
)
788 wxProperty::wxProperty(void)
790 m_propertyRole
= wxEmptyString
;
791 m_propertyValidator
= NULL
;
792 m_propertyWindow
= NULL
;
796 wxProperty::wxProperty(wxProperty
& copyFrom
)
798 m_value
= copyFrom
.GetValue();
799 m_name
= copyFrom
.GetName();
800 m_propertyRole
= copyFrom
.GetRole();
801 m_propertyValidator
= copyFrom
.GetValidator();
802 m_enabled
= copyFrom
.IsEnabled();
803 m_propertyWindow
= NULL
;
806 wxProperty::wxProperty(wxString nm
, wxString role
, wxPropertyValidator
*ed
):m_name(nm
), m_propertyRole(role
)
808 m_propertyValidator
= ed
;
809 m_propertyWindow
= NULL
;
813 wxProperty::wxProperty(wxString nm
, const wxPropertyValue
& val
, wxString role
, wxPropertyValidator
*ed
):
814 m_value(val
), m_name(nm
), m_propertyRole(role
)
816 m_propertyValidator
= ed
;
817 m_propertyWindow
= NULL
;
821 wxProperty::~wxProperty(void)
823 if (m_propertyValidator
)
824 delete m_propertyValidator
;
827 wxPropertyValue
& wxProperty::GetValue(void) const
829 return (wxPropertyValue
&) m_value
;
832 wxPropertyValidator
*wxProperty::GetValidator(void) const
834 return m_propertyValidator
;
837 wxString
& wxProperty::GetName(void) const
839 return (wxString
&) m_name
;
842 wxString
& wxProperty::GetRole(void) const
844 return (wxString
&) m_propertyRole
;
847 void wxProperty::SetValue(const wxPropertyValue
& val
)
852 void wxProperty::SetValidator(wxPropertyValidator
*ed
)
854 m_propertyValidator
= ed
;
857 void wxProperty::SetRole(wxString
& role
)
859 m_propertyRole
= role
;
862 void wxProperty::SetName(wxString
& nm
)
867 void wxProperty::operator=(const wxPropertyValue
& val
)
873 * Base property view class
876 IMPLEMENT_DYNAMIC_CLASS(wxPropertyView
, wxEvtHandler
)
878 wxPropertyView::wxPropertyView(long flags
)
880 m_buttonFlags
= flags
;
881 m_propertySheet
= NULL
;
882 m_currentValidator
= NULL
;
883 m_currentProperty
= NULL
;
886 wxPropertyView::~wxPropertyView(void)
890 void wxPropertyView::AddRegistry(wxPropertyValidatorRegistry
*registry
)
892 m_validatorRegistryList
.Append(registry
);
895 wxPropertyValidator
*wxPropertyView::FindPropertyValidator(wxProperty
*property
)
897 if (property
->GetValidator())
898 return property
->GetValidator();
900 wxNode
*node
= m_validatorRegistryList
.First();
903 wxPropertyValidatorRegistry
*registry
= (wxPropertyValidatorRegistry
*)node
->Data();
904 wxPropertyValidator
*validator
= registry
->GetValidator(property
->GetRole());
911 if (!wxDefaultPropertyValidator)
912 wxDefaultPropertyValidator = new wxPropertyListValidator;
913 return wxDefaultPropertyValidator;
921 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet
, wxObject
)
923 wxPropertySheet::wxPropertySheet(const wxString
& name
)
924 :m_properties(wxKEY_STRING
),m_name(name
)
928 wxPropertySheet::~wxPropertySheet(void)
933 void wxPropertySheet::UpdateAllViews( wxPropertyView
*WXUNUSED(thisView
) )
938 void wxPropertySheet::AddProperty(wxProperty
*property
)
940 m_properties
.Append((const wxChar
*) property
->GetName(), property
);
943 // Get property by name
944 wxProperty
*wxPropertySheet::GetProperty(const wxString
& name
) const
946 wxNode
*node
= m_properties
.Find((const wxChar
*) name
);
950 return (wxProperty
*)node
->Data();
953 bool wxPropertySheet::SetProperty(const wxString
& name
, const wxPropertyValue
& value
)
955 wxProperty
* prop
= GetProperty(name
);
957 prop
->SetValue(value
);
964 void wxPropertySheet::RemoveProperty(const wxString
& name
)
966 wxNode
*node
= m_properties
.Find(name
);
969 wxProperty
*prop
= (wxProperty
*)node
->Data();
971 m_properties
.DeleteNode(node
);
975 bool wxPropertySheet::HasProperty(const wxString
& name
) const
977 return (GetProperty(name
)?TRUE
:FALSE
);
980 // Clear all properties
981 void wxPropertySheet::Clear(void)
983 wxNode
*node
= m_properties
.First();
986 wxProperty
*prop
= (wxProperty
*)node
->Data();
987 wxNode
*next
= node
->Next();
994 // Sets/clears the modified flag for each property value
995 void wxPropertySheet::SetAllModified(bool flag
)
997 wxNode
*node
= m_properties
.First();
1000 wxProperty
*prop
= (wxProperty
*)node
->Data();
1001 prop
->GetValue().SetModified(flag
);
1002 node
= node
->Next();
1007 * Property validator registry
1011 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValidatorRegistry
, wxHashTable
)
1013 wxPropertyValidatorRegistry::wxPropertyValidatorRegistry(void):wxHashTable(wxKEY_STRING
)
1017 wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void)
1022 void wxPropertyValidatorRegistry::RegisterValidator(const wxString
& typeName
, wxPropertyValidator
*validator
)
1024 Put((const wxChar
*) typeName
, validator
);
1027 wxPropertyValidator
*wxPropertyValidatorRegistry::GetValidator(const wxString
& typeName
)
1029 return (wxPropertyValidator
*)Get((const wxChar
*) typeName
);
1032 void wxPropertyValidatorRegistry::ClearRegistry(void)
1036 while ((node
= Next()) != NULL
)
1038 delete (wxPropertyValidator
*)node
->Data();
1043 * Property validator
1047 IMPLEMENT_ABSTRACT_CLASS(wxPropertyValidator
, wxEvtHandler
)
1049 wxPropertyValidator::wxPropertyValidator(long flags
)
1051 m_validatorFlags
= flags
;
1052 m_validatorProperty
= NULL
;
1055 wxPropertyValidator::~wxPropertyValidator(void)
1058 bool wxPropertyValidator::StringToFloat (wxChar
*s
, float *number
) {
1060 bool ok
= StringToDouble (s
, &num
);
1061 *number
= (float) num
;
1065 bool wxPropertyValidator::StringToDouble (wxChar
*s
, double *number
) {
1068 *number
= wxStrtod (s
, &value_ptr
);
1070 int len
= wxStrlen (value_ptr
);
1071 for (int i
= 0; i
< len
; i
++) {
1072 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1073 if (!ok
) return FALSE
;
1079 bool wxPropertyValidator::StringToInt (wxChar
*s
, int *number
) {
1081 bool ok
= StringToLong (s
, &num
);
1082 *number
= (int) num
;
1086 bool wxPropertyValidator::StringToLong (wxChar
*s
, long *number
) {
1089 *number
= wxStrtol (s
, &value_ptr
, 10);
1091 int len
= wxStrlen (value_ptr
);
1092 for (int i
= 0; i
< len
; i
++) {
1093 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1094 if (!ok
) return FALSE
;
1100 wxChar
*wxPropertyValidator::FloatToString (float number
) {
1101 static wxChar buf
[20];
1102 wxSprintf (buf
, _T("%.6g"), number
);
1106 wxChar
*wxPropertyValidator::DoubleToString (double number
) {
1107 static wxChar buf
[20];
1108 wxSprintf (buf
, _T("%.6g"), number
);
1112 wxChar
*wxPropertyValidator::IntToString (int number
) {
1113 return ::IntToString (number
);
1116 wxChar
*wxPropertyValidator::LongToString (long number
) {
1117 return ::LongToString (number
);