1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: teamdlg.cxx,v $
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"
42 #include "scresid.hxx"
46 //------------------------------------------------------------------
50 SC_MOD()->OpenTeamDlg();
53 //========================================================================
55 //========================================================================
57 ScTeamDlg::ScTeamDlg( Window
* pParent
)
58 : FloatingWindow( pParent
, ScResId( RID_SCDLG_TEAM
) ),
59 aBmpTeam ( this, ScResId( 1 ) )
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
);
75 Point aPos
= GetPosPixel();
78 // #87164# title bar must be visible
85 //------------------------------------------------------------------------
87 __EXPORT
ScTeamDlg::~ScTeamDlg()
91 //------------------------------------------------------------------------
93 BOOL __EXPORT
ScTeamDlg::Close()
95 BOOL bReturn
= FloatingWindow::Close();
97 SC_MOD()->SetTeamDlg( NULL
);
103 //------------------------------------------------------------------------
105 void ScTeamDlg::Center()
107 if ( IsRollUp() ) RollDown();
109 Size aSizeDesktop
= GetParent()->GetSizePixel();
110 Size aSize
= GetSizePixel();
113 aNewPos
.X() = (aSizeDesktop
.Width() - aSize
.Width()) / 2;
114 aNewPos
.Y() = (aSizeDesktop
.Height() - aSize
.Height()) / 2;
115 SetPosPixel( aNewPos
);