MGR: On MS Windows, adjust width of Advanced Preferences dialog to fit all tabs without scrolling.

This commit is contained in:
Charlie Fenton 2014-08-01 02:26:01 -07:00
parent 917bf6762c
commit 7a0afdba65
2 changed files with 24 additions and 2 deletions

View File

@ -100,6 +100,29 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas
ReadPreferenceSettings();
//
RestoreState();
#ifdef __WXMSW__
int margin = 0, tabwidth = 0;
RECT r;
BOOL success = TabCtrl_GetItemRect(m_Notebook->GetHWND(), 0, &r);
if (success) {
margin = r.left;
}
success = TabCtrl_GetItemRect(m_Notebook->GetHWND(), m_Notebook->GetPageCount()-1, &r);
if (success) {
tabwidth += r.right;
}
tabwidth += margin;
wxSize sz = m_Notebook->GetBestSize();
if (sz.x < tabwidth) {
sz.x = tabwidth;
m_Notebook->SetMinSize(sz);
}
#endif
this->Layout();
Fit();
}
/* destructor */

View File

@ -98,6 +98,7 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri
m_panelControls->SetSizer( notebookSizer );
m_panelControls->Layout();
notebookSizer->Fit( m_panelControls );
dialogSizer->Add( m_panelControls, 1, wxALL|wxEXPAND, 1 );
m_panelButtons = new wxPanel( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
@ -126,8 +127,6 @@ CDlgAdvPreferencesBase::CDlgAdvPreferencesBase( wxWindow* parent, int id, wxStri
dialogSizer->Fit( this );
this->SetSizer( dialogSizer );
this->Layout();
Fit();
}
wxPanel* CDlgAdvPreferencesBase::createProcessorTab(wxNotebook* notebook)