xref: /AOO41X/main/sfx2/source/dialog/titledockwin.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3*cdf0e10cSrcweir  *
4*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
5*cdf0e10cSrcweir  *
6*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
7*cdf0e10cSrcweir  *
8*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
9*cdf0e10cSrcweir  *
10*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
11*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
12*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
13*cdf0e10cSrcweir  *
14*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
15*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
18*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
19*cdf0e10cSrcweir  *
20*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
21*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
22*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
23*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
24*cdf0e10cSrcweir  *
25*cdf0e10cSrcweir  ************************************************************************/
26*cdf0e10cSrcweir 
27*cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
28*cdf0e10cSrcweir 
29*cdf0e10cSrcweir #include "sfx2/titledockwin.hxx"
30*cdf0e10cSrcweir #include "sfx2/bindings.hxx"
31*cdf0e10cSrcweir #include "sfx2/dispatch.hxx"
32*cdf0e10cSrcweir #include "sfxlocal.hrc"
33*cdf0e10cSrcweir #include "sfxresid.hxx"
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <svl/eitem.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir //......................................................................................................................
38*cdf0e10cSrcweir namespace sfx2
39*cdf0e10cSrcweir {
40*cdf0e10cSrcweir //......................................................................................................................
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir 	//==================================================================================================================
43*cdf0e10cSrcweir 	//= TitledDockingWindow
44*cdf0e10cSrcweir 	//==================================================================================================================
45*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
46*cdf0e10cSrcweir     TitledDockingWindow::TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow, Window* i_pParent,
47*cdf0e10cSrcweir             WinBits i_nStyle )
48*cdf0e10cSrcweir         :SfxDockingWindow( i_pBindings, i_pChildWindow, i_pParent, i_nStyle )
49*cdf0e10cSrcweir         ,m_sTitle()
50*cdf0e10cSrcweir         ,m_aToolbox( this )
51*cdf0e10cSrcweir         ,m_aContentWindow( this, WB_DIALOGCONTROL )
52*cdf0e10cSrcweir         ,m_aBorder( 3, 1, 3, 3 )
53*cdf0e10cSrcweir         ,m_bLayoutPending( false )
54*cdf0e10cSrcweir         ,m_nTitleBarHeight(0)
55*cdf0e10cSrcweir     {
56*cdf0e10cSrcweir         impl_construct();
57*cdf0e10cSrcweir     }
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
60*cdf0e10cSrcweir     TitledDockingWindow::TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow, Window* i_pParent,
61*cdf0e10cSrcweir             const ResId& i_rResId )
62*cdf0e10cSrcweir         :SfxDockingWindow( i_pBindings, i_pChildWindow, i_pParent, i_rResId )
63*cdf0e10cSrcweir         ,m_sTitle()
64*cdf0e10cSrcweir         ,m_aToolbox( this )
65*cdf0e10cSrcweir         ,m_aContentWindow( this )
66*cdf0e10cSrcweir         ,m_aBorder( 3, 1, 3, 3 )
67*cdf0e10cSrcweir         ,m_bLayoutPending( false )
68*cdf0e10cSrcweir     {
69*cdf0e10cSrcweir         impl_construct();
70*cdf0e10cSrcweir     }
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
73*cdf0e10cSrcweir     void TitledDockingWindow::impl_construct()
74*cdf0e10cSrcweir     {
75*cdf0e10cSrcweir         SetBackground( Wallpaper() );
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir         m_aToolbox.SetSelectHdl( LINK( this, TitledDockingWindow, OnToolboxItemSelected ) );
78*cdf0e10cSrcweir         m_aToolbox.SetOutStyle( TOOLBOX_STYLE_FLAT );
79*cdf0e10cSrcweir         m_aToolbox.SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) );
80*cdf0e10cSrcweir         m_aToolbox.Show();
81*cdf0e10cSrcweir         impl_resetToolBox();
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir         m_aContentWindow.Show();
84*cdf0e10cSrcweir     }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
87*cdf0e10cSrcweir     TitledDockingWindow::~TitledDockingWindow()
88*cdf0e10cSrcweir     {
89*cdf0e10cSrcweir     }
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
92*cdf0e10cSrcweir     void TitledDockingWindow::SetTitle( const String& i_rTitle )
93*cdf0e10cSrcweir     {
94*cdf0e10cSrcweir         m_sTitle = i_rTitle;
95*cdf0e10cSrcweir         Invalidate();
96*cdf0e10cSrcweir     }
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
99*cdf0e10cSrcweir     String TitledDockingWindow::GetTitle() const
100*cdf0e10cSrcweir     {
101*cdf0e10cSrcweir         return impl_getTitle();
102*cdf0e10cSrcweir     }
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
105*cdf0e10cSrcweir     void TitledDockingWindow::SetText( const String& i_rText )
106*cdf0e10cSrcweir     {
107*cdf0e10cSrcweir         SfxDockingWindow::SetText( i_rText );
108*cdf0e10cSrcweir         if ( m_sTitle.Len() == 0 )
109*cdf0e10cSrcweir             // our text is used as title, too => repaint
110*cdf0e10cSrcweir             Invalidate();
111*cdf0e10cSrcweir     }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
114*cdf0e10cSrcweir     void TitledDockingWindow::Resize()
115*cdf0e10cSrcweir     {
116*cdf0e10cSrcweir         SfxDockingWindow::Resize();
117*cdf0e10cSrcweir         impl_scheduleLayout();
118*cdf0e10cSrcweir     }
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
121*cdf0e10cSrcweir     void TitledDockingWindow::onLayoutDone()
122*cdf0e10cSrcweir     {
123*cdf0e10cSrcweir         // not interested in
124*cdf0e10cSrcweir     }
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
127*cdf0e10cSrcweir     void TitledDockingWindow::impl_scheduleLayout()
128*cdf0e10cSrcweir     {
129*cdf0e10cSrcweir         m_bLayoutPending = true;
130*cdf0e10cSrcweir     }
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
133*cdf0e10cSrcweir     void TitledDockingWindow::impl_layout()
134*cdf0e10cSrcweir     {
135*cdf0e10cSrcweir         m_bLayoutPending = false;
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir         m_aToolbox.ShowItem( 1, !IsFloatingMode() );
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir         const Size aToolBoxSize( m_aToolbox.CalcWindowSizePixel() );
140*cdf0e10cSrcweir         Size aWindowSize( GetOutputSizePixel() );
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir         // position the tool box
143*cdf0e10cSrcweir         m_nTitleBarHeight = GetSettings().GetStyleSettings().GetTitleHeight();
144*cdf0e10cSrcweir         if ( aToolBoxSize.Height() > m_nTitleBarHeight )
145*cdf0e10cSrcweir             m_nTitleBarHeight = aToolBoxSize.Height();
146*cdf0e10cSrcweir         m_aToolbox.SetPosSizePixel(
147*cdf0e10cSrcweir             Point(
148*cdf0e10cSrcweir                 aWindowSize.Width() - aToolBoxSize.Width(),
149*cdf0e10cSrcweir                 ( m_nTitleBarHeight - aToolBoxSize.Height() ) / 2
150*cdf0e10cSrcweir             ),
151*cdf0e10cSrcweir             aToolBoxSize
152*cdf0e10cSrcweir         );
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir         // Place the content window.
155*cdf0e10cSrcweir         if ( m_nTitleBarHeight < aToolBoxSize.Height() )
156*cdf0e10cSrcweir             m_nTitleBarHeight = aToolBoxSize.Height();
157*cdf0e10cSrcweir         aWindowSize.Height() -= m_nTitleBarHeight;
158*cdf0e10cSrcweir         m_aContentWindow.SetPosSizePixel(
159*cdf0e10cSrcweir             Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ),
160*cdf0e10cSrcweir             Size(
161*cdf0e10cSrcweir                 aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(),
162*cdf0e10cSrcweir                 aWindowSize.Height() - m_aBorder.Top() - m_aBorder.Bottom()
163*cdf0e10cSrcweir             )
164*cdf0e10cSrcweir         );
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir         onLayoutDone();
167*cdf0e10cSrcweir     }
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
170*cdf0e10cSrcweir     void TitledDockingWindow::Paint( const Rectangle& i_rArea )
171*cdf0e10cSrcweir     {
172*cdf0e10cSrcweir         if ( m_bLayoutPending )
173*cdf0e10cSrcweir             impl_layout();
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir         SfxDockingWindow::Paint( i_rArea );
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir         Push( PUSH_FONT | PUSH_FILLCOLOR | PUSH_LINECOLOR );
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir         SetFillColor( GetSettings().GetStyleSettings().GetDialogColor() );
180*cdf0e10cSrcweir         SetLineColor();
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir         // bold font
183*cdf0e10cSrcweir         Font aFont( GetFont() );
184*cdf0e10cSrcweir         aFont.SetWeight( WEIGHT_BOLD );
185*cdf0e10cSrcweir         SetFont( aFont );
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir         // Set border values.
188*cdf0e10cSrcweir         Size aWindowSize( GetOutputSizePixel() );
189*cdf0e10cSrcweir         int nOuterLeft = 0;
190*cdf0e10cSrcweir         int nInnerLeft = nOuterLeft + m_aBorder.Left() - 1;
191*cdf0e10cSrcweir         int nOuterRight = aWindowSize.Width() - 1;
192*cdf0e10cSrcweir         int nInnerRight = nOuterRight - m_aBorder.Right() + 1;
193*cdf0e10cSrcweir         int nInnerTop = m_nTitleBarHeight + m_aBorder.Top() - 1;
194*cdf0e10cSrcweir         int nOuterBottom = aWindowSize.Height() - 1;
195*cdf0e10cSrcweir         int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1;
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir         // Paint title bar background.
198*cdf0e10cSrcweir         Rectangle aTitleBarBox( Rectangle(
199*cdf0e10cSrcweir             nOuterLeft,
200*cdf0e10cSrcweir             0,
201*cdf0e10cSrcweir             nOuterRight,
202*cdf0e10cSrcweir             nInnerTop-1
203*cdf0e10cSrcweir         ) );
204*cdf0e10cSrcweir         DrawRect( aTitleBarBox );
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir         if ( nInnerLeft > nOuterLeft )
207*cdf0e10cSrcweir             DrawRect( Rectangle( nOuterLeft, nInnerTop, nInnerLeft, nInnerBottom ) );
208*cdf0e10cSrcweir         if ( nOuterRight > nInnerRight )
209*cdf0e10cSrcweir             DrawRect( Rectangle( nInnerRight, nInnerTop, nOuterRight, nInnerBottom ) );
210*cdf0e10cSrcweir         if ( nInnerBottom < nOuterBottom )
211*cdf0e10cSrcweir             DrawRect( Rectangle( nOuterLeft, nInnerBottom, nOuterRight, nOuterBottom ) );
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir         // Paint bevel border.
214*cdf0e10cSrcweir         SetFillColor();
215*cdf0e10cSrcweir         SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() );
216*cdf0e10cSrcweir         if ( m_aBorder.Top() > 0 )
217*cdf0e10cSrcweir             DrawLine( Point( nInnerLeft, nInnerTop ), Point( nInnerLeft, nInnerBottom ) );
218*cdf0e10cSrcweir         if ( m_aBorder.Left() > 0 )
219*cdf0e10cSrcweir             DrawLine( Point( nInnerLeft, nInnerTop ), Point( nInnerRight, nInnerTop ) );
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir         SetLineColor( GetSettings().GetStyleSettings().GetLightColor() );
222*cdf0e10cSrcweir         if ( m_aBorder.Bottom() > 0 )
223*cdf0e10cSrcweir             DrawLine( Point( nInnerRight, nInnerBottom ), Point( nInnerLeft, nInnerBottom ) );
224*cdf0e10cSrcweir         if ( m_aBorder.Right() > 0 )
225*cdf0e10cSrcweir             DrawLine( Point( nInnerRight, nInnerBottom ), Point( nInnerRight, nInnerTop ) );
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir         // Paint title bar text.
228*cdf0e10cSrcweir         SetLineColor( GetSettings().GetStyleSettings().GetActiveTextColor() );
229*cdf0e10cSrcweir         aTitleBarBox.Left() += 3;
230*cdf0e10cSrcweir         DrawText( aTitleBarBox, impl_getTitle(), TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir         // Restore original values of the output device.
233*cdf0e10cSrcweir         Pop();
234*cdf0e10cSrcweir     }
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
237*cdf0e10cSrcweir     String TitledDockingWindow::impl_getTitle() const
238*cdf0e10cSrcweir     {
239*cdf0e10cSrcweir         return m_sTitle.Len() ? m_sTitle : GetText();
240*cdf0e10cSrcweir     }
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
243*cdf0e10cSrcweir     void TitledDockingWindow::impl_resetToolBox()
244*cdf0e10cSrcweir     {
245*cdf0e10cSrcweir         m_aToolbox.Clear();
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir         // Get the closer bitmap and set it as right most button.
248*cdf0e10cSrcweir         Image aImage( SfxResId( SFX_IMG_CLOSE_DOC ) );
249*cdf0e10cSrcweir         Image aImageHC( SfxResId( SFX_IMG_CLOSE_DOC_HC ) );
250*cdf0e10cSrcweir         m_aToolbox.InsertItem( 1,
251*cdf0e10cSrcweir                 GetSettings().GetStyleSettings().GetHighContrastMode()
252*cdf0e10cSrcweir             ?   aImageHC
253*cdf0e10cSrcweir             :   aImage
254*cdf0e10cSrcweir         );
255*cdf0e10cSrcweir         m_aToolbox.ShowItem( 1 );
256*cdf0e10cSrcweir     }
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
259*cdf0e10cSrcweir     sal_uInt16 TitledDockingWindow::impl_addDropDownToolBoxItem( const String& i_rItemText, const rtl::OString& i_nHelpId, const Link& i_rCallback )
260*cdf0e10cSrcweir     {
261*cdf0e10cSrcweir         // Add the menu before the closer button.
262*cdf0e10cSrcweir         const sal_uInt16 nItemCount( m_aToolbox.GetItemCount() );
263*cdf0e10cSrcweir 	    const sal_uInt16 nItemId( nItemCount + 1 );
264*cdf0e10cSrcweir         m_aToolbox.InsertItem( nItemId, i_rItemText, TIB_DROPDOWNONLY, nItemCount > 0 ? nItemCount - 1 : TOOLBOX_APPEND );
265*cdf0e10cSrcweir 	    m_aToolbox.SetHelpId( nItemId, i_nHelpId );
266*cdf0e10cSrcweir 	    m_aToolbox.SetClickHdl( i_rCallback );
267*cdf0e10cSrcweir 	    m_aToolbox.SetDropdownClickHdl( i_rCallback );
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir         // The tool box has likely changed its size. The title bar has to be
270*cdf0e10cSrcweir         // resized.
271*cdf0e10cSrcweir         impl_scheduleLayout();
272*cdf0e10cSrcweir         Invalidate();
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir         return nItemId;
275*cdf0e10cSrcweir     }
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
278*cdf0e10cSrcweir     IMPL_LINK( TitledDockingWindow, OnToolboxItemSelected, ToolBox*, pToolBox )
279*cdf0e10cSrcweir     {
280*cdf0e10cSrcweir 	    const sal_uInt16 nId = pToolBox->GetCurItemId();
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 	    if ( nId == 1 )
283*cdf0e10cSrcweir         {
284*cdf0e10cSrcweir             // the closer
285*cdf0e10cSrcweir             EndTracking();
286*cdf0e10cSrcweir             const sal_uInt16 nChildWindowId( GetChildWindow_Impl()->GetType() );
287*cdf0e10cSrcweir             const SfxBoolItem aVisibility( nChildWindowId, sal_False );
288*cdf0e10cSrcweir             GetBindings().GetDispatcher()->Execute(
289*cdf0e10cSrcweir                 nChildWindowId,
290*cdf0e10cSrcweir                 SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
291*cdf0e10cSrcweir                 &aVisibility,
292*cdf0e10cSrcweir                 NULL
293*cdf0e10cSrcweir             );
294*cdf0e10cSrcweir         }
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir 	    return 0;
297*cdf0e10cSrcweir     }
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
300*cdf0e10cSrcweir     void TitledDockingWindow::StateChanged( StateChangedType i_nType )
301*cdf0e10cSrcweir     {
302*cdf0e10cSrcweir         switch ( i_nType )
303*cdf0e10cSrcweir         {
304*cdf0e10cSrcweir             case STATE_CHANGE_INITSHOW:
305*cdf0e10cSrcweir                 impl_scheduleLayout();
306*cdf0e10cSrcweir                 break;
307*cdf0e10cSrcweir         }
308*cdf0e10cSrcweir         SfxDockingWindow::StateChanged( i_nType );
309*cdf0e10cSrcweir     }
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
312*cdf0e10cSrcweir     void TitledDockingWindow::EndDocking( const Rectangle& i_rRect, sal_Bool i_bFloatMode )
313*cdf0e10cSrcweir     {
314*cdf0e10cSrcweir         SfxDockingWindow::EndDocking( i_rRect, i_bFloatMode );
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir         if ( m_aEndDockingHdl.IsSet() )
317*cdf0e10cSrcweir             m_aEndDockingHdl.Call( this );
318*cdf0e10cSrcweir     }
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
321*cdf0e10cSrcweir     void TitledDockingWindow::DataChanged( const DataChangedEvent& i_rDataChangedEvent )
322*cdf0e10cSrcweir     {
323*cdf0e10cSrcweir         SfxDockingWindow::DataChanged( i_rDataChangedEvent );
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir         switch ( i_rDataChangedEvent.GetType() )
326*cdf0e10cSrcweir         {
327*cdf0e10cSrcweir             case DATACHANGED_SETTINGS:
328*cdf0e10cSrcweir                 if ( ( i_rDataChangedEvent.GetFlags() & SETTINGS_STYLE ) == 0)
329*cdf0e10cSrcweir                     break;
330*cdf0e10cSrcweir                 // else fall through.
331*cdf0e10cSrcweir             case DATACHANGED_FONTS:
332*cdf0e10cSrcweir             case DATACHANGED_FONTSUBSTITUTION:
333*cdf0e10cSrcweir             {
334*cdf0e10cSrcweir                 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir                 // Font.
337*cdf0e10cSrcweir                 Font aFont = rStyleSettings.GetAppFont();
338*cdf0e10cSrcweir                 if ( IsControlFont() )
339*cdf0e10cSrcweir                     aFont.Merge( GetControlFont() );
340*cdf0e10cSrcweir                 SetZoomedPointFont( aFont );
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir                 // Color.
343*cdf0e10cSrcweir                 Color aColor;
344*cdf0e10cSrcweir                 if ( IsControlForeground() )
345*cdf0e10cSrcweir                     aColor = GetControlForeground();
346*cdf0e10cSrcweir                 else
347*cdf0e10cSrcweir                     aColor = rStyleSettings.GetButtonTextColor();
348*cdf0e10cSrcweir                 SetTextColor( aColor );
349*cdf0e10cSrcweir                 SetTextFillColor();
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir                 impl_scheduleLayout();
352*cdf0e10cSrcweir                 Invalidate();
353*cdf0e10cSrcweir             }
354*cdf0e10cSrcweir             break;
355*cdf0e10cSrcweir         }
356*cdf0e10cSrcweir     }
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir //......................................................................................................................
359*cdf0e10cSrcweir } // namespace sfx2
360*cdf0e10cSrcweir //......................................................................................................................
361