Bug 13960: Combo box must not be dropped down before mouse moves update the selected option.

This commit is contained in:
pollmann%netscape.com 1999-09-19 09:48:04 +00:00
Родитель cddb3bbc74
Коммит 703289e64a
2 изменённых файлов: 30 добавлений и 22 удалений

Просмотреть файл

@ -2099,18 +2099,22 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
nsresult
nsListControlFrame::MouseMove(nsIDOMEvent* aMouseEvent)
{
if (IsInDropDownMode() == PR_TRUE) {
PRInt32 oldIndex;
PRInt32 curIndex = mSelectedIndex;
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
mSelectedIndex = curIndex;
mOldSelectedIndex = oldIndex;
if (kNothingSelected != mSelectedIndex) {
if (mOldSelectedIndex != mSelectedIndex) {
if (mOldSelectedIndex != kNothingSelected) {
SetContentSelected(mOldSelectedIndex, PR_FALSE);
if (mComboboxFrame) { // Synonym for IsInDropDownMode()
PRBool isDroppedDown = PR_FALSE;
mComboboxFrame->IsDroppedDown(&isDroppedDown);
if (isDroppedDown) {
PRInt32 oldIndex;
PRInt32 curIndex = mSelectedIndex;
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
mSelectedIndex = curIndex;
mOldSelectedIndex = oldIndex;
if (kNothingSelected != mSelectedIndex) {
if (mOldSelectedIndex != mSelectedIndex) {
if (mOldSelectedIndex != kNothingSelected) {
SetContentSelected(mOldSelectedIndex, PR_FALSE);
}
SetContentSelected(mSelectedIndex, PR_TRUE);
}
SetContentSelected(mSelectedIndex, PR_TRUE);
}
}
}

Просмотреть файл

@ -2099,18 +2099,22 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
nsresult
nsListControlFrame::MouseMove(nsIDOMEvent* aMouseEvent)
{
if (IsInDropDownMode() == PR_TRUE) {
PRInt32 oldIndex;
PRInt32 curIndex = mSelectedIndex;
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
mSelectedIndex = curIndex;
mOldSelectedIndex = oldIndex;
if (kNothingSelected != mSelectedIndex) {
if (mOldSelectedIndex != mSelectedIndex) {
if (mOldSelectedIndex != kNothingSelected) {
SetContentSelected(mOldSelectedIndex, PR_FALSE);
if (mComboboxFrame) { // Synonym for IsInDropDownMode()
PRBool isDroppedDown = PR_FALSE;
mComboboxFrame->IsDroppedDown(&isDroppedDown);
if (isDroppedDown) {
PRInt32 oldIndex;
PRInt32 curIndex = mSelectedIndex;
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
mSelectedIndex = curIndex;
mOldSelectedIndex = oldIndex;
if (kNothingSelected != mSelectedIndex) {
if (mOldSelectedIndex != mSelectedIndex) {
if (mOldSelectedIndex != kNothingSelected) {
SetContentSelected(mOldSelectedIndex, PR_FALSE);
}
SetContentSelected(mSelectedIndex, PR_TRUE);
}
SetContentSelected(mSelectedIndex, PR_TRUE);
}
}
}