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:
Sonicadvance1 2010-02-19 22:56:37 +00:00
parent 227be30f98
commit f833cc7601
6 changed files with 21 additions and 21 deletions

View File

@ -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_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); 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); 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 = new wxSlider(this, ID_VOLUME, ac_Config.m_Volume, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
m_volumeSlider->Enable(SupportsVolumeChanges(ac_Config.sBackend)); m_volumeSlider->Enable(SupportsVolumeChanges(ac_Config.sBackend));
@ -102,10 +102,11 @@ void DSPConfigDialogHLE::AddBackend(const char* backend)
// Update values // Update values
m_BackendSelection->Append(wxString::FromAscii(backend)); m_BackendSelection->Append(wxString::FromAscii(backend));
#ifdef __APPLE__ #ifdef __APPLE__
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend)); int num = m_BackendSelection->FindString(wxString::FromAscii(ac_Config.sBackend));
#else #else
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str())); int num = m_BackendSelection->FindString(wxString::FromAscii(ac_Config.sBackend.c_str()));
#endif #endif
m_BackendSelection->SetSelection(num);
} }
void DSPConfigDialogHLE::ClearBackends() void DSPConfigDialogHLE::ClearBackends()
@ -133,9 +134,9 @@ void DSPConfigDialogHLE::SettingsChanged(wxCommandEvent& event)
g_Config.m_EnableRE0Fix = m_buttonEnableRE0Fix->GetValue(); g_Config.m_EnableRE0Fix = m_buttonEnableRE0Fix->GetValue();
#ifdef __APPLE__ #ifdef __APPLE__
strncpy(ac_Config.sBackend, m_BackendSelection->GetValue().mb_str(), 128); strncpy(ac_Config.sBackend, m_BackendSelection->GetStringSelection().mb_str(), 128);
#else #else
ac_Config.sBackend = m_BackendSelection->GetValue().mb_str(); ac_Config.sBackend = m_BackendSelection->GetStringSelection().mb_str();
#endif #endif
ac_Config.Update(); ac_Config.Update();
g_Config.Save(); g_Config.Save();
@ -155,5 +156,5 @@ bool DSPConfigDialogHLE::SupportsVolumeChanges(std::string backend)
void DSPConfigDialogHLE::BackendChanged(wxCommandEvent& event) 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())));
} }

View File

@ -48,7 +48,7 @@ private:
wxCheckBox *m_buttonEnableThrottle; wxCheckBox *m_buttonEnableThrottle;
wxCheckBox *m_buttonEnableRE0Fix; wxCheckBox *m_buttonEnableRE0Fix;
wxArrayString wxArrayBackends; wxArrayString wxArrayBackends;
wxComboBox *m_BackendSelection; wxChoice *m_BackendSelection;
enum enum
{ {

View File

@ -45,7 +45,7 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
m_buttonEnableDTKMusic = new wxCheckBox(this, ID_ENABLE_DTK_MUSIC, wxT("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_buttonEnableDTKMusic = new wxCheckBox(this, ID_ENABLE_DTK_MUSIC, wxT("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Audio Throttle"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Audio Throttle"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxStaticText *BackendText = new wxStaticText(this, wxID_ANY, wxT("Audio Backend"), wxDefaultPosition, wxDefaultSize, 0); 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 = new wxSlider(this, ID_VOLUME, ac_Config.m_Volume, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
m_volumeSlider->Enable(SupportsVolumeChanges(ac_Config.sBackend)); m_volumeSlider->Enable(SupportsVolumeChanges(ac_Config.sBackend));

View File

@ -46,7 +46,7 @@ private:
wxCheckBox *m_buttonEnableDTKMusic; wxCheckBox *m_buttonEnableDTKMusic;
wxCheckBox *m_buttonEnableThrottle; wxCheckBox *m_buttonEnableThrottle;
wxArrayString wxArrayBackends; wxArrayString wxArrayBackends;
wxComboBox *m_BackendSelection; wxChoice *m_BackendSelection;
enum enum
{ {

View File

@ -494,12 +494,12 @@ void GCPadConfigDialog::CreateGUIControls()
m_Notebook->AddPage(m_Controller[i], wxString::Format(wxT("Gamecube Pad %d"), i+1)); m_Notebook->AddPage(m_Controller[i], wxString::Format(wxT("Gamecube Pad %d"), i+1));
// Controller // Controller
m_Joyname[i] = new wxComboBox(m_Controller[i], IDC_JOYNAME, StrJoyname[0], wxDefaultPosition, wxSize(400, -1), StrJoyname, wxCB_READONLY); m_Joyname[i] = new wxChoice(m_Controller[i], IDC_JOYNAME, wxDefaultPosition, wxSize(400, -1), StrJoyname, 0, wxDefaultValidator, StrJoyname[0]);
// Dead zone // Dead zone
m_ComboDeadZoneLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Dead Zone")); m_ComboDeadZoneLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Dead Zone"));
m_ComboDeadZoneLeft[i] = new wxComboBox(m_Controller[i], IDC_DEAD_ZONE_LEFT, TextDeadZone[0], wxDefaultPosition, wxSize(50, -1), TextDeadZone, wxCB_READONLY); m_ComboDeadZoneLeft[i] = new wxChoice(m_Controller[i], IDC_DEAD_ZONE_LEFT, wxDefaultPosition, wxSize(50, -1), TextDeadZone, 0, wxDefaultValidator, TextDeadZone[0]);
m_ComboDeadZoneRight[i] = new wxComboBox(m_Controller[i], IDC_DEAD_ZONE_RIGHT, TextDeadZone[0], wxDefaultPosition, wxSize(50, -1), TextDeadZone, wxCB_READONLY); m_ComboDeadZoneRight[i] = new wxChoice(m_Controller[i], IDC_DEAD_ZONE_RIGHT, wxDefaultPosition, wxSize(50, -1), TextDeadZone, 0, wxDefaultValidator, TextDeadZone[0]);
// Circle to square // Circle to square
m_CheckS2C[i] = new wxCheckBox(m_Controller[i], IDC_STICK_S2C, wxT("Square To Circle")); m_CheckS2C[i] = new wxCheckBox(m_Controller[i], IDC_STICK_S2C, wxT("Square To Circle"));
@ -510,13 +510,12 @@ void GCPadConfigDialog::CreateGUIControls()
m_DiagonalLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Diagonal")); m_DiagonalLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Diagonal"));
m_DiagonalLabel[i]->SetToolTip(wxT("To produce a perfect circle in the 'Out' window you have to manually set\n") m_DiagonalLabel[i]->SetToolTip(wxT("To produce a perfect circle in the 'Out' window you have to manually set\n")
wxT("your diagonal values here from what is shown in the 'In' window.")); wxT("your diagonal values here from what is shown in the 'In' window."));
m_ComboDiagonal[i] = new wxComboBox(m_Controller[i], IDC_STICK_DIAGONAL, StrDiagonal[0], wxDefaultPosition, wxSize(50, -1), StrDiagonal, wxCB_READONLY); m_ComboDiagonal[i] = new wxChoice(m_Controller[i], IDC_STICK_DIAGONAL, wxDefaultPosition, wxSize(50, -1), StrDiagonal, 0, wxDefaultValidator, StrDiagonal[0]);
// Rumble // Rumble
m_CheckRumble[i] = new wxCheckBox(m_Controller[i], IDC_RUMBLE, wxT("Rumble")); m_CheckRumble[i] = new wxCheckBox(m_Controller[i], IDC_RUMBLE, wxT("Rumble"));
m_RumbleStrengthLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Strength")); m_RumbleStrengthLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Strength"));
m_RumbleStrength[i] = new wxComboBox(m_Controller[i], IDC_RUMBLE_STRENGTH, StrRumble[0], wxDefaultPosition, wxSize(50, -1), StrRumble, wxCB_READONLY); m_RumbleStrength[i] = new wxChoice(m_Controller[i], IDC_RUMBLE_STRENGTH, wxDefaultPosition, wxSize(50, -1), StrRumble, 0, wxDefaultValidator, StrRumble[0]);
// Sizers // Sizers
m_sDeadZoneHoriz[i] = new wxBoxSizer(wxHORIZONTAL); m_sDeadZoneHoriz[i] = new wxBoxSizer(wxHORIZONTAL);
m_sDeadZoneHoriz[i]->Add(m_ComboDeadZoneLeft[i], 0, (wxUP), 0); m_sDeadZoneHoriz[i]->Add(m_ComboDeadZoneLeft[i], 0, (wxUP), 0);
@ -607,7 +606,7 @@ void GCPadConfigDialog::CreateGUIControls()
m_TriggerStatusL[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("000"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); m_TriggerStatusL[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("000"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
m_TriggerStatusR[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("000"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); m_TriggerStatusR[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("000"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
m_tTriggerSource[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("Trigger Source")); m_tTriggerSource[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("Trigger Source"));
m_TriggerType[i] = new wxComboBox(m_Controller[i], IDC_TRIGGER_TYPE, StrTriggerType[0], wxDefaultPosition, wxSize(70, -1), StrTriggerType, wxCB_READONLY); m_TriggerType[i] = new wxChoice(m_Controller[i], IDC_TRIGGER_TYPE, wxDefaultPosition, wxSize(70, -1), StrTriggerType, 0, wxDefaultValidator, StrTriggerType[0]);
// Sizers // Sizers
m_sGridTrigger[i] = new wxGridBagSizer(0, 0); m_sGridTrigger[i] = new wxGridBagSizer(0, 0);
@ -666,7 +665,7 @@ void GCPadConfigDialog::CreateGUIControls()
m_gDPad[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("D-Pad")); m_gDPad[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("D-Pad"));
m_gStick[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Main Stick")); m_gStick[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Main Stick"));
m_Text_StickSrc[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Source")); m_Text_StickSrc[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Source"));
m_Combo_StickSrc[i] = new wxComboBox(m_Controller[i], IDC_STICK_SOURCE, StrSource[0], wxDefaultPosition, wxSize(70, -1), StrSource, wxCB_READONLY); m_Combo_StickSrc[i] = new wxChoice(m_Controller[i], IDC_STICK_SOURCE, wxDefaultPosition, wxSize(70, -1), StrSource, 0, wxDefaultValidator, StrSource[0]);
m_sStickSrc[i] = new wxBoxSizer(wxHORIZONTAL); m_sStickSrc[i] = new wxBoxSizer(wxHORIZONTAL);
m_sStickSrc[i]->Add(m_Text_StickSrc[i], 0, (wxUP), 4); m_sStickSrc[i]->Add(m_Text_StickSrc[i], 0, (wxUP), 4);
m_sStickSrc[i]->Add(m_Combo_StickSrc[i], 0, (wxLEFT), 2); m_sStickSrc[i]->Add(m_Combo_StickSrc[i], 0, (wxLEFT), 2);
@ -674,7 +673,7 @@ void GCPadConfigDialog::CreateGUIControls()
m_gStick[i]->AddSpacer(2); m_gStick[i]->AddSpacer(2);
m_gCStick[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("C-Stick")); m_gCStick[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("C-Stick"));
m_Text_CStickSrc[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Source")); m_Text_CStickSrc[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Source"));
m_Combo_CStickSrc[i] = new wxComboBox(m_Controller[i], IDC_CSTICK_SOURCE, StrSource[0], wxDefaultPosition, wxSize(70, -1), StrSource, wxCB_READONLY); m_Combo_CStickSrc[i] = new wxChoice(m_Controller[i], IDC_CSTICK_SOURCE, wxDefaultPosition, wxSize(70, -1), StrSource, 0, wxDefaultValidator, StrSource[0]);
m_sCStickSrc[i] = new wxBoxSizer(wxHORIZONTAL); m_sCStickSrc[i] = new wxBoxSizer(wxHORIZONTAL);
m_sCStickSrc[i]->Add(m_Text_CStickSrc[i], 0, (wxUP), 4); m_sCStickSrc[i]->Add(m_Text_CStickSrc[i], 0, (wxUP), 4);
m_sCStickSrc[i]->Add(m_Combo_CStickSrc[i], 0, (wxLEFT), 2); m_sCStickSrc[i]->Add(m_Combo_CStickSrc[i], 0, (wxLEFT), 2);
@ -682,7 +681,7 @@ void GCPadConfigDialog::CreateGUIControls()
m_gCStick[i]->AddSpacer(2); m_gCStick[i]->AddSpacer(2);
m_gTrigger[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Triggers")); m_gTrigger[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Triggers"));
m_Text_TriggerSrc[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Source")); m_Text_TriggerSrc[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Source"));
m_Combo_TriggerSrc[i] = new wxComboBox(m_Controller[i], IDC_TRIGGER_SOURCE, StrSource[0], wxDefaultPosition, wxSize(70, -1), StrSource, wxCB_READONLY); m_Combo_TriggerSrc[i] = new wxChoice(m_Controller[i], IDC_TRIGGER_SOURCE, wxDefaultPosition, wxSize(70, -1), StrSource, 0, wxDefaultValidator, StrSource[0]);
m_sTriggerSrc[i] = new wxBoxSizer(wxHORIZONTAL); m_sTriggerSrc[i] = new wxBoxSizer(wxHORIZONTAL);
m_sTriggerSrc[i]->Add(m_Text_TriggerSrc[i], 0, (wxUP), 4); m_sTriggerSrc[i]->Add(m_Text_TriggerSrc[i], 0, (wxUP), 4);
m_sTriggerSrc[i]->Add(m_Combo_TriggerSrc[i], 0, (wxLEFT), 2); m_sTriggerSrc[i]->Add(m_Combo_TriggerSrc[i], 0, (wxLEFT), 2);

View File

@ -109,7 +109,7 @@ class GCPadConfigDialog : public wxDialog
IDC_STICK_DIAGONAL, IDC_STICK_S2C, IDC_STICK_DIAGONAL, IDC_STICK_S2C,
IDC_RUMBLE, IDC_RUMBLE_STRENGTH, IDC_RUMBLE, IDC_RUMBLE_STRENGTH,
IDC_TRIGGER_TYPE, IDC_TRIGGER_TYPE,
IDC_STICK_SOURCE, IDC_CSTICK_SOURCE, IDC_TRIGGER_SOURCE, IDC_STICK_SOURCE, IDC_CSTICK_SOURCE, IDC_TRIGGER_SOURCE,
IDS_STICK_PRESS, IDS_CSTICK_PRESS, IDS_TRIGGER_PRESS, IDS_STICK_PRESS, IDS_CSTICK_PRESS, IDS_TRIGGER_PRESS,
}; };
@ -137,7 +137,7 @@ class GCPadConfigDialog : public wxDialog
*m_Button_Analog[IDB_TRIGGER_R - IDB_ANALOG_LEFT_X + 1][4], *m_Button_Analog[IDB_TRIGGER_R - IDB_ANALOG_LEFT_X + 1][4],
*m_Button_GC[IDB_SHDR_SEMI_R - IDB_BTN_A + 1][4]; *m_Button_GC[IDB_SHDR_SEMI_R - IDB_BTN_A + 1][4];
wxComboBox *m_Joyname[4], wxChoice *m_Joyname[4],
*m_ComboDeadZoneLeft[4], *m_ComboDeadZoneLeft[4],
*m_ComboDeadZoneRight[4], *m_ComboDeadZoneRight[4],
*m_ComboDiagonal[4], *m_ComboDiagonal[4],