update dev300-m57
[ooovba.git] / sfx2 / source / dialog / navigat.cxx
blob348ddc6412ab9eda56fc1752455f74ecc4a70acb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navigat.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sfx2.hxx"
34 // includes *******************************************************************
36 #ifndef GCC
37 #endif
39 #include <sfx2/navigat.hxx>
40 #include <sfx2/sfx.hrc>
41 #include <sfx2/app.hxx>
42 #include "sfxresid.hxx"
43 #include "helpid.hrc"
45 SFX_IMPL_DOCKINGWINDOW( SfxNavigatorWrapper , SID_NAVIGATOR );
47 SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd ,
48 USHORT nId ,
49 SfxBindings* pBindings ,
50 SfxChildWinInfo* pInfo )
51 : SfxChildWindow( pParentWnd , nId )
53 pWindow = new SfxNavigator( pBindings, this, pParentWnd,
54 WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
55 eChildAlignment = SFX_ALIGN_NOALIGNMENT;
57 pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
58 pWindow->SetOutputSizePixel( Size( 270, 240 ) );
60 ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
61 SetHideNotDelete( TRUE );
64 SfxNavigator::SfxNavigator( SfxBindings* pBind ,
65 SfxChildWindow* pChildWin ,
66 Window* pParent ,
67 WinBits nBits )
68 : SfxDockingWindow( pBind ,
69 pChildWin ,
70 pParent ,
71 nBits )
72 , pWrapper( pChildWin )
74 SetText( String( SfxResId( SID_NAVIGATOR ) ) );
77 void SfxNavigator::Resize()
79 SfxDockingWindow::Resize();
80 if ( pWrapper->GetContextWindow() )
81 pWrapper->GetContextWindow()->SetSizePixel( GetOutputSizePixel() );
84 void SfxNavigator::Resizing( Size &rSize )
86 SfxDockingWindow::Resizing( rSize );
88 SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
89 DBG_ASSERT( pCon, "Kein Context!" );
90 if ( pCon )
91 pCon->Resizing( rSize );
94 BOOL SfxNavigator::Close()
96 SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
97 DBG_ASSERT( pCon, "Kein Context!" );
98 if ( !pCon || pCon->Close() )
99 return SfxDockingWindow::Close();
100 else
101 return FALSE;