1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 // includes *******************************************************************
32 #include <sfx2/navigat.hxx>
33 #include <sfx2/sfx.hrc>
34 #include <sfx2/app.hxx>
35 #include "sfx2/sfxresid.hxx"
38 SFX_IMPL_DOCKINGWINDOW( SfxNavigatorWrapper
, SID_NAVIGATOR
);
40 SfxNavigatorWrapper::SfxNavigatorWrapper( Window
* pParentWnd
,
42 SfxBindings
* pBindings
,
43 SfxChildWinInfo
* pInfo
)
44 : SfxChildWindow( pParentWnd
, nId
)
46 pWindow
= new SfxNavigator( pBindings
, this, pParentWnd
,
47 WB_STDDOCKWIN
| WB_CLIPCHILDREN
| WB_SIZEABLE
| WB_3DLOOK
| WB_ROLLABLE
);
48 eChildAlignment
= SFX_ALIGN_NOALIGNMENT
;
50 pWindow
->SetHelpId ( HID_NAVIGATOR_WINDOW
);
51 pWindow
->SetOutputSizePixel( Size( 270, 240 ) );
53 ( ( SfxDockingWindow
* ) pWindow
)->Initialize( pInfo
);
54 SetHideNotDelete( sal_True
);
57 SfxNavigator::SfxNavigator( SfxBindings
* pBind
,
58 SfxChildWindow
* pChildWin
,
61 : SfxDockingWindow( pBind
,
65 , pWrapper( pChildWin
)
67 SetText( String( SfxResId( SID_NAVIGATOR
) ) );
70 void SfxNavigator::Resize()
72 SfxDockingWindow::Resize();
73 if ( pWrapper
->GetContextWindow() )
74 pWrapper
->GetContextWindow()->SetSizePixel( GetOutputSizePixel() );
77 void SfxNavigator::Resizing( Size
&rSize
)
79 SfxDockingWindow::Resizing( rSize
);
81 SfxChildWindowContext
*pCon
= GetChildWindow_Impl()->GetContext_Impl();
82 DBG_ASSERT( pCon
, "No Context!" );
84 pCon
->Resizing( rSize
);
87 sal_Bool
SfxNavigator::Close()
89 SfxChildWindowContext
*pCon
= GetChildWindow_Impl()->GetContext_Impl();
90 DBG_ASSERT( pCon
, "No Context!" );
91 if ( !pCon
|| pCon
->Close() )
92 return SfxDockingWindow::Close();
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */