merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / miscdlgs / teamdlg.cxx
bloba0b86604e0de92575d015ad1f6f58051a59f6240
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: teamdlg.cxx,v $
10 * $Revision: 1.6 $
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_sc.hxx"
36 //------------------------------------------------------------------
38 #include <tools/shl.hxx>
40 #include "teamdlg.hxx"
41 #include "scmod.hxx"
42 #include "scresid.hxx"
43 #include "sc.hrc"
46 //------------------------------------------------------------------
48 void ShowTheTeam()
50 SC_MOD()->OpenTeamDlg();
53 //========================================================================
54 // ScTeamDlg
55 //========================================================================
57 ScTeamDlg::ScTeamDlg( Window* pParent )
58 : FloatingWindow( pParent, ScResId( RID_SCDLG_TEAM ) ),
59 aBmpTeam ( this, ScResId( 1 ) )
61 FreeResource();
62 SC_MOD()->SetTeamDlg( this );
64 Bitmap aBmp( ScResId( RID_SCTEAMDLGBMP1 ) );
66 Size aSize = aBmp.GetSizePixel();
67 USHORT nOff = (USHORT)aBmpTeam.GetPosPixel().X();
69 aBmpTeam.SetSizePixel( aSize );
70 aBmpTeam.SetBitmap( aBmp );
71 aSize.Width() += (2*nOff);
72 aSize.Height() += (2*nOff);
73 SetOutputSizePixel( aSize );
74 Center();
75 Point aPos = GetPosPixel();
76 if (aPos.Y() < 0)
78 // #87164# title bar must be visible
79 aPos.Y() = 0;
80 SetPosPixel(aPos);
82 Show();
85 //------------------------------------------------------------------------
87 __EXPORT ScTeamDlg::~ScTeamDlg()
91 //------------------------------------------------------------------------
93 BOOL __EXPORT ScTeamDlg::Close()
95 BOOL bReturn = FloatingWindow::Close();
97 SC_MOD()->SetTeamDlg( NULL );
98 delete this;
100 return bReturn;
103 //------------------------------------------------------------------------
105 void ScTeamDlg::Center()
107 if ( IsRollUp() ) RollDown();
109 Size aSizeDesktop = GetParent()->GetSizePixel();
110 Size aSize = GetSizePixel();
111 Point aNewPos;
113 aNewPos.X() = (aSizeDesktop.Width() - aSize.Width()) / 2;
114 aNewPos.Y() = (aSizeDesktop.Height() - aSize.Height()) / 2;
115 SetPosPixel( aNewPos );