summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:59:30 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:59:30 +0000
commit2f382d6c2579a25c68dbd121af7f1f5dc7ec9852 (patch)
tree8c6c555a872e6812cd3f76de570b06683526ad14 /vcl/source/window
parentf7a0cc83bb59efd6abd820bd78acc75e8313ea4e (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/brdwin.cxx8
-rw-r--r--vcl/source/window/cursor.cxx61
-rw-r--r--vcl/source/window/decoview.cxx42
-rw-r--r--vcl/source/window/dialog.cxx16
-rw-r--r--vcl/source/window/dndevdis.cxx40
-rw-r--r--vcl/source/window/dockwin.cxx11
-rw-r--r--vcl/source/window/floatwin.cxx29
-rw-r--r--vcl/source/window/introwin.cxx132
-rw-r--r--vcl/source/window/makefile.mk6
-rw-r--r--vcl/source/window/menu.cxx64
-rw-r--r--vcl/source/window/splitwin.cxx81
-rw-r--r--vcl/source/window/status.cxx55
-rw-r--r--vcl/source/window/toolbox.cxx60
-rw-r--r--vcl/source/window/window.cxx309
-rw-r--r--vcl/source/window/window2.cxx15
-rw-r--r--vcl/source/window/winproc.cxx18
-rw-r--r--vcl/source/window/wrkwin.cxx29
17 files changed, 766 insertions, 210 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 16eb0e5e1739..e0539abdb27b 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: brdwin.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: ssa $ $Date: 2002-06-27 16:17:20 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1090,6 +1090,8 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
nStyle |= FRAME_DRAW_DOUBLEIN;
if ( nBorderStyle & WINDOW_BORDER_MONO )
nStyle |= FRAME_DRAW_MONO;
+ if ( nBorderStyle & WINDOW_BORDER_MENU )
+ nStyle |= FRAME_DRAW_MENU;
DecorationView aDecoView( mpOutDev );
Point aTmpPoint;
@@ -3213,7 +3215,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
{
// Alle WindowBits entfernen, die wir nicht haben wollen
WinBits nOrgStyle = nStyle;
- WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN);
+ WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_NOSHADOW);
if ( nTypeStyle & BORDERWINDOW_STYLE_APP )
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index aa4718e02682..25d998fc52a0 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cursor.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ssa $ $Date: 2001-11-26 17:12:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,6 +99,7 @@ struct ImplCursorData
Size maPixSize; // Pixel-Size
long mnPixSlant; // Pixel-Slant
short mnOrientation; // Pixel-Orientation
+ unsigned char mnDirection; // indicates writing direction
USHORT mnStyle; // Cursor-Style
BOOL mbCurVisible; // Ist Cursor aktuell sichtbar
Window* mpWindow; // Zugeordnetes Windows
@@ -116,10 +117,13 @@ static void ImplCursorInvert( ImplCursorData* pData )
nInvertStyle = INVERT_50;
else
nInvertStyle = 0;
+
Rectangle aRect( pData->maPixPos, pData->maPixSize );
- if ( pData->mnOrientation || pData->mnPixSlant )
+ if ( pData->mnDirection || pData->mnOrientation || pData->mnPixSlant )
{
Polygon aPoly( aRect );
+ aPoly[1].X() += 1; // include the right border
+ aPoly[2].X() += 1;
if ( pData->mnPixSlant )
{
Point aPoint = aPoly.GetPoint( 0 );
@@ -130,6 +134,41 @@ static void ImplCursorInvert( ImplCursorData* pData )
aPoint.X() += pData->mnPixSlant;
aPoly.SetPoint( aPoint, 1 );
}
+
+ // apply direction flag after slant to use the correct shape
+ if ( pData->mnDirection )
+ {
+ Point pAry[7];
+ int delta = 3*aRect.getWidth()+1;
+ if( pData->mnDirection == CURSOR_DIRECTION_LTR )
+ {
+ // left-to-right
+ pAry[0] = aPoly.GetPoint( 0 );
+ pAry[1] = aPoly.GetPoint( 1 );
+ pAry[2] = pAry[1];
+ pAry[2].X() += delta;
+ pAry[3] = pAry[1];
+ pAry[3].Y() += delta;
+ pAry[4] = aPoly.GetPoint( 2 );
+ pAry[5] = aPoly.GetPoint( 3 );
+ pAry[6] = aPoly.GetPoint( 4 );
+ }
+ else if( pData->mnDirection == CURSOR_DIRECTION_RTL )
+ {
+ // right-to-left
+ pAry[0] = aPoly.GetPoint( 0 );
+ pAry[1] = aPoly.GetPoint( 1 );
+ pAry[2] = aPoly.GetPoint( 2 );
+ pAry[3] = aPoly.GetPoint( 3 );
+ pAry[4] = pAry[0];
+ pAry[4].Y() += delta;
+ pAry[5] = pAry[0];
+ pAry[5].X() -= delta;
+ pAry[6] = aPoly.GetPoint( 4 );
+ }
+ aPoly = Polygon( 7, pAry);
+ }
+
if ( pData->mnOrientation )
aPoly.Rotate( pData->maPixRotOff, pData->mnOrientation );
pWindow->Invert( aPoly, nInvertStyle );
@@ -150,6 +189,7 @@ void Cursor::ImplDraw()
mpData->maPixSize = pWindow->LogicToPixel( maSize );
mpData->mnPixSlant = pWindow->LogicToPixel( Size( mnSlant, 0 ) ).Width();
mpData->mnOrientation = mnOrientation;
+ mpData->mnDirection = mnDirection;
long nOffsetY = pWindow->LogicToPixel( Size( 0, mnOffsetY ) ).Height();
// Position um den Offset korrigieren
@@ -280,6 +320,7 @@ Cursor::Cursor()
mnSlant = 0;
mnOffsetY = 0;
mnOrientation = 0;
+ mnDirection = 0;
mnStyle = 0;
mbVisible = FALSE;
}
@@ -294,6 +335,7 @@ Cursor::Cursor( const Cursor& rCursor ) :
mpWindow = NULL;
mnSlant = rCursor.mnSlant;
mnOrientation = rCursor.mnOrientation;
+ mnDirection = rCursor.mnDirection;
mnStyle = 0;
mbVisible = rCursor.mbVisible;
}
@@ -434,12 +476,24 @@ void Cursor::SetOrientation( short nNewOrientation )
// -----------------------------------------------------------------------
+void Cursor::SetDirection( unsigned char nNewDirection )
+{
+ if ( mnDirection != nNewDirection )
+ {
+ mnDirection = nNewDirection;
+ ImplNew();
+ }
+}
+
+// -----------------------------------------------------------------------
+
Cursor& Cursor::operator=( const Cursor& rCursor )
{
maPos = rCursor.maPos;
maSize = rCursor.maSize;
mnSlant = rCursor.mnSlant;
mnOrientation = rCursor.mnOrientation;
+ mnDirection = rCursor.mnDirection;
mbVisible = rCursor.mbVisible;
ImplNew();
@@ -454,6 +508,7 @@ BOOL Cursor::operator==( const Cursor& rCursor ) const
(maSize == rCursor.maSize) &&
(mnSlant == rCursor.mnSlant) &&
(mnOrientation == rCursor.mnOrientation) &&
+ (mnDirection == rCursor.mnDirection) &&
(mbVisible == rCursor.mbVisible) )
return TRUE;
else
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 37b532df5fa0..f404effcccb6 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: decoview.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: cd $ $Date: 2003-01-09 12:01:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -551,27 +551,37 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
break;
case SYMBOL_CHECKMARK:
{
- Point aPos1( rRect.Left(), rRect.Bottom() - rRect.GetHeight() / 3 );
- Point aPos2( rRect.Left() + rRect.GetWidth()/3, rRect.Bottom() );
- Point aPos3( rRect.TopRight() );
+ // #106953# never mirror checkmarks
+ BOOL bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
+ Point aPos1( bRTL ? rRect.Right() : rRect.Left(),
+ rRect.Bottom() - rRect.GetHeight() / 3 );
+ Point aPos2( bRTL ? rRect.Right() - rRect.GetWidth()/3 : rRect.Left() + rRect.GetWidth()/3,
+ rRect.Bottom() );
+ Point aPos3( bRTL ? rRect.TopLeft() : rRect.TopRight() );
Size aRectSize( 1, 2 );
long nStepsY = aPos2.Y()-aPos1.Y();
long nX = aPos1.X();
long nY = aPos1.Y();
for ( long n = 0; n <= nStepsY; n++ )
{
+ if( bRTL )
+ nX--;
pDev->DrawRect( Rectangle( Point( nX, nY++ ), aRectSize ) );
- nX++;
+ if( !bRTL )
+ nX++;
}
nStepsY = aPos2.Y()-aPos3.Y();
nX = aPos2.X();
nY = aPos2.Y();
for ( n = 0; n <= nStepsY; n++ )
{
+ if( bRTL )
+ if ( --nX < rRect.Left() )
+ break;
pDev->DrawRect( Rectangle( Point( nX, nY-- ), aRectSize ) );
- nX++;
- if ( nX > rRect.Right() )
- break;
+ if( !bRTL )
+ if ( ++nX > rRect.Right() )
+ break;
}
}
break;
@@ -862,6 +872,10 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
const StyleSettings& rStyleSettings, USHORT nStyle )
{
+ // mask menu style
+ BOOL bMenuStyle = nStyle & FRAME_DRAW_MENU;
+ nStyle &= ~FRAME_DRAW_MENU;
+
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) )
nStyle |= FRAME_DRAW_MONO;
@@ -962,6 +976,8 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
else
{
pDev->ImplDraw2ColorFrame( rRect,
+ bMenuStyle ?
+ rStyleSettings.GetMenuBorderColor() :
rStyleSettings.GetLightBorderColor(),
rStyleSettings.GetDarkShadowColor() );
}
@@ -979,9 +995,11 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else
{
- pDev->ImplDraw2ColorFrame( rRect,
- rStyleSettings.GetLightColor(),
- rStyleSettings.GetShadowColor() );
+ // flat menues have no shadow border
+ if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() )
+ pDev->ImplDraw2ColorFrame( rRect,
+ rStyleSettings.GetLightColor(),
+ rStyleSettings.GetShadowColor() );
}
rRect.Left()++;
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 02a3297f8ad7..9b5c523d2db1 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dialog.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: pl $ $Date: 2002-12-10 16:50:31 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -138,6 +138,9 @@ static ByteString ImplGetDialogText( Dialog* pDialog )
static BOOL ImplIsMnemonicCtrl( Window* pWindow )
{
+ if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() )
+ return FALSE;
+
if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) ||
(pWindow->GetType() == WINDOW_CHECKBOX) ||
(pWindow->GetType() == WINDOW_TRISTATEBOX) ||
@@ -193,7 +196,7 @@ void ImplWindowAutoMnemonic( Window* pWindow )
if ( (pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL )
{
- pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
+ pGetChild = pParent->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
pChild = pGetChild->ImplGetWindow();
@@ -531,7 +534,7 @@ void Dialog::StateChanged( StateChangedType nType )
if ( nType == STATE_CHANGE_INITSHOW )
{
- if ( Application::IsAutoMnemonicEnabled() )
+ if ( GetSettings().GetStyleSettings().GetAutoMnemonic() )
ImplWindowAutoMnemonic( this );
//if ( IsDefaultPos() && !mbFrame )
@@ -695,9 +698,14 @@ short Dialog::Execute()
ImplDelData aDelData;
ImplAddDel( &aDelData );
pSVData->maAppData.mnModalMode++;
+ //DBG_ASSERT( mpDialogParent, "Dialog::Execute() - no Parent: cannot set modal count!" );
+ if( mpDialogParent )
+ mpDialogParent->ImplIncModalCount(); // #106303# support frame based modal count
while ( !aDelData.IsDelete() && mbInExecute )
Application::Yield();
pSVData->maAppData.mnModalMode--;
+ if( mpDialogParent )
+ mpDialogParent->ImplDecModalCount(); // #106303# support frame based modal count
if ( !aDelData.IsDelete() )
ImplRemoveDel( &aDelData );
#ifdef DBG_UTIL
diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx
index 1e779ac0eb19..21dd58b8719e 100644
--- a/vcl/source/window/dndevdis.cxx
+++ b/vcl/source/window/dndevdis.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dndevdis.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: obr $ $Date: 2002-04-30 15:45:40 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -105,6 +105,10 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -113,6 +117,9 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
// handle the case that drop is in an other vcl window than the last dragOver
@@ -135,7 +142,6 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
if( nListeners == 0 ) {
OSL_TRACE( "rejecting drop due to missing listeners." );
dtde.Context->rejectDrop();
- dtde.Context->dropComplete(sal_False);
}
// this is a drop -> no further drag overs
@@ -155,6 +161,10 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -163,6 +173,9 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
// assume pointer write operation to be atomic
@@ -211,6 +224,10 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -219,6 +236,9 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
if( pChildWindow != m_pCurrentWindow )
@@ -262,6 +282,10 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -270,6 +294,9 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
if( pChildWindow != m_pCurrentWindow )
@@ -313,6 +340,10 @@ void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent&
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( origin );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( origin );
if( NULL == pChildWindow )
@@ -321,6 +352,9 @@ void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent&
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( origin );
+
aSolarGuard.clear();
fireDragGestureEvent( pChildWindow, dge.DragSource, dge.Event, origin, dge.DragAction );
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 3f4c00c6f6c5..954982e166ce 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dockwin.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: pl $ $Date: 2002-12-11 17:44:54 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -654,11 +654,8 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
else if( rNEvt.GetType() == EVENT_KEYINPUT )
{
const KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
- if( rKey.GetCode() == KEY_F4 && rKey.GetModifier()
-#ifdef WNT
- && !rKey.IsMod2() // avoid Alt-F4 on Windows
-#endif
- )
+ if( rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
+ rKey.IsShift() && rKey.IsMod1() )
{
SetFloatingMode( !IsFloatingMode() );
return TRUE;
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 2b1597462498..5732e9b90df7 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: floatwin.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: ssa $ $Date: 2002-12-09 11:07:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -388,7 +388,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( ( (nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_DOWN) ||
(nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_RIGHT) )
&& ( nFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ) )
- aPos.X() += 1;
+ aPos.X() += 2;
// Evt. noch anpassen
if ( bBreak && !(nFlags & FLOATWIN_POPUPMODE_NOAUTOARRANGE) )
@@ -448,21 +448,28 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest )
{
- // compare coordinates in absolute screen coordinates
FloatingWindow* pWin = this;
- Point aAbsolute( pReference->OutputToAbsoluteScreenPixel(
- pReference->ScreenToOutputPixel(rPos) ) );
- if( pReference->ImplHasMirroredGraphics() && !pReference->IsRTLEnabled() )
+ Point aAbsolute( rPos );
+
+ // compare coordinates in absolute screen coordinates
+ if( pReference->ImplHasMirroredGraphics() )
{
- // --- RTL --- re-mirror back to get device coordiantes
- pReference->ImplReMirror( aAbsolute );
+ if(!pReference->IsRTLEnabled() )
+ // --- RTL --- re-mirror back to get device coordiantes
+ pReference->ImplReMirror( aAbsolute );
+
+ Rectangle aRect( pReference->ScreenToOutputPixel(aAbsolute), Size(1,1) ) ;
+ aRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel( aRect );
+ aAbsolute = aRect.TopLeft();
}
+ else
+ aAbsolute = Point( pReference->OutputToAbsoluteScreenPixel(
+ pReference->ScreenToOutputPixel(rPos) ) );
do
{
- //Rectangle devRect( OutputToAbsoluteScreenPixel( ScreenToOutputPixel(pWin->GetPosPixel()) ), pWin->GetSizePixel() ) ;
- Rectangle devRect( pWin->GetWindowExtentsRelative( NULL ) );
+ Rectangle devRect( pWin->ImplOutputToUnmirroredAbsoluteScreenPixel( Rectangle( pWin->ScreenToOutputPixel(pWin->GetPosPixel()), pWin->GetSizePixel()) ) ) ;
if ( devRect.IsInside( aAbsolute ) )
{
rHitTest = IMPL_FLOATWIN_HITTEST_WINDOW;
diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx
new file mode 100644
index 000000000000..9a248117aab6
--- /dev/null
+++ b/vcl/source/window/introwin.cxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: introwin.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source 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.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SV_INTROWIN_CXX
+
+#ifndef REMOTE_APPSERVER
+#ifndef _SV_SVSYS_HXX
+#include <svsys.h>
+#endif
+#ifndef _SV_SALFRAME_HXX
+#include <salframe.hxx>
+#endif
+#else
+#include <rmwindow.hxx>
+#endif
+
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_RC_H
+#include <rc.h>
+#endif
+#ifndef _SV_SVDATA_HXX
+#include <svdata.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <svapp.hxx>
+#endif
+#ifndef _SV_BRDWIN_HXX
+#include <brdwin.hxx>
+#endif
+#ifndef _SV_WINDOW_H
+#include <window.h>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <wrkwin.hxx>
+#endif
+#ifndef _SV_OPENGL_HXX
+#include <opengl.hxx>
+#endif
+
+#include <introwin.hxx>
+
+#pragma hdrstop
+
+
+// =======================================================================
+
+void IntroWindow::ImplInitData()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpIntroWindow = this;
+}
+
+// -----------------------------------------------------------------------
+
+IntroWindow::IntroWindow( ) :
+ WorkWindow( WINDOW_INTROWINDOW )
+{
+ ImplInitData();
+ WorkWindow::ImplInit( 0, WB_INTROWIN, NULL );
+}
+
+// -----------------------------------------------------------------------
+
+IntroWindow::~IntroWindow()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if ( pSVData->mpIntroWindow == this )
+ pSVData->mpIntroWindow = NULL;
+}
+
+
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 1cc1498a676c..8bee810368c8 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.9 $
+# $Revision: 1.10 $
#
-# last change: $Author: obr $ $Date: 2002-11-21 08:18:50 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -105,6 +105,7 @@ SLOFILES= $(SLO)$/accel.obj \
$(SLO)$/window2.obj \
$(SLO)$/winproc.obj \
$(SLO)$/wrkwin.obj \
+ $(SLO)$/introwin.obj \
$(SLO)$/scrwnd.obj \
$(SLO)$/dndevdis.obj \
$(SLO)$/dndlcon.obj \
@@ -117,6 +118,7 @@ EXCEPTIONSFILES= \
$(SLO)$/window.obj \
$(SLO)$/winproc.obj \
$(SLO)$/wrkwin.obj \
+ $(SLO)$/introwin.obj \
$(SLO)$/accel.obj \
$(SLO)$/cursor.obj \
$(SLO)$/dlgctrl.obj \
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a164a6cde4af..6b8885c4e557 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: menu.cxx,v $
*
- * $Revision: 1.89 $
+ * $Revision: 1.90 $
*
- * last change: $Author: tbe $ $Date: 2002-12-12 18:04:56 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1864,20 +1864,24 @@ Size Menu::ImplCalcSize( Window* pWin )
Size aMaxImgSz;
long nMaxTextWidth = 0;
long nMaxAccWidth = 0;
+ long nMinMenuItemHeight = nFontHeight;
- static long nMinMenuItemHeight = 16;
-
- for ( USHORT i = (USHORT)pItemList->Count(); i; )
+ const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings();
+ if ( rSettings.GetUseImagesInMenus() )
{
- MenuItemData* pData = pItemList->GetDataFromPos( --i );
- if ( ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))
+ nMinMenuItemHeight = 16;
+ for ( USHORT i = (USHORT)pItemList->Count(); i; )
{
- Size aImgSz = pData->aImage.GetSizePixel();
- if ( aImgSz.Height() > aMaxImgSz.Height() )
- aMaxImgSz.Height() = aImgSz.Height();
- if ( aImgSz.Height() > nMinMenuItemHeight )
- nMinMenuItemHeight = aImgSz.Height();
- break;
+ MenuItemData* pData = pItemList->GetDataFromPos( --i );
+ if ( ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))
+ {
+ Size aImgSz = pData->aImage.GetSizePixel();
+ if ( aImgSz.Height() > aMaxImgSz.Height() )
+ aMaxImgSz.Height() = aImgSz.Height();
+ if ( aImgSz.Height() > nMinMenuItemHeight )
+ nMinMenuItemHeight = aImgSz.Height();
+ break;
+ }
}
}
@@ -1918,16 +1922,19 @@ Size Menu::ImplCalcSize( Window* pWin )
nMaxTextWidth = nTextWidth;
long nTextHeight = pWin->GetTextHeight();
- pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight );
-
// if ( nTextHeight > pData->aSz.Height() )
// pData->aSz.Height() = nTextHeight;
if ( bIsMenuBar )
{
+ if ( nTextHeight > pData->aSz.Height() )
+ pData->aSz.Height() = nTextHeight;
+
pData->aSz.Width() = nTextWidth + 4*nExtra;
aSz.Width() += pData->aSz.Width();
}
+ else
+ pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight );
}
// Accel
@@ -1961,11 +1968,12 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar )
{
+ USHORT gfxExtra = std::max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
nCheckPos = (USHORT)nExtra;
- nImagePos = (USHORT)(nCheckPos + nFontHeight/2 + nExtra );
+ nImagePos = (USHORT)(nCheckPos + nFontHeight/2 + gfxExtra );
nTextPos = (USHORT)(nImagePos+aMaxImgSz.Width());
if ( aMaxImgSz.Width() )
- nTextPos += (USHORT)nExtra;
+ nTextPos += gfxExtra;
aSz.Width() = nTextPos + nMaxTextWidth + nExtra + nMaxAccWidth;
aSz.Width() += 10*nExtra; // etwas mehr...
@@ -2016,6 +2024,8 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
if ( aPos.Y() >= 0 )
{
long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2);
+ if( bIsMenuBar )
+ nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
USHORT nTextStyle = 0;
USHORT nSymbolStyle = 0;
USHORT nImageStyle = 0;
@@ -2034,12 +2044,12 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
- aTmpPos.X() = aPos.X() + 1;
+ aTmpPos.X() = aPos.X() + 2;
pWin->SetLineColor( rSettings.GetShadowColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 1, aTmpPos.Y() ) );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3, aTmpPos.Y() ) );
aTmpPos.Y()++;
pWin->SetLineColor( rSettings.GetLightColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 1, aTmpPos.Y() ) );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3, aTmpPos.Y() ) );
pWin->SetLineColor();
}
@@ -2512,6 +2522,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
pMenu->pWindow = pWindow;
((MenuBarWindow*)pWindow)->SetMenu( pMenu );
long nHeight = pMenu->ImplCalcSize( pWindow ).Height();
+ if( nHeight < 20 ) nHeight = 20; // leave enough space for closer
pWindow->SetPosSizePixel( 0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT );
return pWindow;
}
@@ -2741,6 +2752,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
}
MenuFloatingWindow* pWin = new MenuFloatingWindow( this, pW, nStyle | WB_SYSTEMWINDOW );
+ pWin->SetBorderStyle( pWin->GetBorderStyle() | WINDOW_BORDER_MENU );
pWindow = pWin;
Size aSz = ImplCalcSize( pWin );
@@ -4169,7 +4181,10 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
// Im Vollbild-Modus hat die MenuBar ggf. die Hoehe 0:
// Nicht immer einfach die Window-Hoehe nehmen, weil ItemHeight < WindowHeight.
if ( GetSizePixel().Height() )
- aItemBottomRight.Y() += pData->aSz.Height();
+ {
+ // #107747# give menuitems the height of the menubar
+ aItemBottomRight.Y() += GetOutputSizePixel().Height()-1;
+ }
// ImplExecute ist doch nicht modal...
// #99071# do not grab the focus, otherwise it will be restored to the menubar
@@ -4355,7 +4370,8 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
else
SetFillColor( GetSettings().GetStyleSettings().GetMenuBarColor() );
- DrawRect( Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), pData->aSz.Height()-2 ) ) );
+ // #107747# give menuitems the height of the menubar
+ DrawRect( Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) ) );
pMenu->ImplPaint( this, 0, 0, pData, bHighlight );
}
return;
@@ -4376,7 +4392,8 @@ Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos )
if ( n == nPos )
{
if ( pData->eType != MENUITEM_SEPARATOR )
- aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), pData->aSz.Height()-2 ) );
+ // #107747# give menuitems the height of the menubar
+ aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) );
break;
}
@@ -4681,6 +4698,7 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt )
ImplInitMenuWindow( this, TRUE, TRUE );
// Falls sich der Font geaendert hat.
long nHeight = pMenu->ImplCalcSize( this ).Height();
+ if( nHeight < 20 ) nHeight = 20; // leave enough space for closer
SetPosSizePixel( 0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT );
GetParent()->Resize();
Invalidate();
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 184d556c054b..59b7ba919b2e 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: splitwin.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2002-08-28 09:13:50 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -415,7 +415,7 @@ static void ImplDeleteSet( ImplSplitSet* pSet )
if ( pSet->mpBitmap )
delete pSet->mpBitmap;
- delete pItems;
+ delete [] pItems;
delete pSet;
}
@@ -1476,6 +1476,73 @@ void SplitWindow::ImplSetWindowSize( long nDelta )
// -----------------------------------------------------------------------
+Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
+{
+ Size aSize( aNewSize );
+ long nSplitSize = mpMainSet->mnSplitSize-2;
+
+ if ( mbAutoHide || mbFadeOut )
+ nSplitSize += SPLITWIN_SPLITSIZEEX;
+
+ // Wenn Fenster sizeable ist, wird die groesse automatisch nach
+ // dem MainSet festgelegt, wenn kein relatives Fenster enthalten
+ // ist
+ if ( mnWinStyle & WB_SIZEABLE )
+ {
+ long nCurSize;
+ long nCalcSize = 0;
+ USHORT i;
+
+ for ( i = 0; i < mpMainSet->mnItems; i++ )
+ {
+ if ( mpMainSet->mpItems[i].mnBits & (SWIB_RELATIVESIZE | SWIB_PERCENTSIZE) )
+ break;
+ else
+ nCalcSize += mpMainSet->mpItems[i].mnSize;
+ }
+
+ if ( i == mpMainSet->mnItems )
+ {
+ long nDelta = 0;
+ Point aPos = GetPosPixel();
+
+ if ( mbHorz )
+ nCurSize = aNewSize.Height()-mnTopBorder-mnBottomBorder;
+ else
+ nCurSize = aNewSize.Width()-mnLeftBorder-mnRightBorder;
+ nCurSize -= nSplitSize;
+ nCurSize -= (mpMainSet->mnItems-1)*mpMainSet->mnSplitSize;
+
+ nDelta = nCalcSize-nCurSize;
+ if ( !nDelta )
+ return aSize;
+
+ if ( meAlign == WINDOWALIGN_TOP )
+ {
+ aSize.Height() += nDelta;
+ }
+ else if ( meAlign == WINDOWALIGN_BOTTOM )
+ {
+ aPos.Y() -= nDelta;
+ aSize.Height() += nDelta;
+ }
+ else if ( meAlign == WINDOWALIGN_LEFT )
+ {
+ aSize.Width() += nDelta;
+ }
+ else // meAlign == WINDOWALIGN_RIGHT
+ {
+ aPos.X() -= nDelta;
+ aSize.Width() += nDelta;
+ }
+ }
+ }
+
+ return aSize;
+}
+
+// -----------------------------------------------------------------------
+
void SplitWindow::ImplCalcLayout()
{
if ( !mbCalc || !mbRecalc || !mpMainSet->mpItems )
@@ -2641,7 +2708,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
memcpy( pNewItems, pSet->mpItems, sizeof( ImplSplitItem )*nPos );
if ( nPos < pSet->mnItems )
memcpy( pNewItems+nPos+1, pSet->mpItems+nPos, sizeof( ImplSplitItem )*(pSet->mnItems-nPos) );
- delete pSet->mpItems;
+ delete[] pSet->mpItems;
pSet->mpItems = pNewItems;
pSet->mnItems++;
pSet->mbCalcPix = TRUE;
@@ -2740,7 +2807,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
}
else
{
- delete pSet->mpItems;
+ delete[] pSet->mpItems;
pSet->mpItems = NULL;
}
ImplSplitItem* pNewItems = new ImplSplitItem[pNewSet->mnItems+1];
@@ -2751,7 +2818,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
memcpy( pNewItems+nNewPos+1, pNewSet->mpItems+nNewPos,
sizeof( ImplSplitItem )*(pNewSet->mnItems-nNewPos) );
}
- delete pNewSet->mpItems;
+ delete[] pNewSet->mpItems;
pNewSet->mpItems = pNewItems;
pNewSet->mnItems++;
pNewSet->mbCalcPix = TRUE;
@@ -2790,7 +2857,7 @@ void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
}
else
{
- delete pSet->mpItems;
+ delete[] pSet->mpItems;
pSet->mpItems = NULL;
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index ec4b6306ac1b..d182c10bdb29 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: status.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: cd $ $Date: 2002-11-20 08:43:39 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -117,6 +117,7 @@ struct ImplStatusItem
ULONG mnHelpId;
void* mpUserData;
BOOL mbVisible;
+ XubString maAccessibleName;
};
DECLARE_LIST( ImplStatusItemList, ImplStatusItem* );
@@ -489,6 +490,9 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
DecorationView aDecoView( this );
aDecoView.DrawFrame( aRect, nStyle );
}
+
+ if ( !ImplIsRecordLayout() )
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_DRAWITEM, (void*) pItem->mnId );
}
// -----------------------------------------------------------------------
@@ -904,6 +908,8 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMADDED, (void*) nItemId );
}
// -----------------------------------------------------------------------
@@ -919,6 +925,8 @@ void StatusBar::RemoveItem( USHORT nItemId )
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMREMOVED, (void*) nItemId );
}
}
@@ -938,6 +946,8 @@ void StatusBar::ShowItem( USHORT nItemId )
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_SHOWITEM, (void*) nItemId );
}
}
}
@@ -958,6 +968,8 @@ void StatusBar::HideItem( USHORT nItemId )
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_HIDEITEM, (void*) nItemId );
}
}
}
@@ -983,6 +995,8 @@ void StatusBar::ShowItems()
mbVisibleItems = TRUE;
if ( !mbProgressMode )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_SHOWALLITEMS );
}
}
@@ -995,6 +1009,8 @@ void StatusBar::HideItems()
mbVisibleItems = FALSE;
if ( !mbProgressMode )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_HIDEALLITEMS );
}
}
@@ -1046,6 +1062,8 @@ void StatusBar::Clear()
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_ALLITEMSREMOVED );
}
// -----------------------------------------------------------------------
@@ -1469,3 +1487,36 @@ Size StatusBar::CalcWindowSizePixel() const
return Size( nCalcWidth, nCalcHeight );
}
+
+
+// -----------------------------------------------------------------------
+
+void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != STATUSBAR_ITEM_NOTFOUND )
+ {
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->maAccessibleName != rName )
+ {
+ pItem->maAccessibleName = rName;
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_NAMECHANGED, (void*) pItem->mnId );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != STATUSBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maAccessibleName;
+ else
+ return ImplGetSVEmptyStr();
+}
+
+// -----------------------------------------------------------------------
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 453192079c07..5482918e0f7d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: toolbox.cxx,v $
*
- * $Revision: 1.57 $
+ * $Revision: 1.58 $
*
- * last change: $Author: ssa $ $Date: 2002-12-06 12:57:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -619,7 +619,6 @@ static void ImplCalcFloatSizes( ToolBox* pThis )
// min. Groesse berechnen
long nCalcSize = pThis->mnItemWidth;
- ImplToolItem* pItem;
std::vector< ImplToolItem >::const_iterator it;
it = pThis->mpData->m_aItems.begin();
@@ -1657,7 +1656,7 @@ ToolBox::~ToolBox()
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
- delete mpFloatSizeAry;
+ delete[] mpFloatSizeAry;
// Wenn keine ToolBox-Referenzen mehr auf die Listen bestehen, dann
// Listen mit wegloeschen
@@ -2076,7 +2075,7 @@ void ToolBox::ImplFormat( BOOL bResize )
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
{
- delete mpFloatSizeAry;
+ delete[] mpFloatSizeAry;
mpFloatSizeAry = NULL;
}
@@ -3548,6 +3547,8 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
Window *pWin = Application::GetFocusWindow();
if( pWin && pWin->mbToolBox && pWin != this )
bDrawHotSpot = FALSE;
+ else if( !HasFocus() && HasChildPathFocus() ) // focus is in our childwindow: no highlight
+ bDrawHotSpot = FALSE;
/*
else
if( pWin && !pWin->mbToolBox )
@@ -3714,7 +3715,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
}
// only clear highlight when focus is not in toolbar
- if ( bClearHigh && mnHighItemId && !HasFocus() )
+ if ( bClearHigh && mnHighItemId && !HasChildPathFocus() )
{
USHORT nClearPos = GetItemPos( mnHighItemId );
if ( nClearPos != TOOLBOX_ITEM_NOTFOUND )
@@ -4757,7 +4758,15 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
mbDummy2_KeyEvt = TRUE;
Activate();
Click();
+
+ // #107776# we might be destroyed in the selecthandler
+ ImplDelData aDelData;
+ ImplAddDel( &aDelData );
Select();
+ if ( aDelData.IsDelete() )
+ return bRet;
+ ImplRemoveDel( &aDelData );
+
Deactivate();
mbDummy2_KeyEvt = FALSE;
mnMouseModifier = 0;
@@ -4831,6 +4840,11 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
USHORT nCode = aKeyCode.GetCode();
BOOL bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
BOOL bForwardKey = FALSE;
+
+ // #107776# we might be destroyed in the keyhandler
+ ImplDelData aDelData;
+ ImplAddDel( &aDelData );
+
switch ( nCode )
{
case KEY_UP:
@@ -4981,13 +4995,26 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
// do nothing to avoid key presses going into the document
// while the toolbox has the focus
- // just forward function and special keys
+ // just forward function and special keys and combinations with Alt-key
USHORT aKeyGroup = aKeyCode.GetGroup();
- if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC )
+ if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() )
bForwardKey = TRUE;
}
}
+ if ( aDelData.IsDelete() )
+ return;
+ ImplRemoveDel( &aDelData );
+
+ // #107251# move focus away if this toolbox was disabled during keyinput
+ if( HasFocus() && mbInputDisabled && (ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL)
+ {
+ USHORT n = 0;
+ Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
+ if ( pFocusControl && pFocusControl != this )
+ pFocusControl->ImplControlFocus( GETFOCUS_INIT );
+ }
+
mnKeyModifier = 0;
if( bForwardKey )
@@ -5260,7 +5287,11 @@ void ToolBox::ImplShowFocus()
{
ImplToolItem* pItem = ImplGetItem( mnHighItemId );
if( pItem->mpWindow )
- DrawSelectionBackground( pItem->maRect, 2, FALSE, TRUE, pItem->mpWindow ? TRUE : FALSE );
+ {
+ Window *pWin = pItem->mpWindow->mpBorderWindow ? pItem->mpWindow->mpBorderWindow : pItem->mpWindow;
+ pWin->mbDrawSelectionBackground = TRUE;
+ pWin->Invalidate( 0 );
+ }
}
}
@@ -5273,14 +5304,9 @@ void ToolBox::ImplHideFocus()
ImplToolItem* pItem = ImplGetItem( mnHighItemId );
if( pItem->mpWindow )
{
- Rectangle aRect( pItem->maRect );
- // increase rect a little to get rid of selection border
- // see DrawSelectionBackground(...)
- aRect.nLeft -= 1;
- aRect.nTop -= 1;
- aRect.nRight += 1;
- aRect.nBottom += 1;
- Invalidate( aRect, 0);
+ Window *pWin = pItem->mpWindow->mpBorderWindow ? pItem->mpWindow->mpBorderWindow : pItem->mpWindow;
+ pWin->mbDrawSelectionBackground = FALSE;
+ pWin->Invalidate( 0 );
}
}
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c2111b545db2..e97b3b94d127 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: window.cxx,v $
*
- * $Revision: 1.166 $
+ * $Revision: 1.167 $
*
- * last change: $Author: ssa $ $Date: 2002-12-13 09:55:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -208,6 +208,7 @@
#include <unowrap.hxx>
#include <dndlcon.hxx>
#include <dndevdis.hxx>
+#include <impbmpconv.hxx>
#ifndef _UNOTOOLS_CONFIGNODE_HXX_
#include <unotools/confignode.hxx>
@@ -399,44 +400,51 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
// to avoid UI scaling due to large fonts
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- Font aFont = aStyleSettings.GetAppFont();
- aFont.SetHeight( 8 );
+ // #107886# allow scaling of the UI if the menu font is
+ // slightly larger/smaller than the 8pt default
+ int defFontheight = 8;
+ Font aFont = aStyleSettings.GetMenuFont();
+ if( abs(aFont.GetHeight() - defFontheight) == 1 )
+ defFontheight = aFont.GetHeight();
+
+ aFont = aStyleSettings.GetAppFont();
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetAppFont( aFont );
//aFont = aStyleSettings.GetHelpFont();
- //aFont.SetHeight( 8 );
+ //aFont.SetHeight( defFontheight );
//aStyleSettings.SetHelpFont( aFont );
aFont = aStyleSettings.GetTitleFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetTitleFont( aFont );
aFont = aStyleSettings.GetFloatTitleFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetFloatTitleFont( aFont );
//aFont = aStyleSettings.GetMenuFont();
- //aFont.SetHeight( 8 );
+ //aFont.SetHeight( defFontheight );
//aStyleSettings.SetMenuFont( aFont );
aFont = aStyleSettings.GetToolFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetToolFont( aFont );
aFont = aStyleSettings.GetLabelFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetLabelFont( aFont );
aFont = aStyleSettings.GetInfoFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetInfoFont( aFont );
aFont = aStyleSettings.GetRadioCheckFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetRadioCheckFont( aFont );
aFont = aStyleSettings.GetPushButtonFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetPushButtonFont( aFont );
aFont = aStyleSettings.GetFieldFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetFieldFont( aFont );
aFont = aStyleSettings.GetIconFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetIconFont( aFont );
aFont = aStyleSettings.GetGroupFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetGroupFont( aFont );
rSettings.SetStyleSettings( aStyleSettings );
@@ -458,8 +466,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
}
if( bAutoHCMode )
{
- if( rSettings.GetStyleSettings().GetFaceColor().GetLuminance() < 8 ||
- rSettings.GetStyleSettings().GetWindowColor().GetLuminance() < 8 )
+ if( rSettings.GetStyleSettings().GetFaceColor().IsDark()
+ || rSettings.GetStyleSettings().GetWindowColor().IsDark() )
{
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
aStyleSettings.SetHighContrastMode( TRUE );
@@ -652,7 +660,7 @@ void Window::ImplInitData( WindowType nType )
mbCreatedWithToolkit = FALSE;
mbSuppressAccessibilityEvents = FALSE; // TRUE: do not send any accessibility events
mbEnableRTL = TRUE; // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
-
+ mbDrawSelectionBackground = FALSE; // TRUE: draws transparent window background to indicate (toolbox) selection
#ifdef REMOTE_APPSERVER
mpRmEvents = NULL;
@@ -742,6 +750,11 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
else if( mbFloatWin )
nFrameStyle |= SAL_FRAME_STYLE_TOOLWINDOW;
+ if( nStyle & WB_INTROWIN )
+ nFrameStyle |= SAL_FRAME_STYLE_INTRO;
+
+ if( nStyle & WB_NOSHADOW )
+ nFrameStyle |= SAL_FRAME_STYLE_NOSHADOW;
SalFrame* pParentFrame = NULL;
if ( pParent )
@@ -805,6 +818,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
mpFrameData->mnFirstMouseY = -1;
mpFrameData->mnLastMouseWinX = -1;
mpFrameData->mnLastMouseWinY = -1;
+ mpFrameData->mnModalMode = 0;
mpFrameData->mnMouseDownTime = 0;
mpFrameData->mnClickCount = 0;
mpFrameData->mnFirstMouseCode = 0;
@@ -899,25 +913,6 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
// the correct size before we display the window
if ( nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_APP) )
mpFrame->GetClientSize( mnOutWidth, mnOutHeight );
-
-#ifndef REMOTE_APPSERVER
- if( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() )
- {
- // instanciate access bridge service
- if( !pSVData->mxAccessBridge.is() )
- {
- if( !ImplInitAccessBridge() )
- {
- AllSettings aSettings = Application::GetSettings();
- MiscSettings aMisc = aSettings.GetMiscSettings();
- aMisc.SetEnableATToolSupport( FALSE );
- aSettings.SetMiscSettings( aMisc );
- Application::SetSettings( aSettings );
- }
- }
- }
-#endif
-
}
else
{
@@ -2332,6 +2327,7 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
nPaintFlags = mnPaintFlags & ~(IMPL_PAINT_PAINT);
Region* pChildRegion = NULL;
+ Rectangle aSelectionRect;
if ( mnPaintFlags & IMPL_PAINT_PAINT )
{
Region* pWinChildClipRegion = ImplGetWinChildClipRegion();
@@ -2392,6 +2388,10 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
Erase();
}
+ // #98943# trigger drawing of toolbox selection after all childern are painted
+ if( mbDrawSelectionBackground )
+ aSelectionRect = aPaintRect;
+
Paint( aPaintRect );
if ( mpWinData )
@@ -2427,6 +2427,10 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
*/
InvertTracking( *(mpWinData->mpTrackRect), mpWinData->mnTrackFlags );
+ // #98943# draw toolbox selection
+ if( !aSelectionRect.IsEmpty() )
+ DrawSelectionBackground( aSelectionRect, 2, FALSE, TRUE, FALSE );
+
if ( pChildRegion )
delete pChildRegion;
}
@@ -3221,7 +3225,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if( mpParent && !mpParent->mbFrame && mpParent->ImplHasMirroredGraphics() && !mpParent->IsRTLEnabled() )
{
// --- RTL --- (re-mirror at parent window)
- nX = mpParent->mnOutWidth - mnOutWidth - 1 - nX;
+ nX = mpParent->mnOutWidth - mnOutWidth - nX;
}
}
}
@@ -3557,6 +3561,8 @@ void Window::ImplToTop( USHORT nFlags )
nSysFlags = SAL_FRAME_TOTOP_RESTOREWHENMIN;
if ( nFlags & TOTOP_FOREGROUNDTASK )
nSysFlags = SAL_FRAME_TOTOP_FOREGROUNDTASK;
+ if ( nFlags & TOTOP_GRABFOCUSONLY )
+ nSysFlags = SAL_FRAME_TOTOP_GRABFOCUS_ONLY;
mpFrame->ToTop( nSysFlags );
}
#else
@@ -3878,7 +3884,6 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
}
// -----------------------------------------------------------------------
-
void Window::ImplGrabFocus( USHORT nFlags )
{
// Es soll immer das Client-Fenster den Focus bekommen. Falls
@@ -3886,6 +3891,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
// muessten wir bei allen GrabFocus()-Aufrufen in VCL dafuer
// sorgen, das es an der Stelle gemacht wird. Dies wuerde
// beispielsweise bei ToTop() der Fall sein.
+
if ( mpClientWindow )
{
// Wegen nicht ganz durchdachtem Konzept muessen wir hier
@@ -3987,7 +3993,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
// nicht auf ein anderes Fenster setzen darf
//DBG_WARNING( "Window::GrabFocus() - Frame doesn't have the focus" );
#ifndef REMOTE_APPSERVER
- mpFrame->ToTop( SAL_FRAME_TOTOP_GRABFOCUS );
+ mpFrame->ToTop( SAL_FRAME_TOTOP_GRABFOCUS | SAL_FRAME_TOTOP_GRABFOCUS_ONLY );
#else
mpFrame->ToTop(0);
#endif
@@ -4214,7 +4220,7 @@ void Window::ImplNewInputContext()
else
aSize.Height() = (12*pFocusWin->mnDPIY)/72;
}
- pFontEntry = pFocusWin->mpFontCache->Get( pFocusWin->mpFontList, rFont, aSize );
+ pFontEntry = pFocusWin->mpFontCache->Get( pFocusWin->mpFontList, rFont, aSize, pFocusWin->mpOutDevData ? pFocusWin->mpOutDevData->mpFirstFontSubstEntry : NULL );
if ( pFontEntry )
aNewContext.mpFont = &pFontEntry->maFontSelData;
}
@@ -4919,6 +4925,18 @@ void Window::ImplNotifyKeyMouseEventListeners( NotifyEvent& rNEvt )
if ( mbCompoundControl || ( rNEvt.GetWindow() == this ) )
ImplCallEventListeners( VCLEVENT_WINDOW_KEYUP, (void*)rNEvt.GetKeyEvent() );
}
+
+ // #106721# check if we're part of a compound control and notify
+ Window *pParent = ImplGetParent();
+ while( pParent )
+ {
+ if( pParent->IsCompoundControl() )
+ {
+ pParent->ImplNotifyKeyMouseEventListeners( rNEvt );
+ break;
+ }
+ pParent = pParent->ImplGetParent();
+ }
}
// -----------------------------------------------------------------------
@@ -5074,18 +5092,36 @@ void Window::CallEventListeners( ULONG nEvent, void* pData )
{
VclWindowEvent aEvent( this, nEvent, pData );
+ ImplDelData aDelData;
+ ImplAddDel( &aDelData );
+
ImplSVData* pSVData = ImplGetSVData();
pSVData->mpApp->ImplCallEventListeners( &aEvent );
+ if ( aDelData.IsDelete() )
+ return;
+
if ( !maEventListeners.empty() )
maEventListeners.Call( &aEvent );
+ if ( aDelData.IsDelete() )
+ return;
+
+ ImplRemoveDel( &aDelData );
+
Window* pWindow = this;
while ( pWindow )
{
+ pWindow->ImplAddDel( &aDelData );
+
if ( !pWindow->maChildEventListeners.empty() )
pWindow->maChildEventListeners.Call( &aEvent );
+ if ( aDelData.IsDelete() )
+ return;
+
+ pWindow->ImplRemoveDel( &aDelData );
+
pWindow = pWindow->GetParent();
}
}
@@ -6072,6 +6108,42 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
mpBorderWindow->Show( TRUE, nFlags );
else if ( mbFrame )
{
+ ImplSVData* pSVData = ImplGetSVData();
+ // #106431#, hide SplashScreen
+ if( pSVData->mpIntroWindow && !ImplIsWindowOrChild( pSVData->mpIntroWindow ) )
+ pSVData->mpIntroWindow->Hide();
+
+#ifndef REMOTE_APPSERVER
+ // HACK: this code belongs IMHO at the end of InitVCL, but because there is no
+ // configuration service available at this time, we need to delay it until the
+ // first (accessible) window is shown ..
+ if( ImplIsAccessibleNativeFrame() )
+ {
+ ImplSVData* pSVData = ImplGetSVData();
+
+ if( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() )
+ {
+ if( !pSVData->mxAccessBridge.is() )
+ {
+ // instanciate access bridge service
+ if( !ImplInitAccessBridge(true) )
+ {
+ AllSettings aSettings = Application::GetSettings();
+ MiscSettings aMisc = aSettings.GetMiscSettings();
+ aMisc.SetEnableATToolSupport( FALSE );
+ aSettings.SetMiscSettings( aMisc );
+ Application::SetSettings( aSettings );
+ }
+ // if the user chose to quit the app, do not show this frame ..
+ else if( pSVData->maAppData.mbAppQuit == TRUE )
+ {
+ return;
+ }
+ }
+ }
+ }
+#endif
+
//DBG_ASSERT( !mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
mbSuppressAccessibilityEvents = FALSE;
@@ -6159,19 +6231,19 @@ BOOL Window::ImplRegisterAccessibleNativeFrame()
ImplSVData* pSVData = ImplGetSVData();
// register proxy accessible for the new native frame window
- if(pSVData->mxAccessBridge.is())
+ if( pSVData->mxAccessBridge.is() )
{
const SystemEnvData * pEnvData = GetSystemData();
- if(pEnvData)
+ if( pEnvData )
{
Reference< XTopWindow > xTopWindow( ImplGetWindow()->GetComponentInterface(), UNO_QUERY );
- if(xTopWindow.is())
+ if( xTopWindow.is() )
{
#ifdef WNT
- pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_uInt32) pEnvData->hWnd), GetAccessible(), xTopWindow);
+ pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_Int32) pEnvData->hWnd), GetAccessible(), xTopWindow);
#else
- pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_uInt32) pEnvData->aWindow), GetAccessible(), xTopWindow);
+ pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_Int32) pEnvData->aWindow), GetAccessible(), xTopWindow);
#endif
bNativeFrameRegistered = TRUE;
mbSuppressAccessibilityEvents = FALSE; // allow accessibility events
@@ -6195,9 +6267,9 @@ void Window::ImplRevokeAccessibleNativeFrame()
if( pSVData->mxAccessBridge.is() )
{
#ifdef WNT
- pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_uInt32) pEnvData->hWnd));
+ pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_Int32) pEnvData->hWnd));
#else
- pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_uInt32) pEnvData->aWindow));
+ pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_Int32) pEnvData->aWindow));
#endif
}
}
@@ -6812,15 +6884,31 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR
Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow )
{
+ // with decoration
+ return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE );
+}
+
+Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow )
+{
+ // without decoration
+ return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly )
+{
SalFrameGeometry g = mpFrame->GetGeometry();
// make sure we use the extent of our border window,
// otherwise we miss a few pixels
- Window *pWin = mpBorderWindow ? mpBorderWindow : this;
+ Window *pWin = (!bClientOnly && mpBorderWindow) ? mpBorderWindow : this;
+
Point aPos( pWin->OutputToScreenPixel( Point(0,0) ) );
aPos.X() += g.nX;
aPos.Y() += g.nY;
Size aSize ( pWin->GetSizePixel() );
- if( mbFrame || (mpBorderWindow && mpBorderWindow->mbFrame) )
+ // #104088# do not add decoration to the workwindow to be compatible to java accessibility api
+ if( !bClientOnly && (mbFrame || (mpBorderWindow && mpBorderWindow->mbFrame && GetType() != WINDOW_WORKWINDOW)) )
{
aPos.X() -= g.nLeftDecoration;
aPos.Y() -= g.nTopDecoration;
@@ -6828,7 +6916,11 @@ Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow )
aSize.Height() += g.nTopDecoration + g.nBottomDecoration;
}
if( pRelativeWindow )
- aPos = pRelativeWindow->AbsoluteScreenToOutputPixel( aPos );
+ {
+ // #106399# express coordinates relative to borderwindow
+ Window *pRelWin = (!bClientOnly && pRelativeWindow->mpBorderWindow) ? pRelativeWindow->mpBorderWindow : pRelativeWindow;
+ aPos = pRelWin->AbsoluteScreenToOutputPixel( aPos );
+ }
return Rectangle( aPos, aSize );
}
@@ -7346,6 +7438,18 @@ void Window::SetText( const XubString& rStr )
mpFrame->SetTitle( rStr );
ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
+
+ // #107247# needed for accessibility
+ // The VCLEVENT_WINDOW_FRAMETITLECHANGED is (mis)used to notify accessible name changes.
+ // Therefore a window, which is labeled by this window, must also notify an accessible
+ // name change.
+ if ( IsReallyVisible() )
+ {
+ Window* pWindow = GetLabelFor();
+ if ( pWindow && pWindow != this )
+ pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
+ }
+
StateChanged( STATE_CHANGE_TEXT );
}
@@ -7623,13 +7727,18 @@ void Window::ImplCallActivateListeners( Window *pOld )
if ( !pOld || !ImplIsChild( pOld ) )
{
ImplCallEventListeners( VCLEVENT_WINDOW_ACTIVATE, pOld );
- if( !GetParent() || !GetParent()->IsCompoundControl() )
- {
+ // #106298# revoke the change for 105369, because this change
+ // disabled the activate event for the parent,
+ // if the parent is a compound control
+ //if( !GetParent() || !GetParent()->IsCompoundControl() )
+ //{
// #100759#, avoid walking the wrong frame's hierarchy
// eg, undocked docking windows (ImplDockFloatWin)
- if ( ImplGetParent() && mpFrameWindow == ImplGetParent()->mpFrameWindow )
+ // #104714#, revert the changes for 100759 because it has a side effect when pOld is a dialog
+ // additionally the gallery is not dockable anymore, so 100759 canot occur
+ if ( ImplGetParent() ) /* && mpFrameWindow == ImplGetParent()->mpFrameWindow ) */
ImplGetParent()->ImplCallActivateListeners( pOld );
- }
+ //}
}
}
@@ -7728,12 +7837,16 @@ Reference< XDragSource > Window::GetDragSource()
aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
#elif defined UNX
+ aDropTargetAL.realloc( 3 );
+ aDragSourceAL.realloc( 3 );
aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DragSource" );
aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DropTarget" );
aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() );
aDropTargetAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
aDropTargetAL[ 1 ] = makeAny( pEnvData->aShellWindow );
+ aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( aDragSourceSN.getLength() )
mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
@@ -7814,9 +7927,10 @@ Reference< XClipboard > Window::GetClipboard()
if( xInit.is() )
{
- Sequence< Any > aArgumentList( 2 );
+ Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "CLIPBOARD" ) );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
xInit->initialize( aArgumentList );
}
@@ -7862,9 +7976,10 @@ Reference< XClipboard > Window::GetSelection()
if( xFactory.is() )
{
# ifdef UNX
- Sequence< Any > aArgumentList( 2 );
+ Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "PRIMARY" ) );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments(
OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ), aArgumentList ), UNO_QUERY );
@@ -8050,15 +8165,21 @@ USHORT Window::GetAccessibleChildWindowCount()
pChild = pChild->mpNext;
}
- // Search also for SystemWindows.
- Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pOverlap = pOverlap->GetWindow( WINDOW_FIRSTOVERLAP );
- while ( pOverlap )
+ // #107176# ignore overlapwindows
+ // this only affects non-system floating windows
+ // which are either not accessible (like the HelpAgent) or should be changed to system windows anyway
+ /*
+ if( ImplIsOverlapWindow() )
{
- if( pOverlap->IsVisible() )
- nChildren++;
- pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
+ Window* pOverlap = GetWindow( WINDOW_FIRSTOVERLAP );
+ while ( pOverlap )
+ {
+ if( pOverlap->IsVisible() )
+ nChildren++;
+ pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
+ }
}
+ */
// report the menubarwindow as a child of THE workwindow
if( GetType() == WINDOW_BORDERWINDOW )
@@ -8131,19 +8252,24 @@ Window* Window::GetAccessibleChildWindow( USHORT n )
}
if ( !pChild )
{
- Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pOverlap = pOverlap->GetWindow( WINDOW_FIRSTOVERLAP );
- while ( !pChild && pOverlap )
+ // #107176# ignore overlapwindows
+ /*
+ if( ImplIsOverlapWindow() )
{
- if ( !nChildren && pOverlap->IsVisible() )
+ Window* pOverlap = GetWindow( WINDOW_FIRSTOVERLAP );
+ while ( !pChild && pOverlap )
{
- pChild = pOverlap;
- break;
+ if ( !nChildren && pOverlap->IsVisible() )
+ {
+ pChild = pOverlap;
+ break;
+ }
+ pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
+ if( pOverlap && pOverlap->IsVisible() )
+ nChildren--;
}
- pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
- if( pOverlap && pOverlap->IsVisible() )
- nChildren--;
}
+ */
}
if ( pChild && ( pChild->GetType() == WINDOW_BORDERWINDOW ) && ( pChild->GetChildCount() == 1 ) )
@@ -8401,6 +8527,16 @@ BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
}
}
+void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect )
+{
+ if( ! mpOutDevData )
+ ImplInitOutDevData();
+ mpOutDevData->mpRecordLayout = pLayout;
+ mpOutDevData->maRecordRect = rRect;
+ Paint( rRect );
+ mpOutDevData->mpRecordLayout = NULL;
+}
+
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
@@ -8441,6 +8577,9 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
extern void ImplRGBtoHSB( const Color& rColor, USHORT& nHue, USHORT& nSat, USHORT& nBri );
extern Color ImplHSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri );
+ if( rRect.IsEmpty() )
+ return;
+
// colors used for item highlighting
Color aSelectionBorderCol( GetSettings().GetStyleSettings().GetHighlightColor() );
Color aSelectionFillCol( aSelectionBorderCol );
@@ -8587,3 +8726,25 @@ BOOL Window::IsTopWindow() const
return xTopWindow.is() ? TRUE : FALSE;
}
+void Window::ImplMirrorFramePos( Point &pt ) const
+{
+ pt.X() = mpFrame->maGeometry.nWidth-1-pt.X();
+}
+
+// frame based modal counter (dialogs are not modal to the whole application anymore)
+BOOL Window::IsInModalMode() const
+{
+ return (mpFrameWindow->mpFrameData->mnModalMode != 0);
+}
+void Window::ImplIncModalCount()
+{
+ mpFrameWindow->mpFrameData->mnModalMode++;
+}
+void Window::ImplDecModalCount()
+{
+ mpFrameWindow->mpFrameData->mnModalMode--;
+}
+void Window::ImplNotifyIconifiedState( BOOL bIconified )
+{
+ mpFrameWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_ICONIFIED : VCLEVENT_WINDOW_RESTORED );
+}
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 99baa3e9ae03..7619c2fa479b 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: window2.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: ssa $ $Date: 2002-12-03 14:36:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,11 +110,8 @@
#ifndef _SV_ACCESS_HXX
#include <access.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_VIRDEV_HXX
#include <virdev.hxx>
@@ -550,7 +547,7 @@ void Window::Invert( const Polygon& rPoly, USHORT nFlags )
nSalFlags |= SAL_INVERT_HIGHLIGHT;
if ( nFlags & INVERT_50 )
nSalFlags |= SAL_INVERT_50;
- const SalPoint* pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this );
#else
ImplServerGraphics* pGraphics = ImplGetServerGraphics();
@@ -747,7 +744,7 @@ void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
}
}
- const SalPoint* pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
pGraphics->Invert( nPoints, pPtAry, SAL_INVERT_TRACKFRAME, this );
#else
ImplServerGraphics* pGraphics;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 5ae8315fced6..c3754781e170 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: winproc.cxx,v $
*
- * $Revision: 1.76 $
+ * $Revision: 1.77 $
*
- * last change: $Author: ssa $ $Date: 2002-12-12 16:46:10 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -324,7 +324,9 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pChild != pSVData->maHelpData.mpHelpWin )
+ if ( !pSVData->maHelpData.mpHelpWin ||
+ !( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
+ pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) )
{
USHORT nHelpMode = 0;
if ( pSVData->maHelpData.mbQuickHelp )
@@ -511,7 +513,8 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
#endif
// no mouse messages to disabled windows
- if ( !pChild->IsEnabled() || !pChild->IsInputEnabled() )
+ // #106845# if the window was disabed during capturing we have to pass the mouse events to release capturing
+ if ( pSVData->maWinData.mpCaptureWin != pChild && (!pChild->IsEnabled() || !pChild->IsInputEnabled()) )
{
ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave );
if ( nSVEvent == EVENT_MOUSEMOVE )
@@ -1626,7 +1629,10 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
pWindow->mpFrameData->mbNeedSysWindow = (nNewWidth < IMPL_MIN_NEEDSYSWIN) ||
(nNewHeight < IMPL_MIN_NEEDSYSWIN);
- pWindow->mpFrameData->mbMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ BOOL bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ if( bMinimized != pWindow->mpFrameData->mbMinimized )
+ pWindow->mpFrameWindow->ImplNotifyIconifiedState( bMinimized );
+ pWindow->mpFrameData->mbMinimized = bMinimized;
}
// -----------------------------------------------------------------------
@@ -1709,7 +1715,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
ImplSVData* pSVData = ImplGetSVData();
Window* pTopLevelWindow = mpFrameData->mpFocusWin->ImplGetFirstOverlapWindow();
if ( !pTopLevelWindow->IsInputEnabled() && pSVData->maWinData.mpLastExecuteDlg )
- pSVData->maWinData.mpLastExecuteDlg->ToTop( TOTOP_RESTOREWHENMIN );
+ pSVData->maWinData.mpLastExecuteDlg->ToTop( TOTOP_RESTOREWHENMIN | TOTOP_GRABFOCUSONLY);
else
pTopLevelWindow->GrabFocus();
}
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index ff5ce667ddfa..fe39754cfe0d 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wrkwin.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mba $ $Date: 2002-10-11 18:08:29 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -271,31 +271,6 @@ WorkWindow::~WorkWindow()
// -----------------------------------------------------------------------
-void WorkWindow::SetIcon( USHORT nIcon )
-{
- // Should be removed in the next top level update - now in SystemWindow
- mnIcon = nIcon;
- SystemWindow::SetIcon( nIcon );
-}
-
-// -----------------------------------------------------------------------
-
-void WorkWindow::SetWindowState( const ByteString& rStr )
-{
- // Should be removed in the next top level update - now in SystemWindow
- SystemWindow::SetWindowState( rStr );
-}
-
-// -----------------------------------------------------------------------
-
-ByteString WorkWindow::GetWindowState() const
-{
- // Should be removed in the next top level update - now in SystemWindow
- return SystemWindow::GetWindowState();
-}
-
-// -----------------------------------------------------------------------
-
void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode )
{
if ( !mbFullScreenMode == !bFullScreenMode )