Kaydet (Commit) e1823c53 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS mav09 (1.7.2); FILE MERGED

2004/09/30 09:24:01 mav 1.7.2.6: #i27773# resync
2004/09/28 10:07:29 mav 1.7.2.5: #27773# resync
2004/09/16 17:20:05 mav 1.7.2.4: RESYNC: (1.7-1.10); FILE MERGED
2004/08/12 17:00:53 mav 1.7.2.3: #i27773# fix from CD
2004/08/02 13:37:36 mav 1.7.2.2: #i27773# interface change
2004/07/16 14:59:27 mba 1.7.2.1: #i27773#: dispose windows; listen for resize events of own frame always, frame will never resize its component window
üst 55702968
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: layoutmanager.cxx,v $ * $RCSfile: layoutmanager.cxx,v $
* *
* $Revision: 1.10 $ * $Revision: 1.11 $
* *
* last change: $Author: obo $ $Date: 2004-09-09 17:09:42 $ * last change: $Author: kz $ $Date: 2004-10-04 18:06:16 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -2279,6 +2279,40 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible ) ...@@ -2279,6 +2279,40 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
{ {
} }
aWriteLock.lock();
Reference< XUIElement > xMenuBar( m_xMenuBar, UNO_QUERY );
Reference< css::awt::XWindow > xContainerWindow( m_xContainerWindow );
Reference< XComponent > xInplaceMenuBar( m_xInplaceMenuBar );
MenuBarManager* pInplaceMenuBar( m_pInplaceMenuBar );
aWriteLock.unlock();
if (( xMenuBar.is() || xInplaceMenuBar.is() ) && xContainerWindow.is() )
{
vos::OGuard aGuard( Application::GetSolarMutex() );
MenuBar* pMenuBar( 0 );
if ( xInplaceMenuBar.is() )
pMenuBar = (MenuBar *)pInplaceMenuBar->GetMenuBar();
else
{
MenuBarWrapper* pMenuBarWrapper = SAL_STATIC_CAST( MenuBarWrapper*, xMenuBar.get() );
pMenuBar = (MenuBar *)pMenuBarWrapper->GetMenuBarManager()->GetMenuBar();
}
Window* pWindow = VCLUnoHelper::GetWindow( xContainerWindow );
while ( pWindow && !pWindow->IsSystemWindow() )
pWindow = pWindow->GetParent();
if ( pWindow )
{
SystemWindow* pSysWindow = (SystemWindow *)pWindow;
if ( bSetVisible )
pSysWindow->SetMenuBar( pMenuBar );
else
pSysWindow->SetMenuBar( 0 );
}
}
doLayout(); doLayout();
} }
...@@ -2478,23 +2512,7 @@ sal_Bool LayoutManager::implts_hideProgressBar() ...@@ -2478,23 +2512,7 @@ sal_Bool LayoutManager::implts_hideProgressBar()
return sal_False; return sal_False;
} }
void SAL_CALL LayoutManager::attachFrame( const Reference< XFrame >& xFrame ) void LayoutManager::implts_setInplaceMenuBar( const Reference< XIndexAccess >& xMergedMenuBar )
throw (::com::sun::star::uno::RuntimeException)
{
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
WriteGuard aWriteLock( m_aLock );
m_xFrame = xFrame;
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
}
void SAL_CALL LayoutManager::reset()
throw (RuntimeException)
{
implts_reset( sal_True );
}
void SAL_CALL LayoutManager::setInplaceMenuBar( sal_Int64 pInplaceMenuBarPointer )
throw (::com::sun::star::uno::RuntimeException) throw (::com::sun::star::uno::RuntimeException)
{ {
/* SAFE AREA ----------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
...@@ -2514,7 +2532,9 @@ throw (::com::sun::star::uno::RuntimeException) ...@@ -2514,7 +2532,9 @@ throw (::com::sun::star::uno::RuntimeException)
if ( m_xFrame.is() && if ( m_xFrame.is() &&
m_xContainerWindow.is() ) m_xContainerWindow.is() )
{ {
m_pInplaceMenuBar = new MenuBarManager( m_xSMGR, m_xFrame, (MenuBar *)(long)pInplaceMenuBarPointer, sal_False, sal_False ); MenuBar* pMenuBar = new MenuBar;
m_pInplaceMenuBar = new MenuBarManager( m_xSMGR, m_xFrame, pMenuBar, sal_True, sal_True );
m_pInplaceMenuBar->SetItemContainer( xMergedMenuBar );
Window* pWindow = VCLUnoHelper::GetWindow( m_xContainerWindow ); Window* pWindow = VCLUnoHelper::GetWindow( m_xContainerWindow );
while ( pWindow && !pWindow->IsSystemWindow() ) while ( pWindow && !pWindow->IsSystemWindow() )
...@@ -2523,7 +2543,7 @@ throw (::com::sun::star::uno::RuntimeException) ...@@ -2523,7 +2543,7 @@ throw (::com::sun::star::uno::RuntimeException)
if ( pWindow ) if ( pWindow )
{ {
SystemWindow* pSysWindow = (SystemWindow *)pWindow; SystemWindow* pSysWindow = (SystemWindow *)pWindow;
pSysWindow->SetMenuBar( (MenuBar *)(long)pInplaceMenuBarPointer ); pSysWindow->SetMenuBar( pMenuBar );
} }
m_bInplaceMenuSet = sal_True; m_bInplaceMenuSet = sal_True;
...@@ -2534,17 +2554,18 @@ throw (::com::sun::star::uno::RuntimeException) ...@@ -2534,17 +2554,18 @@ throw (::com::sun::star::uno::RuntimeException)
/* SAFE AREA ----------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
implts_updateMenuBarClose(); implts_updateMenuBarClose();
} }
} }
void SAL_CALL LayoutManager::resetInplaceMenuBar() void LayoutManager::implts_resetInplaceMenuBar()
throw (::com::sun::star::uno::RuntimeException) throw (::com::sun::star::uno::RuntimeException)
{ {
/* SAFE AREA ----------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
WriteGuard aWriteLock( m_aLock ); WriteGuard aWriteLock( m_aLock );
m_bInplaceMenuSet = sal_False; m_bInplaceMenuSet = sal_False;
if ( m_xMenuBar.is() && // if ( m_xMenuBar.is() &&
m_xContainerWindow.is() ) if ( m_xContainerWindow.is() )
{ {
vos::OGuard aGuard( Application::GetSolarMutex() ); vos::OGuard aGuard( Application::GetSolarMutex() );
MenuBarWrapper* pMenuBarWrapper = SAL_STATIC_CAST( MenuBarWrapper*, m_xMenuBar.get() ); MenuBarWrapper* pMenuBarWrapper = SAL_STATIC_CAST( MenuBarWrapper*, m_xMenuBar.get() );
...@@ -2555,7 +2576,10 @@ throw (::com::sun::star::uno::RuntimeException) ...@@ -2555,7 +2576,10 @@ throw (::com::sun::star::uno::RuntimeException)
if ( pWindow ) if ( pWindow )
{ {
SystemWindow* pSysWindow = (SystemWindow *)pWindow; SystemWindow* pSysWindow = (SystemWindow *)pWindow;
if ( pMenuBarWrapper )
pSysWindow->SetMenuBar( (MenuBar *)pMenuBarWrapper->GetMenuBarManager()->GetMenuBar() ); pSysWindow->SetMenuBar( (MenuBar *)pMenuBarWrapper->GetMenuBarManager()->GetMenuBar() );
else
pSysWindow->SetMenuBar( 0 );
} }
} }
...@@ -2569,22 +2593,51 @@ throw (::com::sun::star::uno::RuntimeException) ...@@ -2569,22 +2593,51 @@ throw (::com::sun::star::uno::RuntimeException)
/* SAFE AREA ----------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
} }
void SAL_CALL LayoutManager::attachFrame( const Reference< XFrame >& xFrame )
throw (::com::sun::star::uno::RuntimeException)
{
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
WriteGuard aWriteLock( m_aLock );
m_xFrame = xFrame;
aWriteLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
// if ( xFrame.is() )
// xFrame->getContainerWindow()->addWindowListener( Reference< css::awt::XWindowListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
}
void SAL_CALL LayoutManager::reset()
throw (RuntimeException)
{
implts_reset( sal_True );
}
void SAL_CALL LayoutManager::setInplaceMenuBar( sal_Int64 pInplaceMenuBarPointer )
throw (::com::sun::star::uno::RuntimeException)
{
OSL_ENSURE( sal_False, "This method is obsolete and should not be used!\n" );
}
void SAL_CALL LayoutManager::resetInplaceMenuBar()
throw (::com::sun::star::uno::RuntimeException)
{
OSL_ENSURE( sal_False, "This method is obsolete and should not be used!\n" );
}
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
// XMenuBarMergingAcceptor // XMenuBarMergingAcceptor
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
sal_Bool SAL_CALL LayoutManager::setMergeMenuBar( sal_Bool SAL_CALL LayoutManager::setMergedMenuBar(
const Reference< XIndexAccess >& ContainerMenuBar, const Reference< XIndexAccess >& xMergedMenuBar )
const Reference< XDispatchProvider >& ContainerDispatchProvider,
const Reference< XIndexAccess >& EmbedObjectMenuBar,
const Reference< XDispatchProvider >& EmbedObjectDispatchProvider )
throw (::com::sun::star::uno::RuntimeException) throw (::com::sun::star::uno::RuntimeException)
{ {
return sal_False; implts_setInplaceMenuBar( xMergedMenuBar );
return sal_True;
} }
void SAL_CALL LayoutManager::removeMergedMenuBar() void SAL_CALL LayoutManager::removeMergedMenuBar()
throw (::com::sun::star::uno::RuntimeException) throw (::com::sun::star::uno::RuntimeException)
{ {
implts_resetInplaceMenuBar();
} }
::com::sun::star::awt::Rectangle SAL_CALL LayoutManager::getCurrentDockingArea() ::com::sun::star::awt::Rectangle SAL_CALL LayoutManager::getCurrentDockingArea()
...@@ -2612,17 +2665,19 @@ throw ( RuntimeException ) ...@@ -2612,17 +2665,19 @@ throw ( RuntimeException )
if ( m_xDockingAreaAcceptor == xDockingAreaAcceptor ) if ( m_xDockingAreaAcceptor == xDockingAreaAcceptor )
return; return;
std::vector< Reference< css::awt::XWindow > > oldDockingAreaWindows;
// Remove listener from old docking area acceptor // Remove listener from old docking area acceptor
if ( m_xDockingAreaAcceptor.is() ) if ( m_xDockingAreaAcceptor.is() )
{ {
Reference< css::awt::XWindow > xWindow( m_xDockingAreaAcceptor->getContainerWindow() ); Reference< css::awt::XWindow > xWindow( m_xDockingAreaAcceptor->getContainerWindow() );
if ( xWindow.is() ) if ( xWindow.is() && m_xFrame->getContainerWindow() != m_xContainerWindow )
xWindow->removeWindowListener( Reference< css::awt::XWindowListener >( static_cast< OWeakObject * >( this ), UNO_QUERY )); xWindow->removeWindowListener( Reference< css::awt::XWindowListener >( static_cast< OWeakObject * >( this ), UNO_QUERY ));
m_xDockAreaWindows[DockingArea_DOCKINGAREA_TOP]->dispose(); oldDockingAreaWindows.push_back( m_xDockAreaWindows[DockingArea_DOCKINGAREA_TOP] );
m_xDockAreaWindows[DockingArea_DOCKINGAREA_BOTTOM]->dispose(); oldDockingAreaWindows.push_back( m_xDockAreaWindows[DockingArea_DOCKINGAREA_BOTTOM] );
m_xDockAreaWindows[DockingArea_DOCKINGAREA_LEFT]->dispose(); oldDockingAreaWindows.push_back( m_xDockAreaWindows[DockingArea_DOCKINGAREA_LEFT] );
m_xDockAreaWindows[DockingArea_DOCKINGAREA_RIGHT]->dispose(); oldDockingAreaWindows.push_back( m_xDockAreaWindows[DockingArea_DOCKINGAREA_RIGHT] );
m_xDockAreaWindows[DockingArea_DOCKINGAREA_TOP].clear(); m_xDockAreaWindows[DockingArea_DOCKINGAREA_TOP].clear();
m_xDockAreaWindows[DockingArea_DOCKINGAREA_BOTTOM].clear(); m_xDockAreaWindows[DockingArea_DOCKINGAREA_BOTTOM].clear();
...@@ -2650,6 +2705,24 @@ throw ( RuntimeException ) ...@@ -2650,6 +2705,24 @@ throw ( RuntimeException )
/* SAFE AREA ----------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
implts_destroyElements(); // remove all elements implts_destroyElements(); // remove all elements
if ( oldDockingAreaWindows.size() > 0 )
{
for ( sal_Int32 i=0; i < (sal_Int32)oldDockingAreaWindows.size(); i++ )
{
if ( oldDockingAreaWindows[i].is() )
{
try
{
oldDockingAreaWindows[i]->dispose();
}
catch ( Exception& )
{
}
}
}
}
implts_createAddonsToolBars(); // create addon toolbars implts_createAddonsToolBars(); // create addon toolbars
implts_createCustomToolBars(); // create custom toolbars implts_createCustomToolBars(); // create custom toolbars
implts_sortUIElements(); implts_sortUIElements();
...@@ -5169,6 +5242,23 @@ throw( css::uno::RuntimeException ) ...@@ -5169,6 +5242,23 @@ throw( css::uno::RuntimeException )
} }
m_aAsyncLayoutTimer.Start(); m_aAsyncLayoutTimer.Start();
} }
else if ( m_xFrame.is() && aEvent.Source == m_xFrame->getContainerWindow() )
{
Reference< css::awt::XWindow > xComponentWindow( m_xFrame->getComponentWindow() );
if( xComponentWindow.is() == sal_True )
{
css::uno::Reference< css::awt::XDevice > xDevice( m_xFrame->getContainerWindow(), css::uno::UNO_QUERY );
// Convert relativ size to output size.
css::awt::Rectangle aRectangle = m_xFrame->getContainerWindow()->getPosSize();
css::awt::DeviceInfo aInfo = xDevice->getInfo();
css::awt::Size aSize ( aRectangle.Width - aInfo.LeftInset - aInfo.RightInset ,
aRectangle.Height - aInfo.TopInset - aInfo.BottomInset );
// Resize our component window.
xComponentWindow->setPosSize( 0, 0, aSize.Width, aSize.Height, css::awt::PosSize::POSSIZE );
}
}
else else
{ {
sal_Bool bLocked( m_bDockingInProgress ); sal_Bool bLocked( m_bDockingInProgress );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment