#include "wx/filepicker.h"
#include "wx/tooltip.h"
-#include <gtk/gtk.h>
-
-
+#include "wx/gtk/private.h"
// ============================================================================
// implementation
{
if (!gtk_check_version(2,6,0))
{
- // VERY IMPORTANT: this code is identic to relative code in wxFileButton;
- // if you find a problem here, fix it also in wxFileButton !
+ // VERY IMPORTANT: this code is identic to relative code in wxDirButton;
+ // if you find a problem here, fix it also in wxDirButton !
m_needParent = true;
+ m_acceptsFocus = true;
if (!PreCreation( parent, pos, size ) ||
!wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
m_parent->DoAddChild( this );
PostCreation(size);
- SetBestSize(size);
+ SetInitialSize(size);
}
else
return wxGenericFileButton::Create(parent, id, label, path, message, wildcard,
}
}
-
void wxFileButton::SetPath(const wxString &str)
{
m_path = str;
// NB: it's important to use gtk_file_chooser_get_filename instead of
// gtk_file_chooser_get_current_folder (see GTK docs) !
- gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
+ wxGtkString filename(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)));
p->UpdatePath(filename);
// since GtkFileChooserButton when used to pick directories also uses a combobox,
// style was given.
if (p->HasFlag(wxDIRP_CHANGE_DIR))
chdir(filename);
- g_free(filename);
// ...and fire an event
wxFileDirPickerEvent event(wxEVT_COMMAND_DIRPICKER_CHANGED, p, p->GetId(), p->GetPath());
// if you find a problem here, fix it also in wxFileButton !
m_needParent = true;
+ m_acceptsFocus = true;
if (!PreCreation( parent, pos, size ) ||
!wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
m_parent->DoAddChild( this );
PostCreation(size);
- SetBestSize(size);
+ SetInitialSize(size);
}
else
return wxGenericDirButton::Create(parent, id, label, path, message, wildcard,