new |placement| parameter to PlaceBehind. bug 42557 r=neil (mostly), rjc. rs=hyatt

This commit is contained in:
danm-moz%comcast.net 2003-10-07 01:19:51 +00:00
Родитель 700a5a690d
Коммит dca8cc1f87
12 изменённых файлов: 39 добавлений и 16 удалений

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

@ -214,6 +214,12 @@ enum nsContentType {
eContentTypeContent = 1 // eContentTypeUI must equal 1
};
enum nsTopLevelWidgetZPlacement { // for PlaceBehind()
eZPlacementBottom = 0, // bottom of the window stack
eZPlacementBelow, // just below another widget
eZPlacementTop // top of the window stack
};
/**
* Basic struct for widget initialization data.
* @see Create member function of nsIWidget
@ -450,9 +456,15 @@ class nsIWidget : public nsISupports {
* Position this widget just behind the given widget. (Used to
* control z-order for top-level widgets. Get/SetZIndex by contrast
* control z-order for child widgets of other widgets.)
* null aWidget means put on top.
* @param aPlacement top, bottom, or below a widget
* (if top or bottom, param aWidget is ignored)
* @param aWidget widget to place this widget behind
* (only if aPlacement is eZPlacementBelow).
* null is equivalent to aPlacement of eZPlacementTop
* @param aActivate true to activate the widget after placing it
*/
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate) = 0;
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate) = 0;
/**
* Minimize, maximize or normalize the window size.

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

@ -129,7 +129,8 @@ public:
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop,
PRInt32 *aX, PRInt32 *aY);
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD SetSizeMode(PRInt32 aMode);
void CalculateAndSetZoomedSize();

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

@ -1149,7 +1149,8 @@ NS_IMETHODIMP nsCocoaWindow::Move(PRInt32 aX, PRInt32 aY)
// Position the window behind the given window
//
//-------------------------------------------------------------------------
NS_METHOD nsCocoaWindow::PlaceBehind(nsIWidget *aWidget, PRBool aActivate)
NS_METHOD nsCocoaWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate)
{
#if 0
if (aWidget) {

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

@ -503,8 +503,9 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY)
}
NS_IMETHODIMP
nsWindow::PlaceBehind(nsIWidget *aWidget,
PRBool aActivate)
nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget,
PRBool aActivate)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

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

@ -94,8 +94,9 @@ public:
PRInt32 *aY);
NS_IMETHOD Move(PRInt32 aX,
PRInt32 aY);
NS_IMETHOD PlaceBehind(nsIWidget *aWidget,
PRBool aActivate);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget,
PRBool aActivate);
NS_IMETHOD SetSizeMode(PRInt32 aMode);
NS_IMETHOD Enable(PRBool aState);
NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE);

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

@ -1210,7 +1210,8 @@ NS_IMETHODIMP nsMacWindow::Move(PRInt32 aX, PRInt32 aY)
// Position the window behind the given window
//
//-------------------------------------------------------------------------
NS_METHOD nsMacWindow::PlaceBehind(nsIWidget *aWidget, PRBool aActivate)
NS_METHOD nsMacWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate)
{
if (aWidget) {
WindowPtr behind = (WindowPtr)aWidget->GetNativeData(NS_NATIVE_DISPLAY);

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

@ -113,7 +113,8 @@ public:
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop,
PRInt32 *aX, PRInt32 *aY);
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD SetSizeMode(PRInt32 aMode);
NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);

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

@ -1217,7 +1217,8 @@ NS_METHOD nsWindow::IsVisible(PRBool & bState)
// Position the window behind the given window
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::PlaceBehind(nsIWidget *aWidget, PRBool aActivate)
NS_METHOD nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate)
{
HWND behind = aWidget ? (HWND)aWidget->GetNativeData(NS_NATIVE_WINDOW) : HWND_TOP;
UINT flags = SWP_ZORDER;

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

@ -121,7 +121,8 @@ class nsWindow : public nsBaseWidget,
NS_IMETHOD SetFocus(PRBool aRaise);
NS_IMETHOD GetBounds(nsRect &aRect);
NS_IMETHOD IsVisible( PRBool &aState);
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD CaptureMouse(PRBool aCapture);

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

@ -312,7 +312,8 @@ public:
virtual nsIWidget* GetParent(void);
NS_IMETHOD Show(PRBool bState);
NS_IMETHOD IsVisible(PRBool & aState);
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD SetSizeMode(PRInt32 aMode);
NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent,

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

@ -342,7 +342,7 @@ NS_IMETHODIMP nsBaseWidget::SetZIndex(PRInt32 aZIndex)
if (NS_SUCCEEDED(childWidget->GetZIndex(&childZIndex))) {
if (aZIndex < childZIndex) {
parent->mChildren->InsertElementAt(this, index);
PlaceBehind(childWidget, PR_FALSE);
PlaceBehind(eZPlacementBelow, childWidget, PR_FALSE);
break;
}
}
@ -374,7 +374,8 @@ NS_IMETHODIMP nsBaseWidget::GetZIndex(PRInt32* aZIndex)
// Places widget behind the given widget (platforms must override)
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsBaseWidget::PlaceBehind(nsIWidget *aWidget, PRBool aActivate)
NS_IMETHODIMP nsBaseWidget::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate)
{
return NS_OK;
}

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

@ -86,7 +86,8 @@ public:
NS_IMETHOD SetZIndex(PRInt32 aZIndex);
NS_IMETHOD GetZIndex(PRInt32* aZIndex);
NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD SetSizeMode(PRInt32 aMode);
NS_IMETHOD GetSizeMode(PRInt32* aMode);