Making splitters support persistence.

This commit is contained in:
hyatt%netscape.com 2000-09-08 06:55:10 +00:00
Родитель a465d37a02
Коммит 366dca089a
3 изменённых файлов: 37 добавлений и 17 удалений

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

@ -141,6 +141,8 @@ XUL_ATOM(resizeafter, "resizeafter")
XUL_ATOM(state, "state")
XUL_ATOM(debug, "debug")
XUL_ATOM(fixed, "fixed")
// grid
XUL_ATOM(grid, "grid")
XUL_ATOM(rows, "rows")

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

@ -770,6 +770,14 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
if (button != 1)
return NS_OK;
nsCOMPtr<nsIContent> content;
mOuter->GetContent(getter_AddRefs(content));
nsAutoString disabled;
content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled);
if (disabled.Equals(NS_LITERAL_STRING("true")))
return NS_OK;
nsBoxLayoutState state(mOuter->mPresContext);
mCurrentPos = 0;
mPressed = PR_TRUE;
@ -808,6 +816,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
nsIBox* childBox = nsnull;
mParentBox->GetChildBox(&childBox);
PRBool skip = PR_FALSE;
while (nsnull != childBox)
{
nsIFrame* childFrame = nsnull;
@ -849,7 +858,11 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
childBox->GetBounds(r);
r.Inflate(margin);
nsAutoString fixed;
content->GetAttribute(kNameSpaceID_None, nsXULAtoms::fixed, fixed);
if (count < childIndex) {
if (!fixed.Equals(NS_LITERAL_STRING("true"))) {
mChildInfosBefore[mChildInfosBeforeCount].child = childBox;
mChildInfosBefore[mChildInfosBeforeCount].min = isHorizontal ? minSize.width : minSize.height;
mChildInfosBefore[mChildInfosBeforeCount].max = isHorizontal ? maxSize.width : maxSize.height;
@ -858,7 +871,9 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
mChildInfosBefore[mChildInfosBeforeCount].index = count;
mChildInfosBefore[mChildInfosBeforeCount].changed = mChildInfosBefore[mChildInfosBeforeCount].current;
mChildInfosBeforeCount++;
}
} else if (count > childIndex) {
if (!fixed.Equals(NS_LITERAL_STRING("true"))) {
mChildInfosAfter[mChildInfosAfterCount].child = childBox;
mChildInfosAfter[mChildInfosAfterCount].min = isHorizontal ? minSize.width : minSize.height;
mChildInfosAfter[mChildInfosAfterCount].max = isHorizontal ? maxSize.width : maxSize.height;
@ -869,6 +884,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent)
mChildInfosAfterCount++;
}
}
}
rv = childBox->GetNextBox(&childBox);
NS_ASSERTION(rv == NS_OK,"failed to get next child");
@ -1191,7 +1207,7 @@ nsSplitterFrameInner::SetPreferredSize(nsBoxLayoutState& aState, nsIBox* aChildB
if (oldValue.EqualsWithConversion(ch))
return;
content->SetAttribute(kNameSpaceID_None, attribute, NS_ConvertASCIItoUCS2(ch), PR_FALSE);
content->SetAttribute(kNameSpaceID_None, attribute, NS_ConvertASCIItoUCS2(ch), PR_TRUE);
#ifndef REAL_TIME_DRAG
aChildBox->MarkDirty(aState);
#else

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

@ -141,6 +141,8 @@ XUL_ATOM(resizeafter, "resizeafter")
XUL_ATOM(state, "state")
XUL_ATOM(debug, "debug")
XUL_ATOM(fixed, "fixed")
// grid
XUL_ATOM(grid, "grid")
XUL_ATOM(rows, "rows")