]> git.saurik.com Git - wxWidgets.git/commitdiff
added wx_dynamic_cast()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 Mar 2005 10:53:55 +0000 (10:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 Mar 2005 10:53:55 +0000 (10:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32574 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure.in
docs/changes.txt
docs/latex/wx/function.tex
include/wx/defs.h

index 6e2e1ab326648e7e93a70292cfc5d9e485b3ecd2..9e5583fad2dc46bc0b0e2dd9347b09dfaf5b2e6a 100644 (file)
@@ -1882,6 +1882,7 @@ dnl check whether C++ compiler supports C++ casts
 AC_CXX_CONST_CAST
 AC_CXX_REINTERPRET_CAST
 AC_CXX_STATIC_CAST
+AC_CXX_DYNAMIC_CAST
 
 dnl check various STL features
 if test "$wxUSE_STL" = "yes"; then
index 17d1350f089f208dddc60bef720dd566cdb7a95a..11951c0b99f04f905cde342f1e8ef4fe5479f5b6 100644 (file)
@@ -7,16 +7,18 @@ wxWidgets 2.5 Change Log - For more verbose changes, see the manual
 
 All:
 
-- wxURI::GetUser and wxURI::HasUser have been renamed to wxURI::GetUserInfo and wxURI::HasUserInfo respectively so that wxURI::GetUser returns the old username that were in the HTTP specification along with wxURI::GetPassword (Note that if you used wxURI::GetUser from 2.5.3 you should rename all instances of it to wxURI::GetUserInfo).
-- Added 
+- wxURI::GetUser() only returns the user name now, use GetUserInfo() to get
+  user and password as in 2.5.4; wxURI::GetPassword() added
+- added wx_dynamic_cast() macro
 
 All (GUI):
 
 - Added GetIcon, GetBitmap to wxImageList. wxGenericImageList's original
   GetBitmap is renamed GetBitmapPtr.
 - Added XPM data constructor to wxImage.
-- Added style parameter to wxBufferedDC to allow buffering just
-  the client, or the whole virtual area.
+- Added style parameter to wxBufferedDC to allow buffering just the client, or
+  the whole virtual area.
+
 
 wxPalmOS:
 
index c6808d5e6536e2aa9dda74fde7d6d8d127e709ca..122ed0d49fcf394fc4493c55ed2c8985edb29f16 100644 (file)
@@ -247,6 +247,7 @@ the corresponding topic.
 \helpref{wxWriteResource}{wxwriteresource}\\
 \helpref{wxYield}{wxyield}\\
 \helpref{wx\_const\_cast}{wxconstcastraw}\\
+\helpref{wx\_dynamic\_cast}{wxdynamiccastraw}\\
 \helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}\\
 \helpref{wx\_static\_cast}{wxstaticcastraw}\\
 \helpref{\_}{underscore}\\
@@ -3500,7 +3501,8 @@ Example:
 \helpref{RTTI overview}{runtimeclassoverview}\\
 \helpref{wxDynamicCastThis}{wxdynamiccastthis}\\
 \helpref{wxConstCast}{wxconstcast}\\
-\helpref{wxStatiicCast}{wxstaticcast}
+\helpref{wxStaticCast}{wxstaticcast}\\
+\helpref{wx\_dynamic\_cast}{wxdynamiccastraw}
 
 
 \membersection{wxDynamicCastThis}\label{wxdynamiccastthis}
@@ -3543,6 +3545,23 @@ arguments is the same as for the standard cast.
 
 \wxheading{See also}
 
+\helpref{wx\_dynamic\_cast}{wxdynamiccastraw},\\
+\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw},\\
+\helpref{wx\_static\_cast}{wxstaticcastraw}
+
+
+\membersection{wx\_dynamic\_cast}\label{wxdynamiccastraw}
+
+\func{T}{wx\_dynamic\_cast}{T, x}
+
+Same as \texttt{dynamic\_cast<T>(x)} if the compiler supports dynamic cast or
+\texttt{(T)x} for old compilers. Unlike \helpref{wxDynamicCast}{wxdynamiccast},
+the cast it to the type \arg{T} and not to \texttt{T *} and also the order of
+arguments is the same as for the standard cast.
+
+\wxheading{See also}
+
+\helpref{wx\_const\_cast}{wxconstcastraw},\\
 \helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw},\\
 \helpref{wx\_static\_cast}{wxstaticcastraw}
 
@@ -3557,6 +3576,7 @@ Same as \texttt{reinterpret\_cast<T>(x)} if the compiler supports reinterpret ca
 \wxheading{See also}
 
 \helpref{wx\_const\_cast}{wxconstcastraw},\\
+\helpref{wx\_dynamic\_cast}{wxdynamiccastraw},\\
 \helpref{wx\_static\_cast}{wxstaticcastraw}
 
 
@@ -3573,6 +3593,7 @@ star is not appended to it.
 \wxheading{See also}
 
 \helpref{wx\_const\_cast}{wxconstcastraw},\\
+\helpref{wx\_dynamic\_cast}{wxdynamiccastraw},\\
 \helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}
 
 
index 4203d06ec2f0bb05c099bc5c4486ab63b82fe4b0..5194f0678626472bcd7966378d95df187a472349 100644 (file)
@@ -269,6 +269,9 @@ typedef int wxWindowID;
     #ifndef HAVE_STATIC_CAST
         #define HAVE_STATIC_CAST
     #endif
+    #ifndef HAVE_DYNAMIC_CAST
+        #define HAVE_DYNAMIC_CAST
+    #endif
 #endif /*  HAVE_CXX_CASTS */
 
 #ifdef HAVE_STATIC_CAST
@@ -277,6 +280,12 @@ typedef int wxWindowID;
     #define wx_static_cast(t, x) ((t)(x))
 #endif
 
+#ifdef HAVE_DYNAMIC_CAST
+    #define wx_dynamic_cast(t, x) dynamic_cast<t>(x)
+#else
+    #define wx_dynamic_cast(t, x) ((t)(x))
+#endif
+
 #ifdef HAVE_CONST_CAST
     #define wx_const_cast(t, x) const_cast<t>(x)
 #else