xref: /aoo41x/main/sfx2/source/dialog/navigat.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sfx2.hxx"
30 
31 // includes *******************************************************************
32 
33 #ifndef GCC
34 #endif
35 
36 #include <sfx2/navigat.hxx>
37 #include <sfx2/sfx.hrc>
38 #include <sfx2/app.hxx>
39 #include "sfx2/sfxresid.hxx"
40 #include "helpid.hrc"
41 
42 SFX_IMPL_DOCKINGWINDOW( SfxNavigatorWrapper , SID_NAVIGATOR );
43 
44 SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd ,
45 												sal_uInt16 nId ,
46 												SfxBindings* pBindings ,
47 												SfxChildWinInfo* pInfo )
48 					: SfxChildWindow( pParentWnd , nId )
49 {
50     pWindow = new SfxNavigator( pBindings, this, pParentWnd,
51         WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
52 	eChildAlignment = SFX_ALIGN_NOALIGNMENT;
53 
54 	pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
55     pWindow->SetOutputSizePixel( Size( 270, 240 ) );
56 
57 	( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
58 	SetHideNotDelete( sal_True );
59 }
60 
61 SfxNavigator::SfxNavigator( SfxBindings* pBind ,
62 							SfxChildWindow* pChildWin ,
63 							Window* pParent ,
64 							WinBits nBits )
65 						: SfxDockingWindow( pBind ,
66 										    pChildWin ,
67 										    pParent ,
68 										    nBits )
69 						, pWrapper( pChildWin )
70 {
71 	SetText( String( SfxResId( SID_NAVIGATOR ) ) );
72 }
73 
74 void SfxNavigator::Resize()
75 {
76 	SfxDockingWindow::Resize();
77 	if ( pWrapper->GetContextWindow() )
78         pWrapper->GetContextWindow()->SetSizePixel( GetOutputSizePixel() );
79 }
80 
81 void SfxNavigator::Resizing( Size &rSize )
82 {
83 	SfxDockingWindow::Resizing( rSize );
84 
85 	SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
86 	DBG_ASSERT( pCon, "Kein Context!" );
87 	if ( pCon )
88 		pCon->Resizing( rSize );
89 }
90 
91 sal_Bool SfxNavigator::Close()
92 {
93 	SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
94 	DBG_ASSERT( pCon, "Kein Context!" );
95 	if ( !pCon || pCon->Close() )
96 		return SfxDockingWindow::Close();
97 	else
98 		return sal_False;
99 }
100 
101