+ // 1) dir ctrl
+ m_dirCtrl = NULL; // this is necessary, event handler called from
+ // wxGenericDirCtrl would crash otherwise!
+ long dirStyle = wxDIRCTRL_DIR_ONLY | wxDEFAULT_CONTROL_BORDER;
+
+#ifdef __WXMSW__
+ if (!HasFlag(wxDD_DIR_MUST_EXIST))
+ {
+ // Only under Windows do we need the wxTR_EDIT_LABEL tree control style
+ // before we can call EditLabel (required for "New directory")
+ dirStyle |= wxDIRCTRL_EDIT_LABELS;
+ }
+#endif
+
+ m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,
+ m_path, wxDefaultPosition,
+ wxSize(300, 200),
+ dirStyle);
+
+ wxSizerFlags flagsBorder2;
+ flagsBorder2.DoubleBorder(wxTOP | wxLEFT | wxRIGHT);
+
+ topsizer->Add(m_dirCtrl, wxSizerFlags(flagsBorder2).Proportion(1).Expand());
+
+#ifndef __SMARTPHONE__
+ // TODO: Make this an option depending on a flag?
+ wxCheckBox *
+ check = new wxCheckBox(this, ID_SHOW_HIDDEN, _("Show &hidden directories"));
+ topsizer->Add(check, wxSizerFlags(flagsBorder2).Right());
+#endif // !__SMARTPHONE__
+
+ // 2) text ctrl
+ m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition );
+ topsizer->Add(m_input, wxSizerFlags(flagsBorder2).Expand());
+
+ // 3) buttons if any
+ wxSizer *buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
+ if ( buttonSizer )
+ {
+ topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder());
+ }
+
+#ifdef __SMARTPHONE__
+ // overwrite menu set by CreateSeparatedButtonSizer() call above
+ SetRightMenu(wxID_ANY, _("Options"), dirMenu);
+#endif
+
+ m_input->SetFocus();
+
+ SetAutoLayout( true );