From 1a64b24d3e326c2fd63d843c789fce97aab68b13 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 Jun 2005 23:46:33 +0000 Subject: [PATCH 1/1] documented wxScopeGuard; this class is too useful to not use it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ docs/latex/wx/function.tex | 44 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index a87fe68a7e..268adf7aee 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -5,6 +5,10 @@ wxWidgets Change Log - For more verbose changes, see the manual 2.6.2 ----- +All: + +- Fixed wxScopeGuard to work with VC++, documented it + wxMSW: - Fixed multiline tooltips handling. diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index d0ccdcc7eb..ee09e36d36 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -189,6 +189,8 @@ the corresponding topic. \helpref{wxNewId}{wxnewid}\\ \helpref{wxNow}{wxnow}\\ \helpref{wxOnAssert}{wxonassert}\\ +\helpref{wxON\_BLOCK\_EXIT}{wxonblockexit}\\ +\helpref{wxON\_BLOCK\_EXIT\_OBJ}{wxonblockexitobj}\\ \helpref{wxOpenClipboard}{wxopenclipboard}\\ \helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\ \helpref{wxDirExists}{functionwxdirexists}\\ @@ -2749,6 +2751,48 @@ Generates an integer identifier unique to this run of the program. +\membersection{wxON\_BLOCK\_EXIT}\label{wxonblockexit} + +\func{}{wxON\_BLOCK\_EXIT0}{\param{}{func}} +\func{}{wxON\_BLOCK\_EXIT1}{\param{}{func}, \param{}{p1}} +\func{}{wxON\_BLOCK\_EXIT2}{\param{}{func}, \param{}{p1}, \param{}{p2}} + +This family of macros allows to ensure that the global function \arg{func} +with 0, 1, 2 or more parameters (up to some implementaton-defined limit) is +executed on scope exit, whether due to a normal function return or because an +exception has been thrown. A typical example of its usage: +\begin{verbatim} + void *buf = malloc(size); + wxON_BLOCK_EXIT1(free, buf); +\end{verbatim} + +Please see the original article by Andrei Alexandrescu and Petru Marginean +published in December 2000 issue of \emph{C/C++ Users Journal} for more +details. + +\wxheading{Include files} + + + +\wxheading{See also} + +\helpref{wxON\_BLOCK\_EXIT\_OBJ}{wxonblockexitobj} + + +\membersection{wxON\_BLOCK\_EXIT\_OBJ}\label{wxonblockexitobj} + +\func{}{wxON\_BLOCK\_EXIT\_OBJ0}{\param{}{obj}, \param{}{method}} +\func{}{wxON\_BLOCK\_EXIT\_OBJ1}{\param{}{obj}, \param{}{method}, \param{}{p1}} +\func{}{wxON\_BLOCK\_EXIT\_OBJ2}{\param{}{obj}, \param{}{method}, \param{}{p1}, \param{}{p2}} + +This family of macros is similar to \helpref{wxON\_BLOCK\_EXIT}{wxonblockexit} +but calls a method of the given object instead of a free function. + +\wxheading{Include files} + + + + \membersection{::wxRegisterId}\label{wxregisterid} \func{void}{wxRegisterId}{\param{long}{ id}} -- 2.45.2