mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Convert a few Comboboxes over to choiceboxes. WX OSX doesn't support Comboboxes with Readonly
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5087 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -46,7 +46,7 @@ DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wx
|
||||
m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Audio Throttle"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_buttonEnableRE0Fix = new wxCheckBox(this, ID_ENABLE_RE0_FIX, wxT("Enable RE0 Audio Hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
wxStaticText *BackendText = new wxStaticText(this, wxID_ANY, wxT("Audio Backend"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_BackendSelection = new wxComboBox(this, ID_BACKEND, wxEmptyString, wxDefaultPosition, wxSize(90, 20), wxArrayBackends, wxCB_READONLY, wxDefaultValidator);
|
||||
m_BackendSelection = new wxChoice(this, ID_BACKEND, wxDefaultPosition, wxSize(90, 20), wxArrayBackends, 0, wxDefaultValidator, wxEmptyString);
|
||||
|
||||
m_volumeSlider = new wxSlider(this, ID_VOLUME, ac_Config.m_Volume, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
|
||||
m_volumeSlider->Enable(SupportsVolumeChanges(ac_Config.sBackend));
|
||||
@ -102,10 +102,11 @@ void DSPConfigDialogHLE::AddBackend(const char* backend)
|
||||
// Update values
|
||||
m_BackendSelection->Append(wxString::FromAscii(backend));
|
||||
#ifdef __APPLE__
|
||||
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend));
|
||||
int num = m_BackendSelection->FindString(wxString::FromAscii(ac_Config.sBackend));
|
||||
#else
|
||||
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str()));
|
||||
int num = m_BackendSelection->FindString(wxString::FromAscii(ac_Config.sBackend.c_str()));
|
||||
#endif
|
||||
m_BackendSelection->SetSelection(num);
|
||||
}
|
||||
|
||||
void DSPConfigDialogHLE::ClearBackends()
|
||||
@ -133,9 +134,9 @@ void DSPConfigDialogHLE::SettingsChanged(wxCommandEvent& event)
|
||||
g_Config.m_EnableRE0Fix = m_buttonEnableRE0Fix->GetValue();
|
||||
|
||||
#ifdef __APPLE__
|
||||
strncpy(ac_Config.sBackend, m_BackendSelection->GetValue().mb_str(), 128);
|
||||
strncpy(ac_Config.sBackend, m_BackendSelection->GetStringSelection().mb_str(), 128);
|
||||
#else
|
||||
ac_Config.sBackend = m_BackendSelection->GetValue().mb_str();
|
||||
ac_Config.sBackend = m_BackendSelection->GetStringSelection().mb_str();
|
||||
#endif
|
||||
ac_Config.Update();
|
||||
g_Config.Save();
|
||||
@ -155,5 +156,5 @@ bool DSPConfigDialogHLE::SupportsVolumeChanges(std::string backend)
|
||||
|
||||
void DSPConfigDialogHLE::BackendChanged(wxCommandEvent& event)
|
||||
{
|
||||
m_volumeSlider->Enable(SupportsVolumeChanges(std::string(m_BackendSelection->GetValue().mb_str())));
|
||||
m_volumeSlider->Enable(SupportsVolumeChanges(std::string(m_BackendSelection->GetStringSelection().mb_str())));
|
||||
}
|
||||
|
Reference in New Issue
Block a user