printf("Pressed mDragStartPx=%d\n",mDragStartPx);
nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent){    nsCOMPtr<nsIDOMMouseEvent> mouseEvent(do_QueryInterface(aMouseEvent));  PRUint16 button = 0;  mouseEvent->GetButton(&button);  // only if left button  if (button != 1)     return NS_OK;  nsBoxLayoutState state(mOuter->mPresContext);  mCurrentPos = 0;  mPressed = PR_TRUE;  mDidDrag = PR_FALSE;  mOuter->GetParentBox(&mParentBox);  // get our index  nscoord childIndex = nsFrameNavigator::IndexOf(mOuter->mPresContext, mParentBox, mOuter);  PRInt32 childCount = nsFrameNavigator::CountFrames(mOuter->mPresContext, mParentBox);  // if its 0 or the last index then stop right here.  if (childIndex == 0 || childIndex == childCount-1) {    mPressed = PR_FALSE;    return NS_OK;  }	EnsureOrient();  PRBool isHorizontal = !mOuter->IsHorizontal();  ResizeType resizeBefore = GetResizeBefore();  ResizeType resizeAfter  = GetResizeAfter();  delete[] mChildInfosBefore;  delete[] mChildInfosAfter;  mChildInfosBefore = new nsSplitterInfo[childCount];  mChildInfosAfter  = new nsSplitterInfo[childCount];  // create info 2 lists. One of the children before us and one after.  PRInt32 count = 0;  mChildInfosBeforeCount = 0;  mChildInfosAfterCount = 0;  nsIBox* childBox = nsnull;  mParentBox->GetChildBox(&childBox);   while (nsnull != childBox)   {     nsIFrame* childFrame = nsnull;    childBox->GetFrame(&childFrame);    nsCOMPtr<nsIContent> content;    childFrame->GetContent(getter_AddRefs(content));    nsCOMPtr<nsIAtom> atom;    nsresult rv;    NS_WITH_SERVICE(nsIXBLService, xblService, "component://netscape/xbl", &rv);    if (NS_SUCCEEDED(rv) && xblService) {      PRInt32 dummy;      xblService->ResolveTag(content, &dummy, getter_AddRefs(atom));    } else      content->GetTag(*getter_AddRefs(atom));    // skip over any splitters    if (atom.get() != nsXULAtoms::splitter) {         nsSize prefSize(0,0);        nsSize minSize(0,0);        nsSize maxSize(0,0);        nscoord flex = 0;        childBox->GetPrefSize(state, prefSize);        childBox->GetMinSize(state, minSize);        childBox->GetMaxSize(state, maxSize);        nsBox::BoundsCheck(minSize, prefSize, maxSize);        mOuter->AddMargin(childBox, minSize);        mOuter->AddMargin(childBox, prefSize);        mOuter->AddMargin(childBox, maxSize);        childBox->GetFlex(state, flex);        nsMargin margin(0,0,0,0);        childBox->GetMargin(margin);        nsRect r(0,0,0,0);        childBox->GetBounds(r);        r.Inflate(margin);        if (count < childIndex) {            mChildInfosBefore[mChildInfosBeforeCount].child   = childBox;            mChildInfosBefore[mChildInfosBeforeCount].min     = isHorizontal ? minSize.width : minSize.height;            mChildInfosBefore[mChildInfosBeforeCount].max     = isHorizontal ? maxSize.width : maxSize.height;            mChildInfosBefore[mChildInfosBeforeCount].current = isHorizontal ? r.width : r.height;            mChildInfosBefore[mChildInfosBeforeCount].flex    = flex;            mChildInfosBefore[mChildInfosBeforeCount].index   = count;            mChildInfosBefore[mChildInfosBeforeCount].changed = mChildInfosBefore[mChildInfosBeforeCount].current;            mChildInfosBeforeCount++;        } else if (count > childIndex) {            mChildInfosAfter[mChildInfosAfterCount].child   = childBox;            mChildInfosAfter[mChildInfosAfterCount].min     = isHorizontal ? minSize.width : minSize.height;            mChildInfosAfter[mChildInfosAfterCount].max     = isHorizontal ? maxSize.width : maxSize.height;            mChildInfosAfter[mChildInfosAfterCount].current = isHorizontal ? r.width : r.height;            mChildInfosAfter[mChildInfosAfterCount].flex    = flex;            mChildInfosAfter[mChildInfosAfterCount].index   = count;            mChildInfosAfter[mChildInfosAfterCount].changed   = mChildInfosAfter[mChildInfosAfterCount].current;            mChildInfosAfterCount++;        }     }        rv = childBox->GetNextBox(&childBox);    NS_ASSERTION(rv == NS_OK,"failed to get next child");    count++;  }  // if the resizebefore is closest we must reverse the list because the first child in the list  // is the Farthest we want the first child to be the closest.  if (resizeBefore == Closest)     Reverse(mChildInfosBefore, mChildInfosBeforeCount);  // if the resizeafter is the Farthest we must reverse the list because the first child in the list  // is the closest we want the first child to be the Farthest.  if (resizeAfter == Farthest)     Reverse(mChildInfosAfter, mChildInfosAfterCount);  // grow only applys to the children after. If grow is set then no space should be taken out of any children after  // us. To do this we just set the size of that list to be 0.  if (resizeAfter == Grow)     mChildInfosAfterCount = 0;  nsRect vr(0,0,0,0);  nsIView *v;  mOuter->GetView(mOuter->mPresContext, &v);  v->GetBounds(vr);  PRInt32 c = 0;  if (isHorizontal) {     mouseEvent->GetClientX(&c);     mSplitterPos = mOuter->mRect.x;     mSplitterViewPos = vr.x;  } else {     mouseEvent->GetClientY(&c);     mSplitterPos = mOuter->mRect.y;     mSplitterViewPos = vr.y;  }  mDragStartPx = c;      printf("Pressed mDragStartPx=%d\n",mDragStartPx);  return NS_OK;}