зеркало из https://github.com/mozilla/gecko-dev.git
Made tabs us visibility instead of shrinking their children to 0,0.
Made it possible to change the look for the selected tab.
This commit is contained in:
Родитель
b672b00381
Коммит
039be939e6
|
@ -56,9 +56,10 @@
|
|||
<spring class="spacer"/>
|
||||
<tabcontrol align="vertical">
|
||||
<tabbox>
|
||||
<tab>&tabHTML.label;</tab>
|
||||
<tab selected="true">&tabHTML.label;</tab>
|
||||
<tab>&tabCSS.label;</tab>
|
||||
<tab>&tabJSE.label;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
<tabpanel>
|
||||
<!-- CSS Properties -->
|
||||
|
|
|
@ -46,8 +46,9 @@
|
|||
|
||||
<tabcontrol align="vertical">
|
||||
<tabbox align="horizontal" flex="100%">
|
||||
<tab>&tableTab.label;</tab>
|
||||
<tab selected="true">&tableTab.label;</tab>
|
||||
<tab>&cellTab.label;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
|
||||
<tabpanel flex="100%">
|
||||
|
|
|
@ -42,8 +42,9 @@
|
|||
|
||||
<tabcontrol flex="100%" align="vertical">
|
||||
<tabbox>
|
||||
<tab>&tab.cookiesonsystem.label;</tab>
|
||||
<tab selected="true">&tab.cookiesonsystem.label;</tab>
|
||||
<tab>&tab.bannedservers.label;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
<tabpanel align="horizontal" style="width: 400px;">
|
||||
<box class="tabpanel" id="system" flex="100%" align="vertical">
|
||||
|
|
|
@ -43,9 +43,10 @@
|
|||
|
||||
<tabcontrol flex="100%" align="vertical">
|
||||
<tabbox>
|
||||
<tab>&tab.signonsstored.label;</tab>
|
||||
<tab selected="true">&tab.signonsstored.label;</tab>
|
||||
<tab>&tab.signonsnotstored.label;</tab>
|
||||
<tab>&tab.nopreview.label;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
<tabpanel align="horizontal" style="width: 400px;">
|
||||
<!-- saved signons -->
|
||||
|
|
|
@ -1668,7 +1668,7 @@ nsBoxFrame::GetRedefinedMinPrefMax(nsIFrame* aFrame, nsBoxInfo& aSize)
|
|||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsGfxScrollFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
incrementalChild = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -1695,7 +1695,7 @@ nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increm
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
ibox->Dirty(aReflowState, incrementalChild);
|
||||
ibox->Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
|
||||
// nsIBox methods
|
||||
NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize);
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; }
|
||||
|
|
|
@ -1668,7 +1668,7 @@ nsBoxFrame::GetRedefinedMinPrefMax(nsIFrame* aFrame, nsBoxInfo& aSize)
|
|||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsGfxScrollFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
incrementalChild = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -1695,7 +1695,7 @@ nsGfxScrollFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increm
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
ibox->Dirty(aReflowState, incrementalChild);
|
||||
ibox->Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
|
||||
// nsIBox methods
|
||||
NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize);
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; }
|
||||
|
|
|
@ -690,7 +690,7 @@ nsScrollPortFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScrollPortFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsScrollPortFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
mIncremental = PR_FALSE;
|
||||
incrementalChild = nsnull;
|
||||
|
@ -702,7 +702,7 @@ nsScrollPortFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incre
|
|||
|
||||
nsIBox* ibox;
|
||||
if (NS_SUCCEEDED(childFrame->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox)
|
||||
ibox->Dirty(aReflowState, incrementalChild);
|
||||
ibox->Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
else {
|
||||
incrementalChild = frame;
|
||||
// if we found a leaf that is not a box. Then mark it as being incremental. So if we are ever
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
// nsIBox methods
|
||||
NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize);
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void) { return NS_OK; }
|
||||
NS_IMETHOD_(nsrefcnt) Release(void) { return NS_OK; }
|
||||
|
|
|
@ -471,7 +471,7 @@ nsBoxFrame::Reflow(nsIPresContext& aPresContext,
|
|||
Invalidate(&aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
|
||||
} else {
|
||||
// otherwise dirty our children
|
||||
Dirty(aReflowState,incrementalChild);
|
||||
Dirty(aPresContext, aReflowState,incrementalChild);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
|
@ -858,25 +858,29 @@ nsBoxFrame::ChildResized(nsIFrame* aFrame, nsHTMLReflowMetrics& aDesiredSize, ns
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsBoxFrame::CollapseChild(nsIPresContext* aPresContext, nsIFrame* frame)
|
||||
nsBoxFrame::CollapseChild(nsIPresContext& aPresContext, nsIFrame* frame, PRBool hide)
|
||||
{
|
||||
nsRect rect(0,0,0,0);
|
||||
frame->GetRect(rect);
|
||||
if (rect.width > 0 || rect.height > 0) {
|
||||
// shrink the frame
|
||||
frame->SizeTo(aPresContext, 0,0);
|
||||
|
||||
// shrink the view
|
||||
// shrink the view
|
||||
nsIView* view = nsnull;
|
||||
frame->GetView(aPresContext, &view);
|
||||
frame->GetView(&aPresContext, &view);
|
||||
|
||||
// if we find a view stop right here. All views under it
|
||||
// will be clipped.
|
||||
if (view) {
|
||||
view->SetDimensions(0,0,PR_FALSE);
|
||||
return;
|
||||
nsViewVisibility v;
|
||||
view->GetVisibility(v);
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
view->GetWidget(*getter_AddRefs(widget));
|
||||
if (hide) {
|
||||
view->SetVisibility(nsViewVisibility_kHide);
|
||||
} else {
|
||||
view->SetVisibility(nsViewVisibility_kShow);
|
||||
}
|
||||
if (widget) {
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// collapse the child
|
||||
|
@ -885,13 +889,35 @@ nsBoxFrame::CollapseChild(nsIPresContext* aPresContext, nsIFrame* frame)
|
|||
|
||||
while (nsnull != child)
|
||||
{
|
||||
CollapseChild(aPresContext, child);
|
||||
CollapseChild(aPresContext, child, hide);
|
||||
nsresult rv = child->GetNextSibling(&child);
|
||||
NS_ASSERTION(rv == NS_OK,"failed to get next child");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus)
|
||||
{
|
||||
nsresult rv = nsHTMLContainerFrame::DidReflow(aPresContext, aStatus);
|
||||
NS_ASSERTION(rv == NS_OK,"DidReflow failed");
|
||||
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
nscoord count = 0;
|
||||
while (nsnull != childFrame)
|
||||
{
|
||||
// make collapsed children not show up
|
||||
if (mSprings[count].collapsed) {
|
||||
CollapseChild(aPresContext, childFrame, PR_TRUE);
|
||||
}
|
||||
|
||||
rv = childFrame->GetNextSibling(&childFrame);
|
||||
NS_ASSERTION(rv == NS_OK,"failed to get next child");
|
||||
count++;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the boxes rect. Set the x,y locations of all its children. Taking into account
|
||||
|
@ -912,7 +938,11 @@ nsBoxFrame::PlaceChildren(nsIPresContext& aPresContext, nsRect& boxRect)
|
|||
|
||||
// make collapsed children not show up
|
||||
if (mSprings[count].collapsed) {
|
||||
CollapseChild(&aPresContext, childFrame);
|
||||
nsRect rect(0,0,0,0);
|
||||
childFrame->GetRect(rect);
|
||||
if (rect.width > 0 || rect.height > 0) {
|
||||
childFrame->SizeTo(&aPresContext, 0,0);
|
||||
}
|
||||
} else {
|
||||
const nsStyleSpacing* spacing;
|
||||
rv = childFrame->GetStyleData(eStyleStruct_Spacing,
|
||||
|
@ -1605,8 +1635,15 @@ nsBoxFrame::AddChildSize(nsBoxInfo& aInfo, nsBoxInfo& aChildInfo)
|
|||
* will be flowed incrementally.
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsBoxFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsBoxFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
nsIFrame* targetFrame = nsnull;
|
||||
aReflowState.reflowCommand->GetTarget(targetFrame);
|
||||
if (this == targetFrame) {
|
||||
// if it has redraw us if we are the target
|
||||
Invalidate(&aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
|
||||
}
|
||||
|
||||
incrementalChild = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -1625,7 +1662,7 @@ nsBoxFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalC
|
|||
// can't use nsCOMPtr on non-refcounted things like frames
|
||||
nsIBox* ibox;
|
||||
if (NS_SUCCEEDED(childFrame->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox)
|
||||
ibox->Dirty(aReflowState, incrementalChild);
|
||||
ibox->Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
else
|
||||
incrementalChild = frame;
|
||||
|
||||
|
|
|
@ -75,10 +75,13 @@ public:
|
|||
|
||||
// nsIBox methods
|
||||
NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize);
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& aIncrementalChild);
|
||||
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
|
@ -171,7 +174,7 @@ protected:
|
|||
virtual PRIntn GetSkipSides() const { return 0; }
|
||||
|
||||
virtual void GetInset(nsMargin& margin);
|
||||
virtual void CollapseChild(nsIPresContext* aPresContext, nsIFrame* frame);
|
||||
virtual void CollapseChild(nsIPresContext& aPresContext, nsIFrame* frame, PRBool hide);
|
||||
|
||||
nsresult GenerateDirtyReflowCommand(nsIPresContext& aPresContext,
|
||||
nsIPresShell& aPresShell);
|
||||
|
|
|
@ -85,6 +85,7 @@ nsDeckFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
|
||||
// if the index changed hide the old element and make the now element visible
|
||||
if (aAttribute == nsHTMLAtoms::index) {
|
||||
/*
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
aPresContext->GetShell(getter_AddRefs(shell));
|
||||
|
||||
|
@ -93,6 +94,37 @@ nsDeckFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
nsIReflowCommand::StyleChanged);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
shell->AppendReflowCommand(reflowCmd);
|
||||
*/
|
||||
|
||||
Invalidate(aPresContext, nsRect(0,0,mRect.width,mRect.height), PR_FALSE);
|
||||
|
||||
int index = 0;
|
||||
|
||||
// get the index attribute
|
||||
nsAutoString value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::index, value))
|
||||
{
|
||||
PRInt32 error;
|
||||
|
||||
// convert it to an integer
|
||||
index = value.ToInteger(&error);
|
||||
}
|
||||
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
nscoord count = 0;
|
||||
while (nsnull != childFrame)
|
||||
{
|
||||
// make collapsed children not show up
|
||||
if (index != count)
|
||||
CollapseChild(*aPresContext, childFrame, PR_TRUE);
|
||||
else
|
||||
CollapseChild(*aPresContext, childFrame, PR_FALSE);
|
||||
|
||||
rv = childFrame->GetNextSibling(&childFrame);
|
||||
NS_ASSERTION(rv == NS_OK,"failed to get next child");
|
||||
count++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -202,7 +234,6 @@ nsDeckFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
nsIFrame* aChildList)
|
||||
{
|
||||
nsresult r = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -235,6 +266,36 @@ nsDeckFrame::AddChildSize(nsBoxInfo& aInfo, nsBoxInfo& aChildInfo)
|
|||
|
||||
nsresult
|
||||
nsDeckFrame::PlaceChildren(nsIPresContext& aPresContext, nsRect& boxRect)
|
||||
{
|
||||
// ------- set the childs positions ---------
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
nscoord count = 0;
|
||||
while (nsnull != childFrame)
|
||||
{
|
||||
nsresult rv;
|
||||
// make collapsed children not show up
|
||||
if (mSprings[count].collapsed) {
|
||||
//nsRect rect(0,0,0,0);
|
||||
//childFrame->GetRect(rect);
|
||||
//if (rect.width > 0 || rect.height > 0) {
|
||||
// childFrame->SizeTo(0,0);
|
||||
CollapseChild(aPresContext, childFrame, PR_TRUE);
|
||||
//}
|
||||
} else {
|
||||
childFrame->MoveTo(&aPresContext, boxRect.x, boxRect.y);
|
||||
}
|
||||
|
||||
rv = childFrame->GetNextSibling(&childFrame);
|
||||
NS_ASSERTION(rv == NS_OK,"failed to get next child");
|
||||
count++;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDeckFrame::DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus)
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
|
@ -248,53 +309,28 @@ nsDeckFrame::PlaceChildren(nsIPresContext& aPresContext, nsRect& boxRect)
|
|||
index = value.ToInteger(&error);
|
||||
}
|
||||
|
||||
// ------- set the childs positions ---------
|
||||
nsresult rv = nsBoxFrame::DidReflow(aPresContext, aStatus);
|
||||
NS_ASSERTION(rv == NS_OK,"DidReflow failed");
|
||||
|
||||
nsIFrame* childFrame = mFrames.FirstChild();
|
||||
nscoord count = 0;
|
||||
while (nsnull != childFrame)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
/*
|
||||
// see if the child has a view. If it doesn't make one for it.
|
||||
nsIView* childView = nsnull;
|
||||
childFrame->GetView(&childView);
|
||||
if (childView == nsnull) {
|
||||
nsCOMPtr<nsIStyleContext> context;
|
||||
childFrame->GetStyleContext(getter_AddRefs(context));
|
||||
CreateViewForFrame(aPresContext,childFrame,context,PR_TRUE);
|
||||
childFrame->GetView(&childView);
|
||||
NS_ASSERTION(childView != nsnull, "Deck could not create a view for its child!!!");
|
||||
}
|
||||
*/
|
||||
|
||||
//nsCOMPtr<nsIViewManager> vm;
|
||||
// childView->GetViewManager(*getter_AddRefs(vm));
|
||||
|
||||
// make collapsed children not show up
|
||||
if (mSprings[count].collapsed || count != index) {
|
||||
CollapseChild(&aPresContext, childFrame);
|
||||
// } if (count != index) {
|
||||
// if the child is not in view then make sure its view is 0 so it clips
|
||||
// out all its children.
|
||||
//vm->ResizeView(childView, 0,0);
|
||||
//childFrame->SizeTo(0,0);
|
||||
//childView->SetParent(nsnull);
|
||||
} else {
|
||||
////nsIView* pv;
|
||||
//GetView(&pv);
|
||||
//childView->SetParent(pv);
|
||||
childFrame->MoveTo(&aPresContext, boxRect.x, boxRect.y);
|
||||
}
|
||||
if (index != count)
|
||||
CollapseChild(aPresContext, childFrame, PR_TRUE);
|
||||
else
|
||||
CollapseChild(aPresContext, childFrame, PR_FALSE);
|
||||
|
||||
rv = childFrame->GetNextSibling(&childFrame);
|
||||
NS_ASSERTION(rv == NS_OK,"failed to get next child");
|
||||
count++;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsDeckFrame::ChildResized(nsIFrame* aFrame, nsHTMLReflowMetrics& aDesiredSize, nsRect& aRect, nsCalculatedBoxInfo& aInfo, PRBool* aResized, nscoord& aChangedIndex, PRBool& aFinished, nscoord aIndex, nsString& aReason)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,9 @@ public:
|
|||
nsIAtom* aAttribute,
|
||||
PRInt32 aHint);
|
||||
|
||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
static const nsIID& GetIID() { static nsIID iid = NS_IBOX_IID; return iid; }
|
||||
|
||||
NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize)=0;
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)=0;
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)=0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -656,7 +656,7 @@ nsMenuFrame::DidReflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Overridden Box method.
|
||||
NS_IMETHODIMP
|
||||
nsMenuFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsMenuFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
incrementalChild = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -670,7 +670,7 @@ nsMenuFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incremental
|
|||
}
|
||||
|
||||
// Now call our original box frame method
|
||||
rv = nsBoxFrame::Dirty(aReflowState, incrementalChild);
|
||||
rv = nsBoxFrame::Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
if (rv != NS_OK || incrementalChild)
|
||||
return rv;
|
||||
|
||||
|
@ -680,7 +680,7 @@ nsMenuFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incremental
|
|||
// to call its Dirty method...
|
||||
nsIBox* ibox;
|
||||
if (NS_SUCCEEDED(popup->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox)
|
||||
ibox->Dirty(aReflowState, incrementalChild);
|
||||
ibox->Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
else
|
||||
incrementalChild = frame;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild);
|
||||
|
||||
NS_IMETHOD AppendFrames(nsIPresContext& aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
|
|
|
@ -253,7 +253,7 @@ nsPopupSetFrame::DidReflow(nsIPresContext& aPresContext,
|
|||
|
||||
// Overridden Box method.
|
||||
NS_IMETHODIMP
|
||||
nsPopupSetFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsPopupSetFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
incrementalChild = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -267,7 +267,7 @@ nsPopupSetFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increme
|
|||
}
|
||||
|
||||
// Now call our original box frame method
|
||||
rv = nsBoxFrame::Dirty(aReflowState, incrementalChild);
|
||||
rv = nsBoxFrame::Dirty(aPresContext, aReflowState, incrementalChild);
|
||||
if (rv != NS_OK || incrementalChild)
|
||||
return rv;
|
||||
|
||||
|
@ -284,7 +284,7 @@ nsPopupSetFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& increme
|
|||
nsIFrame* ignore;
|
||||
nsIBox* ibox;
|
||||
if (NS_SUCCEEDED(popup->QueryInterface(nsIBox::GetIID(), (void**)&ibox)) && ibox)
|
||||
ibox->Dirty(aReflowState, ignore);
|
||||
ibox->Dirty(aPresContext, aReflowState, ignore);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild);
|
||||
|
||||
NS_IMETHOD AppendFrames(nsIPresContext& aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
|
|
|
@ -58,12 +58,6 @@ NS_NewTabFrame ( nsIFrame** aNewFrame )
|
|||
|
||||
} // NS_NewTabFrame
|
||||
|
||||
/*
|
||||
nsTabFrame::nsTabFrame()
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
void
|
||||
nsTabFrame::MouseClicked(nsIPresContext* aPresContext)
|
||||
{
|
||||
|
@ -83,28 +77,37 @@ nsTabFrame::MouseClicked(nsIPresContext* aPresContext)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
// set visiblity
|
||||
PRInt32 count = 0;
|
||||
tabpanel->ChildCount(count);
|
||||
for (PRInt32 i = 0; i < count; i++)
|
||||
{
|
||||
nsIContent* child;
|
||||
tabpanel->ChildAt(i,child);
|
||||
// unselect the old tab
|
||||
|
||||
if (i != index)
|
||||
child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::style, "visibility: hidden", PR_TRUE);
|
||||
else
|
||||
child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::style, "visibility: visible", PR_TRUE);
|
||||
}
|
||||
*/
|
||||
// get the current index
|
||||
nsAutoString v;
|
||||
PRInt32 error;
|
||||
tabpanel->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::index, v);
|
||||
PRInt32 oldIndex = v.ToInteger(&error);
|
||||
|
||||
if (oldIndex != index)
|
||||
{
|
||||
// get the tab box
|
||||
nsIContent* parent;
|
||||
mContent->GetParent(parent);
|
||||
|
||||
// get child
|
||||
nsIContent* child;
|
||||
parent->ChildAt(oldIndex, child);
|
||||
|
||||
// set the old tab to be unselected
|
||||
child->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::selected, "false", PR_TRUE);
|
||||
|
||||
// set the new tab to be selected
|
||||
mContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::selected, "true", PR_TRUE);
|
||||
}
|
||||
|
||||
// set the panels index
|
||||
char value[100];
|
||||
sprintf(value, "%d", index);
|
||||
|
||||
tabpanel->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::index, value, PR_TRUE);
|
||||
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -45,6 +45,26 @@ protected:
|
|||
virtual nsresult GetChildWithTag(nsIAtom* atom, nsIContent* start, nsIContent*& tabpanel);
|
||||
virtual nsresult GetTabControl(nsIContent* content, nsIContent*& tabcontrol);
|
||||
virtual nsresult GetIndexInParent(nsIContent* content, PRInt32& index);
|
||||
// Selection Methods
|
||||
// XXX Doc me... (in nsIFrame.h puhleeze)
|
||||
// XXX If these are selection specific, then the name should imply selection
|
||||
// rather than generic event processing, e.g., SelectionHandlePress...
|
||||
NS_IMETHOD HandlePress(nsIPresContext& aPresContext,
|
||||
nsGUIEvent * aEvent,
|
||||
nsEventStatus& aEventStatus) { return NS_OK; }
|
||||
|
||||
NS_IMETHOD HandleMultiplePress(nsIPresContext& aPresContext,
|
||||
nsGUIEvent * aEvent,
|
||||
nsEventStatus& aEventStatus) { return NS_OK; }
|
||||
|
||||
|
||||
NS_IMETHOD HandleDrag(nsIPresContext& aPresContext,
|
||||
nsGUIEvent * aEvent,
|
||||
nsEventStatus& aEventStatus) { return NS_OK; }
|
||||
|
||||
NS_IMETHOD HandleRelease(nsIPresContext& aPresContext,
|
||||
nsGUIEvent * aEvent,
|
||||
nsEventStatus& aEventStatus) { return NS_OK; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -1471,7 +1471,7 @@ nsTitledButtonFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTitledButtonFrame::Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
nsTitledButtonFrame::Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild)
|
||||
{
|
||||
// leafs should just return themselves as the incremental child
|
||||
incrementalChild = this;
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
// nsIBox frame interface
|
||||
NS_IMETHOD GetBoxInfo(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsBoxInfo& aSize);
|
||||
NS_IMETHOD Dirty(const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild);
|
||||
NS_IMETHOD Dirty(nsIPresContext& aPresContext, const nsHTMLReflowState& aReflowState, nsIFrame*& incrementalChild);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
|
|
@ -33,9 +33,10 @@ Rights Reserved.
|
|||
|
||||
<tabcontrol align="vertical" style="margin:5px">
|
||||
<tabbox align="horizontal">
|
||||
<tab>&Name.tab;</tab>
|
||||
<tab selected="true">&Name.tab;</tab>
|
||||
<tab>&Address.tab;</tab>
|
||||
<tab>&Other.tab;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
|
||||
<tabpanel align="vertical" flex="100%" style="border:2px groove white">
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
</box>
|
||||
<tabcontrol align="vertical">
|
||||
<tabbox align="horizontal">
|
||||
<tab class="selected" onclick="loadPage('newProfile1_1.xul');">&newprofile.title;</tab>
|
||||
<!-- <tab class="nonselected" onclick="loadPage('mailnews.xul');">&mailnews.title;</tab> -->
|
||||
<tab selected="true" onclick="loadPage('newProfile1_1.xul');">&newprofile.title;</tab>
|
||||
<!-- <tab onclick="loadPage('mailnews.xul');">&mailnews.title;</tab> -->
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
<tabpanel flex="100%"/>
|
||||
<!-- <tabpanel flex="100%"/> -->
|
||||
|
|
|
@ -6,16 +6,17 @@
|
|||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<box align="vertical" style="height: 100%; width: 100%">
|
||||
<box align="vertical" flex="1">
|
||||
<tabcontrol align="vertical" flex="100%" >
|
||||
<tabbox align="horizontal">
|
||||
<tab>centered</tab>
|
||||
<tab selected="true">centered</tab>
|
||||
<tab>percent</tab>
|
||||
<tab>html</tab>
|
||||
<tab><html:img src="resource:/res/toolbar/stop.gif"/></tab>
|
||||
<tab>native</tab>
|
||||
<tab>iframe</tab>
|
||||
<tab>dialog</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
|
||||
<tabpanel flex="100%" style="border: 2px outset gray">
|
||||
|
|
|
@ -49,10 +49,11 @@
|
|||
|
||||
<tabcontrol align="vertical">
|
||||
<tabbox align="horizontal">
|
||||
<tab onclick="loadPage('find', null);">&find.title.label;</tab>
|
||||
<tab selected="true" onclick="loadPage('find', null);">&find.title.label;</tab>
|
||||
<tab onclick="loadPage('internet', null);">&internet.title.label;</tab>
|
||||
<tab onclick="loadPage('mail', null);">&mailnews.title.label;</tab>
|
||||
<tab onclick="loadPage('addressbook', null);">&addressbook.title.label;</tab>
|
||||
<spring flex="1"/>
|
||||
</tabbox>
|
||||
|
||||
<tabpanel />
|
||||
|
|
|
@ -1089,6 +1089,13 @@ tabcontrol {
|
|||
border: none;
|
||||
}
|
||||
|
||||
/* when a tab is selected this is how it should look.
|
||||
*/
|
||||
tab[selected="true"] {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/********* XP Scrollbar *********/
|
||||
|
||||
thumb {
|
||||
|
|
Загрузка…
Ссылка в новой задаче