xref: /aoo4110/main/sfx2/source/dialog/navigat.cxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sfx2.hxx"
26 
27 // includes *******************************************************************
28 
29 #ifndef GCC
30 #endif
31 
32 #include <sfx2/navigat.hxx>
33 #include <sfx2/sfx.hrc>
34 #include <sfx2/app.hxx>
35 #include "sfx2/sfxresid.hxx"
36 #include "helpid.hrc"
37 
38 SFX_IMPL_DOCKINGWINDOW( SfxNavigatorWrapper , SID_NAVIGATOR );
39 
SfxNavigatorWrapper(Window * pParentWnd,sal_uInt16 nId,SfxBindings * pBindings,SfxChildWinInfo * pInfo)40 SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd ,
41 												sal_uInt16 nId ,
42 												SfxBindings* pBindings ,
43 												SfxChildWinInfo* pInfo )
44 					: SfxChildWindow( pParentWnd , nId )
45 {
46     pWindow = new SfxNavigator( pBindings, this, pParentWnd,
47         WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
48 	eChildAlignment = SFX_ALIGN_NOALIGNMENT;
49 
50 	pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
51     pWindow->SetOutputSizePixel( Size( 270, 240 ) );
52 
53 	( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
54 	SetHideNotDelete( sal_True );
55 }
56 
SfxNavigator(SfxBindings * pBind,SfxChildWindow * pChildWin,Window * pParent,WinBits nBits)57 SfxNavigator::SfxNavigator( SfxBindings* pBind ,
58 							SfxChildWindow* pChildWin ,
59 							Window* pParent ,
60 							WinBits nBits )
61 						: SfxDockingWindow( pBind ,
62 										    pChildWin ,
63 										    pParent ,
64 										    nBits )
65 						, pWrapper( pChildWin )
66 {
67 	SetText( String( SfxResId( SID_NAVIGATOR ) ) );
68 }
69 
Resize()70 void SfxNavigator::Resize()
71 {
72 	SfxDockingWindow::Resize();
73 	if ( pWrapper->GetContextWindow() )
74         pWrapper->GetContextWindow()->SetSizePixel( GetOutputSizePixel() );
75 }
76 
Resizing(Size & rSize)77 void SfxNavigator::Resizing( Size &rSize )
78 {
79 	SfxDockingWindow::Resizing( rSize );
80 
81 	SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
82 	DBG_ASSERT( pCon, "Kein Context!" );
83 	if ( pCon )
84 		pCon->Resizing( rSize );
85 }
86 
Close()87 sal_Bool SfxNavigator::Close()
88 {
89 	SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
90 	DBG_ASSERT( pCon, "Kein Context!" );
91 	if ( !pCon || pCon->Close() )
92 		return SfxDockingWindow::Close();
93 	else
94 		return sal_False;
95 }
96 
97