don't call SetInsertionPointToEnd() on read-only combobox in wxGridCellChoiceEditor::Reset() neither (this had been already fixed for StartEdit() before) (#8843)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1598,19 +1598,7 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid)
|
|||||||
|
|
||||||
m_startValue = grid->GetTable()->GetValue(row, col);
|
m_startValue = grid->GetTable()->GetValue(row, col);
|
||||||
|
|
||||||
if (m_allowOthers)
|
Reset(); // this updates combo box to correspond to m_startValue
|
||||||
{
|
|
||||||
Combo()->SetValue(m_startValue);
|
|
||||||
Combo()->SetInsertionPointEnd();
|
|
||||||
}
|
|
||||||
else // the combobox is read-only
|
|
||||||
{
|
|
||||||
// find the right position, or default to the first if not found
|
|
||||||
int pos = Combo()->FindString(m_startValue);
|
|
||||||
if (pos == wxNOT_FOUND)
|
|
||||||
pos = 0;
|
|
||||||
Combo()->SetSelection(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
Combo()->SetFocus();
|
Combo()->SetFocus();
|
||||||
|
|
||||||
@@ -1638,8 +1626,19 @@ bool wxGridCellChoiceEditor::EndEdit(int row, int col,
|
|||||||
|
|
||||||
void wxGridCellChoiceEditor::Reset()
|
void wxGridCellChoiceEditor::Reset()
|
||||||
{
|
{
|
||||||
|
if (m_allowOthers)
|
||||||
|
{
|
||||||
Combo()->SetValue(m_startValue);
|
Combo()->SetValue(m_startValue);
|
||||||
Combo()->SetInsertionPointEnd();
|
Combo()->SetInsertionPointEnd();
|
||||||
|
}
|
||||||
|
else // the combobox is read-only
|
||||||
|
{
|
||||||
|
// find the right position, or default to the first if not found
|
||||||
|
int pos = Combo()->FindString(m_startValue);
|
||||||
|
if (pos == wxNOT_FOUND)
|
||||||
|
pos = 0;
|
||||||
|
Combo()->SetSelection(pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGridCellChoiceEditor::SetParameters(const wxString& params)
|
void wxGridCellChoiceEditor::SetParameters(const wxString& params)
|
||||||
|
Reference in New Issue
Block a user