From 749caeeb381b57bef763364a4cf85c2f2fb6dfc1 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 23 Feb 2003 02:03:41 +0000
Subject: [PATCH] documented wxGetApp()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/function.tex | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index 2e04f4c8d6..438c1ce9ee 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -85,6 +85,7 @@ the corresponding topic.
 \helpref{wxFindWindowByLabel}{wxfindwindowbylabel}\\
 \helpref{wxFindWindowByName}{wxfindwindowbyname}\\
 \helpref{wxGetActiveWindow}{wxgetactivewindow}\\
+\helpref{wxGetApp}{wxgetapp}\\
 \helpref{wxGetClipboardData}{wxgetclipboarddata}\\
 \helpref{wxGetClipboardFormatName}{wxgetclipboardformatname}\\
 \helpref{wxGetColourFromUser}{wxgetcolourfromuser}\\
@@ -343,6 +344,21 @@ int CTheApp::ExitInstance()
 
 <wx/app.h>
 
+
+\membersection{::wxGetApp}\label{wxgetapp}
+
+\func{wxAppDerivedClass\&}{wxGetApp}{\void}
+
+This function doesn't exist in wxWindows but it is created by using
+the \helpref{IMPLEMENT\_APP}{implementapp} macro. Thus, before using it
+anywhere but in the same module where this macro is used, you must make it
+available using \helpref{DECLARE\_APP}{declareapp}.
+
+The advantage of using this function compared to directly using the global
+wxTheApp pointer is that the latter is of type {\tt wxApp *} and so wouldn't
+allow you to access the functions specific to your application class but not
+present in wxApp while wxGetApp() returns the object of the right type.
+
 \membersection{::wxHandleFatalExceptions}\label{wxhandlefatalexceptions}
 
 \func{bool}{wxHandleFatalExceptions}{\param{bool}{ doIt = true}}
@@ -2690,8 +2706,10 @@ class wxCommand: public wxObject
 
 \func{}{DECLARE\_APP}{className}
 
-This is used in headers to create a forward declaration of the wxGetApp function implemented
-by IMPLEMENT\_APP. It creates the declaration {\tt className\& wxGetApp(void)}.
+This is used in headers to create a forward declaration of the 
+\helpref{wxGetApp}{wxgetapp} function implemented by 
+\helpref{IMPLEMENT\_APP}{implementapp}. It creates the declaration 
+{\tt className\& wxGetApp(void)}.
 
 Example:
 
-- 
2.47.2

