]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/app.cpp
generate mouse events for all static controls, not just wxStaticLine (patch 1276413...
[wxWidgets.git] / src / motif / app.cpp
index 30ddd80a6d13a551d773f0b145ea8195e5c123c7..a28cc95f914fa63b8514300dc7c66b13ea58aa33 100644 (file)
@@ -38,7 +38,6 @@
 #pragma message disable nosimpint
 #endif
 #include <Xm/Xm.h>
 #pragma message disable nosimpint
 #endif
 #include <Xm/Xm.h>
-#include <Xm/Label.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
@@ -98,15 +97,32 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
 
     wxWidgetHashTable = new wxHashTable(wxKEY_INTEGER);
 
 
     wxWidgetHashTable = new wxHashTable(wxKEY_INTEGER);
 
+#if wxUSE_INTL
+    wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
+#endif
+
     return true;
 }
 
 void wxApp::CleanUp()
 {
     return true;
 }
 
 void wxApp::CleanUp()
 {
+    wxAppBase::CleanUp();
+
     delete wxWidgetHashTable;
     wxWidgetHashTable = NULL;
 
     delete wxWidgetHashTable;
     wxWidgetHashTable = NULL;
 
-    wxAppBase::CleanUp();
+    delete m_mainLoop;
+
+    for( wxPerDisplayDataMap::iterator it  = m_perDisplayData->begin(),
+                                       end = m_perDisplayData->end();
+         it != end; ++it )
+    {
+        delete it->second->m_visualInfo;
+        XtDestroyWidget( it->second->m_topLevelWidget );
+        delete it->second;
+    }
+
+    delete m_perDisplayData;
 }
 
 void wxApp::Exit()
 }
 
 void wxApp::Exit()
@@ -134,19 +150,6 @@ wxApp::wxApp()
 
 wxApp::~wxApp()
 {
 
 wxApp::~wxApp()
 {
-    delete m_mainLoop;
-
-    for( wxPerDisplayDataMap::iterator it  = m_perDisplayData->begin(),
-                                       end = m_perDisplayData->end();
-         it != end; ++it )
-    {
-        delete it->second->m_visualInfo;
-        XtDestroyWidget( it->second->m_topLevelWidget );
-        delete it->second;
-    }
-
-    delete m_perDisplayData;
-
     wxApp::SetInstance(NULL);
 }
 
     wxApp::SetInstance(NULL);
 }
 
@@ -188,8 +191,9 @@ static char *fallbackResources[] = {
 bool wxApp::OnInitGui()
 {
     if( !wxAppBase::OnInitGui() )
 bool wxApp::OnInitGui()
 {
     if( !wxAppBase::OnInitGui() )
-        return FALSE;
+        return false;
 
 
+    XtSetLanguageProc(NULL, NULL, NULL);
     XtToolkitInitialize() ;
     wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
     XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
     XtToolkitInitialize() ;
     wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
     XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
@@ -228,7 +232,7 @@ bool wxApp::OnInitGui()
 
     wxAddIdleCallback();
 
 
     wxAddIdleCallback();
 
-    return TRUE;
+    return true;
 }
 
 WXColormap wxApp::GetMainColormap(WXDisplay* display)
 }
 
 WXColormap wxApp::GetMainColormap(WXDisplay* display)
@@ -307,9 +311,9 @@ WXWidget wxCreateTopLevelWidget( WXDisplay* display )
 
 WXWidget wxCreateTopLevelRealizedWidget( WXDisplay* display )
 {
 
 WXWidget wxCreateTopLevelRealizedWidget( WXDisplay* display )
 {
-    Widget rTlw = XtVaCreateWidget( "dummy_widget", xmLabelWidgetClass,
+    Widget rTlw = XtVaCreateWidget( "dummy_widget", topLevelShellWidgetClass,
                                     (Widget)wxTheApp->GetTopLevelWidget(),
                                     (Widget)wxTheApp->GetTopLevelWidget(),
-                                    NULL);
+                                     NULL, 0 );
     XtSetMappedWhenManaged( rTlw, False );
     XtRealizeWidget( rTlw );
 
     XtSetMappedWhenManaged( rTlw, False );
     XtRealizeWidget( rTlw );
 
@@ -360,7 +364,7 @@ void wxApp::SetTopLevelRealizedWidget(WXDisplay* display, WXWidget widget)
 
 bool wxApp::Yield(bool onlyIfNeeded)
 {
 
 bool wxApp::Yield(bool onlyIfNeeded)
 {
-    static bool s_inYield = FALSE;
+    static bool s_inYield = false;
 
     if ( s_inYield )
     {
 
     if ( s_inYield )
     {
@@ -369,17 +373,17 @@ bool wxApp::Yield(bool onlyIfNeeded)
             wxFAIL_MSG( wxT("wxYield called recursively" ) );
         }
 
             wxFAIL_MSG( wxT("wxYield called recursively" ) );
         }
 
-        return FALSE;
+        return false;
     }
 
     }
 
-    s_inYield = TRUE;
+    s_inYield = true;
 
     while (wxTheApp && wxTheApp->Pending())
         wxTheApp->Dispatch();
 
 
     while (wxTheApp && wxTheApp->Pending())
         wxTheApp->Dispatch();
 
-    s_inYield = FALSE;
+    s_inYield = false;
 
 
-    return TRUE;
+    return true;
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------