15d39f272SZheng Fan /************************************************************** 25d39f272SZheng Fan * 35d39f272SZheng Fan * Licensed to the Apache Software Foundation (ASF) under one 45d39f272SZheng Fan * or more contributor license agreements. See the NOTICE file 55d39f272SZheng Fan * distributed with this work for additional information 65d39f272SZheng Fan * regarding copyright ownership. The ASF licenses this file 75d39f272SZheng Fan * to you under the Apache License, Version 2.0 (the 85d39f272SZheng Fan * "License"); you may not use this file except in compliance 95d39f272SZheng Fan * with the License. You may obtain a copy of the License at 105d39f272SZheng Fan * 115d39f272SZheng Fan * http://www.apache.org/licenses/LICENSE-2.0 125d39f272SZheng Fan * 135d39f272SZheng Fan * Unless required by applicable law or agreed to in writing, 145d39f272SZheng Fan * software distributed under the License is distributed on an 155d39f272SZheng Fan * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 165d39f272SZheng Fan * KIND, either express or implied. See the License for the 175d39f272SZheng Fan * specific language governing permissions and limitations 185d39f272SZheng Fan * under the License. 195d39f272SZheng Fan * 205d39f272SZheng Fan *************************************************************/ 215d39f272SZheng Fan 225d39f272SZheng Fan #include "SidebarDialControlBmp.hxx" 235d39f272SZheng Fan 245d39f272SZheng Fan #include <sfx2/sidebar/Theme.hxx> 255d39f272SZheng Fan 265d39f272SZheng Fan #include <vcl/svapp.hxx> 275d39f272SZheng Fan 285d39f272SZheng Fan #include "PosSizePropertyPanel.hrc" 295d39f272SZheng Fan #include <svx/dialogs.hrc> 305d39f272SZheng Fan #include <svx/dialmgr.hxx> 31*facb16e7SArmin Le Grand #include <svx/svdstr.hrc> 325d39f272SZheng Fan 335d39f272SZheng Fan namespace svx { namespace sidebar { 345d39f272SZheng Fan 355d39f272SZheng Fan SidebarDialControlBmp::SidebarDialControlBmp (Window& rParent) 365d39f272SZheng Fan : DialControlBmp(rParent) 375d39f272SZheng Fan { 385d39f272SZheng Fan } 395d39f272SZheng Fan 405d39f272SZheng Fan 415d39f272SZheng Fan 425d39f272SZheng Fan 435d39f272SZheng Fan SidebarDialControlBmp::~SidebarDialControlBmp (void) 445d39f272SZheng Fan { 455d39f272SZheng Fan } 465d39f272SZheng Fan 475d39f272SZheng Fan 485d39f272SZheng Fan 495d39f272SZheng Fan 505d39f272SZheng Fan void SidebarDialControlBmp::DrawElements ( 515d39f272SZheng Fan const String& rText, 525d39f272SZheng Fan sal_Int32 nAngle) 535d39f272SZheng Fan { 545d39f272SZheng Fan if (Application::GetSettings().GetLayoutRTL()) 555d39f272SZheng Fan nAngle = 18000 - nAngle; 565d39f272SZheng Fan double fAngle = nAngle * F_PI180 / 100.0; 575d39f272SZheng Fan double fSin = sin( fAngle ); 585d39f272SZheng Fan double fCos = cos( fAngle ); 595d39f272SZheng Fan DrawText( maRect, String(), mbEnabled ? 0 : TEXT_DRAW_DISABLE ); 605d39f272SZheng Fan const sal_Int32 nDx (fCos * (maRect.GetWidth()-4) / 2); 615d39f272SZheng Fan const sal_Int32 nDy (-fSin * (maRect.GetHeight()-4) / 2); 625d39f272SZheng Fan Point pt1( maRect.Center() ); 635d39f272SZheng Fan Point pt2( pt1.X() + nDx, pt1.Y() + nDy); 645d39f272SZheng Fan if ( ! sfx2::sidebar::Theme::IsHighContrastMode()) 655d39f272SZheng Fan SetLineColor( Color( 60, 93, 138 ) ); 665d39f272SZheng Fan else 675d39f272SZheng Fan SetLineColor(COL_BLACK);//Application::GetSettings().GetStyleSettings().GetFieldTextColor() 685d39f272SZheng Fan DrawLine( pt1, pt2 ); 695d39f272SZheng Fan } 705d39f272SZheng Fan 715d39f272SZheng Fan 725d39f272SZheng Fan 735d39f272SZheng Fan 745d39f272SZheng Fan void SidebarDialControlBmp::DrawBackground() 755d39f272SZheng Fan { 765d39f272SZheng Fan SetLineColor(); 775d39f272SZheng Fan SetFillColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Paint_PanelBackground)); 785d39f272SZheng Fan DrawRect(maRect); 795d39f272SZheng Fan 80*facb16e7SArmin Le Grand const BitmapEx aBitmapEx( 815d39f272SZheng Fan sfx2::sidebar::Theme::IsHighContrastMode() 825d39f272SZheng Fan ? SVX_RES(IMG_DIACONTROL_H) 835d39f272SZheng Fan : SVX_RES(IMG_DIACONTROL_NORMAL)); 84*facb16e7SArmin Le Grand // Size aImageSize(aBitmapEx.GetSizePixel()); 855d39f272SZheng Fan // aImageSize.Width() -= 1; 865d39f272SZheng Fan // aImageSize.Height() -= 1; 875d39f272SZheng Fan SetAntialiasing(ANTIALIASING_ENABLE_B2DDRAW | ANTIALIASING_PIXELSNAPHAIRLINE); 88*facb16e7SArmin Le Grand DrawBitmapEx(maRect.TopLeft(), /*aImageSize,*/ aBitmapEx); 895d39f272SZheng Fan } 905d39f272SZheng Fan 915d39f272SZheng Fan 925d39f272SZheng Fan } } // end of namespace svx::sidebar 93