-void wxDirDialog::doSize()
-{
- /* Figure out height of DirCtrl, which is what is left over by
- * the textctrl and the buttons. Manually, because I can't seem
- * to get the constraints stuff to do this */
- int w,h,h2;
-
- GetClientSize(&w, &h);
- m_input->GetSize(&w,&h2); h -= h2;
- m_ok->GetSize(&w, &h2); h -= h2;
- //m_check->GetSize(&w, &h2); h -= h2;
- h -= 30;
-
- wxLayoutConstraints *c = new wxLayoutConstraints;
- c->left.SameAs (this, wxLeft,5);
- c->right.SameAs (this, wxRight,5);
- c->height.Absolute (h);
- c->top.SameAs (this, wxTop,5);
- m_dir->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->left.SameAs (this, wxLeft,5);
- c->right.SameAs (this, wxRight,5);
- c->height.AsIs ();
- c->top.Below (m_dir,5);
- m_input->SetConstraints(c);
-
- /* c = new wxLayoutConstraints;
- c->left.SameAs (this, wxLeft,5);
- c->right.SameAs (this, wxRight,5);
- c->height.AsIs ();
- c->top.Below (m_input,5);
- m_check->SetConstraints(c); */
-
- c = new wxLayoutConstraints;
- c->width.SameAs (m_cancel, wxWidth);
- c->height.AsIs ();
- 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,10);
- c->bottom.SameAs (this, wxBottom, 5);
- c->centreX.PercentOf (this, wxWidth, 50);
- m_new->SetConstraints(c);
-
- c = new wxLayoutConstraints;
- c->width.AsIs ();
- c->height.AsIs ();
- c->top.Below (m_input,10);
- c->centreX.PercentOf (this, wxWidth, 80);
- m_cancel->SetConstraints(c);
-
- Layout();
+ wxBeginBusyCursor();
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ // 1) dir ctrl
+ m_dir = new wxDirCtrl( this, ID_DIRCTRL, "/", wxDefaultPosition, wxSize(200,200),
+ wxTR_HAS_BUTTONS | wxSUNKEN_BORDER | wxTR_EDIT_LABELS);
+ topsizer->Add( m_dir, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );
+
+ // 2) text ctrl
+ m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition );
+ topsizer->Add( m_input, 0, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );
+
+ // m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") );
+ // m_check->SetValue(TRUE);
+
+#if wxUSE_STATLINE
+ // 3) static line
+ topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
+#endif
+
+ // 4) buttons
+ wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL );
+ m_ok = new wxButton( this, ID_OK, _("OK") );
+ buttonsizer->Add( m_ok, 0, wxLEFT|wxRIGHT, 10 );
+ m_cancel = new wxButton( this, ID_CANCEL, _("Cancel") );
+ buttonsizer->Add( m_cancel, 0, wxLEFT|wxRIGHT, 10 );
+ m_new = new wxButton( this, ID_NEW, _("New...") );
+ buttonsizer->Add( m_new, 0, wxLEFT|wxRIGHT, 10 );
+
+ topsizer->Add( buttonsizer, 0, wxALL | wxCENTER, 10 );
+
+ m_ok->SetDefault();
+ m_dir->SetFocus();
+
+ SetAutoLayout( TRUE );
+ SetSizer( topsizer );
+
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+
+ Centre( wxBOTH );
+
+ wxEndBusyCursor();