#pragma hdrstop
#endif
-#include "wx/filectrl.h"
-
#if wxUSE_FILECTRL && !defined(__WXUNIVERSAL__)
-#ifndef WX_PRECOMP
-# include "wx/sizer.h"
-# include "wx/debug.h"
-#endif
+#include "wx/filectrl.h"
#include "wx/gtk/private.h"
-#include "wx/filedlg.h"
#include "wx/filename.h"
#include "wx/scopeguard.h"
#include "wx/tokenzr.h"
wxGtkString str( gtk_file_chooser_get_filename( m_widget ) );
wxString string;
- if (str.c_str() != NULL)
+ if (str)
string = wxString::FromUTF8(str);
return string;
}
if ( path.empty() )
return true;
- return gtk_file_chooser_set_filename( m_widget, path.utf8_str() );
+ return gtk_file_chooser_set_filename( m_widget, path.utf8_str() ) != 0;
}
bool wxGtkFileChooser::SetDirectory( const wxString& dir )
IMPLEMENT_DYNAMIC_CLASS( wxGtkFileCtrl, wxControl )
+wxGtkFileCtrl::~wxGtkFileCtrl()
+{
+ if (m_fcWidget)
+ GTKDisconnect(m_fcWidget);
+}
+
void wxGtkFileCtrl::Init()
{
m_checkNextSelEvent = false;
if ( !dir.empty() )
{
gtk_file_chooser_set_current_folder( m_fcWidget,
- dir.fn_str() );
+ wxGTK_CONV_FN(dir) );
}
const wxString fname = fn.GetFullName();
if ( !fname.empty() )
{
gtk_file_chooser_set_current_name( m_fcWidget,
- fname.fn_str() );
+ wxGTK_CONV_FN(fname) );
}
}
else // wxFC_OPEN
if ( !fname.empty() )
{
gtk_file_chooser_set_filename( m_fcWidget,
- fn.GetFullPath().fn_str() );
+ wxGTK_CONV_FN(fn.GetFullPath()) );
}
}
void wxGtkFileCtrl::ShowHidden(bool show)
{
- // gtk_file_chooser_set_show_hidden() is new in 2.6
- g_object_set (G_OBJECT (m_fcWidget), "show-hidden", show, NULL);
+ gtk_file_chooser_set_show_hidden(m_fcWidget, show);
}
#endif // wxUSE_FILECTRL