X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63852e7836dd87f363eb5bd01af3ef05681a93bd..420ec58abbf042de49ccde2253abd96dbc85c8ff:/src/generic/dirdlgg.cpp diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index db260cf827..fa4ca908b1 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -12,7 +12,17 @@ #pragma implementation "dirdlgg.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + #include "wx/defs.h" + +#if wxUSE_DIRDLG + #include "wx/utils.h" #include "wx/dialog.h" #include "wx/button.h" @@ -24,9 +34,15 @@ #include "wx/gdicmn.h" #include "wx/intl.h" #include "wx/imaglist.h" +#include "wx/icon.h" #include "wx/generic/dirdlgg.h" +// If compiled under Windows, this macro can cause problems +#ifdef GetFirstChild +#undef GetFirstChild +#endif + /* XPM */ static char * icon1_xpm[] = { /* width height ncolors chars_per_pixel */ @@ -126,8 +142,8 @@ class wxDirCtrl: public wxTreeCtrl const wxSize& size = wxDefaultSize, const long style = wxTR_HAS_BUTTONS, const wxString& name = "wxTreeCtrl" ); - void OnExpandItem( const wxTreeEvent &event ); - void OnCollapseItem( const wxTreeEvent &event ); + void OnExpandItem(wxTreeEvent &event ); + void OnCollapseItem(wxTreeEvent &event ); void ShowHidden( const bool yesno ); DECLARE_EVENT_TABLE() protected: @@ -208,15 +224,15 @@ void wxDirCtrl::SetupSections() m_paths.Clear(); m_names.Clear(); - ADD_SECTION("/", _("The Computer") ) + ADD_SECTION(_T("/"), _("The Computer") ) wxGetHomeDir(&home); ADD_SECTION(home, _("My Home") ) - ADD_SECTION("/mnt", _("Mounted Devices") ) - ADD_SECTION("/usr", _("User") ) - ADD_SECTION("/usr/local", _("User Local") ) - ADD_SECTION("/var", _("Variables") ) - ADD_SECTION("/etc", _("Etcetera") ) - ADD_SECTION("/tmp", _("Temporary") ) + ADD_SECTION(_T("/mnt"), _("Mounted Devices") ) + ADD_SECTION(_T("/usr"), _("User") ) + ADD_SECTION(_T("/usr/local"), _("User Local") ) + ADD_SECTION(_T("/var"), _("Variables") ) + ADD_SECTION(_T("/etc"), _("Etcetera") ) + ADD_SECTION(_T("/tmp"), _("Temporary") ) } #undef ADD_SECTION @@ -235,7 +251,7 @@ void wxDirCtrl::CreateItems(const wxTreeItemId &parent) } } -void wxDirCtrl::OnExpandItem( const wxTreeEvent &event ) +void wxDirCtrl::OnExpandItem(wxTreeEvent &event ) { if (event.GetItem() == m_rootId) { @@ -273,7 +289,7 @@ void wxDirCtrl::OnExpandItem( const wxTreeEvent &event ) }; -void wxDirCtrl::OnCollapseItem( const wxTreeEvent &event ) +void wxDirCtrl::OnCollapseItem(wxTreeEvent &event ) { wxTreeItemId child, parent = event.GetItem(); long cookie; @@ -326,7 +342,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition ); // m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") ); m_ok = new wxButton( this, ID_OK, _("OK") ); - m_cancel = new wxButton( this, ID_CANCEL, _("Cancel") ); + m_cancel = new wxButton( this, ID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1) ); m_new = new wxButton( this, ID_NEW, _("New...") ); // m_check->SetValue(TRUE); @@ -352,7 +368,7 @@ void wxDirDialog::doSize() m_input->GetSize(&w,&h2); h -= h2; m_ok->GetSize(&w, &h2); h -= h2; //m_check->GetSize(&w, &h2); h -= h2; - h -= 20; + h -= 30; wxLayoutConstraints *c = new wxLayoutConstraints; c->left.SameAs (this, wxLeft,5); @@ -378,14 +394,14 @@ void wxDirDialog::doSize() c = new wxLayoutConstraints; c->width.SameAs (m_cancel, wxWidth); c->height.AsIs (); - c->top.Below (m_input,5); - c->centreX.PercentOf (this, wxWidth, 25); + c->top.Below (m_input,10); + c->centreX.PercentOf (this, wxWidth, 20); m_ok->SetConstraints(c); c = new wxLayoutConstraints; c->width.SameAs (m_cancel, wxWidth); c->height.AsIs (); - c->top.Below (m_input,5); + c->top.Below (m_input,10); c->bottom.SameAs (this, wxBottom, 5); c->centreX.PercentOf (this, wxWidth, 50); m_new->SetConstraints(c); @@ -393,8 +409,8 @@ void wxDirDialog::doSize() c = new wxLayoutConstraints; c->width.AsIs (); c->height.AsIs (); - c->top.Below (m_input,5); - c->centreX.PercentOf (this, wxWidth, 75); + c->top.Below (m_input,10); + c->centreX.PercentOf (this, wxWidth, 80); m_cancel->SetConstraints(c); Layout(); @@ -414,7 +430,7 @@ void wxDirDialog::OnTreeSelected( wxTreeEvent &event ) m_input->SetValue( *(data->m_path) ); }; -void wxDirDialog::OnTreeKeyDown( wxKeyEvent &WXUNUSED(event) ) +void wxDirDialog::OnTreeKeyDown( wxTreeEvent &WXUNUSED(event) ) { wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData(m_dir->GetSelection()); @@ -488,3 +504,5 @@ void wxDirDialog::OnCheck( wxCommandEvent& WXUNUSED(event) ) printf("Checkbox clicked: %s\n", ( m_check->GetValue() ? "on" : "off" ) ); } */ + +#endif