Update ooo320-m1
[ooovba.git] / sd / source / ui / toolpanel / TitleToolBox.cxx
blob2c2c40f56c1b12e1805896275a01d36358d80e92
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: TitleToolBox.cxx,v $
10 * $Revision: 1.5 $
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 )
48 lastSize = -1;
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)
70 switch (aId)
72 case TBID_PANEL_MENU:
73 InsertItem (TBID_PANEL_MENU,
74 String::CreateFromAscii ("Panel"),
75 TIB_DROPDOWN);
76 break;
78 case TBID_DOCUMENT_CLOSE:
79 InsertItem (TBID_DOCUMENT_CLOSE,
80 GetSettings().GetStyleSettings().GetMenuBarColor().IsDark()
81 ? maImageHC : maImage, 0 );
82 break;
84 case TBID_TRIANGLE_RIGHT:
85 InsertItem (TBID_TRIANGLE_RIGHT,
86 maTriangleRight, 0);
87 break;
89 case TBID_TRIANGLE_DOWN:
90 InsertItem (TBID_TRIANGLE_DOWN,
91 maTriangleDown, 0);
92 break;
94 case TBID_TEST:
95 InsertItem (TBID_TEST,
96 String::CreateFromAscii ("Test"),
97 TIB_DROPDOWN);
98 break;
105 void TitleToolBox::DataChanged (const DataChangedEvent& rDCEvt)
107 Window::DataChanged (rDCEvt);
109 if (rDCEvt.GetFlags() & SETTINGS_STYLE)
111 SetBackground (
112 Wallpaper (GetSettings().GetStyleSettings().GetDialogColor()));
119 } } // end of namespace ::sd::toolbox