-void wxDirDialog::OnSize(wxSizeEvent& WXUNUSED(event))
-{
- doSize();
-}
-
-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();
+ // 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();