From 8895d6a2509b5283c0c31bd5ca0b36c008f0ff9c Mon Sep 17 00:00:00 2001 From: smelenchuk Date: Sat, 12 Feb 2011 07:09:49 +0000 Subject: [PATCH] Make hotkey dialogue display in two columns. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7146 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/HotkeyDlg.cpp | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp index 98d6a1a0d8..351863e3f3 100644 --- a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp +++ b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp @@ -184,6 +184,8 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event) DoGetButtons(ClickedButton->GetId()); } +#define HOTKEY_NUM_COLUMNS 2 + void HotkeyConfigDialog::CreateHotkeyGUIControls(void) { static const wxChar* hkText[] = @@ -234,16 +236,20 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void) // A small type font wxFont m_SmallFont(7, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); - wxStaticBoxSizer *sHotkeys = new wxStaticBoxSizer(wxVERTICAL, this, _("Hotkeys")); + wxStaticBoxSizer *sHotkeyBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Hotkeys")); + wxGridSizer *sHotkeys = new wxGridSizer(HOTKEY_NUM_COLUMNS, 0, 0); // Header line - wxBoxSizer *HeaderSizer = new wxBoxSizer(wxHORIZONTAL); - wxStaticText *StaticTextHeader = new wxStaticText(this, wxID_ANY, _("Action")); - HeaderSizer->Add(StaticTextHeader, 1, wxALL, 2); - HeaderSizer->AddStretchSpacer(); - StaticTextHeader = new wxStaticText(this, wxID_ANY, _("Key"), wxDefaultPosition, size); - HeaderSizer->Add(StaticTextHeader, 0, wxALL, 2); - sHotkeys->Add(HeaderSizer, 0, wxEXPAND | wxALL, 1); + for (int i = 0; i < HOTKEY_NUM_COLUMNS; i++) + { + wxBoxSizer *HeaderSizer = new wxBoxSizer(wxHORIZONTAL); + wxStaticText *StaticTextHeader = new wxStaticText(this, wxID_ANY, _("Action")); + HeaderSizer->Add(StaticTextHeader, 1, wxALL, 2); + HeaderSizer->AddStretchSpacer(); + StaticTextHeader = new wxStaticText(this, wxID_ANY, _("Key"), wxDefaultPosition, size); + HeaderSizer->Add(StaticTextHeader, 0, wxALL, 2); + sHotkeys->Add(HeaderSizer, 0, wxEXPAND | wxALL, 1); + } for (int i = 0; i < NUM_HOTKEYS; i++) { @@ -265,13 +271,15 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void) sHotkeys->Add(sHotkey, 0, wxEXPAND | wxALL, 1); } + sHotkeyBox->Add(sHotkeys); + m_Close = new wxButton(this, ID_CLOSE, _("Close")); wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL); sButtons->AddStretchSpacer(); sButtons->Add(m_Close, 0, (wxLEFT), 5); wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL); - sMainSizer->Add(sHotkeys, 0, wxEXPAND | wxALL, 5); + sMainSizer->Add(sHotkeyBox, 0, wxEXPAND | wxALL, 5); sMainSizer->Add(sButtons, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5); SetSizer(sMainSizer); Layout();