]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/module.tex
Fixed wxFileDialog and VC++ DLL compilation
[wxWidgets.git] / docs / latex / wx / module.tex
CommitLineData
a660d684
KB
1\section{\class{wxModule}}\label{wxmodule}
2
3The module system is a very simple mechanism to allow applications (and parts of wxWindows itself) to
4define initialization and cleanup functions that are automatically called on wxWindows
5startup and exit.
6
7To define a new kind of module, derive a class from wxModule, override the OnInit and OnExit functions,
8and add the DECLARE\_DYNAMIC\_CLASS and IMPLEMENT\_DYNAMIC\_CLASS to header and implementation files
9(which can be the same file). On initialization, wxWindows will find all classes derived from wxModule,
10create an instance of each, and call each OnInit function. On exit, wxWindows will call the OnExit
11function for each module instance.
12
13\wxheading{Derived from}
14
15\helpref{wxObject}{wxobject}
16
17\latexignore{\rtfignore{\wxheading{Members}}}
18
19\membersection{wxModule::wxModule}\label{wxmoduleconstr}
20
21\func{}{wxModule}{\void}
22
23Constructs a wxModule object.
24
25\membersection{wxModule::\destruct{wxModule}}
26
27\func{}{\destruct{wxModule}}{\void}
28
29Destructor.
30
31\membersection{wxModule::CleanupModules}\label{wxmodulecleanupmodules}
32
33\func{static void}{CleanupModules}{\void}
34
35Calls Exit for each module instance. Called by wxWindows on exit, so there is no
36need for an application to call it.
37
38\membersection{wxModule::Exit}\label{wxmoduleexit}
39
40\func{void}{Exit}{\void}
41
42Calls OnExit. This function is called by wxWindows and should not need to be called
43by an application.
44
45\membersection{wxModule::Init}\label{wxmoduleinit}
46
47\func{bool}{Init}{\void}
48
49Calls OnInit. This function is called by wxWindows and should not need to be called
50by an application.
51
52\membersection{wxModule::InitializeModules}\label{wxmoduleinitializemodules}
53
54\func{static bool}{InitializeModules}{\void}
55
56Calls Init for each module instance. Called by wxWindows on startup, so there is no
57need for an application to call it.
58
59\membersection{wxModule::OnExit}\label{wxmoduleonexit}
60
dfad0599 61\func{virtual void}{OnExit}{\void}
a660d684
KB
62
63Provide this function with appropriate cleanup for your module.
64
65\membersection{wxModule::OnInit}\label{wxmoduleoninit}
66
67\func{virtual bool}{OnInit}{\void}
68
69Provide this function with appropriate initialization for your module. If the function
70returns FALSE, wxWindows will exit immediately.
71
72\membersection{wxModule::RegisterModule}\label{wxmoduleregistermodule}
73
74\func{static void}{RegisterModule}{\param{wxModule*}{ module}}
75
76Registers this module with wxWindows. Called by wxWindows on startup, so there is no
77need for an application to call it.
78
79\membersection{wxModule::RegisterModules}\label{wxmoduleregistermodules}
80
81\func{static bool}{RegisterModules}{\void}
82
83Creates instances of and registers all modules. Called by wxWindows on startup, so there is no
84need for an application to call it.
85