From fbb7ee81b4af8eccbef20f738142d5c8048f0f4a Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 23 Mar 2006 18:09:04 +0000 Subject: [PATCH] convenience methods git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/private.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h index 3941352de7..9e57b5f43a 100644 --- a/include/wx/mac/carbon/private.h +++ b/include/wx/mac/carbon/private.h @@ -543,6 +543,14 @@ public : { return SetData( inPartCode , inTag , sizeof( T ) , &data ) ; } + template OSStatus SetData( ResType inTag , const T *data ) + { + return SetData( kControlEntireControl , inTag , sizeof( T ) , data ) ; + } + template OSStatus SetData( ResType inTag , const T& data ) + { + return SetData( kControlEntireControl , inTag , sizeof( T ) , &data ) ; + } template OSStatus GetData( ControlPartCode inPartCode , ResType inTag , T *data ) const { Size dummy ; @@ -554,7 +562,18 @@ public : verify_noerr( GetData( inPartCode , inTag , &value ) ) ; return value ; } - + template OSStatus GetData( ResType inTag , T *data ) const + { + Size dummy ; + return GetData( kControlEntireControl , inTag , sizeof( T ) , data , &dummy ) ; + } + template T GetData( ResType inTag ) const + { + T value ; + verify_noerr( GetData( kControlEntireControl , inTag , &value ) ) ; + return value ; + } + // Flash the control for the specified amount of time virtual void Flash( ControlPartCode part , UInt32 ticks = 8 ) ; -- 2.45.2