summaryrefslogtreecommitdiff
path: root/wx+/app_main.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
commitbd6336c629841c6db3a6ca53a936d629d34db53b (patch)
tree3721ef997864108df175ce677a8a7d4342a6f1d2 /wx+/app_main.h
parent4.0 (diff)
downloadFreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.gz
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.bz2
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.zip
4.1
Diffstat (limited to 'wx+/app_main.h')
-rw-r--r--wx+/app_main.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/wx+/app_main.h b/wx+/app_main.h
new file mode 100644
index 00000000..6b375592
--- /dev/null
+++ b/wx+/app_main.h
@@ -0,0 +1,49 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+
+#ifndef APPMAIN_H_INCLUDED
+#define APPMAIN_H_INCLUDED
+
+#include <wx/window.h>
+#include <wx/app.h>
+
+namespace zen
+{
+//just some wrapper around a global variable representing the (logical) main application window
+void setMainWindow(wxWindow* window); //set main window and enable "exit on frame delete"
+bool mainWindowWasSet();
+
+
+
+
+
+
+
+
+//######################## implementation ########################
+inline
+bool& getMainWndStatus()
+{
+ static bool status = false; //external linkage!
+ return status;
+}
+
+
+inline
+void setMainWindow(wxWindow* window)
+{
+ wxTheApp->SetTopWindow(window);
+ wxTheApp->SetExitOnFrameDelete(true);
+
+ getMainWndStatus() = true;
+}
+
+
+inline
+bool mainWindowWasSet() { return getMainWndStatus(); }
+}
+
+#endif // APPMAIN_H_INCLUDED
bgstack15