void nsDeckFrame::IndexChanged() { //did the index change? int32_t index = GetSelectedIndex(); if (index == mIndex) return; // redraw InvalidateFrame(); // hide the currently showing box nsIFrame* currentBox = GetSelectedBox(); if (currentBox) // only hide if it exists HideBox(currentBox); mIndex = index; #ifdef ACCESSIBILITY nsAccessibilityService* accService = GetAccService(); if (accService) { accService->DeckPanelSwitched(PresContext()->GetPresShell(), mContent, currentBox, GetSelectedBox()); } #endif }
NS_IMETHODIMP nsDeckFrame::DoLayout(nsBoxLayoutState& aState) { // Make sure we tweak the state so it does not resize our children. // We will do that. uint32_t oldFlags = aState.LayoutFlags(); aState.SetLayoutFlags(NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_VISIBILITY); // do a normal layout nsresult rv = nsBoxFrame::DoLayout(aState); // run though each child. Hide all but the selected one nsIFrame* box = nsBox::GetChildBox(this); nscoord count = 0; while (box) { // make collapsed children not show up if (count != mIndex) HideBox(box); box = GetNextBox(box); count++; } aState.SetLayoutFlags(oldFlags); return rv; }
void nsDeckFrame::IndexChanged() { //did the index change? PRInt32 index = GetSelectedIndex(); if (index == mIndex) return; // redraw InvalidateOverflowRect(); // hide the currently showing box nsIBox* currentBox = GetSelectedBox(); if (currentBox) // only hide if it exists HideBox(currentBox); mIndex = index; }
void nsDeckFrame::IndexChanged(nsPresContext* aPresContext) { //did the index change? PRInt32 index = GetSelectedIndex(); if (index == mIndex) return; // redraw InvalidateOverflowRect(); // hide the currently showing box nsIBox* currentBox = GetSelectedBox(); if (currentBox) // only hide if it exists HideBox(aPresContext, currentBox); mIndex = index; // show the new box nsIBox* newBox = GetSelectedBox(); if (newBox) // only show if it exists ShowBox(aPresContext, newBox); }