convenience methods

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2006-03-23 18:09:04 +00:00
parent bcd9697973
commit fbb7ee81b4

View File

@ -543,6 +543,14 @@ public :
{
return SetData( inPartCode , inTag , sizeof( T ) , &data ) ;
}
template <typename T> OSStatus SetData( ResType inTag , const T *data )
{
return SetData( kControlEntireControl , inTag , sizeof( T ) , data ) ;
}
template <typename T> OSStatus SetData( ResType inTag , const T& data )
{
return SetData( kControlEntireControl , inTag , sizeof( T ) , &data ) ;
}
template <typename T> OSStatus GetData( ControlPartCode inPartCode , ResType inTag , T *data ) const
{
Size dummy ;
@ -554,7 +562,18 @@ public :
verify_noerr( GetData<T>( inPartCode , inTag , &value ) ) ;
return value ;
}
template <typename T> OSStatus GetData( ResType inTag , T *data ) const
{
Size dummy ;
return GetData( kControlEntireControl , inTag , sizeof( T ) , data , &dummy ) ;
}
template <typename T> T GetData( ResType inTag ) const
{
T value ;
verify_noerr( GetData<T>( kControlEntireControl , inTag , &value ) ) ;
return value ;
}
// Flash the control for the specified amount of time
virtual void Flash( ControlPartCode part , UInt32 ticks = 8 ) ;