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: TitleToolBox.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 "TitleToolBox.hxx"
36 #include "res_bmp.hrc"
37 #include <vcl/bitmap.hxx>
38 #include <vcl/bitmapex.hxx>
39 #include "sdresid.hxx"
40 #include <rtl/ustring.hxx>
42 namespace sd
{ namespace toolpanel
{
45 TitleToolBox::TitleToolBox (::Window
* pParent
, WinBits nStyle
)
46 : ToolBox( pParent
, nStyle
)
50 Bitmap
aBitmap (SdResId (BMP_CLOSE_DOC
));
51 Bitmap
aBitmapHC (SdResId (BMP_CLOSE_DOC_H
));
52 Bitmap
aTriangleRight (SdResId (BMP_TRIANGLE_RIGHT
));
53 Bitmap
aTriangleDown (SdResId (BMP_TRIANGLE_DOWN
));
55 maImage
= Image (aBitmap
, Color (COL_LIGHTMAGENTA
));
56 maImageHC
= Image (aBitmapHC
, Color (BMP_COLOR_HIGHCONTRAST
));
57 maTriangleRight
= Image (aTriangleRight
, Color (COL_LIGHTMAGENTA
));
58 maTriangleDown
= Image (aTriangleDown
, Color (COL_LIGHTMAGENTA
));
60 SetOutStyle (TOOLBOX_STYLE_FLAT
);
61 SetBackground (Wallpaper (
62 GetSettings().GetStyleSettings().GetDialogColor()));
68 void TitleToolBox::AddItem (ToolBoxId aId
)
73 InsertItem (TBID_PANEL_MENU
,
74 String::CreateFromAscii ("Panel"),
78 case TBID_DOCUMENT_CLOSE
:
79 InsertItem (TBID_DOCUMENT_CLOSE
,
80 GetSettings().GetStyleSettings().GetMenuBarColor().IsDark()
81 ? maImageHC
: maImage
, 0 );
84 case TBID_TRIANGLE_RIGHT
:
85 InsertItem (TBID_TRIANGLE_RIGHT
,
89 case TBID_TRIANGLE_DOWN
:
90 InsertItem (TBID_TRIANGLE_DOWN
,
95 InsertItem (TBID_TEST
,
96 String::CreateFromAscii ("Test"),
105 void TitleToolBox::DataChanged (const DataChangedEvent
& rDCEvt
)
107 Window::DataChanged (rDCEvt
);
109 if (rDCEvt
.GetFlags() & SETTINGS_STYLE
)
112 Wallpaper (GetSettings().GetStyleSettings().GetDialogColor()));
119 } } // end of namespace ::sd::toolbox