]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/init.h
use wxALIGN_LEFT/CENTRE/RIGHT instead of wxTE_XXX to avoid problems with the latter...
[wxWidgets.git] / interface / wx / init.h
CommitLineData
23324ae1 1/////////////////////////////////////////////////////////////////////////////
7c913512 2// Name: init.h
e54c96f1 3// Purpose: interface of global functions
7c913512
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
fa7e10a4
FM
9
10/**
11 @class wxInitializer
12
13 Create an object of this class on the stack to initialize/cleanup the library
14 automatically.
15
e2c4ccaf 16 @library{wxbase}
fa7e10a4
FM
17 @category{appmanagement}
18
19 @see wxGLContext
20*/
21class wxInitializer
22{
23public:
24 /**
25 Initializes the library.
26 Calls wxInitialize().
27 */
28 wxInitializer(int argc = 0, wxChar **argv = NULL);
29
30 /**
31 Has the initialization been successful? (explicit test)
32 */
33 bool IsOk() const;
34
35 /**
36 This dtor only does clean up if we initialized the library properly.
37 Calls wxUninitialize().
38 */
39 ~wxInitializer();
40};
41
42
43
b21126db 44/** @addtogroup group_funcmacro_appinitterm */
8cd06fb5
BP
45//@{
46
7c913512 47/**
8cd06fb5
BP
48 This function can be used to perform the initialization of wxWidgets if you
49 can't use the default initialization code for any reason.
23324ae1 50
8cd06fb5
BP
51 If the function returns true, the initialization was successful and the
52 global wxApp object ::wxTheApp has been created. Moreover, wxEntryCleanup()
53 must be called afterwards. If the function returns false, a catastrophic
54 initialization error occured and (at least the GUI part of) the library
55 can't be used at all.
23324ae1 56
8cd06fb5
BP
57 Notice that parameters @c argc and @c argv may be modified by this
58 function.
027c1c27
BP
59
60 @header{wx/init.h}
23324ae1 61*/
4cc4bfaf 62bool wxEntryStart(int& argc, wxChar** argv);
8cd06fb5
BP
63
64/**
65 See wxEntryStart(int&,wxChar**) for more info about this function.
66
67 This is an additional overload of wxEntryStart() provided under MSW only.
68 It is meant to be called with the parameters passed to WinMain().
69
70 @note Under Windows CE platform, and only there, the type of @a pCmdLine is
71 @c wchar_t *, otherwise it is @c char *, even in Unicode build.
027c1c27 72
fa7e10a4
FM
73 @onlyfor{wxmsw}
74
027c1c27 75 @header{wx/init.h}
8cd06fb5 76*/
7c913512 77bool wxEntryStart(HINSTANCE hInstance,
4cc4bfaf
FM
78 HINSTANCE hPrevInstance = NULL,
79 char* pCmdLine = NULL,
7c913512 80 int nCmdShow = SW_SHOWNORMAL);
8cd06fb5
BP
81
82/**
83 Free resources allocated by a successful call to wxEntryStart().
027c1c27
BP
84
85 @header{wx/init.h}
8cd06fb5
BP
86*/
87void wxEntryCleanup();
88
fa7e10a4
FM
89/**
90 Initialize the library (may be called as many times as needed, but each
91 call to wxInitialize() must be matched by wxUninitialize()).
92
93 With this function you may avoid DECLARE_APP() and IMPLEMENT_APP() macros
94 and use wxInitialize() and wxUninitialize() dynamically in the
95 program startup and termination.
96
97 @header{wx/init.h}
98*/
99bool wxInitialize(int argc = 0, wxChar **argv = NULL);
100
101/**
102 Clean up; the library can't be used any more after the last call to
103 wxUninitialize().
104
105 See wxInitialize() for more info.
106
107 @header{wx/init.h}
108*/
109void wxUninitialize();
110
23324ae1
FM
111//@}
112