This commit is contained in:
hyatt%netscape.com 2000-02-08 01:02:47 +00:00
Родитель d6a1917e8a
Коммит f280862dfb
7 изменённых файлов: 74 добавлений и 89 удалений

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

@ -50,7 +50,6 @@
<box class="tabpanel" id="system" flex="100%" align="vertical">
<box><html:div>&div.cookiesonsystem.label;</html:div></box>
<spring style="height: 10px;"/>
<html:div style="width: 380px;">
<tree id="cookietree" class="inset" style="height: 150px; width: 380px;" align="vertical"
onselect="ViewCookieSelected(event);"
onclick="ViewCookieSelected(event)"
@ -65,7 +64,6 @@
</treehead>
<treechildren id="cookielist"/>
</tree>
</html:div>
<spring style="height: 5px;"/>
<html:fieldset style="border: 2px groove #CCCCDD;">
<html:legend>&treehead.infoselected.label;</html:legend>

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

@ -78,21 +78,24 @@ nsMenuBarListener::KeyUp(nsIDOMEvent* aKeyEvent)
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
PRUint32 theChar;
keyEvent->GetKeyCode(&theChar);
#ifndef XP_UNIX
if (theChar == NS_VK_ALT && mAltKeyDown) {
// The ALT key was down and is now up.
mAltKeyDown = PR_FALSE;
mMenuBarFrame->ToggleMenuActiveState();
}
#endif
PRBool active = mMenuBarFrame->IsActive();
if (active) {
mKeyboardNavigationActive = PR_TRUE;
mKeyboardNavigationActive = PR_TRUE;
aKeyEvent->PreventBubble();
aKeyEvent->PreventCapture();
return NS_ERROR_BASE; // I am consuming event
} else
mKeyboardNavigationActive = PR_FALSE;
mKeyboardNavigationActive = PR_FALSE;
return NS_OK; // means I am NOT consuming event
}
@ -121,18 +124,17 @@ nsMenuBarListener::KeyDown(nsIDOMEvent* aKeyEvent)
// The arrow keys were pressed. User is moving around within
// the menus.
if (active) {
mMenuBarFrame->KeyboardNavigation(theChar);
mKeyboardNavigationActive = PR_TRUE;
mMenuBarFrame->KeyboardNavigation(theChar);
mKeyboardNavigationActive = PR_TRUE;
} else
mKeyboardNavigationActive = PR_FALSE;
}
else if (theChar == NS_VK_ESCAPE) {
// Close one level.
if (active) {
if (active) {
mMenuBarFrame->Escape();
//if(!mMenuBarFrame->IsActive())
mKeyboardNavigationActive = PR_FALSE;
}
mKeyboardNavigationActive = PR_FALSE;
}
}
else if (theChar == NS_VK_ENTER ||
theChar == NS_VK_RETURN) {
@ -140,6 +142,7 @@ nsMenuBarListener::KeyDown(nsIDOMEvent* aKeyEvent)
if (active)
mMenuBarFrame->Enter();
}
#ifndef XP_UNIX
else if (active || altKeyWasDown) {
// Get the character code.
nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
@ -154,13 +157,15 @@ nsMenuBarListener::KeyDown(nsIDOMEvent* aKeyEvent)
mMenuBarFrame->ShortcutNavigation(charCode, active);
}
}
#endif
if (active) {
mKeyboardNavigationActive = PR_TRUE;
mKeyboardNavigationActive = PR_TRUE;
aKeyEvent->PreventBubble();
aKeyEvent->PreventCapture();
return NS_ERROR_BASE; // I am consuming event
aKeyEvent->PreventCapture();
return NS_ERROR_BASE; // I am consuming event
} else
mKeyboardNavigationActive = PR_FALSE;
mKeyboardNavigationActive = PR_FALSE;
return NS_OK; // means I am NOT consuming event
}
@ -174,10 +179,10 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
PRBool active = mMenuBarFrame->IsActive();
if (active) {
mKeyboardNavigationActive = PR_TRUE;
mKeyboardNavigationActive = PR_TRUE;
aKeyEvent->PreventBubble();
aKeyEvent->PreventCapture();
return NS_ERROR_BASE; // I am consuming event
aKeyEvent->PreventCapture();
return NS_ERROR_BASE; // I am consuming event
} else
mKeyboardNavigationActive = PR_FALSE;
@ -196,14 +201,11 @@ nsMenuBarListener::Focus(nsIDOMEvent* aEvent)
nsresult
nsMenuBarListener::Blur(nsIDOMEvent* aEvent)
{
if(mKeyboardNavigationActive && mMenuBarFrame->IsActive()) {
//if(gRollupListener)
// gRollupListener->Rollup();
mMenuBarFrame->ToggleMenuActiveState();
if (mKeyboardNavigationActive && mMenuBarFrame->IsActive()) {
mMenuBarFrame->ToggleMenuActiveState();
mMenuBarFrame->Escape();
mAltKeyDown = PR_FALSE;
mKeyboardNavigationActive = PR_FALSE;
//mMenuBarFrame->ToggleMenuActiveState();
mKeyboardNavigationActive = PR_FALSE;
}
return NS_OK; // means I am NOT consuming event
@ -213,16 +215,11 @@ nsMenuBarListener::Blur(nsIDOMEvent* aEvent)
nsresult
nsMenuBarListener::MouseDown(nsIDOMEvent* aMouseEvent)
{
PRBool isOpen;
//mMenuBarFrame->MenuIsOpen(&isOpen);
if(!mMenuBarFrame->IsOpen() && mMenuBarFrame->IsActive()) {
//if(gRollupListener)
// gRollupListener->Rollup();
if (!mMenuBarFrame->IsOpen() && mMenuBarFrame->IsActive()) {
mMenuBarFrame->ToggleMenuActiveState();
mMenuBarFrame->Escape();
mAltKeyDown = PR_FALSE;
mKeyboardNavigationActive = PR_FALSE;
//mMenuBarFrame->ToggleMenuActiveState();
mMenuBarFrame->Escape();
mAltKeyDown = PR_FALSE;
mKeyboardNavigationActive = PR_FALSE;
}
return NS_OK; // means I am NOT consuming event
}
@ -231,14 +228,11 @@ nsMenuBarListener::MouseDown(nsIDOMEvent* aMouseEvent)
nsresult
nsMenuBarListener::MouseUp(nsIDOMEvent* aMouseEvent)
{
if(!mMenuBarFrame->IsOpen() && mMenuBarFrame->IsActive()) {
//if(gRollupListener)
// gRollupListener->Rollup();
if (!mMenuBarFrame->IsOpen() && mMenuBarFrame->IsActive()) {
mMenuBarFrame->ToggleMenuActiveState();
mMenuBarFrame->Escape();
mKeyboardNavigationActive = PR_FALSE;
mAltKeyDown = PR_FALSE;
//mMenuBarFrame->ToggleMenuActiveState();
}
return NS_OK; // means I am NOT consuming event
}
@ -246,13 +240,11 @@ nsMenuBarListener::MouseUp(nsIDOMEvent* aMouseEvent)
nsresult
nsMenuBarListener::MouseClick(nsIDOMEvent* aMouseEvent)
{
PRBool isOpen;
if(!mMenuBarFrame->IsOpen() && mMenuBarFrame->IsActive()) {
if (!mMenuBarFrame->IsOpen() && mMenuBarFrame->IsActive()) {
mMenuBarFrame->ToggleMenuActiveState();
mMenuBarFrame->Escape();
mKeyboardNavigationActive = PR_FALSE;
mMenuBarFrame->Escape();
mKeyboardNavigationActive = PR_FALSE;
mAltKeyDown = PR_FALSE;
//mMenuBarFrame->ToggleMenuActiveState();
}
return NS_OK; // means I am NOT consuming event

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

@ -296,20 +296,22 @@ nsTitledButtonFrame::Init(nsIPresContext* aPresContext,
// the following block is to append the accesskey to to mTitle if there is an accesskey
// but the mTitle doesn't have the character
mAccesskeyIndex = -1;
nsAutoString accesskey;
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey,
accesskey);
if (accesskey != "") {
mAccesskeyIndex = mTitle.Find(accesskey, PR_TRUE);
if (mAccesskeyIndex == -1) {
nsString tmpstring = "(" ;
accesskey.ToUpperCase();
tmpstring += accesskey;
tmpstring += ")";
mTitle += tmpstring;
}
}
mAccesskeyIndex = -1;
#ifndef XP_UNIX
nsAutoString accesskey;
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey,
accesskey);
if (accesskey != "") {
mAccesskeyIndex = mTitle.Find(accesskey, PR_TRUE);
if (mAccesskeyIndex == -1) {
nsString tmpstring = "(" ;
accesskey.ToUpperCase();
tmpstring += accesskey;
tmpstring += ")";
mTitle += tmpstring;
}
}
#endif
return rv;
}
@ -796,7 +798,7 @@ void
nsTitledButtonFrame::UpdateAccessUnderline()
{
mAccesskeyIndex = -1;
#ifndef XP_UNIX
nsAutoString accesskey;
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey,
accesskey);
@ -805,6 +807,7 @@ nsTitledButtonFrame::UpdateAccessUnderline()
mAccesskeyIndex = mCroppedTitle.Find(accesskey, PR_TRUE);
mNeedsAccessUpdate = PR_TRUE;
#endif
}
NS_IMETHODIMP

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

@ -381,26 +381,20 @@ nsTreeFrame::Reflow(nsIPresContext* aPresContext,
mSlatedForReflow = PR_FALSE;
if (!mSuppressReflow) {
nsRect rect;
GetRect(rect);
if (rect.width != aReflowState.mComputedWidth && aReflowState.reason == eReflowReason_Resize) {
// We're doing a resize and changing the width of the table. All rows must
// reflow. Reset our generation.
SetUseGeneration(PR_FALSE);
}
nsRect rect;
GetRect(rect);
if (rect.width != aReflowState.mComputedWidth && aReflowState.reason == eReflowReason_Resize) {
// We're doing a resize and changing the width of the table. All rows must
// reflow. Reset our generation.
SetUseGeneration(PR_FALSE);
}
if (UseGeneration()) {
++mGeneration;
}
rv = nsTableFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
if (UseGeneration()) {
++mGeneration;
}
rv = nsTableFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}
else
{
aStatus = NS_FRAME_COMPLETE;
}
if (aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE)
aDesiredSize.width = aReflowState.mComputedWidth +
aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right;

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

@ -85,9 +85,6 @@ public:
PRBool ContainsFlexibleColumn(PRInt32 aStartIndex, PRInt32 aEndIndex, nsTableColFrame** aResult);
void SuppressReflow() { mSuppressReflow = PR_TRUE; };
void UnsuppressReflow() { mSuppressReflow = PR_FALSE; };
PRInt32 GetInsertionIndex(nsIFrame *aFrame);
// nsISelfScrollingFrame interface
@ -112,7 +109,6 @@ protected: // Data Members
nsTreeTwistyListener* mTwistyListener;
PRInt32 mGeneration;
PRBool mUseGeneration;
PRBool mSuppressReflow;
PRInt32 mFixedRows;
PRBool mReflowStopped;
}; // class nsTreeFrame

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

@ -290,7 +290,7 @@ nsTreeRowFrame::HandleHeaderDragEvent(nsIPresContext* aPresContext,
nsTreeFrame* treeFrame = (nsTreeFrame*)tableFrame;
// Until we finish all of our batched operations, suppress all reflow.
treeFrame->SuppressReflow();
// XXX How to suppress?
PRInt32 columnCount = treeFrame->GetColCount();
PRInt32* colWidths = new PRInt32[columnCount];
@ -406,8 +406,7 @@ nsTreeRowFrame::HandleHeaderDragEvent(nsIPresContext* aPresContext,
mFlexingCol->GetContent(getter_AddRefs(flexContent));
if (flexContent) {
treeFrame->SetUseGeneration(PR_FALSE); // Cached rows have to reflow.
treeFrame->UnsuppressReflow();
colWidth = flexWidth - delta;
sprintf(ch,"%d*", colWidth);
nsAutoString propColWidth(ch);

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

@ -701,10 +701,13 @@ nsTreeRowGroupFrame::PositionChanged(nsIPresContext* aPresContext, PRInt32 aOldI
mCurrentIndex = aNewIndex;
if (mContentChain) {
// XXX This could cause problems because of async reflow.
// Eventually we need to make the code smart enough to look at a content chain
// when building ANOTHER content chain.
/*if (mContentChain) {
NS_ERROR("This is bad!");
return NS_OK;
}
}*/
// Get our row count.
PRInt32 rowCount;
@ -746,10 +749,10 @@ nsTreeRowGroupFrame::PositionChanged(nsIPresContext* aPresContext, PRInt32 aOldI
FindPreviousRowContent(delta, rowContent, nsnull, getter_AddRefs(topRowContent));
ConstructContentChain(topRowContent);
//Now construct the chain for the old top row so its content chain gets
//set up correctly.
ConstructOldContentChain(aPresContext, rowContent);
ConstructContentChain(topRowContent);
//Now construct the chain for the old top row so its content chain gets
//set up correctly.
ConstructOldContentChain(aPresContext, rowContent);
}
}
else {