]> git.saurik.com Git - wxWidgets.git/blob - include/wx/app.h
glcanvas fix and toplevel event handler exposed
[wxWidgets.git] / include / wx / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/app.h
3 // Purpose: wxAppBase class and macros used for declaration of wxApp
4 // derived class in the user code
5 // Author: Julian Smart
6 // Modified by:
7 // Created: 01/02/97
8 // RCS-ID: $Id$
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_APP_H_BASE_
14 #define _WX_APP_H_BASE_
15
16 // ----------------------------------------------------------------------------
17 // headers we have to include here
18 // ----------------------------------------------------------------------------
19
20 #include "wx/event.h" // for the base class
21
22 #if wxUSE_GUI
23 #include "wx/window.h" // for wxTopLevelWindows
24
25 #include "wx/vidmode.h"
26 #endif // wxUSE_GUI
27
28 #include "wx/build.h"
29 #include "wx/init.h" // we must declare wxEntry()
30
31 class WXDLLIMPEXP_BASE wxAppConsole;
32 class WXDLLIMPEXP_BASE wxAppTraits;
33 class WXDLLIMPEXP_BASE wxCmdLineParser;
34 class WXDLLIMPEXP_BASE wxLog;
35 class WXDLLIMPEXP_BASE wxMessageOutput;
36
37 // wxUSE_EVTLOOP_IN_APP is a temporary hack needed until all ports are updated
38 // to use wxEventLoop, otherwise we get linking errors on wxMac, it's going to
39 // disappear a.s.a.p.
40 #ifdef __WXMAC__
41 #define wxUSE_EVTLOOP_IN_APP 0
42 #else
43 #define wxUSE_EVTLOOP_IN_APP 1
44 class WXDLLEXPORT wxEventLoop;
45 #endif
46
47 // ----------------------------------------------------------------------------
48 // typedefs
49 // ----------------------------------------------------------------------------
50
51 // the type of the function used to create a wxApp object on program start up
52 typedef wxAppConsole* (*wxAppInitializerFunction)();
53
54 // ----------------------------------------------------------------------------
55 // constants
56 // ----------------------------------------------------------------------------
57
58 enum
59 {
60 wxPRINT_WINDOWS = 1,
61 wxPRINT_POSTSCRIPT = 2
62 };
63
64 // ----------------------------------------------------------------------------
65 // wxAppConsole: wxApp for non-GUI applications
66 // ----------------------------------------------------------------------------
67
68 class WXDLLIMPEXP_BASE wxAppConsole : public wxEvtHandler
69 {
70 public:
71 // ctor and dtor
72 wxAppConsole();
73 virtual ~wxAppConsole();
74
75
76 // the virtual functions which may/must be overridden in the derived class
77 // -----------------------------------------------------------------------
78
79 // This is the very first function called for a newly created wxApp object,
80 // it is used by the library to do the global initialization. If, for some
81 // reason, you must override it (instead of just overriding OnInit(), as
82 // usual, for app-specific initializations), do not forget to call the base
83 // class version!
84 virtual bool Initialize(int& argc, wxChar **argv);
85
86 // This gives wxCocoa a chance to call OnInit() with a memory pool in place
87 virtual bool CallOnInit() { return OnInit(); }
88
89 // Called before OnRun(), this is a good place to do initialization -- if
90 // anything fails, return false from here to prevent the program from
91 // continuing. The command line is normally parsed here, call the base
92 // class OnInit() to do it.
93 virtual bool OnInit();
94
95 // this is here only temproary hopefully (FIXME)
96 virtual bool OnInitGui() { return true; }
97
98 // This is the replacement for the normal main(): all program work should
99 // be done here. When OnRun() returns, the programs starts shutting down.
100 virtual int OnRun() = 0;
101
102 // This is only called if OnInit() returned true so it's a good place to do
103 // any cleanup matching the initializations done there.
104 virtual int OnExit();
105
106 // This is the very last function called on wxApp object before it is
107 // destroyed. If you override it (instead of overriding OnExit() as usual)
108 // do not forget to call the base class version!
109 virtual void CleanUp();
110
111 // Called when a fatal exception occurs, this function should take care not
112 // to do anything which might provoke a nested exception! It may be
113 // overridden if you wish to react somehow in non-default way (core dump
114 // under Unix, application crash under Windows) to fatal program errors,
115 // however extreme care should be taken if you don't want this function to
116 // crash.
117 virtual void OnFatalException() { }
118
119 #if wxUSE_EXCEPTIONS
120 // Called when an unhandled C++ exception occurs inside OnRun(): note that
121 // the exception type is lost by now, so if you really want to handle the
122 // exception you should override OnRun() and put a try/catch around
123 // MainLoop() call there
124 virtual void OnUnhandledException() { }
125 #endif // wxUSE_EXCEPTIONS
126
127 // Called from wxExit() function, should terminate the application a.s.a.p.
128 virtual void Exit();
129
130
131 // application info: name, description, vendor
132 // -------------------------------------------
133
134 // NB: all these should be set by the application itself, there are no
135 // reasonable default except for the application name which is taken to
136 // be argv[0]
137
138 // set/get the application name
139 wxString GetAppName() const
140 {
141 return m_appName.empty() ? m_className : m_appName;
142 }
143 void SetAppName(const wxString& name) { m_appName = name; }
144
145 // set/get the app class name
146 wxString GetClassName() const { return m_className; }
147 void SetClassName(const wxString& name) { m_className = name; }
148
149 // set/get the vendor name
150 const wxString& GetVendorName() const { return m_vendorName; }
151 void SetVendorName(const wxString& name) { m_vendorName = name; }
152
153
154 // cmd line parsing stuff
155 // ----------------------
156
157 // all of these methods may be overridden in the derived class to
158 // customize the command line parsing (by default only a few standard
159 // options are handled)
160 //
161 // you also need to call wxApp::OnInit() from YourApp::OnInit() for all
162 // this to work
163
164 #if wxUSE_CMDLINE_PARSER
165 // this one is called from OnInit() to add all supported options
166 // to the given parser (don't forget to call the base class version if you
167 // override it!)
168 virtual void OnInitCmdLine(wxCmdLineParser& parser);
169
170 // called after successfully parsing the command line, return TRUE
171 // to continue and FALSE to exit (don't forget to call the base class
172 // version if you override it!)
173 virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
174
175 // called if "--help" option was specified, return TRUE to continue
176 // and FALSE to exit
177 virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
178
179 // called if incorrect command line options were given, return
180 // FALSE to abort and TRUE to continue
181 virtual bool OnCmdLineError(wxCmdLineParser& parser);
182 #endif // wxUSE_CMDLINE_PARSER
183
184
185 // miscellaneous customization functions
186 // -------------------------------------
187
188 // create the app traits object to which we delegate for everything which
189 // either should be configurable by the user (then he can change the
190 // default behaviour simply by overriding CreateTraits() and returning his
191 // own traits object) or which is GUI/console dependent as then wxAppTraits
192 // allows us to abstract the differences behind the common façade
193 wxAppTraits *GetTraits();
194
195 // the functions below shouldn't be used now that we have wxAppTraits
196 #if WXWIN_COMPATIBILITY_2_4
197
198 #if wxUSE_LOG
199 // override this function to create default log target of arbitrary
200 // user-defined class (default implementation creates a wxLogGui
201 // object) -- this log object is used by default by all wxLogXXX()
202 // functions.
203 virtual wxLog *CreateLogTarget();
204 #endif // wxUSE_LOG
205
206 // similar to CreateLogTarget() but for the global wxMessageOutput
207 // object
208 virtual wxMessageOutput *CreateMessageOutput();
209
210 #endif // WXWIN_COMPATIBILITY_2_4
211
212
213 // event processing functions
214 // --------------------------
215
216 // this method allows to filter all the events processed by the program, so
217 // you should try to return quickly from it to avoid slowing down the
218 // program to the crawl
219 //
220 // return value should be -1 to continue with the normal event processing,
221 // or TRUE or FALSE to stop further processing and pretend that the event
222 // had been already processed or won't be processed at all, respectively
223 virtual int FilterEvent(wxEvent& event);
224
225 #if wxUSE_EXCEPTIONS
226 // call the specified handler on the given object with the given event
227 //
228 // this method only exists to allow catching the exceptions thrown by any
229 // event handler, it would lead to an extra (useless) virtual function call
230 // if the exceptions were not used, so it doesn't even exist in that case
231 virtual void HandleEvent(wxEvtHandler *handler,
232 wxEventFunction func,
233 wxEvent& event) const;
234 #endif // wxUSE_EXCEPTIONS
235
236 // process all events in the wxPendingEvents list -- it is necessary to
237 // call this function to process posted events. This happens during each
238 // event loop iteration in GUI mode but if there is no main loop, it may be
239 // also called directly.
240 virtual void ProcessPendingEvents();
241
242 // doesn't do anything in this class, just a hook for GUI wxApp
243 virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; }
244
245 // make sure that idle events are sent again
246 virtual void WakeUpIdle() { }
247
248
249 // debugging support
250 // -----------------
251
252 // this function is called when an assert failure occurs, the base class
253 // version does the normal processing (i.e. shows the usual assert failure
254 // dialog box)
255 //
256 // the arguments are the place where the assert occured, the text of the
257 // assert itself and the user-specified message
258 #ifdef __WXDEBUG__
259 virtual void OnAssert(const wxChar *file,
260 int line,
261 const wxChar *cond,
262 const wxChar *msg);
263 #endif // __WXDEBUG__
264
265 // check that the wxBuildOptions object (constructed in the application
266 // itself, usually the one from IMPLEMENT_APP() macro) matches the build
267 // options of the library and abort if it doesn't
268 static bool CheckBuildOptions(const char *optionsSignature,
269 const char *componentName);
270 #if WXWIN_COMPATIBILITY_2_4
271 static bool CheckBuildOptions(const wxBuildOptions& buildOptions)
272 {
273 return CheckBuildOptions(buildOptions.m_signature, "your program");
274 }
275 #endif
276
277 // implementation only from now on
278 // -------------------------------
279
280 // helpers for dynamic wxApp construction
281 static void SetInitializerFunction(wxAppInitializerFunction fn)
282 { ms_appInitFn = fn; }
283 static wxAppInitializerFunction GetInitializerFunction()
284 { return ms_appInitFn; }
285
286 // accessors for ms_appInstance field (external code might wish to modify
287 // it, this is why we provide a setter here as well, but you should really
288 // know what you're doing if you call it), wxTheApp is usually used instead
289 // of GetInstance()
290 static wxAppConsole *GetInstance() { return ms_appInstance; }
291 static void SetInstance(wxAppConsole *app) { ms_appInstance = app; }
292
293
294 // command line arguments (public for backwards compatibility)
295 int argc;
296 wxChar **argv;
297
298 protected:
299 // the function which creates the traits object when GetTraits() needs it
300 // for the first time
301 virtual wxAppTraits *CreateTraits();
302
303
304 // function used for dynamic wxApp creation
305 static wxAppInitializerFunction ms_appInitFn;
306
307 // the one and only global application object
308 static wxAppConsole *ms_appInstance;
309
310
311 // application info (must be set from the user code)
312 wxString m_vendorName, // vendor name (ACME Inc)
313 m_appName, // app name
314 m_className; // class name
315
316 // the class defining the application behaviour, NULL initially and created
317 // by GetTraits() when first needed
318 wxAppTraits *m_traits;
319
320
321 // the application object is a singleton anyhow, there is no sense in
322 // copying it
323 DECLARE_NO_COPY_CLASS(wxAppConsole)
324 };
325
326 // ----------------------------------------------------------------------------
327 // wxAppBase: the common part of wxApp implementations for all platforms
328 // ----------------------------------------------------------------------------
329
330 #if wxUSE_GUI
331
332 class WXDLLIMPEXP_CORE wxAppBase : public wxAppConsole
333 {
334 public:
335 wxAppBase();
336 virtual ~wxAppBase();
337
338 // the virtual functions which may/must be overridden in the derived class
339 // -----------------------------------------------------------------------
340
341 // very first initialization function
342 //
343 // Override: very rarely
344 virtual bool Initialize(int& argc, wxChar **argv);
345
346 // a platform-dependent version of OnInit(): the code here is likely to
347 // depend on the toolkit. default version does nothing.
348 //
349 // Override: rarely.
350 virtual bool OnInitGui();
351
352 // called to start program execution - the default version just enters
353 // the main GUI loop in which events are received and processed until
354 // the last window is not deleted (if GetExitOnFrameDelete) or
355 // ExitMainLoop() is called. In console mode programs, the execution
356 // of the program really starts here
357 //
358 // Override: rarely in GUI applications, always in console ones.
359 virtual int OnRun();
360
361 // a matching function for OnInit()
362 virtual int OnExit();
363
364 // very last clean up function
365 //
366 // Override: very rarely
367 virtual void CleanUp();
368
369
370 // the worker functions - usually not used directly by the user code
371 // -----------------------------------------------------------------
372
373 // execute the main GUI loop, the function returns when the loop ends
374 virtual int MainLoop();
375
376 // exit the main loop thus terminating the application
377 virtual void Exit();
378
379 // exit the main GUI loop during the next iteration (i.e. it does not
380 // stop the program immediately!)
381 virtual void ExitMainLoop();
382
383 // returns TRUE if there are unprocessed events in the event queue
384 virtual bool Pending();
385
386 // process the first event in the event queue (blocks until an event
387 // appears if there are none currently, use Pending() if this is not
388 // wanted), returns false if the event loop should stop and true
389 // otherwise
390 virtual bool Dispatch();
391
392 // process all currently pending events right now
393 //
394 // it is an error to call Yield() recursively unless the value of
395 // onlyIfNeeded is TRUE
396 //
397 // WARNING: this function is dangerous as it can lead to unexpected
398 // reentrancies (i.e. when called from an event handler it
399 // may result in calling the same event handler again), use
400 // with _extreme_ care or, better, don't use at all!
401 virtual bool Yield(bool onlyIfNeeded = FALSE) = 0;
402
403 // this virtual function is called in the GUI mode when the application
404 // becomes idle and normally just sends wxIdleEvent to all interested
405 // parties
406 //
407 // it should return TRUE if more idle events are needed, FALSE if not
408 virtual bool ProcessIdle();
409
410 // Send idle event to window and all subwindows
411 // Returns TRUE if more idle time is requested.
412 virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
413
414 // Perform standard OnIdle behaviour: call from port's OnIdle
415 void OnIdle(wxIdleEvent& event);
416
417
418 // top level window functions
419 // --------------------------
420
421 // return TRUE if our app has focus
422 virtual bool IsActive() const { return m_isActive; }
423
424 // set the "main" top level window
425 void SetTopWindow(wxWindow *win) { m_topWindow = win; }
426
427 // return the "main" top level window (if it hadn't been set previously
428 // with SetTopWindow(), will return just some top level window and, if
429 // there are none, will return NULL)
430 virtual wxWindow *GetTopWindow() const
431 {
432 if (m_topWindow)
433 return m_topWindow;
434 else if (wxTopLevelWindows.GetCount() > 0)
435 return wxTopLevelWindows.GetFirst()->GetData();
436 else
437 return (wxWindow *)NULL;
438 }
439
440 // control the exit behaviour: by default, the program will exit the
441 // main loop (and so, usually, terminate) when the last top-level
442 // program window is deleted. Beware that if you disable this behaviour
443 // (with SetExitOnFrameDelete(FALSE)), you'll have to call
444 // ExitMainLoop() explicitly from somewhere.
445 void SetExitOnFrameDelete(bool flag)
446 { m_exitOnFrameDelete = flag ? Yes : No; }
447 bool GetExitOnFrameDelete() const
448 { return m_exitOnFrameDelete == Yes; }
449
450
451 // display mode, visual, printing mode, ...
452 // ------------------------------------------------------------------------
453
454 // Get display mode that is used use. This is only used in framebuffer
455 // wxWin ports (such as wxMGL).
456 virtual wxVideoMode GetDisplayMode() const { return wxVideoMode(); }
457 // Set display mode to use. This is only used in framebuffer wxWin
458 // ports (such as wxMGL). This method should be called from
459 // wxApp::OnInitGui
460 virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return TRUE; }
461
462 // set use of best visual flag (see below)
463 void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; }
464 bool GetUseBestVisual() const { return m_useBestVisual; }
465
466 // set/get printing mode: see wxPRINT_XXX constants.
467 //
468 // default behaviour is the normal one for Unix: always use PostScript
469 // printing.
470 virtual void SetPrintMode(int WXUNUSED(mode)) { }
471 int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
472
473
474 // command line parsing (GUI-specific)
475 // ------------------------------------------------------------------------
476
477 #if wxUSE_CMDLINE_PARSER
478 virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
479 virtual void OnInitCmdLine(wxCmdLineParser& parser);
480 #endif
481
482 // miscellaneous other stuff
483 // ------------------------------------------------------------------------
484
485 // called by toolkit-specific code to set the app status: active (we have
486 // focus) or not and also the last window which had focus before we were
487 // deactivated
488 virtual void SetActive(bool isActive, wxWindow *lastFocus);
489
490 // OBSOLETE: don't use, always returns true
491 //
492 // returns true if the program is successfully initialized
493 bool Initialized() { return true; }
494
495
496 protected:
497 // delete all objects in wxPendingDelete list
498 void DeletePendingObjects();
499
500 // override base class method to use GUI traits
501 virtual wxAppTraits *CreateTraits();
502
503
504 #if wxUSE_EVTLOOP_IN_APP
505 // the main event loop of the application (may be NULL if the loop hasn't
506 // been started yet or has already terminated)
507 wxEventLoop *m_mainLoop;
508 #endif // wxUSE_EVTLOOP_IN_APP
509
510 // the main top level window (may be NULL)
511 wxWindow *m_topWindow;
512
513 // if Yes, exit the main loop when the last top level window is deleted, if
514 // No don't do it and if Later -- only do it once we reach our OnRun()
515 //
516 // the explanation for using this strange scheme is given in appcmn.cpp
517 enum
518 {
519 Later = -1,
520 No,
521 Yes
522 } m_exitOnFrameDelete;
523
524 // TRUE if the apps whats to use the best visual on systems where
525 // more than one are available (Sun, SGI, XFree86 4.0 ?)
526 bool m_useBestVisual;
527
528 // does any of our windows has focus?
529 bool m_isActive;
530
531
532 DECLARE_NO_COPY_CLASS(wxAppBase)
533 };
534
535 #endif // wxUSE_GUI
536
537 // ----------------------------------------------------------------------------
538 // now include the declaration of the real class
539 // ----------------------------------------------------------------------------
540
541 #if wxUSE_GUI
542 #if defined(__WXMSW__)
543 #include "wx/msw/app.h"
544 #elif defined(__WXMOTIF__)
545 #include "wx/motif/app.h"
546 #elif defined(__WXMGL__)
547 #include "wx/mgl/app.h"
548 #elif defined(__WXGTK__)
549 #include "wx/gtk/app.h"
550 #elif defined(__WXX11__)
551 #include "wx/x11/app.h"
552 #elif defined(__WXMAC__)
553 #include "wx/mac/app.h"
554 #elif defined(__WXCOCOA__)
555 #include "wx/cocoa/app.h"
556 #elif defined(__WXPM__)
557 #include "wx/os2/app.h"
558 #endif
559 #else // !GUI
560 // allow using just wxApp (instead of wxAppConsole) in console programs
561 typedef wxAppConsole wxApp;
562 #endif // GUI/!GUI
563
564 // ----------------------------------------------------------------------------
565 // the global data
566 // ----------------------------------------------------------------------------
567
568 // for compatibility, we define this macro to access the global application
569 // object of type wxApp
570 //
571 // note that instead of using of wxTheApp in application code you should
572 // consider using DECLARE_APP() after which you may call wxGetApp() which will
573 // return the object of the correct type (i.e. MyApp and not wxApp)
574 //
575 // the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in
576 // console mode it does nothing at all
577 #define wxTheApp ((wxApp *)wxApp::GetInstance())
578
579 // ----------------------------------------------------------------------------
580 // global functions
581 // ----------------------------------------------------------------------------
582
583 // event loop related functions only work in GUI programs
584 // ------------------------------------------------------
585
586 // Force an exit from main loop
587 extern void WXDLLIMPEXP_BASE wxExit();
588
589 // Yield to other apps/messages
590 extern bool WXDLLIMPEXP_BASE wxYield();
591
592 // Yield to other apps/messages
593 extern void WXDLLIMPEXP_BASE wxWakeUpIdle();
594
595 // ----------------------------------------------------------------------------
596 // macros for dynamic creation of the application object
597 // ----------------------------------------------------------------------------
598
599 // Having a global instance of this class allows wxApp to be aware of the app
600 // creator function. wxApp can then call this function to create a new app
601 // object. Convoluted, but necessary.
602
603 class WXDLLIMPEXP_BASE wxAppInitializer
604 {
605 public:
606 wxAppInitializer(wxAppInitializerFunction fn)
607 { wxApp::SetInitializerFunction(fn); }
608 };
609
610 // Here's a macro you can use if your compiler really, really wants main() to
611 // be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
612 // code if required.
613
614 #define IMPLEMENT_WXWIN_MAIN_CONSOLE \
615 int main(int argc, char **argv) { return wxEntry(argc, argv); }
616
617 #if !wxUSE_GUI || !defined(__WXMSW__)
618 #define IMPLEMENT_WXWIN_MAIN \
619 IMPLEMENT_WXWIN_MAIN_CONSOLE
620 #elif defined(__WXMSW__)
621 // we need HINSTANCE declaration to define WinMain()
622 #include "wx/msw/wrapwin.h"
623
624 #ifdef SW_SHOWNORMAL
625 #define wxSW_SHOWNORMAL SW_SHOWNORMAL
626 #else
627 #define wxSW_SHOWNORMAL 0
628 #endif
629
630 #define IMPLEMENT_WXWIN_MAIN \
631 extern int wxEntry(HINSTANCE hInstance, \
632 HINSTANCE hPrevInstance = NULL, \
633 char *pCmdLine = NULL, \
634 int nCmdShow = wxSW_SHOWNORMAL); \
635 extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
636 HINSTANCE hPrevInstance, \
637 char *lpCmdLine, \
638 int nCmdShow) \
639 { \
640 return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \
641 }
642 #else
643 #define IMPLEMENT_WXWIN_MAIN
644 #endif
645
646 #ifdef __WXUNIVERSAL__
647 #include "wx/univ/theme.h"
648
649 #define IMPLEMENT_WX_THEME_SUPPORT \
650 WX_USE_THEME(win32); \
651 WX_USE_THEME(gtk);
652 #else
653 #define IMPLEMENT_WX_THEME_SUPPORT
654 #endif
655
656 // Use this macro if you want to define your own main() or WinMain() function
657 // and call wxEntry() from there.
658 #define IMPLEMENT_APP_NO_MAIN(appname) \
659 wxAppConsole *wxCreateApp() \
660 { \
661 wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
662 "your program"); \
663 return new appname; \
664 } \
665 wxAppInitializer \
666 wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
667 appname& wxGetApp() { return *(appname *)wxTheApp; }
668
669 // Same as IMPLEMENT_APP() normally but doesn't include themes support in
670 // wxUniversal builds
671 #define IMPLEMENT_APP_NO_THEMES(appname) \
672 IMPLEMENT_APP_NO_MAIN(appname) \
673 IMPLEMENT_WXWIN_MAIN
674
675 // Use this macro exactly once, the argument is the name of the wxApp-derived
676 // class which is the class of your application.
677 #define IMPLEMENT_APP(appname) \
678 IMPLEMENT_APP_NO_THEMES(appname) \
679 IMPLEMENT_WX_THEME_SUPPORT
680
681 // Same as IMPLEMENT_APP(), but for console applications.
682 #define IMPLEMENT_APP_CONSOLE(appname) \
683 IMPLEMENT_APP_NO_MAIN(appname) \
684 IMPLEMENT_WXWIN_MAIN_CONSOLE
685
686 // this macro can be used multiple times and just allows you to use wxGetApp()
687 // function
688 #define DECLARE_APP(appname) extern appname& wxGetApp();
689
690 #endif // _WX_APP_H_BASE_
691