From: <pst...@us...> - 2008-12-30 22:54:31
|
Revision: 662 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=662&view=rev Author: pstieber Date: 2008-12-30 22:54:27 +0000 (Tue, 30 Dec 2008) Log Message: ----------- Set the initial selection in the MIDI device list box based on the passed data. Modified Paths: -------------- trunk/jazz/src/MidiDeviceDialog.cpp Modified: trunk/jazz/src/MidiDeviceDialog.cpp =================================================================== --- trunk/jazz/src/MidiDeviceDialog.cpp 2008-12-30 22:53:35 UTC (rev 661) +++ trunk/jazz/src/MidiDeviceDialog.cpp 2008-12-30 22:54:27 UTC (rev 662) @@ -60,8 +60,16 @@ const string& MidiDeviceName = iMidiDevice->first; mpMidiDeviceListBox->Append(MidiDeviceName.c_str()); } - mpMidiDeviceListBox->SetSelection(0); + if (mDeviceIndex < static_cast<int>(mpMidiDeviceListBox->GetCount())) + { + mpMidiDeviceListBox->SetSelection(mDeviceIndex); + } + else + { + mpMidiDeviceListBox->SetSelection(0); + } + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |