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( wxT("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 (*this) = (bool)(s
!= 0);
387 case wxPropertyValueList
:
389 m_value
.first
= NULL
;
392 wxPropertyValue
*expr
= copyFrom
.m_value
.first
;
395 wxPropertyValue
*expr2
= expr
->NewCopy();
401 case wxPropertyValueNull
:
402 wxFAIL_MSG( wxT("Should never get here!\n" ) );
407 // Return nth argument of a clause (starting from 1)
408 wxPropertyValue
*wxPropertyValue::Arg(wxPropertyValueType type
, int arg
) const
410 wxPropertyValue
*expr
= m_value
.first
;
411 for (int i
= 1; i
< arg
; i
++)
415 if (expr
&& (expr
->m_type
== type
))
421 // Return nth argument of a list expression (starting from zero)
422 wxPropertyValue
*wxPropertyValue::Nth(int arg
) const
424 if (m_type
!= wxPropertyValueList
)
427 wxPropertyValue
*expr
= m_value
.first
;
428 for (int i
= 0; i
< arg
; i
++)
439 // Returns the number of elements in a list expression
440 int wxPropertyValue::Number(void) const
442 if (m_type
!= wxPropertyValueList
)
446 wxPropertyValue
*expr
= m_value
.first
;
455 void wxPropertyValue::WritePropertyClause(wxString
& stream
) // Write this expression as a top-level clause
457 if (m_type
!= wxPropertyValueList
)
460 wxPropertyValue
*node
= m_value
.first
;
463 node
->WritePropertyType(stream
);
464 stream
.Append( wxT("(") );
470 stream
.Append( wxT(" ") );
471 node
->WritePropertyType(stream
);
474 stream
.Append( wxT(",\n" ) );
477 stream
.Append( wxT(").\n\n") );
481 void wxPropertyValue::WritePropertyType(wxString
& stream
) // Write as any other subexpression
486 case wxPropertyValueInteger
:
488 tmp
.Printf( wxT("%ld"), m_value
.integer
);
489 stream
.Append( tmp
);
492 case wxPropertyValueIntegerPtr
:
494 tmp
.Printf( wxT("%ld"), *m_value
.integerPtr
);
495 stream
.Append( tmp
);
498 case wxPropertyValuebool
:
501 stream
.Append( wxT("True") );
503 stream
.Append( wxT("False") );
506 case wxPropertyValueboolPtr
:
508 if (*m_value
.integerPtr
)
509 stream
.Append( wxT("True") );
511 stream
.Append( wxT("False") );
514 case wxPropertyValueReal
:
516 double d
= m_value
.real
;
517 tmp
.Printf( wxT("%.6g"), d
);
518 stream
.Append( tmp
);
521 case wxPropertyValueRealPtr
:
523 double d
= *m_value
.realPtr
;
524 tmp
.Printf( wxT("%.6g"), d
);
525 stream
.Append( tmp
);
528 case wxPropertyValueString
:
530 stream
.Append( m_value
.string
);
533 case wxPropertyValueStringPtr
:
535 wxFAIL_MSG( wxT("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
538 int len = strlen(*(m_value.stringPtr));
539 for (i = 0; i < len; i++)
541 char ch = *(m_value.stringPtr)[i];
547 case wxPropertyValueList
:
550 stream
.Append( wxT("[]") );
553 wxPropertyValue
*expr
= m_value
.first
;
555 stream
.Append( wxT("[") );
558 expr
->WritePropertyType(stream
);
561 stream
.Append( wxT(", ") );
563 stream
.Append( wxT("]") );
567 case wxPropertyValueNull
: break;
571 wxString
wxPropertyValue::GetStringRepresentation(void)
574 WritePropertyType(str
);
578 void wxPropertyValue::operator=(const wxPropertyValue
& val
)
580 m_modifiedFlag
= TRUE
;
581 Copy((wxPropertyValue
&)val
);
584 // void wxPropertyValue::operator=(const char *val)
585 void wxPropertyValue::operator=(const wxString
& val1
)
587 const wxChar
*val
= (const wxChar
*)val1
;
589 m_modifiedFlag
= TRUE
;
590 if (m_type
== wxPropertyValueNull
)
591 m_type
= wxPropertyValueString
;
593 if (m_type
== wxPropertyValueString
)
596 m_value
.string
= copystring(val
);
598 m_value
.string
= NULL
;
600 else if (m_type
== wxPropertyValueStringPtr
)
602 if (*m_value
.stringPtr
)
603 delete[] *m_value
.stringPtr
;
605 *m_value
.stringPtr
= copystring(val
);
607 *m_value
.stringPtr
= NULL
;
616 void wxPropertyValue::operator=(const long val
)
618 m_modifiedFlag
= TRUE
;
619 if (m_type
== wxPropertyValueNull
)
620 m_type
= wxPropertyValueInteger
;
622 if (m_type
== wxPropertyValueInteger
)
623 m_value
.integer
= val
;
624 else if (m_type
== wxPropertyValueIntegerPtr
)
625 *m_value
.integerPtr
= val
;
626 else if (m_type
== wxPropertyValueReal
)
627 m_value
.real
= (float)val
;
628 else if (m_type
== wxPropertyValueRealPtr
)
629 *m_value
.realPtr
= (float)val
;
635 void wxPropertyValue::operator=(const bool val
)
637 m_modifiedFlag
= TRUE
;
638 if (m_type
== wxPropertyValueNull
)
639 m_type
= wxPropertyValuebool
;
641 if (m_type
== wxPropertyValuebool
)
642 m_value
.integer
= (long)val
;
643 else if (m_type
== wxPropertyValueboolPtr
)
644 *m_value
.boolPtr
= val
;
650 void wxPropertyValue::operator=(const float val
)
652 m_modifiedFlag
= TRUE
;
653 if (m_type
== wxPropertyValueNull
)
654 m_type
= wxPropertyValueReal
;
656 if (m_type
== wxPropertyValueInteger
)
657 m_value
.integer
= (long)val
;
658 else if (m_type
== wxPropertyValueIntegerPtr
)
659 *m_value
.integerPtr
= (long)val
;
660 else if (m_type
== wxPropertyValueReal
)
662 else if (m_type
== wxPropertyValueRealPtr
)
663 *m_value
.realPtr
= val
;
669 void wxPropertyValue::operator=(const wxChar
**val
)
671 m_modifiedFlag
= TRUE
;
672 m_type
= wxPropertyValueStringPtr
;
675 m_value
.stringPtr
= (wxChar
**)val
;
677 m_value
.stringPtr
= NULL
;
684 void wxPropertyValue::operator=(const long *val
)
686 m_modifiedFlag
= TRUE
;
687 m_type
= wxPropertyValueIntegerPtr
;
688 m_value
.integerPtr
= (long *)val
;
693 void wxPropertyValue::operator=(const bool *val
)
695 m_modifiedFlag
= TRUE
;
696 m_type
= wxPropertyValueboolPtr
;
697 m_value
.boolPtr
= (bool *)val
;
702 void wxPropertyValue::operator=(const float *val
)
704 m_modifiedFlag
= TRUE
;
705 m_type
= wxPropertyValueRealPtr
;
706 m_value
.realPtr
= (float *)val
;
711 long wxPropertyValue::IntegerValue(void) const
713 if (m_type
== wxPropertyValueInteger
)
714 return m_value
.integer
;
715 else if (m_type
== wxPropertyValueReal
)
716 return (long)m_value
.real
;
717 else if (m_type
== wxPropertyValueIntegerPtr
)
718 return *m_value
.integerPtr
;
719 else if (m_type
== wxPropertyValueRealPtr
)
720 return (long)(*m_value
.realPtr
);
724 long *wxPropertyValue::IntegerValuePtr(void) const
726 return m_value
.integerPtr
;
729 float wxPropertyValue::RealValue(void) const {
730 if (m_type
== wxPropertyValueReal
)
732 else if (m_type
== wxPropertyValueRealPtr
)
733 return *m_value
.realPtr
;
734 else if (m_type
== wxPropertyValueInteger
)
735 return (float)m_value
.integer
;
736 else if (m_type
== wxPropertyValueIntegerPtr
)
737 return (float)*(m_value
.integerPtr
);
741 float *wxPropertyValue::RealValuePtr(void) const
743 return m_value
.realPtr
;
746 bool wxPropertyValue::BoolValue(void) const {
747 if (m_type
== wxPropertyValueReal
)
748 return (m_value
.real
!= 0.0);
749 if (m_type
== wxPropertyValueRealPtr
)
750 return (*(m_value
.realPtr
) != 0.0);
751 else if (m_type
== wxPropertyValueInteger
)
752 return (m_value
.integer
!= 0);
753 else if (m_type
== wxPropertyValueIntegerPtr
)
754 return (*(m_value
.integerPtr
) != 0);
755 else if (m_type
== wxPropertyValuebool
)
756 return (m_value
.integer
!= 0);
757 else if (m_type
== wxPropertyValueboolPtr
)
758 return (*(m_value
.boolPtr
) != 0);
762 bool *wxPropertyValue::BoolValuePtr(void) const
764 return m_value
.boolPtr
;
767 wxChar
*wxPropertyValue::StringValue(void) const {
768 if (m_type
== wxPropertyValueString
)
769 return m_value
.string
;
770 else if (m_type
== wxPropertyValueStringPtr
)
771 return *(m_value
.stringPtr
);
775 wxChar
**wxPropertyValue::StringValuePtr(void) const
777 return m_value
.stringPtr
;
781 * A property (name plus value)
784 IMPLEMENT_DYNAMIC_CLASS(wxProperty
, wxObject
)
786 wxProperty::wxProperty(void)
788 m_propertyRole
= wxEmptyString
;
789 m_propertyValidator
= NULL
;
790 m_propertyWindow
= NULL
;
794 wxProperty::wxProperty(wxProperty
& copyFrom
)
796 m_value
= copyFrom
.GetValue();
797 m_name
= copyFrom
.GetName();
798 m_propertyRole
= copyFrom
.GetRole();
799 m_propertyValidator
= copyFrom
.GetValidator();
800 m_enabled
= copyFrom
.IsEnabled();
801 m_propertyWindow
= NULL
;
804 wxProperty::wxProperty(wxString nm
, wxString role
, wxPropertyValidator
*ed
):m_name(nm
), m_propertyRole(role
)
806 m_propertyValidator
= ed
;
807 m_propertyWindow
= NULL
;
811 wxProperty::wxProperty(wxString nm
, const wxPropertyValue
& val
, wxString role
, wxPropertyValidator
*ed
):
812 m_value(val
), m_name(nm
), m_propertyRole(role
)
814 m_propertyValidator
= ed
;
815 m_propertyWindow
= NULL
;
819 wxProperty::~wxProperty(void)
821 if (m_propertyValidator
)
822 delete m_propertyValidator
;
825 wxPropertyValue
& wxProperty::GetValue(void) const
827 return (wxPropertyValue
&) m_value
;
830 wxPropertyValidator
*wxProperty::GetValidator(void) const
832 return m_propertyValidator
;
835 wxString
& wxProperty::GetName(void) const
837 return (wxString
&) m_name
;
840 wxString
& wxProperty::GetRole(void) const
842 return (wxString
&) m_propertyRole
;
845 void wxProperty::SetValue(const wxPropertyValue
& val
)
850 void wxProperty::SetValidator(wxPropertyValidator
*ed
)
852 m_propertyValidator
= ed
;
855 void wxProperty::SetRole(wxString
& role
)
857 m_propertyRole
= role
;
860 void wxProperty::SetName(wxString
& nm
)
865 void wxProperty::operator=(const wxPropertyValue
& val
)
871 * Base property view class
874 IMPLEMENT_DYNAMIC_CLASS(wxPropertyView
, wxEvtHandler
)
876 wxPropertyView::wxPropertyView(long flags
)
878 m_buttonFlags
= flags
;
879 m_propertySheet
= NULL
;
880 m_currentValidator
= NULL
;
881 m_currentProperty
= NULL
;
884 wxPropertyView::~wxPropertyView(void)
888 void wxPropertyView::AddRegistry(wxPropertyValidatorRegistry
*registry
)
890 m_validatorRegistryList
.Append(registry
);
893 wxPropertyValidator
*wxPropertyView::FindPropertyValidator(wxProperty
*property
)
895 if (property
->GetValidator())
896 return property
->GetValidator();
898 wxNode
*node
= m_validatorRegistryList
.First();
901 wxPropertyValidatorRegistry
*registry
= (wxPropertyValidatorRegistry
*)node
->Data();
902 wxPropertyValidator
*validator
= registry
->GetValidator(property
->GetRole());
909 if (!wxDefaultPropertyValidator)
910 wxDefaultPropertyValidator = new wxPropertyListValidator;
911 return wxDefaultPropertyValidator;
919 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet
, wxObject
)
921 wxPropertySheet::wxPropertySheet(const wxString
& name
)
922 :m_properties(wxKEY_STRING
),m_name(name
)
926 wxPropertySheet::~wxPropertySheet(void)
931 void wxPropertySheet::UpdateAllViews( wxPropertyView
*WXUNUSED(thisView
) )
936 void wxPropertySheet::AddProperty(wxProperty
*property
)
938 m_properties
.Append((const wxChar
*) property
->GetName(), property
);
941 // Get property by name
942 wxProperty
*wxPropertySheet::GetProperty(const wxString
& name
) const
944 wxNode
*node
= m_properties
.Find((const wxChar
*) name
);
948 return (wxProperty
*)node
->Data();
951 bool wxPropertySheet::SetProperty(const wxString
& name
, const wxPropertyValue
& value
)
953 wxProperty
* prop
= GetProperty(name
);
955 prop
->SetValue(value
);
962 void wxPropertySheet::RemoveProperty(const wxString
& name
)
964 wxNode
*node
= m_properties
.Find(name
);
967 wxProperty
*prop
= (wxProperty
*)node
->Data();
969 m_properties
.DeleteNode(node
);
973 bool wxPropertySheet::HasProperty(const wxString
& name
) const
975 return (GetProperty(name
)?TRUE
:FALSE
);
978 // Clear all properties
979 void wxPropertySheet::Clear(void)
981 wxNode
*node
= m_properties
.First();
984 wxProperty
*prop
= (wxProperty
*)node
->Data();
985 wxNode
*next
= node
->Next();
992 // Sets/clears the modified flag for each property value
993 void wxPropertySheet::SetAllModified(bool flag
)
995 wxNode
*node
= m_properties
.First();
998 wxProperty
*prop
= (wxProperty
*)node
->Data();
999 prop
->GetValue().SetModified(flag
);
1000 node
= node
->Next();
1005 * Property validator registry
1009 IMPLEMENT_DYNAMIC_CLASS(wxPropertyValidatorRegistry
, wxHashTable
)
1011 wxPropertyValidatorRegistry::wxPropertyValidatorRegistry(void):wxHashTable(wxKEY_STRING
)
1015 wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void)
1020 void wxPropertyValidatorRegistry::RegisterValidator(const wxString
& typeName
, wxPropertyValidator
*validator
)
1022 Put((const wxChar
*) typeName
, validator
);
1025 wxPropertyValidator
*wxPropertyValidatorRegistry::GetValidator(const wxString
& typeName
)
1027 return (wxPropertyValidator
*)Get((const wxChar
*) typeName
);
1030 void wxPropertyValidatorRegistry::ClearRegistry(void)
1034 while ((node
= Next()) != NULL
)
1036 delete (wxPropertyValidator
*)node
->Data();
1041 * Property validator
1045 IMPLEMENT_ABSTRACT_CLASS(wxPropertyValidator
, wxEvtHandler
)
1047 wxPropertyValidator::wxPropertyValidator(long flags
)
1049 m_validatorFlags
= flags
;
1050 m_validatorProperty
= NULL
;
1053 wxPropertyValidator::~wxPropertyValidator(void)
1056 bool wxPropertyValidator::StringToFloat (wxChar
*s
, float *number
) {
1058 bool ok
= StringToDouble (s
, &num
);
1059 *number
= (float) num
;
1063 bool wxPropertyValidator::StringToDouble (wxChar
*s
, double *number
) {
1066 *number
= wxStrtod (s
, &value_ptr
);
1068 int len
= wxStrlen (value_ptr
);
1069 for (int i
= 0; i
< len
; i
++) {
1070 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1071 if (!ok
) return FALSE
;
1077 bool wxPropertyValidator::StringToInt (wxChar
*s
, int *number
) {
1079 bool ok
= StringToLong (s
, &num
);
1080 *number
= (int) num
;
1084 bool wxPropertyValidator::StringToLong (wxChar
*s
, long *number
) {
1087 *number
= wxStrtol (s
, &value_ptr
, 10);
1089 int len
= wxStrlen (value_ptr
);
1090 for (int i
= 0; i
< len
; i
++) {
1091 ok
= (wxIsspace (value_ptr
[i
]) != 0);
1092 if (!ok
) return FALSE
;
1098 wxChar
*wxPropertyValidator::FloatToString (float number
) {
1099 static wxChar buf
[20];
1100 wxSprintf (buf
, wxT("%.6g"), number
);
1104 wxChar
*wxPropertyValidator::DoubleToString (double number
) {
1105 static wxChar buf
[20];
1106 wxSprintf (buf
, wxT("%.6g"), number
);
1110 wxChar
*wxPropertyValidator::IntToString (int number
) {
1111 return ::IntToString (number
);
1114 wxChar
*wxPropertyValidator::LongToString (long number
) {
1115 return ::LongToString (number
);