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: EmptyWindow.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_sd.hxx"
34 #include "EmptyWindow.hxx"
36 namespace sd
{ namespace toolpanel
{
39 EmptyWindow::EmptyWindow (
40 Window
* pParentWindow
,
41 Color aBackgroundColor
,
43 : Window (pParentWindow
, WinBits()),
46 SetBackground (aBackgroundColor
);
52 EmptyWindow::~EmptyWindow (void)
59 void EmptyWindow::Paint (const Rectangle
& )
61 Size
aWindowSize (GetOutputSizePixel());
62 Point
aPosition(aWindowSize
.Width()/2,aWindowSize
.Height()/2);
65 aPosition
= Point(10,aWindowSize
.Height()/2);
66 if (GetTextBoundRect (aBBox
, msText
))
68 (aWindowSize
.Width()-aBBox
.GetWidth())/2,
69 (aWindowSize
.Height()-aBBox
.GetHeight())/2);
70 DrawText (aPosition
, msText
);
72 String sSizeString
= String::CreateFromInt32(aWindowSize
.Width());
73 sSizeString
.Append (String::CreateFromAscii(" x "));
74 sSizeString
.Append (String::CreateFromInt32(aWindowSize
.Height()));
75 if (GetTextBoundRect (aBBox
, sSizeString
))
77 (aWindowSize
.Width()-aBBox
.GetWidth())/2,
78 aPosition
.Y() + GetTextHeight() + aBBox
.GetHeight());
79 DrawText (aPosition
, sSizeString
);
85 void EmptyWindow::Resize (void)
93 void EmptyWindow::GetFocus (void)
95 GetParent()->GrabFocus();
99 } } // end of namespace ::sd::tpv