From 08cedcbba7feba86ea6e06e717550ba010edbda2 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Mon, 23 Sep 2002 21:35:53 +0000 Subject: [PATCH] #168643 r=pedemont, sr=blizzard OS/2 only - implement GetBounds --- widget/src/os2/nsWindow.cpp | 23 +++++++++++++++++++++++ widget/src/os2/nsWindow.h | 1 + 2 files changed, 24 insertions(+) diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index 5e724f419a81..f51fd5e97619 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -1408,6 +1408,29 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise) return NS_OK; } +//------------------------------------------------------------------------- +// +// Get this component dimension +// +//------------------------------------------------------------------------- +NS_METHOD nsWindow::GetBounds(nsRect &aRect) +{ + if (mWnd) { + SWP swp; + WinQueryWindowPos(mWnd, &swp); + aRect.width = swp.cx; + aRect.height = swp.cy; +// Need to add code to convert coordinate if parent exists - see Windows + aRect.x = swp.x; + aRect.y = swp.y; + } else { + aRect = mBounds; + } + + return NS_OK; +} + + //------------------------------------------------------------------------- // // Get this component dimension diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index fdba38460d53..0f542ed193f4 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -116,6 +116,7 @@ class nsWindow : public nsBaseWidget, NS_IMETHOD Enable( PRBool aState); NS_IMETHOD IsEnabled(PRBool *aState); NS_IMETHOD SetFocus(PRBool aRaise); + NS_IMETHOD GetBounds(nsRect &aRect); NS_IMETHOD IsVisible( PRBool &aState); NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate);