]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/filedlg.cpp
don't try to access empty wxIconBundle in gtk_frame_realized_callback
[wxWidgets.git] / src / motif / filedlg.cpp
index 05b7f34166d5344adb537ec9a0bdd70d2f340500..6ab59b0205aa015ee436aad35e1b761862f45fa1 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        filedlg.cpp
+// Name:        src/motif/filedlg.cpp
 // Purpose:     wxFileDialog
 // Author:      Julian Smart
 // Modified by:
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "filedlg.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 #define XtWindow XTWINDOW
 #endif
 
-#include "wx/defs.h"
-#include "wx/utils.h"
 #include "wx/filedlg.h"
-#include "wx/intl.h"
-#include "wx/app.h"
-#include "wx/settings.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/intl.h"
+    #include "wx/app.h"
+    #include "wx/utils.h"
+    #include "wx/settings.h"
+#endif
+
 #include "wx/tokenzr.h"
 #include "wx/stockitem.h"
 
@@ -118,8 +117,8 @@ static wxString ParseWildCard( const wxString& wild )
 
 wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
                            const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
-                           long style, const wxPoint& pos)
-             :wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos)
+                           long style, const wxPoint& pos, const wxSize& sz, const wxString& name)
+             :wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos, sz, name)
 {
     m_filterIndex = 1;
 }
@@ -173,12 +172,15 @@ int wxFileDialog::ShowModal()
     Arg args[10];
     int ac = 0;
 
-    wxComputeColours (dpy, & m_backgroundColour, (wxColour*) NULL);
+    if (m_backgroundColour.Ok())
+    {
+        wxComputeColours (dpy, & m_backgroundColour, (wxColour*) NULL);
 
-    XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
-    XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;
-    XtSetArg(args[ac], XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel); ac++;
-    XtSetArg(args[ac], XmNforeground, g_itemColors[wxFORE_INDEX].pixel); ac++;
+        XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
+        XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;
+        XtSetArg(args[ac], XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel); ac++;
+        XtSetArg(args[ac], XmNforeground, g_itemColors[wxFORE_INDEX].pixel); ac++;
+    }
 
     wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
 
@@ -235,7 +237,7 @@ int wxFileDialog::ShowModal()
 
     if (!m_message.IsNull())
         XtVaSetValues(shell,
-                      XmNtitle, wxConstCast(m_message.c_str(), char),
+                      XmNtitle, wxConstCast(m_message.mb_str(), char),
                       NULL);
 
     if (!m_wildCard.empty())
@@ -248,7 +250,7 @@ int wxFileDialog::ShowModal()
         else
             filter = wildCard;
 
-        XmTextSetString(filterWidget, wxConstCast(filter.c_str(), char));
+        XmTextSetString(filterWidget, wxConstCast(filter.mb_str(), char));
         XmFileSelectionDoSearch(fileSel, NULL);
     }
 
@@ -277,7 +279,7 @@ int wxFileDialog::ShowModal()
     if (!entirePath.empty())
     {
         XmTextSetString(selectionWidget,
-                        wxConstCast(entirePath.c_str(), char));
+                        wxConstCast(entirePath.mb_str(), char));
     }
 
     XtAddCallback(fileSel, XmNcancelCallback,