merge r4003 (options dialogue layout fixes)

Originally committed to SVN as r4021.
This commit is contained in:
Amar Takhar 2010-01-21 00:28:07 +00:00
parent 89e2428dbe
commit f43bff1e97

View file

@ -110,7 +110,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
SetIcon(BitmapToIcon(GETIMAGE(options_button_24))); SetIcon(BitmapToIcon(GETIMAGE(options_button_24)));
// Create book // Create book
book = new wxTreebook(this,-1,wxDefaultPosition,wxSize(400,300)); book = new wxTreebook(this,-1,wxDefaultPosition,wxDefaultSize);
needsRestart = false; needsRestart = false;
// Panels // Panels
@ -154,8 +154,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
genMainSizer->Add(genSizer1,0,wxEXPAND | wxBOTTOM,5); genMainSizer->Add(genSizer1,0,wxEXPAND | wxBOTTOM,5);
genMainSizer->Add(genSizer2,0,wxEXPAND,0); genMainSizer->Add(genSizer2,0,wxEXPAND,0);
genMainSizer->AddStretchSpacer(1); genMainSizer->AddStretchSpacer(1);
genMainSizer->Fit(generalPage); generalPage->SetSizerAndFit(genMainSizer);
generalPage->SetSizer(genMainSizer);
} }
// File save/load page // File save/load page
@ -214,8 +213,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
fileMainSizer->Add(fileSizer3,0,wxEXPAND | wxTOP,5); fileMainSizer->Add(fileSizer3,0,wxEXPAND | wxTOP,5);
fileMainSizer->Add(fileSizer5,0,wxEXPAND | wxTOP,5); fileMainSizer->Add(fileSizer5,0,wxEXPAND | wxTOP,5);
fileMainSizer->AddStretchSpacer(1); fileMainSizer->AddStretchSpacer(1);
fileMainSizer->Fit(filePage); filePage->SetSizerAndFit(fileMainSizer);
filePage->SetSizer(fileMainSizer);
} }
// Edit box page // Edit box page
@ -288,8 +286,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
editMainSizer->Add(editSizer1,0,wxEXPAND | wxALL,0); editMainSizer->Add(editSizer1,0,wxEXPAND | wxALL,0);
editMainSizer->Add(editSizer3,0,wxEXPAND | wxTOP,5); editMainSizer->Add(editSizer3,0,wxEXPAND | wxTOP,5);
editMainSizer->AddStretchSpacer(1); editMainSizer->AddStretchSpacer(1);
editMainSizer->Fit(editPage); editPage->SetSizerAndFit(editMainSizer);
editPage->SetSizer(editMainSizer);
} }
// Grid page // Grid page
@ -357,8 +354,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
gridMainSizer->Add(gridSizer1,0,wxEXPAND | wxALL,0); gridMainSizer->Add(gridSizer1,0,wxEXPAND | wxALL,0);
gridMainSizer->Add(gridSizer2,0,wxEXPAND | wxTOP,5); gridMainSizer->Add(gridSizer2,0,wxEXPAND | wxTOP,5);
gridMainSizer->AddStretchSpacer(1); gridMainSizer->AddStretchSpacer(1);
gridMainSizer->Fit(gridPage); gridPage->SetSizerAndFit(gridMainSizer);
gridPage->SetSizer(gridMainSizer);
} }
// Video page // Video page
@ -435,8 +431,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
videoMainSizer->Add(videoSizer1,0,wxEXPAND | wxALL,0); videoMainSizer->Add(videoSizer1,0,wxEXPAND | wxALL,0);
videoMainSizer->Add(videoSizer2,0,wxEXPAND | wxTOP,5); videoMainSizer->Add(videoSizer2,0,wxEXPAND | wxTOP,5);
videoMainSizer->AddStretchSpacer(1); videoMainSizer->AddStretchSpacer(1);
videoMainSizer->Fit(videoPage); videoPage->SetSizerAndFit(videoMainSizer);
videoPage->SetSizer(videoMainSizer);
} }
// Audio page // Audio page
@ -470,8 +465,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
audioSizer1->Add(audioSizer4,1,wxEXPAND | wxALL,5); audioSizer1->Add(audioSizer4,1,wxEXPAND | wxALL,5);
audioMainSizer->Add(audioSizer1,0,wxEXPAND | wxALL,0); audioMainSizer->Add(audioSizer1,0,wxEXPAND | wxALL,0);
audioMainSizer->AddStretchSpacer(1); audioMainSizer->AddStretchSpacer(1);
audioMainSizer->Fit(audioPage); audioPage->SetSizerAndFit(audioMainSizer);
audioPage->SetSizer(audioMainSizer);
} }
// Audio display page // Audio display page
@ -522,8 +516,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
displayMainSizer->Add(displaySizer1,0,wxEXPAND | wxALL,0); displayMainSizer->Add(displaySizer1,0,wxEXPAND | wxALL,0);
displayMainSizer->Add(displaySizer2,0,wxEXPAND | wxTOP,5); displayMainSizer->Add(displaySizer2,0,wxEXPAND | wxTOP,5);
displayMainSizer->AddStretchSpacer(1); displayMainSizer->AddStretchSpacer(1);
displayMainSizer->Fit(displayPage); displayPage->SetSizerAndFit(displayMainSizer);
displayPage->SetSizer(displayMainSizer);
} }
// Audio advanced page // Audio advanced page
@ -558,8 +551,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
audioAdvSizer2->Add(audioAdvSizer1,1,wxEXPAND | wxALL,5); audioAdvSizer2->Add(audioAdvSizer1,1,wxEXPAND | wxALL,5);
audioAdvSizer3->Add(audioAdvSizer2,0,wxEXPAND); audioAdvSizer3->Add(audioAdvSizer2,0,wxEXPAND);
audioAdvSizer3->AddStretchSpacer(1); audioAdvSizer3->AddStretchSpacer(1);
audioAdvSizer3->Fit(audioAdvPage); audioAdvPage->SetSizerAndFit(audioAdvSizer3);
audioAdvPage->SetSizer(audioAdvSizer3);
} }
// Automation page // Automation page
@ -585,8 +577,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
autoSizer1->Add(autoSizer2,1,wxEXPAND | wxALL,5); autoSizer1->Add(autoSizer2,1,wxEXPAND | wxALL,5);
autoMainSizer->Add(autoSizer1,0,wxEXPAND | wxALL,0); autoMainSizer->Add(autoSizer1,0,wxEXPAND | wxALL,0);
autoMainSizer->AddStretchSpacer(1); autoMainSizer->AddStretchSpacer(1);
autoMainSizer->Fit(autoPage); autoPage->SetSizerAndFit(autoMainSizer);
autoPage->SetSizer(autoMainSizer);
} }
// Hotkeys page // Hotkeys page
@ -596,7 +587,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
origKeys = Hotkeys.key; origKeys = Hotkeys.key;
// List of shortcuts // List of shortcuts
Shortcuts = new wxListView(hotkeysPage,HOTKEY_LIST,wxDefaultPosition,wxSize(250,150),wxLC_REPORT | wxLC_SINGLE_SEL); Shortcuts = new wxListView(hotkeysPage,HOTKEY_LIST,wxDefaultPosition,wxDefaultSize,wxLC_REPORT | wxLC_SINGLE_SEL);
Shortcuts->InsertColumn(0,_("Function"),wxLIST_FORMAT_LEFT,200); Shortcuts->InsertColumn(0,_("Function"),wxLIST_FORMAT_LEFT,200);
Shortcuts->InsertColumn(1,_("Key"),wxLIST_FORMAT_LEFT,120); Shortcuts->InsertColumn(1,_("Key"),wxLIST_FORMAT_LEFT,120);
@ -621,8 +612,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
wxSizer *hotkeysSizer = new wxBoxSizer(wxVERTICAL); wxSizer *hotkeysSizer = new wxBoxSizer(wxVERTICAL);
hotkeysSizer->Add(Shortcuts,1,wxLEFT|wxRIGHT|wxTOP|wxEXPAND,5); hotkeysSizer->Add(Shortcuts,1,wxLEFT|wxRIGHT|wxTOP|wxEXPAND,5);
hotkeysSizer->Add(buttons,0,wxALL|wxEXPAND,5); hotkeysSizer->Add(buttons,0,wxALL|wxEXPAND,5);
hotkeysSizer->Fit(hotkeysPage); hotkeysPage->SetSizerAndFit(hotkeysSizer);
hotkeysPage->SetSizer(hotkeysSizer);
} }
// List book // List book
@ -639,6 +629,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
#ifdef wxUSE_TREEBOOK #ifdef wxUSE_TREEBOOK
book->ChangeSelection(Options.AsInt(_T("Options page"))); book->ChangeSelection(Options.AsInt(_T("Options page")));
#endif #endif
book->Fit();
// Buttons Sizer // Buttons Sizer
wxStdDialogButtonSizer *stdButtonSizer = new wxStdDialogButtonSizer(); wxStdDialogButtonSizer *stdButtonSizer = new wxStdDialogButtonSizer();
@ -658,7 +649,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
mainSizer->Add(book,1,wxEXPAND | wxALL,5); mainSizer->Add(book,1,wxEXPAND | wxALL,5);
mainSizer->Add(buttonSizer,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,5); mainSizer->Add(buttonSizer,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,5);
mainSizer->SetSizeHints(this); mainSizer->SetSizeHints(this);
SetSizer(mainSizer); SetSizerAndFit(mainSizer);
CenterOnParent(); CenterOnParent();
// Read // Read
@ -1161,7 +1152,7 @@ void DialogOptions::OnDefaultAllHotkey(wxCommandEvent &event) {
/// @param shorts /// @param shorts
/// ///
DialogInputHotkey::DialogInputHotkey(wxWindow *parent, HotkeyType *_key, wxString name, wxListView *shorts) DialogInputHotkey::DialogInputHotkey(wxWindow *parent, HotkeyType *_key, wxString name, wxListView *shorts)
: wxDialog(parent, -1, _("Press Key"), wxDefaultPosition, wxSize(200,50), wxCAPTION | wxWANTS_CHARS , _T("Press key")) : wxDialog(parent, -1, _("Press Key"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxWANTS_CHARS)
{ {
// Key // Key
key = _key; key = _key;