]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxModule}}\label{wxmodule} |
2 | ||
3 | The module system is a very simple mechanism to allow applications (and parts of wxWindows itself) to | |
4 | define initialization and cleanup functions that are automatically called on wxWindows | |
5 | startup and exit. | |
6 | ||
7 | To define a new kind of module, derive a class from wxModule, override the OnInit and OnExit functions, | |
8 | and 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, | |
10 | create an instance of each, and call each OnInit function. On exit, wxWindows will call the OnExit | |
11 | function 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 | ||
23 | Constructs a wxModule object. | |
24 | ||
25 | \membersection{wxModule::\destruct{wxModule}} | |
26 | ||
27 | \func{}{\destruct{wxModule}}{\void} | |
28 | ||
29 | Destructor. | |
30 | ||
31 | \membersection{wxModule::CleanupModules}\label{wxmodulecleanupmodules} | |
32 | ||
33 | \func{static void}{CleanupModules}{\void} | |
34 | ||
35 | Calls Exit for each module instance. Called by wxWindows on exit, so there is no | |
36 | need for an application to call it. | |
37 | ||
38 | \membersection{wxModule::Exit}\label{wxmoduleexit} | |
39 | ||
40 | \func{void}{Exit}{\void} | |
41 | ||
42 | Calls OnExit. This function is called by wxWindows and should not need to be called | |
43 | by an application. | |
44 | ||
45 | \membersection{wxModule::Init}\label{wxmoduleinit} | |
46 | ||
47 | \func{bool}{Init}{\void} | |
48 | ||
49 | Calls OnInit. This function is called by wxWindows and should not need to be called | |
50 | by an application. | |
51 | ||
52 | \membersection{wxModule::InitializeModules}\label{wxmoduleinitializemodules} | |
53 | ||
54 | \func{static bool}{InitializeModules}{\void} | |
55 | ||
56 | Calls Init for each module instance. Called by wxWindows on startup, so there is no | |
57 | need for an application to call it. | |
58 | ||
59 | \membersection{wxModule::OnExit}\label{wxmoduleonexit} | |
60 | ||
61 | \func{virtual bool}{OnExit}{\void} | |
62 | ||
63 | Provide this function with appropriate cleanup for your module. | |
64 | ||
65 | \membersection{wxModule::OnInit}\label{wxmoduleoninit} | |
66 | ||
67 | \func{virtual bool}{OnInit}{\void} | |
68 | ||
69 | Provide this function with appropriate initialization for your module. If the function | |
70 | returns FALSE, wxWindows will exit immediately. | |
71 | ||
72 | \membersection{wxModule::RegisterModule}\label{wxmoduleregistermodule} | |
73 | ||
74 | \func{static void}{RegisterModule}{\param{wxModule*}{ module}} | |
75 | ||
76 | Registers this module with wxWindows. Called by wxWindows on startup, so there is no | |
77 | need for an application to call it. | |
78 | ||
79 | \membersection{wxModule::RegisterModules}\label{wxmoduleregistermodules} | |
80 | ||
81 | \func{static bool}{RegisterModules}{\void} | |
82 | ||
83 | Creates instances of and registers all modules. Called by wxWindows on startup, so there is no | |
84 | need for an application to call it. | |
85 |