summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/help.cxx10
-rw-r--r--vcl/source/window/dialog.cxx10
-rw-r--r--vcl/source/window/floatwin.cxx54
-rw-r--r--vcl/source/window/menu.cxx33
-rw-r--r--vcl/source/window/window.cxx100
-rw-r--r--vcl/source/window/winproc.cxx52
6 files changed, 199 insertions, 60 deletions
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index b86ad07fa5ac..6a43e3c8939d 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: help.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mt $ $Date: 2001-04-20 07:33:31 $
+ * last change: $Author: ssa $ $Date: 2001-10-24 08:47:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -615,7 +615,11 @@ void ImplSetHelpWindowPos( Window* pHelpWin, USHORT nHelpWinStyle, USHORT nStyle
{
Point aPos = rPos;
Size aSz = pHelpWin->GetSizePixel();
- Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
+ //Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
+ // GetDesktopRectPixel only makes sense for system windows, the help window
+ // however is (still) a VCL window, so we have to align it with the frame window:
+ Rectangle aScreenRect( Point(), pHelpWin->ImplGetFrameWindow()->GetSizePixel() );
+
if ( nHelpWinStyle == HELPWINSTYLE_QUICK )
{
if ( !(nStyle & QUICKHELP_NOAUTOPOS) )
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 5326962f0a32..12480ee0a05f 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dialog.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: th $ $Date: 2001-08-07 11:54:21 $
+ * last change: $Author: ssa $ $Date: 2001-10-24 08:49:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -426,6 +426,9 @@ void Dialog::ImplCenterDialog()
Point aDeskPos = aDeskRect.TopLeft();
Size aDeskSize = aDeskRect.GetSize();
Size aWinSize = GetSizePixel();
+ Window *pWindow = this;
+ while ( pWindow->mpBorderWindow )
+ pWindow = pWindow->mpBorderWindow;
Point aWinPos( ((aDeskSize.Width() - aWinSize.Width()) / 2) + aDeskPos.X(),
((aDeskSize.Height() - aWinSize.Height()) / 2) + aDeskPos.Y() );
@@ -440,7 +443,8 @@ void Dialog::ImplCenterDialog()
if ( aWinPos.Y() < aDeskPos.Y() )
aWinPos.Y() = aDeskPos.Y();
- SetPosPixel( aWinPos );
+ //SetPosPixel( aWinPos );
+ SetPosPixel( pWindow->ScreenToOutputPixel( aWinPos ) );
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 5d9f2c68edfc..b7fa3e95a5d9 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: floatwin.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: th $ $Date: 2001-08-23 13:41:53 $
+ * last change: $Author: ssa $ $Date: 2001-10-24 08:49:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,7 +86,9 @@
#ifndef _SV_FLOATWIN_HXX
#include <floatwin.hxx>
#endif
-
+#ifndef _SV_WINDOW_H
+#include <window.h>
+#endif
#ifndef _SV_RC_H
#include <rc.h>
#endif
@@ -98,6 +100,7 @@
void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
{
mbFloatWin = TRUE;
+ mbInCleanUp = FALSE;
if ( !pParent )
pParent = Application::GetAppWindow();
@@ -105,7 +108,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
DBG_ASSERT( pParent, "FloatWindow::FloatingWindow(): - pParent == NULL and no AppWindow exists" );
// no Border, then we dont need a border window
- if ( !nStyle )
+ if ( !(nStyle & (WB_BORDER|WB_MOVEABLE|WB_SIZEABLE)) )
{
if ( nStyle & WB_SYSTEMWINDOW )
mbFrame = TRUE;
@@ -239,6 +242,18 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
Point aPos;
Size aSize = pWindow->GetSizePixel();
Rectangle aScreenRect = pWindow->ImplGetFrameWindow()->GetDesktopRectPixel();
+
+ // convert....
+ Window* pW = pWindow;
+ if ( pW->mpRealParent )
+ pW = pW->mpRealParent;
+
+ Rectangle normRect( rRect ); // rRect is already relative to top-level window
+ normRect.SetPos( pW->ScreenToOutputPixel( normRect.TopLeft() ) );
+
+ Rectangle devRect( pW->OutputToAbsoluteScreenPixel( normRect.TopLeft() ),
+ pW->OutputToAbsoluteScreenPixel( normRect.BottomRight() ) );
+
USHORT nArrangeAry[5];
USHORT nArrangeIndex;
BOOL bLeft;
@@ -288,26 +303,26 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
switch ( nArrangeAry[nArrangeIndex] )
{
case FLOATWIN_POPUPMODE_LEFT:
- aPos.X() = rRect.Left()-aSize.Width();
- aPos.Y() = rRect.Top();
+ aPos.X() = devRect.Left()-aSize.Width();
+ aPos.Y() = devRect.Top();
aPos.Y() -= pWindow->mnTopBorder;
if ( aPos.X() < aScreenRect.Left() )
bBreak = FALSE;
break;
case FLOATWIN_POPUPMODE_RIGHT:
- aPos = rRect.TopRight();
+ aPos = devRect.TopRight();
aPos.Y() -= pWindow->mnTopBorder;
if ( aPos.X()+aSize.Width() > aScreenRect.Right() )
bBreak = FALSE;
break;
case FLOATWIN_POPUPMODE_UP:
- aPos.X() = rRect.Left();
- aPos.Y() = rRect.Top()-aSize.Height();
+ aPos.X() = devRect.Left();
+ aPos.Y() = devRect.Top()-aSize.Height();
if ( aPos.Y() < aScreenRect.Top() )
bBreak = FALSE;
break;
case FLOATWIN_POPUPMODE_DOWN:
- aPos = rRect.BottomLeft();
+ aPos = devRect.BottomLeft();
if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
bBreak = FALSE;
break;
@@ -322,7 +337,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() )
{
bTop = TRUE;
- aPos.Y() = rRect.Bottom()-aSize.Height();
+ aPos.Y() = devRect.Bottom()-aSize.Height();
if ( aPos.Y() < aScreenRect.Top() )
aPos.Y() = aScreenRect.Top();
}
@@ -332,7 +347,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if ( aPos.X()+aSize.Width() > aScreenRect.Right() )
{
bLeft = TRUE;
- aPos.X() = rRect.Right()-aSize.Width();
+ aPos.X() = devRect.Right()-aSize.Width();
if ( aPos.X() < aScreenRect.Left() )
aPos.X() = aScreenRect.Left();
}
@@ -356,7 +371,10 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
aPos.Y() = aScreenRect.Top();
rArrangeIndex = nArrangeIndex;
- return aPos;
+
+ aPos = pW->AbsoluteScreenToOutputPixel( aPos );
+ // caller expects cordinates relative to top-level win
+ return pW->OutputToScreenPixel( aPos );
}
// -----------------------------------------------------------------------
@@ -607,13 +625,12 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
}
else
*/
- Show();
-
// FloatingWindow in Liste der Fenster aufnehmen, die sich im PopupModus
// befinden
ImplSVData* pSVData = ImplGetSVData();
mpNextFloat = pSVData->maWinData.mpFirstFloat;
pSVData->maWinData.mpFirstFloat = this;
+ Show( TRUE, SHOW_NOACTIVATE );
}
// -----------------------------------------------------------------------
@@ -668,10 +685,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
ImplSVData* pSVData = ImplGetSVData();
+ mbInCleanUp = TRUE; // prevent killing this window due to focus change while working with it
+
// Bei allen nachfolgenden PopupMode-Fenster den Modus auch beenden
- while ( pSVData->maWinData.mpFirstFloat != this )
+ while ( pSVData->maWinData.mpFirstFloat && pSVData->maWinData.mpFirstFloat != this )
pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+
// Fenster aus der Liste austragen
pSVData->maWinData.mpFirstFloat = mpNextFloat;
mpNextFloat = NULL;
@@ -728,6 +748,8 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId )
}
}
}
+
+ mbInCleanUp = FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 3715ee0666fe..7eb193c5c587 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: menu.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: mt $ $Date: 2001-10-09 13:56:47 $
+ * last change: $Author: ssa $ $Date: 2001-10-24 08:49:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,7 +125,6 @@
#ifndef _VCL_I18NHELP_HXX
#include <i18nhelp.hxx>
#endif
-
#ifndef _ISOLANG_HXX
#include <tools/isolang.hxx>
#endif
@@ -1943,6 +1942,12 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
nFocusId = Window::SaveFocus();
bRealExecute = TRUE;
}
+ else
+ {
+ // assure that only one menu is open at a time
+ if( pStartedFrom->bIsMenuBar && pSVData->maWinData.mpFirstFloat )
+ pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+ }
DBG_ASSERT( !ImplGetWindow(), "Win?!" );
Rectangle aRect( rRect );
@@ -2002,7 +2007,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
aMnemonicGenerator.CreateMnemonic( pItemList->GetDataFromPos(n)->aText );
}
- MenuFloatingWindow* pWin = new MenuFloatingWindow( this, pW, nStyle );
+ MenuFloatingWindow* pWin = new MenuFloatingWindow( this, pW, nStyle | WB_SYSTEMWINDOW );
pWindow = pWin;
Size aSz = ImplCalcSize( pWin );
@@ -2305,8 +2310,9 @@ IMPL_LINK( MenuFloatingWindow, PopupEnd, FloatingWindow*, pPopup )
{
if ( pActivePopup )
{
- DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" );
- pActivePopup->bCanceled = TRUE;
+ //DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" );
+ KillActivePopup(); // should be ok to just remove it
+ //pActivePopup->bCanceled = TRUE;
}
bInExecute = FALSE;
pMenu->bInCallback = TRUE;
@@ -2351,7 +2357,10 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
{
if ( pActivePopup && ( pActivePopup != pData->pSubMenu ) )
{
+ ULONG nOldFlags = GetPopupModeFlags();
+ SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
KillActivePopup();
+ SetPopupModeFlags( nOldFlags );
}
if ( pData->bEnabled && pData->pSubMenu && pData->pSubMenu->GetItemCount() && ( pData->pSubMenu != pActivePopup ) )
{
@@ -2389,7 +2398,10 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
// die lange im Activate Rescheduled haben und jetzt schon nicht mehr
// angezeigt werden sollen.
Menu* pTest = pActivePopup;
+ ULONG nOldFlags = GetPopupModeFlags();
+ SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
USHORT nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? FALSE : TRUE );
+ SetPopupModeFlags( nOldFlags );
// nRet != 0, wenn es waerend Activate() abgeschossen wurde...
if ( !nRet && ( pActivePopup == pTest ) && pActivePopup->ImplGetWindow() )
@@ -2454,6 +2466,9 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
{
if ( pActivePopup && ( !pThisOnly || ( pThisOnly == pActivePopup ) ) )
{
+ //if( pActivePopup->pWindow->mbFloatWin )
+ if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() )
+ return; // kill it later
if ( pActivePopup->bInCallback )
pActivePopup->bCanceled = TRUE;
@@ -2469,6 +2484,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
pPopup->ImplGetFloatingWindow()->StopExecute();
delete pPopup->pWindow;
pPopup->pWindow = NULL;
+
Update();
}
}
@@ -3088,6 +3104,7 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
}
pData = pMenu->pItemList->GetDataFromPos( nHighlightedItem );
// Point MyPos = GetPosPixel();
+// Point aItemTopLeft( MyPos.X()+nX, MyPos.Y() );
Point aItemTopLeft( nX, 0 );
Point aItemBottomRight( aItemTopLeft );
aItemBottomRight.X() += pData->aSz.Width();
@@ -3117,6 +3134,10 @@ void MenuBarWindow::KillActivePopup()
{
if ( pActivePopup )
{
+ //if( pActivePopup->pWindow->mbFloatWin )
+ if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() )
+ return; // kill it later
+
if ( pActivePopup->bInCallback )
pActivePopup->bCanceled = TRUE;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 29a39a5b74e3..9b9f123c4c90 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: window.cxx,v $
*
- * $Revision: 1.43 $
+ * $Revision: 1.44 $
*
- * last change: $Author: hro $ $Date: 2001-10-19 14:55:57 $
+ * last change: $Author: ssa $ $Date: 2001-10-24 08:49:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -556,7 +556,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
if ( nStyle & WB_APP )
nFrameStyle |= SAL_FRAME_STYLE_DEFAULT;
if ( mbFloatWin || ((GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)this)->mbFloatWindow) )
- nFrameStyle = 0;
+ nFrameStyle = SAL_FRAME_STYLE_FLOAT; // hmmm, was '0' before ????
SalFrame* pParentFrame = NULL;
if ( pParent )
@@ -2942,6 +2942,16 @@ void Window::ImplPosSizeWindow( long nX, long nY,
}
}
+/* if ( nFlags & (WINDOW_POSSIZE_X|WINDOW_POSSIZE_Y) )
+ {
+ POINT aPt;
+ aPt.x = maPos.X();
+ aPt.y = maPos.Y();
+ ClientToScreen( mpFrame->maFrameData.mhWnd , &aPt );
+ maPos.X() = aPt.x;
+ maPos.Y() = aPt.y;
+ }
+*/
if ( bNewPos || bNewSize )
{
#ifndef REMOTE_APPSERVER
@@ -3602,11 +3612,18 @@ void Window::ImplGrabFocus( USHORT nFlags )
if ( !mpFrameData->mbHasFocus )
#endif
{
- // Hier setzen wir schon den Focus um, da ToTop() den Focus
- // nicht auf ein anderes Fenster setzen darf
- DBG_WARNING( "Window::GrabFocus() - Frame doesn't have the focus" );
- mpFrame->ToTop( 0 );
- return;
+ // menue windows never get the system focus
+ // the application will keep the focus
+ if( mbFloatWin )
+ return;
+ else
+ {
+ // Hier setzen wir schon den Focus um, da ToTop() den Focus
+ // nicht auf ein anderes Fenster setzen darf
+ DBG_WARNING( "Window::GrabFocus() - Frame doesn't have the focus" );
+ mpFrame->ToTop( 0 );
+ return;
+ }
}
Window* pOldFocusWindow = pSVData->maWinData.mpFocusWin;
@@ -5952,21 +5969,29 @@ void Window::SetPosSizePixel( long nX, long nY,
if ( pWindow->mbFrame )
{
- // Nur Groessenaenderungen werden beruecksichtig
- if ( (nFlags & WINDOW_POSSIZE_SIZE) == WINDOW_POSSIZE_SIZE )
- {
- if ( !(nFlags & WINDOW_POSSIZE_WIDTH) )
- nWidth = pWindow->mnOutWidth;
- if ( !(nFlags & WINDOW_POSSIZE_HEIGHT) )
- nHeight = pWindow->mnOutHeight;
-
- pWindow->mpFrame->SetClientSize( nWidth, nHeight );
- // Resize should be called directly. If we havn't
- // set the correct size, we get a second resize from
- // the system with the correct size. This can be happend
- // if the size is to small or to lare.
- ImplHandleResize( pWindow, nWidth, nHeight );
- }
+ if ( !(nFlags & WINDOW_POSSIZE_WIDTH) )
+ nWidth = pWindow->mnOutWidth;
+ if ( !(nFlags & WINDOW_POSSIZE_HEIGHT) )
+ nHeight = pWindow->mnOutHeight;
+
+ long nOldWidth = pWindow->mnOutWidth;
+ long nOldHeight = pWindow->mnOutHeight;
+
+ USHORT nSysFlags=0;
+ if( nFlags & WINDOW_POSSIZE_WIDTH )
+ nSysFlags |= SAL_FRAME_POSSIZE_WIDTH;
+ if( nFlags & WINDOW_POSSIZE_HEIGHT )
+ nSysFlags |= SAL_FRAME_POSSIZE_HEIGHT;
+ if( nFlags & WINDOW_POSSIZE_X )
+ nSysFlags |= SAL_FRAME_POSSIZE_X;
+ if( nFlags & WINDOW_POSSIZE_Y )
+ nSysFlags |= SAL_FRAME_POSSIZE_Y;
+ pWindow->mpFrame->SetPosSize( nX, nY, nWidth, nHeight, nSysFlags );
+ // Resize should be called directly. If we havn't
+ // set the correct size, we get a second resize from
+ // the system with the correct size. This can be happend
+ // if the size is to small or to large.
+ ImplHandleResize( pWindow, nWidth, nHeight );
}
else
{
@@ -5980,18 +6005,16 @@ void Window::SetPosSizePixel( long nX, long nY,
Rectangle Window::GetDesktopRectPixel() const
{
-/*
Rectangle rRect;
mpFrameWindow->mpFrame->GetWorkArea( rRect );
return rRect;
- */
- return Rectangle( ScreenToOutputPixel( Point() ), mpFrameWindow->GetOutputSizePixel() );
}
// -----------------------------------------------------------------------
Point Window::OutputToScreenPixel( const Point& rPos ) const
{
+ // relative to top level parent
return Point( rPos.X()+mnOutOffX, rPos.Y()+mnOutOffY );
}
@@ -5999,11 +6022,36 @@ Point Window::OutputToScreenPixel( const Point& rPos ) const
Point Window::ScreenToOutputPixel( const Point& rPos ) const
{
+ // relative to top level parent
return Point( rPos.X()-mnOutOffX, rPos.Y()-mnOutOffY );
}
// -----------------------------------------------------------------------
+Point Window::OutputToAbsoluteScreenPixel( const Point& rPos ) const
+{
+ // relative to the screen
+ Point p = OutputToScreenPixel( rPos );
+ SalFrame::Geometry g = mpFrame->GetGeometry();
+ p.X() += g.nX;
+ p.Y() += g.nY;
+ return p;
+}
+
+// -----------------------------------------------------------------------
+
+Point Window::AbsoluteScreenToOutputPixel( const Point& rPos ) const
+{
+ // relative to the screen
+ Point p = ScreenToOutputPixel( rPos );
+ SalFrame::Geometry g = mpFrame->GetGeometry();
+ p.X() -= g.nX;
+ p.Y() -= g.nY;
+ return p;
+}
+
+// -----------------------------------------------------------------------
+
void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index e8848fc4ead7..bee72302c22a 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: winproc.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: th $ $Date: 2001-08-13 11:36:36 $
+ * last change: $Author: ssa $ $Date: 2001-10-24 08:49:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -761,7 +761,8 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
// Fenster bei Klick nach vorne bringen
if ( nSVEvent == EVENT_MOUSEBUTTONDOWN )
{
- pChild->ToTop();
+ if( !pChild->mbFloatWin ) // totop for floating windows would change the focus
+ pChild->ToTop();
if ( aDelData.IsDelete() )
return 1;
}
@@ -910,7 +911,10 @@ static Window* ImplGetKeyInputWindow( Window* pWindow )
// find window - is every time the window which has currently the
// focus or the last time the focus.
- Window* pChild = pWindow->mpFrameData->mpFocusWin;
+ // the first floating window always has the focus
+ Window* pChild = pSVData->maWinData.mpFirstFloat;
+ if( !pChild )
+ pChild = pWindow->mpFrameData->mpFocusWin;
// no child - than no input
if ( !pChild )
@@ -1390,8 +1394,9 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
pWindow->mbWaitSystemResize = FALSE;
if ( pWindow->IsReallyVisible() )
pWindow->ImplSetClipFlag();
- if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->mbAllResize )
- pWindow->Resize();
+ if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->mbAllResize ||
+ ( pWindow->mbFrame && pWindow->mpClientWindow ) ) // propagate resize for system border windows
+ pWindow->Resize(); // otherwise menues cannot be positioned
else
pWindow->mbCallResize = TRUE;
}
@@ -1404,6 +1409,25 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
// -----------------------------------------------------------------------
+void ImplHandleMove( Window* pWindow, long nNewX, long nNewY )
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if ( pSVData->maWinData.mpFirstFloat && pWindow->ImplIsRealParentPath( pSVData->maWinData.mpFirstFloat ) )
+ {
+ if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) )
+ pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ImplHandleMoveResize( Window* pWindow, long nNewX, long nNewY, long nNewWidth, long nNewHeight )
+{
+ ImplHandleResize( pWindow, nNewWidth, nNewHeight );
+}
+
+// -----------------------------------------------------------------------
+
static void ImplActivateFloatingWindows( Window* pWindow, BOOL bActive )
{
// Zuerst alle ueberlappenden Fenster ueberpruefen
@@ -1459,6 +1483,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
}
else
{
+/*
Window* pFocusWin = mpFrameData->mpFocusWin;
if ( pFocusWin )
{
@@ -1504,6 +1529,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
// Alle FloatingFenster deaktiv zeichnen
if ( mpFrameData->mbStartFocusState != bHasFocus )
ImplActivateFloatingWindows( this, bHasFocus );
+*/
}
return 0;
@@ -1879,6 +1905,13 @@ long ImplWindowFrameProc( void* pInst, SalFrame* pFrame,
}
break;
+ case SALEVENT_MOVE:
+ {
+ SalFrame::Geometry g = ((Window*)pInst)->mpFrame->GetGeometry();
+ ImplHandleMove( (Window*)pInst, g.nX, g.nY );
+ }
+ break;
+
case SALEVENT_RESIZE:
{
long nNewWidth;
@@ -1888,6 +1921,13 @@ long ImplWindowFrameProc( void* pInst, SalFrame* pFrame,
}
break;
+ case SALEVENT_MOVERESIZE:
+ {
+ SalFrame::Geometry g = ((Window*)pInst)->mpFrame->GetGeometry();
+ ImplHandleMoveResize( (Window*)pInst, g.nX, g.nY, g.nWidth, g.nHeight );
+ }
+ break;
+
case SALEVENT_GETFOCUS:
ImplHandleGetFocus( (Window*)pInst );
break;