decoview.cxx (9f62ea84) decoview.cxx (dd7ece3a)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_vcl.hxx"
26#include <vcl/settings.hxx>
27#include <tools/poly.hxx>

--- 236 unchanged lines hidden (view full) ---

264 }
265 break;
266
267 case SYMBOL_PAGEUP:
268 case SYMBOL_PAGEDOWN:
269 {
270 if ( !( nSize & 0x01 ))
271 {
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_vcl.hxx"
26#include <vcl/settings.hxx>
27#include <tools/poly.hxx>

--- 236 unchanged lines hidden (view full) ---

264 }
265 break;
266
267 case SYMBOL_PAGEUP:
268 case SYMBOL_PAGEDOWN:
269 {
270 if ( !( nSize & 0x01 ))
271 {
272 // An even rectangle size means we have to use a smaller size for
273 // our arrows as we want to use one pixel for the spearhead! Otherwise
272 // An even rectangle size means we have to use a smaller size for
273 // our arrows as we want to use one pixel for the spearhead! Otherwise
274 // it will be clipped!
275 nCenterX++;
276 n2 = ( nMin-1 ) / 2;
277 n4 = ( nMin-1 ) / 4;
278 }
279
280 nTop = nCenterY-n2;
281 nBottom = nCenterY-1;

--- 455 unchanged lines hidden (view full) ---

737 sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False;
738 nStyle &= ~FRAME_DRAW_MENU;
739
740 Window *pWin = NULL;
741 if( pDev->GetOutDevType() == OUTDEV_WINDOW )
742 pWin = (Window*) pDev;
743
744 // UseFlatBorders disables 3D style for all frames except menus
274 // it will be clipped!
275 nCenterX++;
276 n2 = ( nMin-1 ) / 2;
277 n4 = ( nMin-1 ) / 4;
278 }
279
280 nTop = nCenterY-n2;
281 nBottom = nCenterY-1;

--- 455 unchanged lines hidden (view full) ---

737 sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False;
738 nStyle &= ~FRAME_DRAW_MENU;
739
740 Window *pWin = NULL;
741 if( pDev->GetOutDevType() == OUTDEV_WINDOW )
742 pWin = (Window*) pDev;
743
744 // UseFlatBorders disables 3D style for all frames except menus
745 // menus may use different border colors (eg on XP)
746 // normal frames will be drawn using the shadow color
745 // menus may use different border colors (e.g. on XP)
746 // normal frames will be drawn using the shadow color
747 // whereas window frame borders will use black
748 sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
749
747 // whereas window frame borders will use black
748 sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() );
749
750 // no flat borders for standard VCL controls (ie formcontrols that keep their classic look)
750 // no flat borders for standard VCL controls (i.e. formcontrols that keep their classic look)
751 // will not affect frame windows (like dropdowns)
752 if( bFlatBorders && pWin && pWin->GetType() == WINDOW_BORDERWINDOW && (pWin != pWin->ImplGetFrameWindow()) )
753 {
754 // check for formcontrol, i.e., a control without NWF enabled
755 Control *pControl = dynamic_cast< Control* >( pWin->GetWindow( WINDOW_CLIENT ) );
756 if( pControl && pControl->IsNativeWidgetEnabled() )
757 bFlatBorders = sal_True;
758 else

--- 57 unchanged lines hidden (view full) ---

816 {
817 sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
818 if( pWin->GetType() == WINDOW_BORDERWINDOW )
819 nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
820 ImplControlValue aControlValue( nValueStyle );
821 Rectangle aBound, aContent;
822 Rectangle aNatRgn( rRect );
823 if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
751 // will not affect frame windows (like dropdowns)
752 if( bFlatBorders && pWin && pWin->GetType() == WINDOW_BORDERWINDOW && (pWin != pWin->ImplGetFrameWindow()) )
753 {
754 // check for formcontrol, i.e., a control without NWF enabled
755 Control *pControl = dynamic_cast< Control* >( pWin->GetWindow( WINDOW_CLIENT ) );
756 if( pControl && pControl->IsNativeWidgetEnabled() )
757 bFlatBorders = sal_True;
758 else

--- 57 unchanged lines hidden (view full) ---

816 {
817 sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle;
818 if( pWin->GetType() == WINDOW_BORDERWINDOW )
819 nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
820 ImplControlValue aControlValue( nValueStyle );
821 Rectangle aBound, aContent;
822 Rectangle aNatRgn( rRect );
823 if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
824 aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
824 aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
825 {
826 if( pWin->DrawNativeControl( CTRL_FRAME, PART_BORDER, aContent, CTRL_STATE_ENABLED,
827 aControlValue, rtl::OUString()) )
828 {
829 rRect = aContent;
830 return;
831 }
832 }

--- 80 unchanged lines hidden (view full) ---

913 rStyleSettings.GetMenuBorderColor(),
914 rStyleSettings.GetDarkShadowColor() );
915 else
916 pDev->ImplDraw2ColorFrame( rRect,
917 bFlatBorders ? // no 3d effect
918 rStyleSettings.GetDarkShadowColor() :
919 rStyleSettings.GetLightBorderColor(),
920 rStyleSettings.GetDarkShadowColor() );
825 {
826 if( pWin->DrawNativeControl( CTRL_FRAME, PART_BORDER, aContent, CTRL_STATE_ENABLED,
827 aControlValue, rtl::OUString()) )
828 {
829 rRect = aContent;
830 return;
831 }
832 }

--- 80 unchanged lines hidden (view full) ---

913 rStyleSettings.GetMenuBorderColor(),
914 rStyleSettings.GetDarkShadowColor() );
915 else
916 pDev->ImplDraw2ColorFrame( rRect,
917 bFlatBorders ? // no 3d effect
918 rStyleSettings.GetDarkShadowColor() :
919 rStyleSettings.GetLightBorderColor(),
920 rStyleSettings.GetDarkShadowColor() );
921
921
922 }
923
924 rRect.Left()++;
925 rRect.Top()++;
926 rRect.Right()--;
927 rRect.Bottom()--;
928
929 sal_Bool bDrawn = sal_True;

--- 5 unchanged lines hidden (view full) ---

935 rStyleSettings.GetFaceColor() );
936 else
937 pDev->ImplDraw2ColorFrame( rRect,
938 rStyleSettings.GetDarkShadowColor(),
939 rStyleSettings.GetLightBorderColor() );
940 }
941 else
942 {
922 }
923
924 rRect.Left()++;
925 rRect.Top()++;
926 rRect.Right()--;
927 rRect.Bottom()--;
928
929 sal_Bool bDrawn = sal_True;

--- 5 unchanged lines hidden (view full) ---

935 rStyleSettings.GetFaceColor() );
936 else
937 pDev->ImplDraw2ColorFrame( rRect,
938 rStyleSettings.GetDarkShadowColor(),
939 rStyleSettings.GetLightBorderColor() );
940 }
941 else
942 {
943 // flat menues have no shadow border
943 // flat menus have no shadow border
944 if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() )
945 pDev->ImplDraw2ColorFrame( rRect,
946 rStyleSettings.GetLightColor(),
947 rStyleSettings.GetShadowColor() );
948 else
949 bDrawn = sal_False;
950 }
951 if( bDrawn )

--- 305 unchanged lines hidden (view full) ---

1257 Point aStart( rStart ), aStop( rStop );
1258 const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
1259
1260 mpOutDev->Push( PUSH_LINECOLOR );
1261 if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
1262 mpOutDev->SetLineColor( Color( COL_BLACK ) );
1263 else
1264 mpOutDev->SetLineColor( rStyleSettings.GetShadowColor() );
944 if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() )
945 pDev->ImplDraw2ColorFrame( rRect,
946 rStyleSettings.GetLightColor(),
947 rStyleSettings.GetShadowColor() );
948 else
949 bDrawn = sal_False;
950 }
951 if( bDrawn )

--- 305 unchanged lines hidden (view full) ---

1257 Point aStart( rStart ), aStop( rStop );
1258 const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
1259
1260 mpOutDev->Push( PUSH_LINECOLOR );
1261 if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
1262 mpOutDev->SetLineColor( Color( COL_BLACK ) );
1263 else
1264 mpOutDev->SetLineColor( rStyleSettings.GetShadowColor() );
1265
1265
1266 mpOutDev->DrawLine( aStart, aStop );
1267 if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
1268 {
1269 mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
1270 if( bVertical )
1271 {
1272 aStart.X()++;
1273 aStop.X()++;
1274 }
1275 else
1276 {
1277 aStart.Y()++;
1278 aStop.Y()++;
1279 }
1280 mpOutDev->DrawLine( aStart, aStop );
1281 }
1282 mpOutDev->Pop();
1283}
1266 mpOutDev->DrawLine( aStart, aStop );
1267 if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
1268 {
1269 mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
1270 if( bVertical )
1271 {
1272 aStart.X()++;
1273 aStop.X()++;
1274 }
1275 else
1276 {
1277 aStart.Y()++;
1278 aStop.Y()++;
1279 }
1280 mpOutDev->DrawLine( aStart, aStop );
1281 }
1282 mpOutDev->Pop();
1283}
1284