X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30b5fc118f6fa8bad8cd3692ca42c164aa5007f9..625cb8c0b1ac12f26265cae2c69d7f510de0edb1:/src/generic/prop.cpp diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index 12d9626903..028427d935 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -20,8 +20,9 @@ #pragma hdrstop #endif +#if wxUSE_PROPSHEET + #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include "wx/debug.h" @@ -179,7 +180,7 @@ wxPropertyValue::wxPropertyValue(wxStringList *the_list) wxNode *node = the_list->First(); while (node) { - char *s = (char *)node->Data(); + wxChar *s = (wxChar *)node->Data(); Append(new wxPropertyValue(s)); node = node->Next(); } @@ -564,7 +565,7 @@ void wxPropertyValue::WritePropertyType(wxString& stream) // Write as any oth expr->WritePropertyType(stream); expr = expr->m_next; if (expr) - stream.Append( wxT(", ") ); + stream.Append( wxT(", ") ); } stream.Append( wxT("]") ); } @@ -613,7 +614,7 @@ void wxPropertyValue::operator=(const wxString& val1) } else if (m_type == wxPropertyValueStringPtr) { - wxFAIL_MSG( "Shouldn't try to assign a wxString reference to a char* pointer."); + wxFAIL_MSG( wxT("Shouldn't try to assign a wxString reference to a char* pointer.") ); if (val) *m_value.stringPtr = copystring(val); else @@ -1006,14 +1007,14 @@ void wxPropertySheet::RemoveProperty(const wxString& name) if(node) { wxProperty *prop = (wxProperty *)node->Data(); - delete prop; + delete prop; m_properties.DeleteNode(node); } -} +} bool wxPropertySheet::HasProperty(const wxString& name) const { - return (GetProperty(name)?TRUE:FALSE); + return (GetProperty(name)?TRUE:FALSE); } // Clear all properties @@ -1095,10 +1096,10 @@ wxPropertyValidator::~wxPropertyValidator(void) {} bool wxPropertyValidator::StringToFloat (wxChar *s, float *number) { - double num; - bool ok = StringToDouble (s, &num); - *number = (float) num; - return ok; + double num; + bool ok = StringToDouble (s, &num); + *number = (float) num; + return ok; } bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) { @@ -1106,20 +1107,20 @@ bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) { wxChar *value_ptr; *number = wxStrtod (s, &value_ptr); if (value_ptr) { - int len = wxStrlen (value_ptr); - for (int i = 0; i < len; i++) { - ok = (wxIsspace (value_ptr[i]) != 0); - if (!ok) return FALSE; - } + int len = wxStrlen (value_ptr); + for (int i = 0; i < len; i++) { + ok = (wxIsspace (value_ptr[i]) != 0); + if (!ok) return FALSE; + } } return ok; } bool wxPropertyValidator::StringToInt (wxChar *s, int *number) { - long num; - bool ok = StringToLong (s, &num); - *number = (int) num; - return ok; + long num; + bool ok = StringToLong (s, &num); + *number = (int) num; + return ok; } bool wxPropertyValidator::StringToLong (wxChar *s, long *number) { @@ -1127,31 +1128,33 @@ bool wxPropertyValidator::StringToLong (wxChar *s, long *number) { wxChar *value_ptr; *number = wxStrtol (s, &value_ptr, 10); if (value_ptr) { - int len = wxStrlen (value_ptr); - for (int i = 0; i < len; i++) { - ok = (wxIsspace (value_ptr[i]) != 0); - if (!ok) return FALSE; - } + int len = wxStrlen (value_ptr); + for (int i = 0; i < len; i++) { + ok = (wxIsspace (value_ptr[i]) != 0); + if (!ok) return FALSE; + } } return ok; } wxChar *wxPropertyValidator::FloatToString (float number) { - static wxChar buf[20]; - wxSprintf (buf, wxT("%.6g"), number); - return buf; + static wxChar buf[20]; + wxSprintf (buf, wxT("%.6g"), number); + return buf; } wxChar *wxPropertyValidator::DoubleToString (double number) { - static wxChar buf[20]; - wxSprintf (buf, wxT("%.6g"), number); - return buf; + static wxChar buf[20]; + wxSprintf (buf, wxT("%.6g"), number); + return buf; } wxChar *wxPropertyValidator::IntToString (int number) { - return ::IntToString (number); + return ::IntToString (number); } wxChar *wxPropertyValidator::LongToString (long number) { - return ::LongToString (number); + return ::LongToString (number); } + +#endif // wxUSE_PROPSHEET