BAGEL: Fix save dialog edit text increasing as selection changes

This commit is contained in:
Paul Gilbert 2024-03-21 18:36:44 -07:00 committed by Eugene Sandulenko
parent 347a8021dd
commit 462f915754
3 changed files with 5 additions and 13 deletions

View File

@ -441,11 +441,8 @@ VOID CBagSaveDialog::OnBofButton(CBofObject *pObject, INT nFlags) {
VOID CBagSaveDialog::OnBofListBox(CBofObject * /*pObject*/, INT nItemIndex) {
Assert(IsValidObject(this));
#if BOF_MAC
// Hack to make sure that our edit text box remains the sole
// getter of keydown events.
m_bResetFocus = TRUE;
#endif
// Reset the focus away from the text field if set
ReleaseFocus();
// There is only one list box on this dialog
if (m_pListBox != nullptr) {
@ -454,12 +451,10 @@ VOID CBagSaveDialog::OnBofListBox(CBofObject * /*pObject*/, INT nItemIndex) {
// Show selected item in the Edit control
if (m_pEditText != nullptr) {
m_pEditText->SetFocus();
m_pEditText->SetText(m_pListBox->GetText(nItemIndex));
#if BOF_MAC
m_pEditText->OnSelect();
m_pEditText->UpdateWindow();
#endif
}
m_nSelectedItem = nItemIndex;
}

View File

@ -129,8 +129,7 @@ VOID CBofEditText::OnKeyHit(ULONG lKey, ULONG lRepCount) {
CBofRect rect = CalculateTextRect(this, &tmp, 12, 0);
if ((m_cRect.Width() - rect.Width()) > 10) {
_text = tmp;
UpdateWindow();
SetText(tmp);
}
} else if (lKey == BKEY_BACK && !_text.IsEmpty()) {

View File

@ -212,8 +212,6 @@ VOID CBofListBox::OnLButtonDown(UINT /*nFlags*/, CBofPoint *pPoint, void *) {
_parent->OnBofListBox(this, nIndex);
}
}
SetFocus();
}