+ // return the "main" top level window (if it hadn't been set previously
+ // with SetTopWindow(), will return just some top level window and, if
+ // there are none, will return NULL)
+ wxWindow *GetTopWindow() const
+ {
+ if (m_topWindow)
+ return m_topWindow;
+ else if (wxTopLevelWindows.GetCount() > 0)
+ return wxTopLevelWindows.GetFirst()->GetData();
+ else
+ return (wxWindow *)NULL;
+ }
+
+ // control the exit behaviour: by default, the program will exit the
+ // main loop (and so, usually, terminate) when the last top-level
+ // program window is deleted. Beware that if you disabel this (with
+ // SetExitOnFrameDelete(FALSE)), you'll have to call ExitMainLoop()
+ // explicitly from somewhere.
+ void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
+ bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
+
+ // miscellaneous customization functions
+ // -------------------------------------
+
+#if wxUSE_LOG
+ // override this function to create default log target of arbitrary
+ // user-defined class (default implementation creates a wxLogGui
+ // object) - this log object is used by default by all wxLogXXX()
+ // functions.
+ virtual wxLog *CreateLogTarget() { return new wxLogGui; }
+#endif // wxUSE_LOG
+
+
+ // get the standard icon used by wxWin dialogs - this allows the user
+ // to customize the standard dialogs. The 'which' parameter is one of
+ // wxICON_XXX values
+ virtual wxIcon GetStdIcon(int which) const = 0;
+
+ // VZ: what does this do exactly?
+ void SetWantDebugOutput( bool flag ) { m_wantDebugOutput = flag; }
+ bool GetWantDebugOutput() const { return m_wantDebugOutput; }
+
+ // set/get printing mode: see wxPRINT_XXX constants.
+ //
+ // default behaviour is the normal one for Unix: always use PostScript
+ // printing.
+ virtual void SetPrintMode(int WXUNUSED(mode)) { }
+ int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
+
+ // implementation only from now on
+ // -------------------------------
+
+ // helpers for dynamic wxApp construction
+ static void SetInitializerFunction(wxAppInitializerFunction fn)
+ { m_appInitFn = fn; }
+ static wxAppInitializerFunction GetInitializerFunction()
+ { return m_appInitFn; }
+
+ // access to the command line arguments
+ int argc;
+ char **argv;
+
+//private:
+protected:
+ // function used for dynamic wxApp creation
+ static wxAppInitializerFunction m_appInitFn;
+
+ // application info (must be set from the user code)
+ wxString m_vendorName, // vendor name (ACME Inc)
+ m_appName, // app name
+ m_className; // class name
+
+ // if TRUE, exit the main loop when the last top level window is deleted
+ bool m_exitOnFrameDelete;
+
+ // TRUE if the application wants to get debug output
+ bool m_wantDebugOutput;
+
+ // the main top level window - may be NULL
+ wxWindow *m_topWindow;
+};
+
+// ----------------------------------------------------------------------------
+// now include the declaration of the real class
+// ----------------------------------------------------------------------------
+
+#if defined(__WXMSW__)
+ #include "wx/msw/app.h"
+#elif defined(__WXMOTIF__)
+ #include "wx/motif/app.h"
+#elif defined(__WXQT__)
+ #include "wx/qt/app.h"
+#elif defined(__WXGTK__)
+ #include "wx/gtk/app.h"
+#elif defined(__WXMAC__)
+ #include "wx/mac/app.h"
+#elif defined(__WXSTUBS__)
+ #include "wx/stubs/app.h"
+#endif
+
+// ----------------------------------------------------------------------------
+// macros for dynamic creation of the application object
+// ----------------------------------------------------------------------------
+
+// Having a global instance of this class allows wxApp to be aware of the app
+// creator function. wxApp can then call this function to create a new app
+// object. Convoluted, but necessary.