xti updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-07-28 20:16:51 +00:00
parent 38759b6794
commit fbbdc52c5d
3 changed files with 149 additions and 55 deletions

View File

@@ -60,7 +60,7 @@ const wxClassInfo* wxObject::sm_classParentswxObject[] = { NULL } ;
wxClassInfo wxObject::sm_classwxObject(sm_classParentswxObject , wxT("") , wxT("wxObject"),
(int) sizeof(wxObject), \
(wxObjectConstructorFn) 0 ,
(wxPropertyInfo*) NULL,0 , 0 ,
(wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 ,
0 , wxVariantToObjectConverterwxObject , wxObjectToVariantConverterwxObject);
template<> void wxStringReadValue(const wxString & , wxObject * & ){assert(0) ;}
template<> void wxStringWriteValue(wxString & , wxObject* const & ){assert(0) ;}

View File

@@ -198,7 +198,10 @@ void wxXmlAddContentToNode( wxXmlNode* node , const wxString& data )
wxString wxXmlGetContentFromNode( wxXmlNode *node )
{
return node->GetChildren()->GetContent() ;
if ( node->GetChildren() )
return node->GetChildren()->GetContent() ;
else
return wxEmptyString ;
}
// streamer specializations
@@ -261,6 +264,18 @@ void wxStringWriteValue(wxString &s , const wxPoint &data )
WX_CUSTOM_TYPE_INFO(wxPoint)
void wxStringReadValue(const wxString &s , wxSize &data )
{
wxSscanf(s, _T("%d,%d"), &data.x , &data.y ) ;
}
void wxStringWriteValue(wxString &s , const wxSize &data )
{
s = wxString::Format("%d,%d", data.x , data.y ) ;
}
WX_CUSTOM_TYPE_INFO(wxSize)
// removing header dependancy on string tokenizer
void wxSetStringToArray( const wxString &s , wxArrayString &array )
@@ -298,7 +313,7 @@ void wxClassInfo::Unregister(const char *WXUNUSED(name))
const wxPropertyAccessor *wxClassInfo::FindAccessor(const char *PropertyName)
{
const wxPropertyInfo* info = FindPropInfo( PropertyName ) ;
const wxPropertyInfo* info = FindPropertyInfo( PropertyName ) ;
if ( info )
return info->GetAccessor() ;
@@ -306,7 +321,7 @@ const wxPropertyAccessor *wxClassInfo::FindAccessor(const char *PropertyName)
return NULL ;
}
const wxPropertyInfo *wxClassInfo::FindPropInfo (const char *PropertyName) const
const wxPropertyInfo *wxClassInfo::FindPropertyInfo (const char *PropertyName) const
{
const wxPropertyInfo* info = GetFirstProperty() ;
@@ -320,13 +335,35 @@ const wxPropertyInfo *wxClassInfo::FindPropInfo (const char *PropertyName) const
const wxClassInfo** parents = GetParents() ;
for ( int i = 0 ; parents[i] ; ++ i )
{
if ( ( info = parents[i]->FindPropInfo( PropertyName ) ) != NULL )
if ( ( info = parents[i]->FindPropertyInfo( PropertyName ) ) != NULL )
return info ;
}
return 0;
}
const wxHandlerInfo *wxClassInfo::FindHandlerInfo (const char *PropertyName) const
{
const wxHandlerInfo* info = GetFirstHandler() ;
while( info )
{
if ( strcmp( info->GetName() , PropertyName ) == 0 )
return info ;
info = info->GetNext() ;
}
const wxClassInfo** parents = GetParents() ;
for ( int i = 0 ; parents[i] ; ++ i )
{
if ( ( info = parents[i]->FindHandlerInfo( PropertyName ) ) != NULL )
return info ;
}
return 0;
}
void wxClassInfo::SetProperty(wxObject *object, const char *propertyName, const wxxVariant &value)
{
const wxPropertyAccessor *accessor;