2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Original Author: David W. Hyatt (hyatt@netscape.com)
|
|
|
|
* Mike Pinkerton (pinkerton@netscape.com)
|
|
|
|
* Dean Tessman <dean_tessman@hotmail.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
//
|
|
|
|
// nsMenuPopupFrame
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef nsMenuPopupFrame_h__
|
|
|
|
#define nsMenuPopupFrame_h__
|
|
|
|
|
|
|
|
#include "prtypes.h"
|
|
|
|
#include "nsIAtom.h"
|
2007-07-04 08:49:38 -07:00
|
|
|
#include "nsGkAtoms.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsCOMPtr.h"
|
2007-07-04 08:49:38 -07:00
|
|
|
#include "nsMenuFrame.h"
|
2007-05-14 02:11:38 -07:00
|
|
|
#include "nsIDOMEventTarget.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsBoxFrame.h"
|
2008-12-05 08:37:31 -08:00
|
|
|
#include "nsMenuParent.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIWidget.h"
|
|
|
|
|
|
|
|
#include "nsITimer.h"
|
|
|
|
|
2007-08-03 07:05:07 -07:00
|
|
|
// XUL popups can be in several different states. When opening a popup, the
|
|
|
|
// state changes as follows:
|
|
|
|
// ePopupClosed - initial state
|
|
|
|
// ePopupShowing - during the period when the popupshowing event fires
|
|
|
|
// ePopupOpen - between the popupshowing event and being visible. Creation
|
|
|
|
// of the child frames, layout and reflow occurs in this state.
|
|
|
|
// ePopupOpenAndVisible - layout is done and AdjustView is called to make
|
|
|
|
// the popup's widget visible. The popup is now
|
|
|
|
// visible and the popupshown event fires.
|
|
|
|
// When closing a popup:
|
|
|
|
// ePopupHidden - during the period when the popuphiding event fires and
|
|
|
|
// the popup is removed.
|
|
|
|
// ePopupClosed - the popup's widget is made invisible.
|
|
|
|
enum nsPopupState {
|
|
|
|
// state when a popup is not open
|
|
|
|
ePopupClosed,
|
|
|
|
// state from when a popup is requested to be shown to after the
|
|
|
|
// popupshowing event has been fired.
|
|
|
|
ePopupShowing,
|
|
|
|
// state while a popup is open but the widget is not yet visible
|
|
|
|
ePopupOpen,
|
|
|
|
// state while a popup is open and visible on screen
|
|
|
|
ePopupOpenAndVisible,
|
|
|
|
// state from when a popup is requested to be hidden to when it is closed.
|
|
|
|
ePopupHiding,
|
|
|
|
// state which indicates that the popup was hidden without firing the
|
|
|
|
// popuphiding or popuphidden events. It is used when executing a menu
|
|
|
|
// command because the menu needs to be hidden before the command event
|
|
|
|
// fires, yet the popuphiding and popuphidden events are fired after. This
|
|
|
|
// state can also occur when the popup is removed because the document is
|
|
|
|
// unloaded.
|
|
|
|
ePopupInvisible
|
|
|
|
};
|
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// values are selected so that the direction can be flipped just by
|
|
|
|
// changing the sign
|
|
|
|
#define POPUPALIGNMENT_NONE 0
|
|
|
|
#define POPUPALIGNMENT_TOPLEFT 1
|
|
|
|
#define POPUPALIGNMENT_TOPRIGHT -1
|
|
|
|
#define POPUPALIGNMENT_BOTTOMLEFT 2
|
|
|
|
#define POPUPALIGNMENT_BOTTOMRIGHT -2
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#define INC_TYP_INTERVAL 1000 // 1s. If the interval between two keypresses is shorter than this,
|
|
|
|
// treat as a continue typing
|
|
|
|
// XXX, kyle.yuan@sun.com, there are 4 definitions for the same purpose:
|
|
|
|
// nsMenuPopupFrame.h, nsListControlFrame.cpp, listbox.xml, tree.xml
|
|
|
|
// need to find a good place to put them together.
|
|
|
|
// if someone changes one, please also change the other.
|
|
|
|
|
|
|
|
nsIFrame* NS_NewMenuPopupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
|
|
|
class nsIViewManager;
|
|
|
|
class nsIView;
|
|
|
|
class nsMenuPopupFrame;
|
|
|
|
|
2008-12-05 08:37:31 -08:00
|
|
|
class nsMenuPopupFrame : public nsBoxFrame, public nsMenuParent
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsMenuPopupFrame(nsIPresShell* aShell, nsStyleContext* aContext);
|
|
|
|
|
2008-12-05 08:37:31 -08:00
|
|
|
// nsMenuParent interface
|
2007-07-04 08:49:38 -07:00
|
|
|
virtual nsMenuFrame* GetCurrentMenuItem();
|
|
|
|
NS_IMETHOD SetCurrentMenuItem(nsMenuFrame* aMenuItem);
|
|
|
|
virtual void CurrentMenuIsBeingDestroyed();
|
|
|
|
NS_IMETHOD ChangeMenuItem(nsMenuFrame* aMenuItem, PRBool aSelectFirstItem);
|
2007-06-29 15:15:59 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// as popups are opened asynchronously, the popup pending state is used to
|
|
|
|
// prevent multiple requests from attempting to open the same popup twice
|
2007-08-03 07:05:07 -07:00
|
|
|
nsPopupState PopupState() { return mPopupState; }
|
|
|
|
void SetPopupState(nsPopupState aPopupState) { mPopupState = aPopupState; }
|
2007-06-29 15:15:59 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
NS_IMETHOD SetActive(PRBool aActiveFlag) { return NS_OK; } // We don't care.
|
|
|
|
virtual PRBool IsActive() { return PR_FALSE; }
|
|
|
|
virtual PRBool IsMenuBar() { return PR_FALSE; }
|
|
|
|
|
|
|
|
/*
|
|
|
|
* When this popup is open, should clicks outside of it be consumed?
|
|
|
|
* Return PR_TRUE if the popup should rollup on an outside click,
|
|
|
|
* but consume that click so it can't be used for anything else.
|
|
|
|
* Return PR_FALSE to allow clicks outside the popup to activate content
|
|
|
|
* even when the popup is open.
|
|
|
|
* ---------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Should clicks outside of a popup be eaten?
|
|
|
|
*
|
|
|
|
* Menus Autocomplete Comboboxes
|
|
|
|
* Mac Eat No Eat
|
|
|
|
* Win No No Eat
|
|
|
|
* Unix Eat No Eat
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
PRBool ConsumeOutsideClicks();
|
|
|
|
|
|
|
|
virtual PRBool IsContextMenu() { return mIsContextMenu; }
|
|
|
|
|
|
|
|
virtual PRBool MenuClosed() { return PR_TRUE; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD GetWidget(nsIWidget **aWidget);
|
|
|
|
|
|
|
|
// The dismissal listener gets created and attached to the window.
|
2007-07-04 08:49:38 -07:00
|
|
|
void AttachedDismissalListener();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Overridden methods
|
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
|
|
|
|
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aModType);
|
|
|
|
|
|
|
|
virtual void Destroy();
|
|
|
|
|
|
|
|
virtual void InvalidateInternal(const nsRect& aDamageRect,
|
|
|
|
nscoord aX, nscoord aY, nsIFrame* aForChild,
|
2008-09-18 02:47:21 -07:00
|
|
|
PRUint32 aFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-11-28 12:18:11 -08:00
|
|
|
// returns true if the popup is a panel with the noautohide attribute set to
|
|
|
|
// true. These panels do not roll up automatically.
|
|
|
|
PRBool IsNoAutoHide();
|
|
|
|
|
2008-09-08 05:58:07 -07:00
|
|
|
// returns true if the popup is a top-most window. Otherwise, the
|
|
|
|
// panel appears in front of the parent window.
|
|
|
|
PRBool IsTopMost();
|
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
void EnsureWidget();
|
2007-06-29 15:15:59 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
virtual nsresult CreateWidgetForView(nsIView* aView);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-16 08:51:27 -07:00
|
|
|
virtual PRBool IsLeaf() const;
|
2007-06-29 15:15:59 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// AdjustView should be called by the parent frame after the popup has been
|
|
|
|
// laid out, so that the view can be shown.
|
|
|
|
void AdjustView();
|
2007-06-29 15:15:59 -07:00
|
|
|
|
2007-08-27 09:23:52 -07:00
|
|
|
nsIView* GetRootViewForPopup(nsIFrame* aStartFrame);
|
2007-07-04 08:49:38 -07:00
|
|
|
|
|
|
|
// set the position of the popup either relative to the anchor aAnchorFrame
|
|
|
|
// (or the frame for mAnchorContent if aAnchorFrame is null) or at a specific
|
|
|
|
// point if a screen position (mScreenXPos and mScreenYPos) are set. The popup
|
|
|
|
// will be adjusted so that it is on screen.
|
|
|
|
nsresult SetPopupPosition(nsIFrame* aAnchorFrame);
|
|
|
|
|
|
|
|
PRBool HasGeneratedChildren() { return mGeneratedChildren; }
|
|
|
|
void SetGeneratedChildren() { mGeneratedChildren = PR_TRUE; }
|
|
|
|
|
|
|
|
// called when the Enter key is pressed while the popup is open. This will
|
2007-11-17 07:47:38 -08:00
|
|
|
// just pass the call down to the current menu, if any. If a current menu
|
|
|
|
// should be opened as a result, this method should return the frame for
|
|
|
|
// that menu, or null if no menu should be opened. Also, calling Enter will
|
|
|
|
// reset the current incremental search string, calculated in
|
|
|
|
// FindMenuWithShortcut.
|
2007-07-04 08:49:38 -07:00
|
|
|
nsMenuFrame* Enter();
|
|
|
|
|
2007-08-15 18:09:58 -07:00
|
|
|
nsPopupType PopupType() const { return mPopupType; }
|
2007-07-04 08:49:38 -07:00
|
|
|
PRBool IsMenu() { return mPopupType == ePopupTypeMenu; }
|
2007-08-03 07:05:07 -07:00
|
|
|
PRBool IsOpen() { return mPopupState == ePopupOpen || mPopupState == ePopupOpenAndVisible; }
|
2007-07-04 08:49:38 -07:00
|
|
|
PRBool HasOpenChanged() { return mIsOpenChanged; }
|
|
|
|
|
2007-08-03 07:05:07 -07:00
|
|
|
// returns true if the popup is in a content shell, or false for a popup in
|
|
|
|
// a chrome shell
|
|
|
|
PRBool IsInContentShell() { return mInContentShell; }
|
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// the Initialize methods are used to set the anchor position for
|
|
|
|
// each way of opening a popup.
|
|
|
|
void InitializePopup(nsIContent* aAnchorContent,
|
|
|
|
const nsAString& aPosition,
|
|
|
|
PRInt32 aXPos, PRInt32 aYPos,
|
|
|
|
PRBool aAttributesOverride);
|
|
|
|
|
2008-04-23 14:25:34 -07:00
|
|
|
/**
|
|
|
|
* @param aIsContextMenu if true, then the popup is
|
|
|
|
* positioned at a slight offset from aXPos/aYPos to ensure the
|
|
|
|
* (presumed) mouse position is not over the menu.
|
|
|
|
*/
|
|
|
|
void InitializePopupAtScreen(PRInt32 aXPos, PRInt32 aYPos,
|
|
|
|
PRBool aIsContextMenu);
|
2007-07-04 08:49:38 -07:00
|
|
|
|
|
|
|
void InitializePopupWithAnchorAlign(nsIContent* aAnchorContent,
|
|
|
|
nsAString& aAnchor,
|
|
|
|
nsAString& aAlign,
|
|
|
|
PRInt32 aXPos, PRInt32 aYPos);
|
|
|
|
|
|
|
|
// indicate that the popup should be opened
|
|
|
|
PRBool ShowPopup(PRBool aIsContextMenu, PRBool aSelectFirstItem);
|
2007-08-03 07:05:07 -07:00
|
|
|
// indicate that the popup should be hidden. The new state should either be
|
|
|
|
// ePopupClosed or ePopupInvisible.
|
|
|
|
void HidePopup(PRBool aDeselectMenu, nsPopupState aNewState);
|
2007-07-04 08:49:38 -07:00
|
|
|
|
|
|
|
// locate and return the menu frame that should be activated for the
|
|
|
|
// supplied key event. If doAction is set to true by this method,
|
|
|
|
// then the menu's action should be carried out, as if the user had pressed
|
|
|
|
// the Enter key. If doAction is false, the menu should just be highlighted.
|
|
|
|
// This method also handles incremental searching in menus so the user can
|
|
|
|
// type the first few letters of an item/s name to select it.
|
|
|
|
nsMenuFrame* FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent, PRBool& doAction);
|
|
|
|
|
|
|
|
void ClearIncrementalString() { mIncrementalString.Truncate(); }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-04-20 03:56:49 -07:00
|
|
|
virtual nsIAtom* GetType() const { return nsGkAtoms::menuPopupFrame; }
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("MenuPopup"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
void EnsureMenuItemIsVisible(nsMenuFrame* aMenuFrame);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// This sets 'left' and 'top' attributes.
|
|
|
|
// May kill the frame.
|
|
|
|
void MoveTo(PRInt32 aLeft, PRInt32 aTop);
|
|
|
|
|
2007-11-28 12:18:11 -08:00
|
|
|
PRBool GetAutoPosition();
|
2007-03-22 10:30:00 -07:00
|
|
|
void SetAutoPosition(PRBool aShouldAutoPosition);
|
|
|
|
void SetConsumeRollupEvent(PRUint32 aConsumeMode);
|
|
|
|
|
|
|
|
nsIScrollableView* GetScrollableView(nsIFrame* aStart);
|
2007-12-19 08:37:32 -08:00
|
|
|
|
|
|
|
// same as SetBounds except the preferred size mPrefSize is also set.
|
|
|
|
void SetPreferredBounds(nsBoxLayoutState& aState, const nsRect& aRect);
|
|
|
|
|
|
|
|
// retrieve the last preferred size
|
|
|
|
nsSize PreferredSize() { return mPrefSize; }
|
|
|
|
// set the last preferred size
|
|
|
|
void SetPreferredSize(nsSize aSize) { mPrefSize = aSize; }
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2007-07-04 08:49:38 -07:00
|
|
|
// Move without updating attributes.
|
|
|
|
void MoveToInternal(PRInt32 aLeft, PRInt32 aTop);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// redefine to tell the box system not to move the views.
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual void GetLayoutFlags(PRUint32& aFlags);
|
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
void InitPositionFromAnchorAlign(const nsAString& aAnchor,
|
|
|
|
const nsAString& aAlign);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-12-10 07:19:16 -08:00
|
|
|
// return the position where the popup should be, when it should be
|
|
|
|
// anchored at anchorRect. aHFlip and aVFlip will be set if the popup may be
|
|
|
|
// flipped in that direction if there is not enough space available.
|
|
|
|
nsPoint AdjustPositionForAnchorAlign(const nsRect& anchorRect, PRBool& aHFlip, PRBool& aVFlip);
|
|
|
|
|
|
|
|
|
|
|
|
// check if the popup will fit into the available space and resize it. This
|
|
|
|
// method handles only one axis at a time so is called twice, once for
|
|
|
|
// horizontal and once for vertical. All arguments are specified for this
|
|
|
|
// one axis. All coordinates are in app units relative to the screen.
|
|
|
|
// aScreenPoint - the point where the popup should appear
|
|
|
|
// aSize - the size of the popup
|
|
|
|
// aScreenBegin - the left or top edge of the screen
|
|
|
|
// aScreenEnd - the right or bottom edge of the screen
|
|
|
|
// aAnchorBegin - the left or top edge of the anchor rectangle
|
|
|
|
// aAnchorEnd - the right or bottom edge of the anchor rectangle
|
|
|
|
// aMarginBegin - the left or top margin of the popup
|
|
|
|
// aMarginEnd - the right or bottom margin of the popup
|
|
|
|
// aOffsetForContextMenu - the additional offset to add for context menus
|
|
|
|
// aFlip - whether to flip or resize the popup when there isn't space
|
|
|
|
nscoord FlipOrResize(nscoord& aScreenPoint, nscoord aSize,
|
|
|
|
nscoord aScreenBegin, nscoord aScreenEnd,
|
|
|
|
nscoord aAnchorBegin, nscoord aAnchorEnd,
|
|
|
|
nscoord aMarginBegin, nscoord aMarginEnd,
|
|
|
|
nscoord aOffsetForContextMenu, PRBool aFlip);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Move the popup to the position specified in its |left| and |top| attributes.
|
|
|
|
void MoveToAttributePosition();
|
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// the content that the popup is anchored to, if any, which may be in a
|
|
|
|
// different document than the popup.
|
|
|
|
nsCOMPtr<nsIContent> mAnchorContent;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
nsMenuFrame* mCurrentMenu; // The current menu that is active.
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// popup alignment relative to the anchor node
|
|
|
|
PRInt8 mPopupAlignment;
|
|
|
|
PRInt8 mPopupAnchor;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
// the position of the popup. The screen coordinates, if set to values other
|
|
|
|
// than -1, override mXPos and mYPos.
|
|
|
|
PRInt32 mXPos;
|
|
|
|
PRInt32 mYPos;
|
|
|
|
PRInt32 mScreenXPos;
|
|
|
|
PRInt32 mScreenYPos;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
nsPopupType mPopupType; // type of popup
|
2007-08-03 07:05:07 -07:00
|
|
|
nsPopupState mPopupState; // open state of the popup
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
PRPackedBool mIsOpenChanged; // true if the open state changed since the last layout
|
|
|
|
PRPackedBool mIsContextMenu; // true for context menus
|
2008-04-23 14:25:34 -07:00
|
|
|
// true if we need to offset the popup to ensure it's not under the mouse
|
|
|
|
PRPackedBool mAdjustOffsetForContextMenu;
|
2007-07-04 08:49:38 -07:00
|
|
|
PRPackedBool mGeneratedChildren; // true if the contents have been created
|
2007-06-29 15:15:59 -07:00
|
|
|
|
2007-07-04 08:49:38 -07:00
|
|
|
PRPackedBool mMenuCanOverlapOSBar; // can we appear over the taskbar/menubar?
|
|
|
|
PRPackedBool mShouldAutoPosition; // Should SetPopupPosition be allowed to auto position popup?
|
2007-03-22 10:30:00 -07:00
|
|
|
PRPackedBool mConsumeRollupEvent; // Should the rollup event be consumed?
|
2007-04-20 11:20:03 -07:00
|
|
|
PRPackedBool mInContentShell; // True if the popup is in a content shell
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsString mIncrementalString; // for incremental typing navigation
|
|
|
|
|
2007-12-19 08:37:32 -08:00
|
|
|
// A popup's preferred size may be different than its actual size stored in
|
|
|
|
// mRect in the case where the popup was resized because it was too large
|
|
|
|
// for the screen. The preferred size mPrefSize holds the full size the popup
|
|
|
|
// would be before resizing. Computations are performed using this size.
|
|
|
|
// The parent frame is responsible for setting the preferred size using
|
|
|
|
// SetPreferredBounds or SetPreferredSize before positioning the popup with
|
|
|
|
// SetPopupPosition.
|
|
|
|
nsSize mPrefSize;
|
|
|
|
|
2008-09-08 05:58:07 -07:00
|
|
|
static PRInt8 sDefaultLevelParent;
|
2007-03-22 10:30:00 -07:00
|
|
|
}; // class nsMenuPopupFrame
|
|
|
|
|
|
|
|
#endif
|