no default filename will be supplied. The wildcard determines what files
are displayed in the file selector, and file extension supplies a type
extension for the required filename. Flags may be a combination of wxOPEN,
-wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, or 0. They are only significant
-at present in Windows.
+wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, or 0.
-Both the X and Windows versions implement a wildcard filter. Typing a
+Both the Unix and Windows versions implement a wildcard filter. Typing a
filename containing wildcards (*, ?) in the filename text item, and
clicking on Ok, will result in only those files matching the pattern being
-displayed. In the X version, supplying no default name will result in the
-wildcard filter being inserted in the filename text item; the filter is
-ignored if a default name is supplied.
+displayed.
-Under Windows (only), the wildcard may be a specification for multiple
-types of file with a description for each, such as:
+The wildcard may be a specification for multiple types of file
+with a description for each, such as:
\begin{verbatim}
"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
#include "wx/sizer.h"
#include "wx/bmpbuttn.h"
+#if wxUSE_TOOLTIPS
+ #include "wx/tooltip.h"
+#endif
+
#include "sys/types.h"
#include "sys/stat.h"
#include "dirent.h"
#include "wx/generic/home.xpm"
#include "wx/generic/listview.xpm"
#include "wx/generic/repview.xpm"
+#include "wx/generic/new_dir.xpm"
+#include "wx/generic/dir_up.xpm"
/* XPM */
static char * folder_xpm[] = {
long my_style = GetWindowStyleFlag();
if (my_style & wxLC_REPORT)
{
- InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, 110 );
+ InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, 130 );
InsertColumn( 1, _("Size"), wxLIST_FORMAT_LEFT, 60 );
InsertColumn( 2, _("Date"), wxLIST_FORMAT_LEFT, 55 );
InsertColumn( 3, _("Time"), wxLIST_FORMAT_LEFT, 50 );
wxString s = wxGetUserHome( wxString() );
m_dirName = s;
Update();
+ SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
+ EnsureVisible( 0 );
}
void wxFileCtrl::GoToDir( const wxString &dir )
{
m_dirName = dir;
Update();
+ SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
+ EnsureVisible( 0 );
}
void wxFileCtrl::GetDir( wxString &dir )
const wxString& wildCard,
long style,
const wxPoint& pos ) :
- wxDialog( parent, -1, message )
+ wxDialog( parent, -1, message, pos, wxDefaultSize, style | wxRESIZE_BORDER )
{
wxBeginBusyCursor();
wxBoxSizer *buttonsizer = new wxBoxSizer( wxHORIZONTAL );
- buttonsizer->Add( new wxBitmapButton( this, ID_LIST_MODE, wxBitmap( listview_xpm ) ), 0, wxALL, 5 );
- buttonsizer->Add( new wxBitmapButton( this, ID_REPORT_MODE, wxBitmap( repview_xpm ) ), 0, wxALL, 5 );
+ wxBitmapButton *but;
+
+ but = new wxBitmapButton( this, ID_LIST_MODE, wxBitmap( listview_xpm ) );
+#if wxUSE_TOOLTIPS
+ but->SetToolTip( _("View files as a list view") );
+#endif
+ buttonsizer->Add( but, 0, wxALL, 5 );
+
+ but = new wxBitmapButton( this, ID_REPORT_MODE, wxBitmap( repview_xpm ) );
+#if wxUSE_TOOLTIPS
+ but->SetToolTip( _("View files as a detailed view") );
+#endif
+ buttonsizer->Add( but, 0, wxALL, 5 );
+
buttonsizer->Add( 30, 5, 1 );
- buttonsizer->Add( new wxButton( this, ID_UP_DIR, "Up" ), 0, wxALL, 5 );
- buttonsizer->Add( new wxBitmapButton( this, ID_PARENT_DIR, wxBitmap(home_xpm) ), 0, wxALL, 5 );
- buttonsizer->Add( new wxButton( this, ID_NEW_DIR, "New..." ), 0, wxALL, 5 );
+
+ but = new wxBitmapButton( this, ID_UP_DIR, wxBitmap( dir_up_xpm ) );
+#if wxUSE_TOOLTIPS
+ but->SetToolTip( _("Go to parent directory") );
+#endif
+ buttonsizer->Add( but, 0, wxALL, 5 );
+
+ but = new wxBitmapButton( this, ID_PARENT_DIR, wxBitmap(home_xpm) );
+#if wxUSE_TOOLTIPS
+ but->SetToolTip( _("Go to home directory") );
+#endif
+ buttonsizer->Add( but, 0, wxALL, 5);
+
+ buttonsizer->Add( 20, 20 );
+
+ but = new wxBitmapButton( this, ID_NEW_DIR, wxBitmap(new_dir_xpm) );
+#if wxUSE_TOOLTIPS
+ but->SetToolTip( _("Create new directory") );
+#endif
+ buttonsizer->Add( but, 0, wxALL, 5 );
+
mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 );
- m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, "*", wxDefaultPosition, wxSize(450,180),
+ m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, "*", wxDefaultPosition, wxSize(440,180),
wxLC_LIST | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );