1*b9e67834SAndre Fischer /************************************************************** 2*b9e67834SAndre Fischer * 3*b9e67834SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 4*b9e67834SAndre Fischer * or more contributor license agreements. See the NOTICE file 5*b9e67834SAndre Fischer * distributed with this work for additional information 6*b9e67834SAndre Fischer * regarding copyright ownership. The ASF licenses this file 7*b9e67834SAndre Fischer * to you under the Apache License, Version 2.0 (the 8*b9e67834SAndre Fischer * "License"); you may not use this file except in compliance 9*b9e67834SAndre Fischer * with the License. You may obtain a copy of the License at 10*b9e67834SAndre Fischer * 11*b9e67834SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 12*b9e67834SAndre Fischer * 13*b9e67834SAndre Fischer * Unless required by applicable law or agreed to in writing, 14*b9e67834SAndre Fischer * software distributed under the License is distributed on an 15*b9e67834SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b9e67834SAndre Fischer * KIND, either express or implied. See the License for the 17*b9e67834SAndre Fischer * specific language governing permissions and limitations 18*b9e67834SAndre Fischer * under the License. 19*b9e67834SAndre Fischer * 20*b9e67834SAndre Fischer *************************************************************/ 21*b9e67834SAndre Fischer 22*b9e67834SAndre Fischer #include "precompiled_svx.hxx" 23*b9e67834SAndre Fischer 24*b9e67834SAndre Fischer #include "TextPropertyPanel.hrc" 25*b9e67834SAndre Fischer #include "TextPropertyPanel.hxx" 26*b9e67834SAndre Fischer #include "SvxSBFontNameBox.hxx" 27*b9e67834SAndre Fischer 28*b9e67834SAndre Fischer #include "svx/dialmgr.hxx" 29*b9e67834SAndre Fischer 30*b9e67834SAndre Fischer #include <editeng/brshitem.hxx> 31*b9e67834SAndre Fischer #include <editeng/colritem.hxx> 32*b9e67834SAndre Fischer #include <editeng/crsditem.hxx> 33*b9e67834SAndre Fischer #include <editeng/escpitem.hxx> 34*b9e67834SAndre Fischer #include <editeng/flstitem.hxx> 35*b9e67834SAndre Fischer #include <editeng/fontitem.hxx> 36*b9e67834SAndre Fischer #include <editeng/kernitem.hxx> 37*b9e67834SAndre Fischer #include <editeng/postitem.hxx> 38*b9e67834SAndre Fischer #include <editeng/shdditem.hxx> 39*b9e67834SAndre Fischer #include <editeng/udlnitem.hxx> 40*b9e67834SAndre Fischer #include <editeng/wghtitem.hxx> 41*b9e67834SAndre Fischer #include <rtl/ref.hxx> 42*b9e67834SAndre Fischer #include <sfx2/dispatch.hxx> 43*b9e67834SAndre Fischer #include <sfx2/objsh.hxx> 44*b9e67834SAndre Fischer #include <sfx2/viewsh.hxx> 45*b9e67834SAndre Fischer #include <sfx2/sidebar/propertypanel.hrc> 46*b9e67834SAndre Fischer #include <sfx2/sidebar/ControlFactory.hxx> 47*b9e67834SAndre Fischer #include <sfx2/sidebar/Theme.hxx> 48*b9e67834SAndre Fischer #include <svtools/ctrltool.hxx> 49*b9e67834SAndre Fischer #include <svtools/unitconv.hxx> 50*b9e67834SAndre Fischer 51*b9e67834SAndre Fischer #include <vcl/gradient.hxx> 52*b9e67834SAndre Fischer #include <vcl/svapp.hxx> 53*b9e67834SAndre Fischer 54*b9e67834SAndre Fischer 55*b9e67834SAndre Fischer using namespace css; 56*b9e67834SAndre Fischer using namespace cssu; 57*b9e67834SAndre Fischer using ::sfx2::sidebar::Theme; 58*b9e67834SAndre Fischer 59*b9e67834SAndre Fischer #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) 60*b9e67834SAndre Fischer 61*b9e67834SAndre Fischer namespace svx { namespace sidebar { 62*b9e67834SAndre Fischer 63*b9e67834SAndre Fischer #undef HAS_IA2 64*b9e67834SAndre Fischer 65*b9e67834SAndre Fischer 66*b9e67834SAndre Fischer #define FONT_CONTROL_WIDTH 160 67*b9e67834SAndre Fischer #define SIZE_CONTROL_WIDTH 80 68*b9e67834SAndre Fischer #define CONTROL_COMBOX_HEIGHT 20 69*b9e67834SAndre Fischer #define CONTROL_HEIGHT_5X 120 70*b9e67834SAndre Fischer #define SIDEBAR_SPACE_NORMAL 0 71*b9e67834SAndre Fischer #define SIDEBAR_SPACE_EXPAND 1 72*b9e67834SAndre Fischer #define SIDEBAR_SPACE_CONDENSED 2 73*b9e67834SAndre Fischer #define SIDEBAR_SPACING_GLOBAL_VALUE String("PopupPanal_Spacing", 18, RTL_TEXTENCODING_ASCII_US) 74*b9e67834SAndre Fischer #define TEXT_SECTIONPAGE_HEIGHT_S SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) + CONTROL_SPACING_VERTICAL * 1 + SECTIONPAGE_MARGIN_VERTICAL_BOT 75*b9e67834SAndre Fischer #define TEXT_SECTIONPAGE_HEIGHT SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT 76*b9e67834SAndre Fischer 77*b9e67834SAndre Fischer // 78*b9e67834SAndre Fischer #define SPACING_NOCUSTOM 0 79*b9e67834SAndre Fischer #define SPACING_CLOSE_BY_CLICK_ICON -1 80*b9e67834SAndre Fischer #define SPACING_CLOSE_BY_CUS_EDIT 1 81*b9e67834SAndre Fischer //end 82*b9e67834SAndre Fischer 83*b9e67834SAndre Fischer 84*b9e67834SAndre Fischer 85*b9e67834SAndre Fischer 86*b9e67834SAndre Fischer 87*b9e67834SAndre Fischer Reference<ui::XUIElement> TextPropertyPanel::Create ( 88*b9e67834SAndre Fischer const ::rtl::OUString& rsResourceURL, 89*b9e67834SAndre Fischer Window* pParent, 90*b9e67834SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 91*b9e67834SAndre Fischer SfxBindings* pBindings) 92*b9e67834SAndre Fischer { 93*b9e67834SAndre Fischer if (pParent == NULL) 94*b9e67834SAndre Fischer throw lang::IllegalArgumentException(A2S("no parent Window given to TextPropertyPanel::Create"), NULL, 0); 95*b9e67834SAndre Fischer if ( ! rxFrame.is()) 96*b9e67834SAndre Fischer throw lang::IllegalArgumentException(A2S("no XFrame given to TextPropertyPanel::Create"), NULL, 1); 97*b9e67834SAndre Fischer if (pBindings == NULL) 98*b9e67834SAndre Fischer throw lang::IllegalArgumentException(A2S("no SfxBindings given to TextPropertyPanel::Create"), NULL, 2); 99*b9e67834SAndre Fischer 100*b9e67834SAndre Fischer ::rtl::Reference<TextPropertyPanel> pPanel ( 101*b9e67834SAndre Fischer new TextPropertyPanel( 102*b9e67834SAndre Fischer rsResourceURL, 103*b9e67834SAndre Fischer pParent, 104*b9e67834SAndre Fischer rxFrame, 105*b9e67834SAndre Fischer pBindings)); 106*b9e67834SAndre Fischer return Reference<ui::XUIElement>(static_cast<XWeak*>(pPanel.get()), UNO_QUERY); 107*b9e67834SAndre Fischer } 108*b9e67834SAndre Fischer 109*b9e67834SAndre Fischer 110*b9e67834SAndre Fischer 111*b9e67834SAndre Fischer 112*b9e67834SAndre Fischer TextPropertyPanel::TextPropertyPanel ( 113*b9e67834SAndre Fischer const ::rtl::OUString& rsResourceURL, 114*b9e67834SAndre Fischer Window* pParent, 115*b9e67834SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 116*b9e67834SAndre Fischer SfxBindings* pBindings) 117*b9e67834SAndre Fischer : ::sfx2::sidebar::SidebarPanelBase(rsResourceURL, pParent, rxFrame, SVX_RES(RID_SIDEBAR_TEXT_PANEL)), 118*b9e67834SAndre Fischer mpFontNameBox (new SvxSBFontNameBox(this, SVX_RES(CB_SBFONT_FONT))), 119*b9e67834SAndre Fischer maFontSizeBox (this, SVX_RES(MB_SBFONT_FONTSIZE)), 120*b9e67834SAndre Fischer mpToolBoxIncDec(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_INCREASE_DECREASE))), 121*b9e67834SAndre Fischer mpToolBoxFont(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_FONT))), 122*b9e67834SAndre Fischer mpToolBoxFontColor(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_FONTCOLOR))), 123*b9e67834SAndre Fischer mpToolBoxScript(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_SCRIPT))), 124*b9e67834SAndre Fischer mpToolBoxScriptSw(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_SCRIPT_SW))), 125*b9e67834SAndre Fischer mpToolBoxSpacing(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_SPACING))), 126*b9e67834SAndre Fischer mpToolBoxHighlight(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_HIGHLIGHT))), 127*b9e67834SAndre Fischer mpFontColorUpdater(), 128*b9e67834SAndre Fischer mpHighlightUpdater(), 129*b9e67834SAndre Fischer 130*b9e67834SAndre Fischer maFontNameControl (SID_ATTR_CHAR_FONT, *pBindings, *this), 131*b9e67834SAndre Fischer maFontSizeControl (SID_ATTR_CHAR_FONTHEIGHT, *pBindings, *this), 132*b9e67834SAndre Fischer maWeightControl (SID_ATTR_CHAR_WEIGHT, *pBindings, *this), 133*b9e67834SAndre Fischer maItalicControl (SID_ATTR_CHAR_POSTURE, *pBindings, *this), 134*b9e67834SAndre Fischer maUnderlineControl (SID_ATTR_CHAR_UNDERLINE, *pBindings, *this), 135*b9e67834SAndre Fischer maStrikeControl (SID_ATTR_CHAR_STRIKEOUT, *pBindings, *this), 136*b9e67834SAndre Fischer maShadowControl (SID_ATTR_CHAR_SHADOWED, *pBindings, *this), 137*b9e67834SAndre Fischer maFontColorControl (SID_ATTR_CHAR_COLOR, *pBindings, *this), 138*b9e67834SAndre Fischer maScriptControlSw (SID_ATTR_CHAR_ESCAPEMENT, *pBindings, *this), //for sw 139*b9e67834SAndre Fischer maSuperScriptControl (SID_SET_SUPER_SCRIPT, *pBindings, *this), 140*b9e67834SAndre Fischer maSubScriptControl (SID_SET_SUB_SCRIPT, *pBindings, *this), 141*b9e67834SAndre Fischer maSpacingControl (SID_ATTR_CHAR_KERNING, *pBindings, *this), 142*b9e67834SAndre Fischer maHighlightControl (SID_ATTR_BRUSH_CHAR, *pBindings, *this), 143*b9e67834SAndre Fischer maSDFontGrow (SID_GROW_FONT_SIZE, *pBindings, *this), 144*b9e67834SAndre Fischer maSDFontShrink (SID_SHRINK_FONT_SIZE, *pBindings, *this), 145*b9e67834SAndre Fischer 146*b9e67834SAndre Fischer maImgIncrease (SVX_RES( IMG_INCREASE)), 147*b9e67834SAndre Fischer maImgDecrease (SVX_RES( IMG_DECREASE)), 148*b9e67834SAndre Fischer maImgBold (SVX_RES( IMG_BOLD )), 149*b9e67834SAndre Fischer maImgItalic (SVX_RES( IMG_ITALIC )), 150*b9e67834SAndre Fischer maImgUnderline (SVX_RES( IMG_UNDERLINE )), 151*b9e67834SAndre Fischer maImgStrike (SVX_RES( IMG_STRIKEOUT )), 152*b9e67834SAndre Fischer maImgShadow (SVX_RES( IMG_SHADOWED )), 153*b9e67834SAndre Fischer maImgFontColor (SVX_RES( IMG_FONTCOLOR)), 154*b9e67834SAndre Fischer maImgSupScript (SVX_RES( IMG_SUPSCRIPT)), 155*b9e67834SAndre Fischer maImgSubScript (SVX_RES( IMG_SUBSCRIPT)), 156*b9e67834SAndre Fischer maImgHighlight (SVX_RES( IMG_HIGHLIGHT)), 157*b9e67834SAndre Fischer 158*b9e67834SAndre Fischer maImgNormalIcon (SVX_RES(IMG_SPACING_D)), 159*b9e67834SAndre Fischer 160*b9e67834SAndre Fischer maImgIncreaseHigh (SVX_RES( IMG_INCREASE_H )), 161*b9e67834SAndre Fischer maImgDecreaseHigh (SVX_RES( IMG_DECREASE_H )), 162*b9e67834SAndre Fischer maImgBoldHigh (SVX_RES( IMG_BOLD_H )), 163*b9e67834SAndre Fischer maImgItalicHigh (SVX_RES( IMG_ITALIC_H )), 164*b9e67834SAndre Fischer maImgUnderlineHigh (SVX_RES( IMG_UNDERLINE_H )), 165*b9e67834SAndre Fischer maImgStrikeHigh (SVX_RES( IMG_STRIKEOUT_H )), 166*b9e67834SAndre Fischer maImgShadowHigh (SVX_RES( IMG_SHADOWED_H )), 167*b9e67834SAndre Fischer maImgFontColorHigh (SVX_RES( IMG_FONTCOLOR_H)), 168*b9e67834SAndre Fischer maImgSupScriptHigh (SVX_RES( IMG_SUPSCRIPT_H)), 169*b9e67834SAndre Fischer maImgSubScriptHigh (SVX_RES( IMG_SUBSCRIPT_H)), 170*b9e67834SAndre Fischer maImgHighlightHigh (SVX_RES( IMG_HIGHLIGHT_H)), 171*b9e67834SAndre Fischer 172*b9e67834SAndre Fischer mpFontList (NULL), 173*b9e67834SAndre Fischer mbMustDelete (false), 174*b9e67834SAndre Fischer mbFocusOnFontSizeCtrl(false), 175*b9e67834SAndre Fischer /*AF 176*b9e67834SAndre Fischer mpFloatWinUnderline(NULL), 177*b9e67834SAndre Fischer mpPageUnderline(NULL), 178*b9e67834SAndre Fischer mpFloatWinFontColor(NULL), 179*b9e67834SAndre Fischer mpPageFontColor(NULL), 180*b9e67834SAndre Fischer mpFloatWinSpacing(NULL), 181*b9e67834SAndre Fischer mpPageSpacing(NULL) 182*b9e67834SAndre Fischer */ 183*b9e67834SAndre Fischer maContext(), 184*b9e67834SAndre Fischer mpBindings(pBindings) 185*b9e67834SAndre Fischer { 186*b9e67834SAndre Fischer Initialize(); 187*b9e67834SAndre Fischer FreeResource(); 188*b9e67834SAndre Fischer } 189*b9e67834SAndre Fischer 190*b9e67834SAndre Fischer 191*b9e67834SAndre Fischer 192*b9e67834SAndre Fischer 193*b9e67834SAndre Fischer TextPropertyPanel::~TextPropertyPanel (void) 194*b9e67834SAndre Fischer { 195*b9e67834SAndre Fischer if(mbMustDelete) 196*b9e67834SAndre Fischer delete mpFontList; 197*b9e67834SAndre Fischer 198*b9e67834SAndre Fischer /*AF 199*b9e67834SAndre Fischer delete mpPageUnderline; 200*b9e67834SAndre Fischer delete mpFloatWinUnderline; 201*b9e67834SAndre Fischer 202*b9e67834SAndre Fischer delete mpPageFontColor; 203*b9e67834SAndre Fischer delete mpFloatWinFontColor; 204*b9e67834SAndre Fischer 205*b9e67834SAndre Fischer delete mpPageSpacing; 206*b9e67834SAndre Fischer delete mpFloatWinSpacing; 207*b9e67834SAndre Fischer */ 208*b9e67834SAndre Fischer } 209*b9e67834SAndre Fischer 210*b9e67834SAndre Fischer 211*b9e67834SAndre Fischer 212*b9e67834SAndre Fischer 213*b9e67834SAndre Fischer void TextPropertyPanel::HandleContextChange ( 214*b9e67834SAndre Fischer const ::sfx2::sidebar::EnumContext aContext) 215*b9e67834SAndre Fischer { 216*b9e67834SAndre Fischer if (maContext == aContext) 217*b9e67834SAndre Fischer { 218*b9e67834SAndre Fischer // Nothing to do. 219*b9e67834SAndre Fischer return; 220*b9e67834SAndre Fischer } 221*b9e67834SAndre Fischer 222*b9e67834SAndre Fischer maContext = aContext; 223*b9e67834SAndre Fischer switch (maContext.GetCombinedContext()) 224*b9e67834SAndre Fischer { 225*b9e67834SAndre Fischer case CombinedEnumContext(Application_Calc, Context_Cell): 226*b9e67834SAndre Fischer case CombinedEnumContext(Application_Calc, Context_Pivot): 227*b9e67834SAndre Fischer { 228*b9e67834SAndre Fischer mpToolBoxScript->Hide(); 229*b9e67834SAndre Fischer mpToolBoxScriptSw->Hide(); 230*b9e67834SAndre Fischer mpToolBoxSpacing->Hide(); 231*b9e67834SAndre Fischer mpToolBoxHighlight->Hide(); 232*b9e67834SAndre Fischer 233*b9e67834SAndre Fischer Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT_S); 234*b9e67834SAndre Fischer aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 235*b9e67834SAndre Fischer aSize.setWidth(GetOutputSizePixel().Width()); 236*b9e67834SAndre Fischer SetSizePixel(aSize); 237*b9e67834SAndre Fischer break; 238*b9e67834SAndre Fischer } 239*b9e67834SAndre Fischer 240*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_Text): 241*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_Table): 242*b9e67834SAndre Fischer { 243*b9e67834SAndre Fischer mpToolBoxScriptSw->Show(); 244*b9e67834SAndre Fischer mpToolBoxScript->Hide(); 245*b9e67834SAndre Fischer mpToolBoxHighlight->Show(); 246*b9e67834SAndre Fischer mpToolBoxSpacing->Show(); 247*b9e67834SAndre Fischer 248*b9e67834SAndre Fischer Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT); 249*b9e67834SAndre Fischer aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 250*b9e67834SAndre Fischer aSize.setWidth(GetOutputSizePixel().Width()); 251*b9e67834SAndre Fischer SetSizePixel(aSize); 252*b9e67834SAndre Fischer break; 253*b9e67834SAndre Fischer } 254*b9e67834SAndre Fischer 255*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_DrawText): 256*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_Annotation): 257*b9e67834SAndre Fischer { 258*b9e67834SAndre Fischer mpToolBoxScriptSw->Show(); 259*b9e67834SAndre Fischer mpToolBoxScript->Hide(); 260*b9e67834SAndre Fischer mpToolBoxSpacing->Show(); 261*b9e67834SAndre Fischer mpToolBoxHighlight->Hide(); 262*b9e67834SAndre Fischer 263*b9e67834SAndre Fischer Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT); 264*b9e67834SAndre Fischer aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 265*b9e67834SAndre Fischer aSize.setWidth(GetOutputSizePixel().Width()); 266*b9e67834SAndre Fischer SetSizePixel(aSize); 267*b9e67834SAndre Fischer break; 268*b9e67834SAndre Fischer } 269*b9e67834SAndre Fischer 270*b9e67834SAndre Fischer case CombinedEnumContext(Application_Calc, Context_EditCell): 271*b9e67834SAndre Fischer case CombinedEnumContext(Application_Calc, Context_DrawText): 272*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_DrawText): 273*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Text): 274*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Table): 275*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_OutlineText): 276*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Draw): 277*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_TextObject): 278*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Graphic): 279*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_DrawText): 280*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Text): 281*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Table): 282*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_OutlineText): 283*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Draw): 284*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_TextObject): 285*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Graphic): 286*b9e67834SAndre Fischer { 287*b9e67834SAndre Fischer mpToolBoxScriptSw->Hide(); 288*b9e67834SAndre Fischer mpToolBoxScript->Show(); 289*b9e67834SAndre Fischer mpToolBoxSpacing->Show(); 290*b9e67834SAndre Fischer mpToolBoxHighlight->Hide(); 291*b9e67834SAndre Fischer 292*b9e67834SAndre Fischer Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT); 293*b9e67834SAndre Fischer aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) ); 294*b9e67834SAndre Fischer aSize.setWidth(GetOutputSizePixel().Width()); 295*b9e67834SAndre Fischer SetSizePixel(aSize); 296*b9e67834SAndre Fischer break; 297*b9e67834SAndre Fischer } 298*b9e67834SAndre Fischer 299*b9e67834SAndre Fischer default: 300*b9e67834SAndre Fischer break; 301*b9e67834SAndre Fischer } 302*b9e67834SAndre Fischer } 303*b9e67834SAndre Fischer 304*b9e67834SAndre Fischer 305*b9e67834SAndre Fischer 306*b9e67834SAndre Fischer 307*b9e67834SAndre Fischer void TextPropertyPanel::PaintRect(const ToolBox &rTB) 308*b9e67834SAndre Fischer { 309*b9e67834SAndre Fischer Point aPos = rTB.GetPosPixel(); 310*b9e67834SAndre Fischer Size aSize = rTB.GetSizePixel(); 311*b9e67834SAndre Fischer Rectangle aRect( aPos, aSize ); 312*b9e67834SAndre Fischer aRect.Left() -= 2; 313*b9e67834SAndre Fischer aRect.Top() -= 1; 314*b9e67834SAndre Fischer aRect.Right() += 2; 315*b9e67834SAndre Fischer aRect.Bottom() += 1; 316*b9e67834SAndre Fischer Color aOldLineColor = GetLineColor(); 317*b9e67834SAndre Fischer Color aOldFillColor = GetFillColor(); 318*b9e67834SAndre Fischer Color aLineColor(200,209,225); 319*b9e67834SAndre Fischer // Color aLineColor = GetSettings().GetStyleSettings().GetPropertySectionTBxBorderColor(); 320*b9e67834SAndre Fischer if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 321*b9e67834SAndre Fischer SetLineColor(aLineColor); 322*b9e67834SAndre Fischer else 323*b9e67834SAndre Fischer SetLineColor(GetSettings().GetStyleSettings().GetShadowColor()); 324*b9e67834SAndre Fischer SetFillColor(COL_TRANSPARENT); 325*b9e67834SAndre Fischer DrawRect(aRect); 326*b9e67834SAndre Fischer 327*b9e67834SAndre Fischer aRect.Left() += 1 ; 328*b9e67834SAndre Fischer aRect.Top() += 1; 329*b9e67834SAndre Fischer aRect.Right() -= 1; 330*b9e67834SAndre Fischer aRect.Bottom() -= 1; 331*b9e67834SAndre Fischer Color aStartColor(220,228,238); 332*b9e67834SAndre Fischer Color aEndColor(245,245,247); 333*b9e67834SAndre Fischer Gradient aBKGrad(GRADIENT_LINEAR, aStartColor, aEndColor); 334*b9e67834SAndre Fischer if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 335*b9e67834SAndre Fischer // DrawGradient(aRect, GetSettings().GetStyleSettings().GetPropertySectionTBxBKGGradient()); 336*b9e67834SAndre Fischer DrawGradient(aRect, aBKGrad); 337*b9e67834SAndre Fischer //else 338*b9e67834SAndre Fischer //{ 339*b9e67834SAndre Fischer // SetFillColor(GetSettings().GetStyleSettings().GetMenuColor()); 340*b9e67834SAndre Fischer // DrawRect(aRect); 341*b9e67834SAndre Fischer //} 342*b9e67834SAndre Fischer 343*b9e67834SAndre Fischer SetLineColor(aOldLineColor); 344*b9e67834SAndre Fischer SetFillColor(aOldFillColor); 345*b9e67834SAndre Fischer } 346*b9e67834SAndre Fischer 347*b9e67834SAndre Fischer 348*b9e67834SAndre Fischer 349*b9e67834SAndre Fischer 350*b9e67834SAndre Fischer void TextPropertyPanel::Paint(const Rectangle &rRect) 351*b9e67834SAndre Fischer { 352*b9e67834SAndre Fischer SidebarPanelBase::Paint(rRect); 353*b9e67834SAndre Fischer 354*b9e67834SAndre Fischer if(mpFontColorUpdater == NULL && mpHighlightUpdater == NULL) 355*b9e67834SAndre Fischer return; 356*b9e67834SAndre Fischer 357*b9e67834SAndre Fischer //size increase & decrease 358*b9e67834SAndre Fischer //AF PaintRect(*mpToolBoxIncDec); 359*b9e67834SAndre Fischer 360*b9e67834SAndre Fischer //Font Toolbox 361*b9e67834SAndre Fischer PaintRect(*mpToolBoxFont); 362*b9e67834SAndre Fischer 363*b9e67834SAndre Fischer //font color toolbox 364*b9e67834SAndre Fischer PaintRect(*mpToolBoxFontColor); 365*b9e67834SAndre Fischer 366*b9e67834SAndre Fischer //script for sw 367*b9e67834SAndre Fischer switch (maContext.GetCombinedContext()) 368*b9e67834SAndre Fischer { 369*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_Text): 370*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_Table): 371*b9e67834SAndre Fischer PaintRect(*mpToolBoxHighlight); 372*b9e67834SAndre Fischer // fall through 373*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_DrawText): 374*b9e67834SAndre Fischer case CombinedEnumContext(Application_Writer, Context_Annotation): 375*b9e67834SAndre Fischer PaintRect(*mpToolBoxScriptSw); 376*b9e67834SAndre Fischer break; 377*b9e67834SAndre Fischer 378*b9e67834SAndre Fischer case CombinedEnumContext(Application_Calc, Context_EditCell): 379*b9e67834SAndre Fischer case CombinedEnumContext(Application_Calc, Context_DrawText): 380*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_DrawText): 381*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Text): 382*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Table): 383*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_OutlineText): 384*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Draw): 385*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_TextObject): 386*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Graphic): 387*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_DrawText): 388*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Text): 389*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Table): 390*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_OutlineText): 391*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Draw): 392*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_TextObject): 393*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Graphic): 394*b9e67834SAndre Fischer PaintRect(*mpToolBoxScript); 395*b9e67834SAndre Fischer break; 396*b9e67834SAndre Fischer } 397*b9e67834SAndre Fischer 398*b9e67834SAndre Fischer if (maContext.GetCombinedContext() != CombinedEnumContext(Application_Calc, Context_Cell)) 399*b9e67834SAndre Fischer { 400*b9e67834SAndre Fischer PaintRect(*mpToolBoxSpacing); 401*b9e67834SAndre Fischer } 402*b9e67834SAndre Fischer } 403*b9e67834SAndre Fischer 404*b9e67834SAndre Fischer 405*b9e67834SAndre Fischer 406*b9e67834SAndre Fischer 407*b9e67834SAndre Fischer void TextPropertyPanel::DataChanged (const DataChangedEvent& rEvent) 408*b9e67834SAndre Fischer { 409*b9e67834SAndre Fischer SetupIcons(); 410*b9e67834SAndre Fischer } 411*b9e67834SAndre Fischer 412*b9e67834SAndre Fischer 413*b9e67834SAndre Fischer 414*b9e67834SAndre Fischer void TextPropertyPanel::Initialize (void) 415*b9e67834SAndre Fischer { 416*b9e67834SAndre Fischer //<<modify fill font list 417*b9e67834SAndre Fischer SfxObjectShell* pDocSh = SfxObjectShell::Current(); 418*b9e67834SAndre Fischer const SfxPoolItem* pItem = NULL; 419*b9e67834SAndre Fischer 420*b9e67834SAndre Fischer if (pDocSh != NULL) 421*b9e67834SAndre Fischer pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); 422*b9e67834SAndre Fischer if (pItem != NULL) 423*b9e67834SAndre Fischer mpFontList = ( (SvxFontListItem*)pItem )->GetFontList(); 424*b9e67834SAndre Fischer else 425*b9e67834SAndre Fischer { 426*b9e67834SAndre Fischer mpFontList = new FontList( Application::GetDefaultDevice() ); 427*b9e67834SAndre Fischer mbMustDelete = 1; 428*b9e67834SAndre Fischer } 429*b9e67834SAndre Fischer 430*b9e67834SAndre Fischer mpFontNameBox->SetAccessibleName(mpFontNameBox->GetQuickHelpText()); 431*b9e67834SAndre Fischer maFontSizeBox.Fill( &mpFontList->Get( String::CreateFromAscii( "" ), String::CreateFromAscii( "" )),mpFontList ); 432*b9e67834SAndre Fischer maFontSizeBox.SetAccessibleName(maFontSizeBox.GetQuickHelpText()); 433*b9e67834SAndre Fischer 434*b9e67834SAndre Fischer //toolbox 435*b9e67834SAndre Fischer SetupIcons(); 436*b9e67834SAndre Fischer InitToolBoxIncDec(); 437*b9e67834SAndre Fischer InitToolBoxFont(); 438*b9e67834SAndre Fischer InitToolBoxFontColor(); 439*b9e67834SAndre Fischer InitToolBoxScript(); 440*b9e67834SAndre Fischer InitToolBoxSpacing(); 441*b9e67834SAndre Fischer InitToolBoxHighlight(); 442*b9e67834SAndre Fischer 443*b9e67834SAndre Fischer #ifdef HAS_IA2 444*b9e67834SAndre Fischer mpFontNameBox->SetAccRelationLabeledBy(&maFontNameBox); 445*b9e67834SAndre Fischer mpFontNameBox->SetMpSubEditAccLableBy(&maFontNameBox); 446*b9e67834SAndre Fischer maFontSizeBox.SetAccRelationLabeledBy(&maFontSizeBox); 447*b9e67834SAndre Fischer maFontSizeBox.SetMpSubEditAccLableBy(&maFontSizeBox); 448*b9e67834SAndre Fischer maToolBoxFont.SetAccRelationLabeledBy(&maToolBoxFont); 449*b9e67834SAndre Fischer maToolBoxIncDec.SetAccRelationLabeledBy(&maToolBoxIncDec); 450*b9e67834SAndre Fischer maToolBoxFontColor.SetAccRelationLabeledBy(&maToolBoxFontColor); 451*b9e67834SAndre Fischer maToolBoxScript.SetAccRelationLabeledBy(&maToolBoxScript); 452*b9e67834SAndre Fischer maToolBoxScriptSw.SetAccRelationLabeledBy(&maToolBoxScriptSw); 453*b9e67834SAndre Fischer maToolBoxSpacing.SetAccRelationLabeledBy(&maToolBoxSpacing); 454*b9e67834SAndre Fischer maToolBoxHighlight.SetAccRelationLabeledBy(&maToolBoxHighlight); 455*b9e67834SAndre Fischer #endif 456*b9e67834SAndre Fischer 457*b9e67834SAndre Fischer //init state 458*b9e67834SAndre Fischer mpHeightItem = NULL; 459*b9e67834SAndre Fischer meWeight = WEIGHT_NORMAL; 460*b9e67834SAndre Fischer meItalic = ITALIC_NONE; 461*b9e67834SAndre Fischer mbShadow = false; 462*b9e67834SAndre Fischer meStrike = STRIKEOUT_NONE; 463*b9e67834SAndre Fischer mbPostureAvailable = true; 464*b9e67834SAndre Fischer mbWeightAvailable = true; 465*b9e67834SAndre Fischer meUnderline = UNDERLINE_NONE; 466*b9e67834SAndre Fischer meUnderlineColor = COL_AUTO; // 467*b9e67834SAndre Fischer maColor = COL_BLACK; 468*b9e67834SAndre Fischer mbColorAvailable = true; 469*b9e67834SAndre Fischer maBackColor = COL_AUTO; 470*b9e67834SAndre Fischer mbBackColorAvailable = true; 471*b9e67834SAndre Fischer meColorType = FONT_COLOR; 472*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_OFF; 473*b9e67834SAndre Fischer mbSuper = false; 474*b9e67834SAndre Fischer mbSub = false; 475*b9e67834SAndre Fischer mbKernAvailable = true; 476*b9e67834SAndre Fischer mbKernLBAvailable = true; 477*b9e67834SAndre Fischer mlKerning = 0; 478*b9e67834SAndre Fischer mpFontColorUpdater.reset(new ToolboxButtonColorUpdater( 479*b9e67834SAndre Fischer SID_ATTR_CHAR_COLOR, 480*b9e67834SAndre Fischer TBI_FONTCOLOR, 481*b9e67834SAndre Fischer mpToolBoxFontColor.get(), 482*b9e67834SAndre Fischer TBX_UPDATER_MODE_CHAR_COLOR_NEW)); 483*b9e67834SAndre Fischer mpHighlightUpdater.reset(new ToolboxButtonColorUpdater( 484*b9e67834SAndre Fischer SID_ATTR_BRUSH_CHAR, 485*b9e67834SAndre Fischer TBI_HIGHLIGHT, 486*b9e67834SAndre Fischer mpToolBoxHighlight.get(), 487*b9e67834SAndre Fischer TBX_UPDATER_MODE_CHAR_COLOR_NEW)); 488*b9e67834SAndre Fischer 489*b9e67834SAndre Fischer //set handler 490*b9e67834SAndre Fischer mpFontNameBox->SetBindings(mpBindings); 491*b9e67834SAndre Fischer //add 492*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, FontSelHdl); 493*b9e67834SAndre Fischer mpFontNameBox->SetSelectHdl(aLink); 494*b9e67834SAndre Fischer //add end 495*b9e67834SAndre Fischer 496*b9e67834SAndre Fischer aLink = LINK(this, TextPropertyPanel, FontSizeModifyHdl); 497*b9e67834SAndre Fischer maFontSizeBox.SetModifyHdl(aLink); 498*b9e67834SAndre Fischer //add 499*b9e67834SAndre Fischer aLink = LINK(this, TextPropertyPanel, FontSizeSelHdl); 500*b9e67834SAndre Fischer maFontSizeBox.SetSelectHdl(aLink); 501*b9e67834SAndre Fischer //add end 502*b9e67834SAndre Fischer aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus); 503*b9e67834SAndre Fischer maFontSizeBox.SetLoseFocusHdl(aLink); 504*b9e67834SAndre Fischer 505*b9e67834SAndre Fischer // add 506*b9e67834SAndre Fischer long aSizeBoxHeight = maFontSizeBox.GetSizePixel().getHeight();; 507*b9e67834SAndre Fischer Point aPosFontSize = maFontSizeBox.GetPosPixel(); 508*b9e67834SAndre Fischer long aPosY = aPosFontSize.getY(); 509*b9e67834SAndre Fischer Point pTBIncDec = mpToolBoxIncDec->GetPosPixel(); 510*b9e67834SAndre Fischer long aIncDecHeight = mpToolBoxIncDec->GetSizePixel().getHeight(); 511*b9e67834SAndre Fischer pTBIncDec.setY(aPosY+aSizeBoxHeight/2-aIncDecHeight/2); 512*b9e67834SAndre Fischer mpToolBoxIncDec->SetPosPixel(pTBIncDec); 513*b9e67834SAndre Fischer //end 514*b9e67834SAndre Fischer } 515*b9e67834SAndre Fischer 516*b9e67834SAndre Fischer 517*b9e67834SAndre Fischer 518*b9e67834SAndre Fischer 519*b9e67834SAndre Fischer void TextPropertyPanel::InitToolBoxFont() 520*b9e67834SAndre Fischer { 521*b9e67834SAndre Fischer mpToolBoxFont->SetQuickHelpText(TBI_BOLD,String(SVX_RES(STR_QH_BOLD))); //Add 522*b9e67834SAndre Fischer mpToolBoxFont->SetQuickHelpText(TBI_ITALIC,String(SVX_RES(STR_QH_ITALIC))); //Add 523*b9e67834SAndre Fischer mpToolBoxFont->SetQuickHelpText(TBI_UNDERLINE,String(SVX_RES(STR_QH_UNDERLINE))); //Add 524*b9e67834SAndre Fischer mpToolBoxFont->SetBackground(Wallpaper()); 525*b9e67834SAndre Fischer mpToolBoxFont->SetPaintTransparent(true); 526*b9e67834SAndre Fischer 527*b9e67834SAndre Fischer Size aTbxSize( mpToolBoxFont->CalcWindowSizePixel() ); 528*b9e67834SAndre Fischer mpToolBoxFont->SetOutputSizePixel( aTbxSize ); 529*b9e67834SAndre Fischer 530*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, ToolboxFontSelectHandler); 531*b9e67834SAndre Fischer mpToolBoxFont->SetSelectHdl ( aLink ); 532*b9e67834SAndre Fischer aLink = LINK(this, TextPropertyPanel, ToolBoxUnderlineClickHdl); 533*b9e67834SAndre Fischer mpToolBoxFont->SetDropdownClickHdl(aLink); 534*b9e67834SAndre Fischer } 535*b9e67834SAndre Fischer 536*b9e67834SAndre Fischer 537*b9e67834SAndre Fischer 538*b9e67834SAndre Fischer 539*b9e67834SAndre Fischer void TextPropertyPanel::InitToolBoxIncDec() 540*b9e67834SAndre Fischer { 541*b9e67834SAndre Fischer Size aTbxSize( mpToolBoxIncDec->CalcWindowSizePixel() ); 542*b9e67834SAndre Fischer mpToolBoxIncDec->SetOutputSizePixel( aTbxSize ); 543*b9e67834SAndre Fischer 544*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, ToolboxIncDecSelectHdl); 545*b9e67834SAndre Fischer mpToolBoxIncDec->SetSelectHdl ( aLink ); 546*b9e67834SAndre Fischer } 547*b9e67834SAndre Fischer 548*b9e67834SAndre Fischer 549*b9e67834SAndre Fischer 550*b9e67834SAndre Fischer 551*b9e67834SAndre Fischer void TextPropertyPanel::InitToolBoxFontColor() 552*b9e67834SAndre Fischer { 553*b9e67834SAndre Fischer Size aTbxSize( mpToolBoxFontColor->CalcWindowSizePixel() ); 554*b9e67834SAndre Fischer mpToolBoxFontColor->SetOutputSizePixel( aTbxSize ); 555*b9e67834SAndre Fischer mpToolBoxFontColor->SetItemBits( TBI_FONTCOLOR, mpToolBoxFontColor->GetItemBits( TBI_FONTCOLOR ) | TIB_DROPDOWNONLY ); 556*b9e67834SAndre Fischer mpToolBoxFontColor->SetBackground(Wallpaper()); 557*b9e67834SAndre Fischer mpToolBoxFontColor->SetPaintTransparent(true); 558*b9e67834SAndre Fischer 559*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, ToolBoxFontColorDropHdl); 560*b9e67834SAndre Fischer mpToolBoxFontColor->SetDropdownClickHdl ( aLink ); 561*b9e67834SAndre Fischer mpToolBoxFontColor->SetSelectHdl ( aLink ); 562*b9e67834SAndre Fischer 563*b9e67834SAndre Fischer } 564*b9e67834SAndre Fischer void TextPropertyPanel::InitToolBoxScript() 565*b9e67834SAndre Fischer { 566*b9e67834SAndre Fischer Size aTbxSize( mpToolBoxScriptSw->CalcWindowSizePixel() ); 567*b9e67834SAndre Fischer mpToolBoxScriptSw->SetOutputSizePixel( aTbxSize ); 568*b9e67834SAndre Fischer mpToolBoxScriptSw->SetBackground(Wallpaper()); 569*b9e67834SAndre Fischer mpToolBoxScriptSw->SetPaintTransparent(true); 570*b9e67834SAndre Fischer 571*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, ToolBoxSwScriptSelectHdl); 572*b9e67834SAndre Fischer mpToolBoxScriptSw->SetSelectHdl ( aLink ); 573*b9e67834SAndre Fischer 574*b9e67834SAndre Fischer aTbxSize = mpToolBoxScript->CalcWindowSizePixel() ; 575*b9e67834SAndre Fischer mpToolBoxScript->SetOutputSizePixel( aTbxSize ); 576*b9e67834SAndre Fischer mpToolBoxScript->SetBackground(Wallpaper()); 577*b9e67834SAndre Fischer mpToolBoxScript->SetPaintTransparent(true); 578*b9e67834SAndre Fischer 579*b9e67834SAndre Fischer aLink = LINK(this, TextPropertyPanel, ToolBoxScriptSelectHdl); 580*b9e67834SAndre Fischer mpToolBoxScript->SetSelectHdl ( aLink ); 581*b9e67834SAndre Fischer } 582*b9e67834SAndre Fischer void TextPropertyPanel::InitToolBoxSpacing() 583*b9e67834SAndre Fischer { 584*b9e67834SAndre Fischer Size aTbxSize( mpToolBoxSpacing->CalcWindowSizePixel() ); 585*b9e67834SAndre Fischer mpToolBoxSpacing->SetOutputSizePixel( aTbxSize ); 586*b9e67834SAndre Fischer mpToolBoxSpacing->SetItemBits( TBI_SPACING, mpToolBoxSpacing->GetItemBits( TBI_SPACING ) | TIB_DROPDOWNONLY ); 587*b9e67834SAndre Fischer mpToolBoxSpacing->SetBackground(Wallpaper()); 588*b9e67834SAndre Fischer mpToolBoxSpacing->SetPaintTransparent(true); 589*b9e67834SAndre Fischer 590*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, SpacingClickHdl); 591*b9e67834SAndre Fischer mpToolBoxSpacing->SetDropdownClickHdl ( aLink ); 592*b9e67834SAndre Fischer mpToolBoxSpacing->SetSelectHdl( aLink ); 593*b9e67834SAndre Fischer } 594*b9e67834SAndre Fischer void TextPropertyPanel::InitToolBoxHighlight() 595*b9e67834SAndre Fischer { 596*b9e67834SAndre Fischer Size aTbxSize( mpToolBoxHighlight->CalcWindowSizePixel() ); 597*b9e67834SAndre Fischer mpToolBoxHighlight->SetOutputSizePixel( aTbxSize ); 598*b9e67834SAndre Fischer mpToolBoxHighlight->SetItemBits( TBI_HIGHLIGHT, mpToolBoxHighlight->GetItemBits( TBI_HIGHLIGHT ) | TIB_DROPDOWNONLY ); 599*b9e67834SAndre Fischer mpToolBoxHighlight->SetBackground(Wallpaper()); 600*b9e67834SAndre Fischer mpToolBoxHighlight->SetPaintTransparent(true); 601*b9e67834SAndre Fischer 602*b9e67834SAndre Fischer Link aLink = LINK(this, TextPropertyPanel, ToolBoxHighlightDropHdl); 603*b9e67834SAndre Fischer mpToolBoxHighlight->SetDropdownClickHdl ( aLink ); 604*b9e67834SAndre Fischer mpToolBoxHighlight->SetSelectHdl( aLink ); 605*b9e67834SAndre Fischer } 606*b9e67834SAndre Fischer 607*b9e67834SAndre Fischer 608*b9e67834SAndre Fischer 609*b9e67834SAndre Fischer 610*b9e67834SAndre Fischer void TextPropertyPanel::SetupIcons (void) 611*b9e67834SAndre Fischer { 612*b9e67834SAndre Fischer if (Theme::GetBoolean(Theme::Bool_UseSymphonyIcons)) 613*b9e67834SAndre Fischer { 614*b9e67834SAndre Fischer mpToolBoxIncDec->SetItemImage(TBI_INCREASE, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgIncreaseHigh : maImgIncrease); 615*b9e67834SAndre Fischer mpToolBoxIncDec->SetItemImage(TBI_DECREASE, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgDecreaseHigh : maImgDecrease); 616*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_BOLD, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgBoldHigh : maImgBold); 617*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_ITALIC, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgItalicHigh : maImgItalic); 618*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_UNDERLINE, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgUnderlineHigh : maImgUnderline); 619*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_STRIKEOUT, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgStrikeHigh : maImgStrike); 620*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_SHADOWED, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgShadowHigh : maImgShadow); 621*b9e67834SAndre Fischer 622*b9e67834SAndre Fischer mpToolBoxFontColor->SetItemImage(TBI_FONTCOLOR, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgFontColorHigh : maImgFontColor); 623*b9e67834SAndre Fischer //for sw 624*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemImage(TBI_SUPER_SW, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgSupScriptHigh : maImgSupScript); 625*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemImage(TBI_SUB_SW, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgSubScriptHigh : maImgSubScript); 626*b9e67834SAndre Fischer //for sc and sd 627*b9e67834SAndre Fischer mpToolBoxScript->SetItemImage(TBI_SUPER, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgSupScriptHigh : maImgSupScript); 628*b9e67834SAndre Fischer mpToolBoxScript->SetItemImage(TBI_SUB, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgSubScriptHigh : maImgSubScript); 629*b9e67834SAndre Fischer mpToolBoxSpacing->SetItemImage(TBI_SPACING, maImgNormalIcon); 630*b9e67834SAndre Fischer mpToolBoxHighlight->SetItemImage(TBI_HIGHLIGHT, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgHighlightHigh : maImgHighlight); 631*b9e67834SAndre Fischer } 632*b9e67834SAndre Fischer else 633*b9e67834SAndre Fischer { 634*b9e67834SAndre Fischer mpToolBoxIncDec->SetItemImage(TBI_INCREASE, GetIcon(A2S(".uno:Grow"))); 635*b9e67834SAndre Fischer mpToolBoxIncDec->SetItemImage(TBI_DECREASE, GetIcon(A2S(".uno:Shrink"))); 636*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_BOLD, GetIcon(A2S(".uno:Bold"))); 637*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_ITALIC, GetIcon(A2S(".uno:Italic"))); 638*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_UNDERLINE, GetIcon(A2S(".uno:Underline"))); 639*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_STRIKEOUT, GetIcon(A2S(".uno:Strikeout"))); 640*b9e67834SAndre Fischer mpToolBoxFont->SetItemImage(TBI_SHADOWED, GetIcon(A2S(".uno:Shadowed"))); 641*b9e67834SAndre Fischer 642*b9e67834SAndre Fischer mpToolBoxFontColor->SetItemImage(TBI_FONTCOLOR, GetIcon(A2S(".uno:FontColor"))); 643*b9e67834SAndre Fischer //for sw 644*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemImage(TBI_SUPER_SW, GetIcon(A2S(".uno:SuperScript"))); 645*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemImage(TBI_SUB_SW, GetIcon(A2S(".uno:SubScript"))); 646*b9e67834SAndre Fischer //for sc and sd 647*b9e67834SAndre Fischer mpToolBoxScript->SetItemImage(TBI_SUPER, GetIcon(A2S(".uno:SuperScript"))); 648*b9e67834SAndre Fischer mpToolBoxScript->SetItemImage(TBI_SUB, GetIcon(A2S(".uno:SubScript"))); 649*b9e67834SAndre Fischer mpToolBoxSpacing->SetItemImage(TBI_SPACING, GetIcon(A2S(".uno:FontworkCharacterSpacingFloater"))); 650*b9e67834SAndre Fischer mpToolBoxHighlight->SetItemImage(TBI_HIGHLIGHT, GetIcon(A2S(".uno:BackColor"))); 651*b9e67834SAndre Fischer } 652*b9e67834SAndre Fischer } 653*b9e67834SAndre Fischer 654*b9e67834SAndre Fischer 655*b9e67834SAndre Fischer 656*b9e67834SAndre Fischer 657*b9e67834SAndre Fischer IMPL_LINK( TextPropertyPanel, FontSelHdl, FontNameBox*, pBox ) 658*b9e67834SAndre Fischer { 659*b9e67834SAndre Fischer if ( !pBox->IsTravelSelect() ) 660*b9e67834SAndre Fischer { 661*b9e67834SAndre Fischer if( SfxViewShell::Current() ) 662*b9e67834SAndre Fischer { 663*b9e67834SAndre Fischer Window* pShellWnd = SfxViewShell::Current()->GetWindow(); 664*b9e67834SAndre Fischer 665*b9e67834SAndre Fischer if ( pShellWnd ) 666*b9e67834SAndre Fischer pShellWnd->GrabFocus(); 667*b9e67834SAndre Fischer } 668*b9e67834SAndre Fischer } 669*b9e67834SAndre Fischer return 0; 670*b9e67834SAndre Fischer } 671*b9e67834SAndre Fischer //add end 672*b9e67834SAndre Fischer IMPL_LINK( TextPropertyPanel, FontSizeModifyHdl, FontSizeBox*, pSizeBox ) 673*b9e67834SAndre Fischer { 674*b9e67834SAndre Fischer if (pSizeBox == &maFontSizeBox) 675*b9e67834SAndre Fischer { 676*b9e67834SAndre Fischer long nSize = pSizeBox->GetValue(); 677*b9e67834SAndre Fischer mbFocusOnFontSizeCtrl = true; 678*b9e67834SAndre Fischer 679*b9e67834SAndre Fischer float fSize = (float)nSize / 10; 680*b9e67834SAndre Fischer SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric(); 681*b9e67834SAndre Fischer SvxFontHeightItem aItem( CalcToUnit( fSize, eUnit ), 100, SID_ATTR_CHAR_FONTHEIGHT ) ; 682*b9e67834SAndre Fischer 683*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L ); 684*b9e67834SAndre Fischer mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false); 685*b9e67834SAndre Fischer } 686*b9e67834SAndre Fischer return 0; 687*b9e67834SAndre Fischer } 688*b9e67834SAndre Fischer //add 689*b9e67834SAndre Fischer IMPL_LINK( TextPropertyPanel, FontSizeSelHdl, FontSizeBox*, pSizeBox ) 690*b9e67834SAndre Fischer { 691*b9e67834SAndre Fischer if ( !pSizeBox->IsTravelSelect() ) 692*b9e67834SAndre Fischer { 693*b9e67834SAndre Fischer if( SfxViewShell::Current() ) 694*b9e67834SAndre Fischer { 695*b9e67834SAndre Fischer Window* pShellWnd = SfxViewShell::Current()->GetWindow(); 696*b9e67834SAndre Fischer 697*b9e67834SAndre Fischer if ( pShellWnd ) 698*b9e67834SAndre Fischer pShellWnd->GrabFocus(); 699*b9e67834SAndre Fischer } 700*b9e67834SAndre Fischer } 701*b9e67834SAndre Fischer 702*b9e67834SAndre Fischer return 0; 703*b9e67834SAndre Fischer } 704*b9e67834SAndre Fischer //add end 705*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, FontSizeLoseFocus, FontSizeBox*, pSizeBox) 706*b9e67834SAndre Fischer { 707*b9e67834SAndre Fischer if(pSizeBox == &maFontSizeBox) 708*b9e67834SAndre Fischer { 709*b9e67834SAndre Fischer mbFocusOnFontSizeCtrl = false; 710*b9e67834SAndre Fischer } 711*b9e67834SAndre Fischer return 0; 712*b9e67834SAndre Fischer } 713*b9e67834SAndre Fischer 714*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox) 715*b9e67834SAndre Fischer { 716*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 717*b9e67834SAndre Fischer 718*b9e67834SAndre Fischer //Bold 719*b9e67834SAndre Fischer if(nId == TBI_BOLD) 720*b9e67834SAndre Fischer { 721*b9e67834SAndre Fischer EndTracking(); 722*b9e67834SAndre Fischer if(meWeight != WEIGHT_BOLD) 723*b9e67834SAndre Fischer meWeight = WEIGHT_BOLD; 724*b9e67834SAndre Fischer else 725*b9e67834SAndre Fischer meWeight = WEIGHT_NORMAL; 726*b9e67834SAndre Fischer SvxWeightItem aWeightItem(meWeight, SID_ATTR_CHAR_WEIGHT); 727*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_WEIGHT, SFX_CALLMODE_RECORD, &aWeightItem, 0L); 728*b9e67834SAndre Fischer UpdateFontBold(); 729*b9e67834SAndre Fischer } 730*b9e67834SAndre Fischer //Italic 731*b9e67834SAndre Fischer else if(nId == TBI_ITALIC) 732*b9e67834SAndre Fischer { 733*b9e67834SAndre Fischer EndTracking(); 734*b9e67834SAndre Fischer if(meItalic != ITALIC_NORMAL) 735*b9e67834SAndre Fischer meItalic = ITALIC_NORMAL; 736*b9e67834SAndre Fischer else 737*b9e67834SAndre Fischer meItalic = ITALIC_NONE; 738*b9e67834SAndre Fischer SvxPostureItem aPostureItem(meItalic, SID_ATTR_CHAR_POSTURE); 739*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_POSTURE, SFX_CALLMODE_RECORD, &aPostureItem, 0L); 740*b9e67834SAndre Fischer UpdateFontItalic(); 741*b9e67834SAndre Fischer } 742*b9e67834SAndre Fischer //underline 743*b9e67834SAndre Fischer else if(nId == TBI_UNDERLINE) 744*b9e67834SAndre Fischer { 745*b9e67834SAndre Fischer EndTracking(); 746*b9e67834SAndre Fischer //add , keep underline's color 747*b9e67834SAndre Fischer if(meUnderline == UNDERLINE_NONE) 748*b9e67834SAndre Fischer { 749*b9e67834SAndre Fischer meUnderline = GetDefaultUnderline(); 750*b9e67834SAndre Fischer //<<modify 751*b9e67834SAndre Fischer //SvxTextLineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE); 752*b9e67834SAndre Fischer SvxUnderlineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE); 753*b9e67834SAndre Fischer //modify end>> 754*b9e67834SAndre Fischer aLineItem.SetColor(meUnderlineColor); 755*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L); 756*b9e67834SAndre Fischer } 757*b9e67834SAndre Fischer else 758*b9e67834SAndre Fischer { 759*b9e67834SAndre Fischer meUnderline = UNDERLINE_NONE; 760*b9e67834SAndre Fischer //<<modify 761*b9e67834SAndre Fischer //SvxTextLineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE); 762*b9e67834SAndre Fischer SvxUnderlineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE); 763*b9e67834SAndre Fischer //modify end>> 764*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L); 765*b9e67834SAndre Fischer } 766*b9e67834SAndre Fischer UpdateFontUnderline(); 767*b9e67834SAndre Fischer //add end 768*b9e67834SAndre Fischer } 769*b9e67834SAndre Fischer //strike out 770*b9e67834SAndre Fischer else if(nId == TBI_STRIKEOUT) 771*b9e67834SAndre Fischer { 772*b9e67834SAndre Fischer EndTracking(); 773*b9e67834SAndre Fischer if(meStrike != STRIKEOUT_NONE && meStrike != STRIKEOUT_DONTKNOW) 774*b9e67834SAndre Fischer meStrike = STRIKEOUT_NONE; 775*b9e67834SAndre Fischer else 776*b9e67834SAndre Fischer meStrike = STRIKEOUT_SINGLE; 777*b9e67834SAndre Fischer SvxCrossedOutItem aStrikeItem(meStrike,SID_ATTR_CHAR_STRIKEOUT); 778*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_STRIKEOUT, SFX_CALLMODE_RECORD, &aStrikeItem, 0L); 779*b9e67834SAndre Fischer UpdateFontStrikeOut(); 780*b9e67834SAndre Fischer } 781*b9e67834SAndre Fischer //shadowed 782*b9e67834SAndre Fischer else if(nId == TBI_SHADOWED) 783*b9e67834SAndre Fischer { 784*b9e67834SAndre Fischer EndTracking(); 785*b9e67834SAndre Fischer mbShadow = !mbShadow; 786*b9e67834SAndre Fischer SvxShadowedItem aShadowItem(mbShadow, SID_ATTR_CHAR_SHADOWED); 787*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_SHADOWED, SFX_CALLMODE_RECORD, &aShadowItem, 0L); 788*b9e67834SAndre Fischer UpdateFontShadowed(); 789*b9e67834SAndre Fischer } 790*b9e67834SAndre Fischer return 0; 791*b9e67834SAndre Fischer } 792*b9e67834SAndre Fischer 793*b9e67834SAndre Fischer 794*b9e67834SAndre Fischer 795*b9e67834SAndre Fischer 796*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox) 797*b9e67834SAndre Fischer { 798*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 799*b9e67834SAndre Fischer 800*b9e67834SAndre Fischer // font size +/- enhancement in sd 801*b9e67834SAndre Fischer switch (maContext.GetCombinedContext()) 802*b9e67834SAndre Fischer { 803*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_DrawText): 804*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Text): 805*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Table): 806*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_OutlineText): 807*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Draw): 808*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_TextObject): 809*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Graphic): 810*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_DrawText): 811*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Text): 812*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Table): 813*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_OutlineText): 814*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Draw): 815*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_TextObject): 816*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Graphic): 817*b9e67834SAndre Fischer if(nId == TBI_INCREASE) 818*b9e67834SAndre Fischer { 819*b9e67834SAndre Fischer EndTracking(); 820*b9e67834SAndre Fischer SfxVoidItem aItem(SID_GROW_FONT_SIZE); 821*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_GROW_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L ); 822*b9e67834SAndre Fischer } 823*b9e67834SAndre Fischer else if(nId == TBI_DECREASE) 824*b9e67834SAndre Fischer { 825*b9e67834SAndre Fischer EndTracking(); 826*b9e67834SAndre Fischer SfxVoidItem aItem(SID_SHRINK_FONT_SIZE); 827*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_SHRINK_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L ); 828*b9e67834SAndre Fischer } 829*b9e67834SAndre Fischer break; 830*b9e67834SAndre Fischer 831*b9e67834SAndre Fischer default: 832*b9e67834SAndre Fischer if(nId == TBI_INCREASE) 833*b9e67834SAndre Fischer { 834*b9e67834SAndre Fischer EndTracking(); 835*b9e67834SAndre Fischer mbFocusOnFontSizeCtrl = false; 836*b9e67834SAndre Fischer sal_Int64 iValue = maFontSizeBox.GetValue(); 837*b9e67834SAndre Fischer int iPos = maFontSizeBox.GetValuePos(iValue, FUNIT_NONE); 838*b9e67834SAndre Fischer long nSize = iValue; 839*b9e67834SAndre Fischer if(iPos != LISTBOX_ENTRY_NOTFOUND) 840*b9e67834SAndre Fischer nSize = maFontSizeBox.GetValue(iPos+1 , FUNIT_NONE); 841*b9e67834SAndre Fischer else if(iValue >= 100 && iValue < 105) 842*b9e67834SAndre Fischer nSize = 105; 843*b9e67834SAndre Fischer else if(iValue >= 105 && iValue < 110) 844*b9e67834SAndre Fischer nSize = 110; 845*b9e67834SAndre Fischer else if(iValue < 960) 846*b9e67834SAndre Fischer { 847*b9e67834SAndre Fischer nSize = (nSize / 10) * 10 + 10; 848*b9e67834SAndre Fischer while(maFontSizeBox.GetValuePos(nSize, FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND) 849*b9e67834SAndre Fischer nSize += 10; 850*b9e67834SAndre Fischer } 851*b9e67834SAndre Fischer else 852*b9e67834SAndre Fischer { 853*b9e67834SAndre Fischer nSize = iValue; 854*b9e67834SAndre Fischer } 855*b9e67834SAndre Fischer 856*b9e67834SAndre Fischer float fSize = (float)nSize / 10; 857*b9e67834SAndre Fischer 858*b9e67834SAndre Fischer SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric(); 859*b9e67834SAndre Fischer SvxFontHeightItem aItem( CalcToUnit( fSize, eUnit ), 100, SID_ATTR_CHAR_FONTHEIGHT ) ; 860*b9e67834SAndre Fischer 861*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L ); 862*b9e67834SAndre Fischer mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false); 863*b9e67834SAndre Fischer //add , update ASAP 864*b9e67834SAndre Fischer maFontSizeBox.SetValue( nSize ); 865*b9e67834SAndre Fischer if(nSize >= 960) 866*b9e67834SAndre Fischer { 867*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,false); 868*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,true); 869*b9e67834SAndre Fischer } 870*b9e67834SAndre Fischer else if(nSize <= 60) 871*b9e67834SAndre Fischer { 872*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,true); 873*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,false); 874*b9e67834SAndre Fischer } 875*b9e67834SAndre Fischer else 876*b9e67834SAndre Fischer { 877*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,true); 878*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,true); 879*b9e67834SAndre Fischer } 880*b9e67834SAndre Fischer //add end 881*b9e67834SAndre Fischer } 882*b9e67834SAndre Fischer else if(nId == TBI_DECREASE) 883*b9e67834SAndre Fischer { 884*b9e67834SAndre Fischer EndTracking(); 885*b9e67834SAndre Fischer mbFocusOnFontSizeCtrl = false; 886*b9e67834SAndre Fischer sal_Int64 iValue = maFontSizeBox.GetValue(); 887*b9e67834SAndre Fischer int iPos = maFontSizeBox.GetValuePos(iValue, FUNIT_NONE); 888*b9e67834SAndre Fischer long nSize = iValue; 889*b9e67834SAndre Fischer if(iPos != LISTBOX_ENTRY_NOTFOUND) 890*b9e67834SAndre Fischer nSize = maFontSizeBox.GetValue(iPos-1 , FUNIT_NONE); 891*b9e67834SAndre Fischer else if(iValue > 100 && iValue <= 105) 892*b9e67834SAndre Fischer nSize = 100; 893*b9e67834SAndre Fischer else if(iValue > 105 && iValue <= 110) 894*b9e67834SAndre Fischer nSize = 105; 895*b9e67834SAndre Fischer else if(iValue > 960) 896*b9e67834SAndre Fischer { 897*b9e67834SAndre Fischer nSize = 960; 898*b9e67834SAndre Fischer } 899*b9e67834SAndre Fischer else if(iValue > 60) 900*b9e67834SAndre Fischer { 901*b9e67834SAndre Fischer nSize = (nSize / 10) * 10 ; 902*b9e67834SAndre Fischer while(maFontSizeBox.GetValuePos(nSize, FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND) 903*b9e67834SAndre Fischer nSize -= 10; 904*b9e67834SAndre Fischer } 905*b9e67834SAndre Fischer else 906*b9e67834SAndre Fischer { 907*b9e67834SAndre Fischer nSize = iValue; 908*b9e67834SAndre Fischer } 909*b9e67834SAndre Fischer 910*b9e67834SAndre Fischer float fSize = (float)nSize / 10; 911*b9e67834SAndre Fischer 912*b9e67834SAndre Fischer SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric(); 913*b9e67834SAndre Fischer SvxFontHeightItem aItem( CalcToUnit( fSize, eUnit ), 100, SID_ATTR_CHAR_FONTHEIGHT ) ; 914*b9e67834SAndre Fischer 915*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L ); 916*b9e67834SAndre Fischer mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false); 917*b9e67834SAndre Fischer //add 918*b9e67834SAndre Fischer maFontSizeBox.SetValue( nSize ); 919*b9e67834SAndre Fischer if(nSize >= 960) 920*b9e67834SAndre Fischer { 921*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,false); 922*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,true); 923*b9e67834SAndre Fischer } 924*b9e67834SAndre Fischer else if(nSize <= 60) 925*b9e67834SAndre Fischer { 926*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,true); 927*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,false); 928*b9e67834SAndre Fischer } 929*b9e67834SAndre Fischer else 930*b9e67834SAndre Fischer { 931*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,true); 932*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,true); 933*b9e67834SAndre Fischer } 934*b9e67834SAndre Fischer //add end 935*b9e67834SAndre Fischer } 936*b9e67834SAndre Fischer } 937*b9e67834SAndre Fischer return 0; 938*b9e67834SAndre Fischer } 939*b9e67834SAndre Fischer 940*b9e67834SAndre Fischer 941*b9e67834SAndre Fischer 942*b9e67834SAndre Fischer 943*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolBoxUnderlineClickHdl, ToolBox*, pToolBox) 944*b9e67834SAndre Fischer { 945*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 946*b9e67834SAndre Fischer if(nId == TBI_UNDERLINE) 947*b9e67834SAndre Fischer { 948*b9e67834SAndre Fischer pToolBox->SetItemDown( nId, true ); 949*b9e67834SAndre Fischer 950*b9e67834SAndre Fischer /**AF 951*b9e67834SAndre Fischer SvxTextUnderlinePage* pUnderlinePage = GetUnderlinePage(); 952*b9e67834SAndre Fischer Size aFloatSz = pUnderlinePage->GetOutputSizePixel(); 953*b9e67834SAndre Fischer GetUnderlineFloatWin()->SetSizePixel( aFloatSz ); 954*b9e67834SAndre Fischer 955*b9e67834SAndre Fischer Point aPos = mpToolBoxFont->GetPosPixel(); 956*b9e67834SAndre Fischer aPos = OutputToScreenPixel( aPos ); 957*b9e67834SAndre Fischer Size aSize = mpToolBoxFont->GetSizePixel(); 958*b9e67834SAndre Fischer Rectangle aRect( aPos, aSize ); 959*b9e67834SAndre Fischer 960*b9e67834SAndre Fischer GetUnderlineFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN ); 961*b9e67834SAndre Fischer GetUnderlineFloatWin()->SetPopupModeFlags(GetUnderlineFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); 962*b9e67834SAndre Fischer pUnderlinePage->SetUnderlineSelect(meUnderline); 963*b9e67834SAndre Fischer */ 964*b9e67834SAndre Fischer } 965*b9e67834SAndre Fischer return 0; 966*b9e67834SAndre Fischer } 967*b9e67834SAndre Fischer 968*b9e67834SAndre Fischer 969*b9e67834SAndre Fischer 970*b9e67834SAndre Fischer 971*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolBoxFontColorDropHdl,ToolBox*, pToolBox) 972*b9e67834SAndre Fischer { 973*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 974*b9e67834SAndre Fischer if(nId == TBI_FONTCOLOR) 975*b9e67834SAndre Fischer { 976*b9e67834SAndre Fischer meColorType = FONT_COLOR; 977*b9e67834SAndre Fischer 978*b9e67834SAndre Fischer pToolBox->SetItemDown( nId, true ); 979*b9e67834SAndre Fischer 980*b9e67834SAndre Fischer /*AF 981*b9e67834SAndre Fischer SvxTextFontColorPage* pFontColorPage = GetFontColorPage(); 982*b9e67834SAndre Fischer 983*b9e67834SAndre Fischer Size aFloatSz = pFontColorPage->GetOutputSizePixel(); 984*b9e67834SAndre Fischer GetFontColorFloatWin()->SetSizePixel( aFloatSz ); 985*b9e67834SAndre Fischer 986*b9e67834SAndre Fischer Point aPos = mpToolBoxFontColor->GetPosPixel(); 987*b9e67834SAndre Fischer aPos = OutputToScreenPixel( aPos ); 988*b9e67834SAndre Fischer Size aSize = mpToolBoxFontColor->GetSizePixel(); 989*b9e67834SAndre Fischer Rectangle aRect( aPos, aSize ); 990*b9e67834SAndre Fischer 991*b9e67834SAndre Fischer GetFontColorFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN ); 992*b9e67834SAndre Fischer GetFontColorFloatWin()->SetPopupModeFlags(GetFontColorFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); 993*b9e67834SAndre Fischer 994*b9e67834SAndre Fischer pFontColorPage->GetFocus(); 995*b9e67834SAndre Fischer pFontColorPage->SetCurColorSelect(maColor, mbColorAvailable); 996*b9e67834SAndre Fischer */ 997*b9e67834SAndre Fischer } 998*b9e67834SAndre Fischer return 0; 999*b9e67834SAndre Fischer } 1000*b9e67834SAndre Fischer 1001*b9e67834SAndre Fischer 1002*b9e67834SAndre Fischer 1003*b9e67834SAndre Fischer 1004*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolBoxSwScriptSelectHdl, ToolBox*, pToolBox) 1005*b9e67834SAndre Fischer { 1006*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 1007*b9e67834SAndre Fischer if( nId == TBI_SUPER_SW ) 1008*b9e67834SAndre Fischer { 1009*b9e67834SAndre Fischer if(meEscape != SVX_ESCAPEMENT_SUPERSCRIPT) 1010*b9e67834SAndre Fischer { 1011*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_SUPERSCRIPT; 1012*b9e67834SAndre Fischer SvxEscapementItem aSupItem(DFLT_ESC_SUPER, DFLT_ESC_PROP, SID_ATTR_CHAR_ESCAPEMENT); 1013*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aSupItem, 0L ); 1014*b9e67834SAndre Fischer } 1015*b9e67834SAndre Fischer else 1016*b9e67834SAndre Fischer { 1017*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_OFF; 1018*b9e67834SAndre Fischer SvxEscapementItem aNoneItem(0, 100, SID_ATTR_CHAR_ESCAPEMENT); 1019*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aNoneItem, 0L ); 1020*b9e67834SAndre Fischer } 1021*b9e67834SAndre Fischer } 1022*b9e67834SAndre Fischer else if(TBI_SUB_SW == nId) 1023*b9e67834SAndre Fischer { 1024*b9e67834SAndre Fischer if(meEscape != SVX_ESCAPEMENT_SUBSCRIPT) 1025*b9e67834SAndre Fischer { 1026*b9e67834SAndre Fischer meEscape = (SvxEscapement)SVX_ESCAPEMENT_SUBSCRIPT; 1027*b9e67834SAndre Fischer SvxEscapementItem aSubItem(DFLT_ESC_SUB, DFLT_ESC_PROP, SID_ATTR_CHAR_ESCAPEMENT); 1028*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aSubItem, 0L ); 1029*b9e67834SAndre Fischer } 1030*b9e67834SAndre Fischer else 1031*b9e67834SAndre Fischer { 1032*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_OFF; 1033*b9e67834SAndre Fischer SvxEscapementItem aNoneItem(0, 100, SID_ATTR_CHAR_ESCAPEMENT); 1034*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aNoneItem, 0L ); 1035*b9e67834SAndre Fischer } 1036*b9e67834SAndre Fischer } 1037*b9e67834SAndre Fischer UpdateFontScript(); 1038*b9e67834SAndre Fischer 1039*b9e67834SAndre Fischer return 0; 1040*b9e67834SAndre Fischer } 1041*b9e67834SAndre Fischer 1042*b9e67834SAndre Fischer 1043*b9e67834SAndre Fischer 1044*b9e67834SAndre Fischer 1045*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox) 1046*b9e67834SAndre Fischer { 1047*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 1048*b9e67834SAndre Fischer if( nId == TBI_SUPER ) 1049*b9e67834SAndre Fischer { 1050*b9e67834SAndre Fischer mbSuper = !mbSuper; 1051*b9e67834SAndre Fischer SfxBoolItem aSupItem(SID_SET_SUPER_SCRIPT, mbSuper); 1052*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_SET_SUPER_SCRIPT, SFX_CALLMODE_RECORD, &aSupItem, 0L ); 1053*b9e67834SAndre Fischer } 1054*b9e67834SAndre Fischer else if(TBI_SUB == nId) 1055*b9e67834SAndre Fischer { 1056*b9e67834SAndre Fischer 1057*b9e67834SAndre Fischer mbSub = !mbSub; 1058*b9e67834SAndre Fischer SfxBoolItem aSubItem(SID_SET_SUB_SCRIPT, mbSub ); 1059*b9e67834SAndre Fischer mpBindings->GetDispatcher()->Execute( SID_SET_SUB_SCRIPT, SFX_CALLMODE_RECORD, &aSubItem, 0L ); 1060*b9e67834SAndre Fischer } 1061*b9e67834SAndre Fischer UpdateFontScript(); 1062*b9e67834SAndre Fischer return 0; 1063*b9e67834SAndre Fischer } 1064*b9e67834SAndre Fischer 1065*b9e67834SAndre Fischer 1066*b9e67834SAndre Fischer 1067*b9e67834SAndre Fischer 1068*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, ToolBoxHighlightDropHdl, ToolBox*, pToolBox) 1069*b9e67834SAndre Fischer { 1070*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 1071*b9e67834SAndre Fischer if(nId == TBI_HIGHLIGHT) 1072*b9e67834SAndre Fischer { 1073*b9e67834SAndre Fischer meColorType = BACK_COLOR; 1074*b9e67834SAndre Fischer 1075*b9e67834SAndre Fischer pToolBox->SetItemDown( nId, true ); 1076*b9e67834SAndre Fischer 1077*b9e67834SAndre Fischer /*AF 1078*b9e67834SAndre Fischer SvxTextFontColorPage* pFontColorPage = GetFontColorPage(); 1079*b9e67834SAndre Fischer 1080*b9e67834SAndre Fischer Size aFloatSz = pFontColorPage->GetOutputSizePixel(); 1081*b9e67834SAndre Fischer GetFontColorFloatWin()->SetSizePixel( aFloatSz ); 1082*b9e67834SAndre Fischer 1083*b9e67834SAndre Fischer Point aPos = mpToolBoxHighlight->GetPosPixel(); 1084*b9e67834SAndre Fischer aPos = OutputToScreenPixel( aPos ); 1085*b9e67834SAndre Fischer Size aSize = mpToolBoxHighlight->GetSizePixel(); 1086*b9e67834SAndre Fischer Rectangle aRect( aPos, aSize ); 1087*b9e67834SAndre Fischer 1088*b9e67834SAndre Fischer GetFontColorFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN ); 1089*b9e67834SAndre Fischer GetFontColorFloatWin()->SetPopupModeFlags(GetFontColorFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); 1090*b9e67834SAndre Fischer 1091*b9e67834SAndre Fischer pFontColorPage->GetFocus(); 1092*b9e67834SAndre Fischer pFontColorPage->SetCurColorSelect(maBackColor, 1093*b9e67834SAndre Fischer mbBackColorAvailable); 1094*b9e67834SAndre Fischer */ 1095*b9e67834SAndre Fischer } 1096*b9e67834SAndre Fischer return 0; 1097*b9e67834SAndre Fischer } 1098*b9e67834SAndre Fischer 1099*b9e67834SAndre Fischer 1100*b9e67834SAndre Fischer 1101*b9e67834SAndre Fischer 1102*b9e67834SAndre Fischer IMPL_LINK(TextPropertyPanel, SpacingClickHdl, ToolBox*, pToolBox) 1103*b9e67834SAndre Fischer { 1104*b9e67834SAndre Fischer const sal_uInt16 nId = pToolBox->GetCurItemId(); 1105*b9e67834SAndre Fischer if(nId == TBI_SPACING) 1106*b9e67834SAndre Fischer { 1107*b9e67834SAndre Fischer pToolBox->SetItemDown( nId, true ); 1108*b9e67834SAndre Fischer 1109*b9e67834SAndre Fischer /*AF 1110*b9e67834SAndre Fischer SvxTextSpacingPage* pSpacingPage = GetSpacingPage(); 1111*b9e67834SAndre Fischer pSpacingPage->SetControlState(mbKernLBAvailable,mbKernAvailable,mlKerning); 1112*b9e67834SAndre Fischer 1113*b9e67834SAndre Fischer Size aFloatSz = pSpacingPage->GetOutputSizePixel(); 1114*b9e67834SAndre Fischer GetSpacingFloatWin()->SetSizePixel( aFloatSz ); 1115*b9e67834SAndre Fischer 1116*b9e67834SAndre Fischer Point aPos = mpToolBoxSpacing->GetPosPixel(); 1117*b9e67834SAndre Fischer aPos = OutputToScreenPixel( aPos ); 1118*b9e67834SAndre Fischer Size aSize = mpToolBoxSpacing->GetSizePixel(); 1119*b9e67834SAndre Fischer Rectangle aRect( aPos, aSize ); 1120*b9e67834SAndre Fischer 1121*b9e67834SAndre Fischer GetSpacingFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_NOFOCUSCLOSE|FLOATWIN_POPUPMODE_DOWN ); 1122*b9e67834SAndre Fischer GetSpacingFloatWin()->SetPopupModeFlags(GetSpacingFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); 1123*b9e67834SAndre Fischer pSpacingPage->GetFocus(); 1124*b9e67834SAndre Fischer */ 1125*b9e67834SAndre Fischer } 1126*b9e67834SAndre Fischer return 0; 1127*b9e67834SAndre Fischer } 1128*b9e67834SAndre Fischer 1129*b9e67834SAndre Fischer 1130*b9e67834SAndre Fischer 1131*b9e67834SAndre Fischer 1132*b9e67834SAndre Fischer IMPL_LINK( TextPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG ) 1133*b9e67834SAndre Fischer { 1134*b9e67834SAndre Fischer return 0; 1135*b9e67834SAndre Fischer } 1136*b9e67834SAndre Fischer 1137*b9e67834SAndre Fischer 1138*b9e67834SAndre Fischer 1139*b9e67834SAndre Fischer 1140*b9e67834SAndre Fischer IMPL_LINK( TextPropertyPanel, ImplSpacingPopupModeEndHdl, FloatingWindow*, EMPTYARG ) 1141*b9e67834SAndre Fischer { 1142*b9e67834SAndre Fischer /*AF 1143*b9e67834SAndre Fischer if(mpPageSpacing) 1144*b9e67834SAndre Fischer { 1145*b9e67834SAndre Fischer if( mpPageSpacing->GetLastCustomState() == SPACING_CLOSE_BY_CUS_EDIT) 1146*b9e67834SAndre Fischer { 1147*b9e67834SAndre Fischer SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE ); 1148*b9e67834SAndre Fischer ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1); 1149*b9e67834SAndre Fischer aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Spacing") ); 1150*b9e67834SAndre Fischer aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt32( mpPageSpacing->GetLastCustomValue() )); 1151*b9e67834SAndre Fischer aWinOpt.SetUserData( aSeq ); 1152*b9e67834SAndre Fischer 1153*b9e67834SAndre Fischer } 1154*b9e67834SAndre Fischer } 1155*b9e67834SAndre Fischer */ 1156*b9e67834SAndre Fischer return 0; 1157*b9e67834SAndre Fischer } 1158*b9e67834SAndre Fischer 1159*b9e67834SAndre Fischer 1160*b9e67834SAndre Fischer 1161*b9e67834SAndre Fischer 1162*b9e67834SAndre Fischer void TextPropertyPanel::NotifyItemUpdate ( 1163*b9e67834SAndre Fischer const sal_uInt16 nSID, 1164*b9e67834SAndre Fischer const SfxItemState eState, 1165*b9e67834SAndre Fischer const SfxPoolItem* pState) 1166*b9e67834SAndre Fischer { 1167*b9e67834SAndre Fischer switch(nSID) 1168*b9e67834SAndre Fischer { 1169*b9e67834SAndre Fischer case SID_ATTR_CHAR_FONT: 1170*b9e67834SAndre Fischer if ( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxFontItem) ) 1171*b9e67834SAndre Fischer { 1172*b9e67834SAndre Fischer mpFontNameBox->Enable(); 1173*b9e67834SAndre Fischer const SvxFontItem* pFontItem = (const SvxFontItem*)pState; 1174*b9e67834SAndre Fischer mpFontNameBox->SetText( pFontItem->GetFamilyName() ); 1175*b9e67834SAndre Fischer } 1176*b9e67834SAndre Fischer else 1177*b9e67834SAndre Fischer { 1178*b9e67834SAndre Fischer mpFontNameBox->SetText( String() ); 1179*b9e67834SAndre Fischer if (SFX_ITEM_DISABLED == eState) 1180*b9e67834SAndre Fischer { 1181*b9e67834SAndre Fischer mpFontNameBox->Disable(); 1182*b9e67834SAndre Fischer } 1183*b9e67834SAndre Fischer } 1184*b9e67834SAndre Fischer break; 1185*b9e67834SAndre Fischer case SID_ATTR_CHAR_FONTHEIGHT: 1186*b9e67834SAndre Fischer if ( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxFontHeightItem) ) 1187*b9e67834SAndre Fischer { 1188*b9e67834SAndre Fischer mpHeightItem = (SvxFontHeightItem*)pState;//const SvxFontHeightItem* 1189*b9e67834SAndre Fischer SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric(); 1190*b9e67834SAndre Fischer long iValue = (long)CalcToPoint( mpHeightItem->GetHeight(), eUnit, 10 ); 1191*b9e67834SAndre Fischer mpToolBoxIncDec->Enable(); 1192*b9e67834SAndre Fischer 1193*b9e67834SAndre Fischer // font size +/- enhancement in sd 1194*b9e67834SAndre Fischer switch(maContext.GetCombinedContext()) 1195*b9e67834SAndre Fischer { 1196*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_DrawText): 1197*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Text): 1198*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Table): 1199*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_OutlineText): 1200*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Draw): 1201*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_TextObject): 1202*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Graphic): 1203*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_DrawText): 1204*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Text): 1205*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Table): 1206*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_OutlineText): 1207*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Draw): 1208*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_TextObject): 1209*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Graphic): 1210*b9e67834SAndre Fischer break; 1211*b9e67834SAndre Fischer 1212*b9e67834SAndre Fischer default: 1213*b9e67834SAndre Fischer if(iValue > 60 && iValue < 960 ) 1214*b9e67834SAndre Fischer { 1215*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,true); 1216*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,true); 1217*b9e67834SAndre Fischer } 1218*b9e67834SAndre Fischer else if (iValue <= 60) 1219*b9e67834SAndre Fischer { 1220*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,true); 1221*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,false); 1222*b9e67834SAndre Fischer } 1223*b9e67834SAndre Fischer else if (iValue >= 960) 1224*b9e67834SAndre Fischer { 1225*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_INCREASE,false); 1226*b9e67834SAndre Fischer mpToolBoxIncDec->EnableItem(TBI_DECREASE,true); 1227*b9e67834SAndre Fischer } 1228*b9e67834SAndre Fischer } 1229*b9e67834SAndre Fischer mpToolBoxIncDec->SetItemState(TBI_INCREASE, STATE_NOCHECK); 1230*b9e67834SAndre Fischer mpToolBoxIncDec->SetItemState(TBI_DECREASE, STATE_NOCHECK); 1231*b9e67834SAndre Fischer 1232*b9e67834SAndre Fischer if( mbFocusOnFontSizeCtrl ) 1233*b9e67834SAndre Fischer return; 1234*b9e67834SAndre Fischer 1235*b9e67834SAndre Fischer maFontSizeBox.Enable( ); 1236*b9e67834SAndre Fischer maFontSizeBox.SetValue( iValue ); 1237*b9e67834SAndre Fischer maFontSizeBox.LoseFocus(); 1238*b9e67834SAndre Fischer } 1239*b9e67834SAndre Fischer else 1240*b9e67834SAndre Fischer { 1241*b9e67834SAndre Fischer mpHeightItem = NULL; 1242*b9e67834SAndre Fischer maFontSizeBox.SetText( String() ); 1243*b9e67834SAndre Fischer //increase decrease diabled when multi-seletion have different font size 1244*b9e67834SAndre Fischer 1245*b9e67834SAndre Fischer // font size +/- enhancement in sd 1246*b9e67834SAndre Fischer switch(maContext.GetCombinedContext()) 1247*b9e67834SAndre Fischer { 1248*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_DrawText): 1249*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Text): 1250*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Table): 1251*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_OutlineText): 1252*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Draw): 1253*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_TextObject): 1254*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Graphic): 1255*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_DrawText): 1256*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Text): 1257*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Table): 1258*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_OutlineText): 1259*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Draw): 1260*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_TextObject): 1261*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Graphic): 1262*b9e67834SAndre Fischer break; 1263*b9e67834SAndre Fischer 1264*b9e67834SAndre Fischer default: 1265*b9e67834SAndre Fischer mpToolBoxIncDec->Disable(); 1266*b9e67834SAndre Fischer } 1267*b9e67834SAndre Fischer if ( eState <= SFX_ITEM_READONLY ) 1268*b9e67834SAndre Fischer { 1269*b9e67834SAndre Fischer maFontSizeBox.Disable( ); 1270*b9e67834SAndre Fischer } 1271*b9e67834SAndre Fischer } 1272*b9e67834SAndre Fischer break; 1273*b9e67834SAndre Fischer case SID_ATTR_CHAR_WEIGHT: 1274*b9e67834SAndre Fischer mbWeightAvailable = (eState >= SFX_ITEM_DONTCARE); 1275*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxWeightItem)) 1276*b9e67834SAndre Fischer { 1277*b9e67834SAndre Fischer const SvxWeightItem* pItem = (const SvxWeightItem*)pState; 1278*b9e67834SAndre Fischer meWeight = (FontWeight)pItem->GetValue(); 1279*b9e67834SAndre Fischer TextStyleChanged(); 1280*b9e67834SAndre Fischer } 1281*b9e67834SAndre Fischer else 1282*b9e67834SAndre Fischer { 1283*b9e67834SAndre Fischer meWeight = WEIGHT_NORMAL; 1284*b9e67834SAndre Fischer TextStyleChanged(); 1285*b9e67834SAndre Fischer } 1286*b9e67834SAndre Fischer break; 1287*b9e67834SAndre Fischer case SID_ATTR_CHAR_POSTURE: 1288*b9e67834SAndre Fischer mbPostureAvailable = (eState >= SFX_ITEM_DONTCARE); 1289*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxPostureItem)) 1290*b9e67834SAndre Fischer { 1291*b9e67834SAndre Fischer const SvxPostureItem* pItem = (const SvxPostureItem*)pState; 1292*b9e67834SAndre Fischer meItalic = (FontItalic)pItem->GetValue(); 1293*b9e67834SAndre Fischer TextStyleChanged(); 1294*b9e67834SAndre Fischer } 1295*b9e67834SAndre Fischer else 1296*b9e67834SAndre Fischer { 1297*b9e67834SAndre Fischer meItalic = ITALIC_NONE; 1298*b9e67834SAndre Fischer TextStyleChanged(); 1299*b9e67834SAndre Fischer } 1300*b9e67834SAndre Fischer break; 1301*b9e67834SAndre Fischer case SID_ATTR_CHAR_UNDERLINE: 1302*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT) //SvxUnderlineItem 1303*b9e67834SAndre Fischer { 1304*b9e67834SAndre Fischer //<<delete 1305*b9e67834SAndre Fischer //if(pState->ISA(SvxTextLineItem)) 1306*b9e67834SAndre Fischer //{ 1307*b9e67834SAndre Fischer // const SvxTextLineItem* pItem = (const SvxTextLineItem*)pState; 1308*b9e67834SAndre Fischer // meUnderline = (FontUnderline)pItem->GetValue(); 1309*b9e67834SAndre Fischer // //add , need to record the underline's color, if not the color will turn to auto 1310*b9e67834SAndre Fischer // meUnderlineColor = pItem->GetColor(); 1311*b9e67834SAndre Fischer // //add end 1312*b9e67834SAndre Fischer //} 1313*b9e67834SAndre Fischer //else 1314*b9e67834SAndre Fischer //delete end>> 1315*b9e67834SAndre Fischer if(pState->ISA(SvxUnderlineItem)) 1316*b9e67834SAndre Fischer { 1317*b9e67834SAndre Fischer const SvxUnderlineItem* pItem = (const SvxUnderlineItem*)pState; 1318*b9e67834SAndre Fischer meUnderline = (FontUnderline)pItem->GetValue(); 1319*b9e67834SAndre Fischer //add 1320*b9e67834SAndre Fischer meUnderlineColor = pItem->GetColor(); 1321*b9e67834SAndre Fischer //add end 1322*b9e67834SAndre Fischer } 1323*b9e67834SAndre Fischer TextStyleChanged(); 1324*b9e67834SAndre Fischer } 1325*b9e67834SAndre Fischer else 1326*b9e67834SAndre Fischer { 1327*b9e67834SAndre Fischer meUnderline = UNDERLINE_NONE; 1328*b9e67834SAndre Fischer TextStyleChanged(); 1329*b9e67834SAndre Fischer } 1330*b9e67834SAndre Fischer break; 1331*b9e67834SAndre Fischer case SID_ATTR_CHAR_SHADOWED: 1332*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxShadowedItem)) 1333*b9e67834SAndre Fischer { 1334*b9e67834SAndre Fischer const SvxShadowedItem* pItem = (const SvxShadowedItem*)pState; 1335*b9e67834SAndre Fischer mbShadow = pItem->GetValue(); 1336*b9e67834SAndre Fischer TextStyleChanged(); 1337*b9e67834SAndre Fischer } 1338*b9e67834SAndre Fischer else 1339*b9e67834SAndre Fischer { 1340*b9e67834SAndre Fischer mbShadow = false; 1341*b9e67834SAndre Fischer TextStyleChanged(); 1342*b9e67834SAndre Fischer } 1343*b9e67834SAndre Fischer break; 1344*b9e67834SAndre Fischer case SID_ATTR_CHAR_STRIKEOUT: 1345*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxCrossedOutItem)) 1346*b9e67834SAndre Fischer { 1347*b9e67834SAndre Fischer const SvxCrossedOutItem* pItem = (const SvxCrossedOutItem*)pState; 1348*b9e67834SAndre Fischer meStrike = (FontStrikeout)pItem->GetValue(); 1349*b9e67834SAndre Fischer 1350*b9e67834SAndre Fischer TextStyleChanged(); 1351*b9e67834SAndre Fischer } 1352*b9e67834SAndre Fischer else 1353*b9e67834SAndre Fischer { 1354*b9e67834SAndre Fischer meStrike = STRIKEOUT_NONE; 1355*b9e67834SAndre Fischer TextStyleChanged(); 1356*b9e67834SAndre Fischer } 1357*b9e67834SAndre Fischer break; 1358*b9e67834SAndre Fischer case SID_ATTR_CHAR_COLOR: 1359*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxColorItem)) 1360*b9e67834SAndre Fischer { 1361*b9e67834SAndre Fischer const SvxBrushItem* pItem = (const SvxBrushItem*)pState; 1362*b9e67834SAndre Fischer maColor = pItem->GetColor(); 1363*b9e67834SAndre Fischer mbColorAvailable = true; 1364*b9e67834SAndre Fischer mpFontColorUpdater->Update(maColor); 1365*b9e67834SAndre Fischer } 1366*b9e67834SAndre Fischer else 1367*b9e67834SAndre Fischer { 1368*b9e67834SAndre Fischer mbColorAvailable = false; 1369*b9e67834SAndre Fischer maColor.SetColor(COL_AUTO); 1370*b9e67834SAndre Fischer mpFontColorUpdater->Update(maColor); 1371*b9e67834SAndre Fischer } 1372*b9e67834SAndre Fischer break; 1373*b9e67834SAndre Fischer case SID_ATTR_BRUSH_CHAR: 1374*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxBrushItem)) 1375*b9e67834SAndre Fischer { 1376*b9e67834SAndre Fischer const SvxBrushItem* pItem = (const SvxBrushItem*)pState; 1377*b9e67834SAndre Fischer maBackColor = pItem->GetColor(); 1378*b9e67834SAndre Fischer mbBackColorAvailable = true; 1379*b9e67834SAndre Fischer mpHighlightUpdater->Update(maBackColor); 1380*b9e67834SAndre Fischer } 1381*b9e67834SAndre Fischer else 1382*b9e67834SAndre Fischer { 1383*b9e67834SAndre Fischer mbBackColorAvailable = false; 1384*b9e67834SAndre Fischer maBackColor.SetColor(COL_AUTO); 1385*b9e67834SAndre Fischer mpHighlightUpdater->Update(maBackColor); 1386*b9e67834SAndre Fischer } 1387*b9e67834SAndre Fischer break; 1388*b9e67834SAndre Fischer case SID_ATTR_CHAR_ESCAPEMENT: 1389*b9e67834SAndre Fischer if( eState == SFX_ITEM_AVAILABLE) 1390*b9e67834SAndre Fischer { 1391*b9e67834SAndre Fischer if( pState->ISA(SvxEscapementItem)) 1392*b9e67834SAndre Fischer { 1393*b9e67834SAndre Fischer const SvxEscapementItem* pItem = (const SvxEscapementItem *)pState; 1394*b9e67834SAndre Fischer short nEsc = pItem->GetEsc(); 1395*b9e67834SAndre Fischer if(nEsc == 0) 1396*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_OFF; 1397*b9e67834SAndre Fischer else if(nEsc > 0) 1398*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_SUPERSCRIPT; 1399*b9e67834SAndre Fischer else 1400*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_SUBSCRIPT; 1401*b9e67834SAndre Fischer } 1402*b9e67834SAndre Fischer else 1403*b9e67834SAndre Fischer { 1404*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_OFF; 1405*b9e67834SAndre Fischer } 1406*b9e67834SAndre Fischer TextStyleChanged(); 1407*b9e67834SAndre Fischer } 1408*b9e67834SAndre Fischer else if(eState == SFX_ITEM_DISABLED) 1409*b9e67834SAndre Fischer { 1410*b9e67834SAndre Fischer mpToolBoxScriptSw->EnableItem(TBI_SUPER,false); 1411*b9e67834SAndre Fischer mpToolBoxScriptSw->EnableItem(TBI_SUB,false); 1412*b9e67834SAndre Fischer } 1413*b9e67834SAndre Fischer else 1414*b9e67834SAndre Fischer { 1415*b9e67834SAndre Fischer meEscape = SVX_ESCAPEMENT_OFF; 1416*b9e67834SAndre Fischer TextStyleChanged(); 1417*b9e67834SAndre Fischer } 1418*b9e67834SAndre Fischer break; 1419*b9e67834SAndre Fischer case SID_SET_SUB_SCRIPT: 1420*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxBoolItem)) 1421*b9e67834SAndre Fischer { 1422*b9e67834SAndre Fischer const SfxBoolItem* pItem = (const SfxBoolItem*)pState; 1423*b9e67834SAndre Fischer mbSub = pItem->GetValue(); 1424*b9e67834SAndre Fischer TextStyleChanged(); 1425*b9e67834SAndre Fischer } 1426*b9e67834SAndre Fischer else 1427*b9e67834SAndre Fischer { 1428*b9e67834SAndre Fischer mbSub = false; 1429*b9e67834SAndre Fischer TextStyleChanged(); 1430*b9e67834SAndre Fischer } 1431*b9e67834SAndre Fischer break; 1432*b9e67834SAndre Fischer case SID_SET_SUPER_SCRIPT: 1433*b9e67834SAndre Fischer if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxBoolItem)) 1434*b9e67834SAndre Fischer { 1435*b9e67834SAndre Fischer const SfxBoolItem* pItem = (const SfxBoolItem*)pState; 1436*b9e67834SAndre Fischer mbSuper = pItem->GetValue(); 1437*b9e67834SAndre Fischer TextStyleChanged(); 1438*b9e67834SAndre Fischer } 1439*b9e67834SAndre Fischer else 1440*b9e67834SAndre Fischer { 1441*b9e67834SAndre Fischer mbSuper = false; 1442*b9e67834SAndre Fischer TextStyleChanged(); 1443*b9e67834SAndre Fischer } 1444*b9e67834SAndre Fischer break; 1445*b9e67834SAndre Fischer case SID_ATTR_CHAR_KERNING: 1446*b9e67834SAndre Fischer if ( SFX_ITEM_AVAILABLE == eState ) 1447*b9e67834SAndre Fischer { 1448*b9e67834SAndre Fischer mbKernLBAvailable = true; 1449*b9e67834SAndre Fischer 1450*b9e67834SAndre Fischer if(pState->ISA(SvxKerningItem)) 1451*b9e67834SAndre Fischer { 1452*b9e67834SAndre Fischer const SvxKerningItem* pKerningItem = (const SvxKerningItem*)pState; 1453*b9e67834SAndre Fischer mlKerning = (long)pKerningItem->GetValue(); 1454*b9e67834SAndre Fischer mbKernAvailable = true; 1455*b9e67834SAndre Fischer } 1456*b9e67834SAndre Fischer else 1457*b9e67834SAndre Fischer { 1458*b9e67834SAndre Fischer mlKerning = 0; 1459*b9e67834SAndre Fischer mbKernAvailable =false; 1460*b9e67834SAndre Fischer } 1461*b9e67834SAndre Fischer } 1462*b9e67834SAndre Fischer else if (SFX_ITEM_DISABLED == eState) 1463*b9e67834SAndre Fischer { 1464*b9e67834SAndre Fischer mbKernLBAvailable = false; 1465*b9e67834SAndre Fischer mbKernAvailable = false; 1466*b9e67834SAndre Fischer mlKerning = 0; 1467*b9e67834SAndre Fischer } 1468*b9e67834SAndre Fischer else 1469*b9e67834SAndre Fischer { 1470*b9e67834SAndre Fischer mbKernLBAvailable = true; 1471*b9e67834SAndre Fischer mbKernAvailable = false; 1472*b9e67834SAndre Fischer mlKerning = 0; 1473*b9e67834SAndre Fischer } 1474*b9e67834SAndre Fischer break; 1475*b9e67834SAndre Fischer 1476*b9e67834SAndre Fischer // font size +/- enhancement in sd 1477*b9e67834SAndre Fischer case SID_SHRINK_FONT_SIZE: 1478*b9e67834SAndre Fischer case SID_GROW_FONT_SIZE: 1479*b9e67834SAndre Fischer switch(maContext.GetCombinedContext()) 1480*b9e67834SAndre Fischer { 1481*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_DrawText): 1482*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Text): 1483*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Table): 1484*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_OutlineText): 1485*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Draw): 1486*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_TextObject): 1487*b9e67834SAndre Fischer case CombinedEnumContext(Application_Draw, Context_Graphic): 1488*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_DrawText): 1489*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Text): 1490*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Table): 1491*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_OutlineText): 1492*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Draw): 1493*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_TextObject): 1494*b9e67834SAndre Fischer case CombinedEnumContext(Application_Impress, Context_Graphic): 1495*b9e67834SAndre Fischer if(eState == SFX_ITEM_DISABLED) 1496*b9e67834SAndre Fischer { 1497*b9e67834SAndre Fischer mpToolBoxIncDec->Disable(); 1498*b9e67834SAndre Fischer } 1499*b9e67834SAndre Fischer else 1500*b9e67834SAndre Fischer { 1501*b9e67834SAndre Fischer mpToolBoxIncDec->Enable(); 1502*b9e67834SAndre Fischer } 1503*b9e67834SAndre Fischer break; 1504*b9e67834SAndre Fischer } 1505*b9e67834SAndre Fischer break; 1506*b9e67834SAndre Fischer } 1507*b9e67834SAndre Fischer } 1508*b9e67834SAndre Fischer 1509*b9e67834SAndre Fischer 1510*b9e67834SAndre Fischer 1511*b9e67834SAndre Fischer 1512*b9e67834SAndre Fischer void TextPropertyPanel::TextStyleChanged() 1513*b9e67834SAndre Fischer { 1514*b9e67834SAndre Fischer if( !mbWeightAvailable ) 1515*b9e67834SAndre Fischer mpToolBoxFont->EnableItem(TBI_BOLD,false); 1516*b9e67834SAndre Fischer else 1517*b9e67834SAndre Fischer mpToolBoxFont->EnableItem(TBI_BOLD,true); 1518*b9e67834SAndre Fischer 1519*b9e67834SAndre Fischer if(!mbPostureAvailable ) 1520*b9e67834SAndre Fischer mpToolBoxFont->EnableItem(TBI_ITALIC,false); 1521*b9e67834SAndre Fischer else 1522*b9e67834SAndre Fischer mpToolBoxFont->EnableItem(TBI_ITALIC,true); 1523*b9e67834SAndre Fischer 1524*b9e67834SAndre Fischer UpdateFontBold(); 1525*b9e67834SAndre Fischer UpdateFontItalic(); 1526*b9e67834SAndre Fischer UpdateFontUnderline(); 1527*b9e67834SAndre Fischer UpdateFontStrikeOut(); 1528*b9e67834SAndre Fischer UpdateFontShadowed(); 1529*b9e67834SAndre Fischer UpdateFontScript(); 1530*b9e67834SAndre Fischer } 1531*b9e67834SAndre Fischer 1532*b9e67834SAndre Fischer 1533*b9e67834SAndre Fischer 1534*b9e67834SAndre Fischer 1535*b9e67834SAndre Fischer void TextPropertyPanel::UpdateFontBold() 1536*b9e67834SAndre Fischer { 1537*b9e67834SAndre Fischer if( meWeight == WEIGHT_BOLD ) 1538*b9e67834SAndre Fischer { 1539*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_BOLD, STATE_CHECK); 1540*b9e67834SAndre Fischer } 1541*b9e67834SAndre Fischer else 1542*b9e67834SAndre Fischer { 1543*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_BOLD, STATE_NOCHECK); 1544*b9e67834SAndre Fischer } 1545*b9e67834SAndre Fischer } 1546*b9e67834SAndre Fischer void TextPropertyPanel::UpdateFontItalic() 1547*b9e67834SAndre Fischer { 1548*b9e67834SAndre Fischer if(meItalic == ITALIC_NORMAL) 1549*b9e67834SAndre Fischer { 1550*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_ITALIC, STATE_CHECK); 1551*b9e67834SAndre Fischer } 1552*b9e67834SAndre Fischer else 1553*b9e67834SAndre Fischer { 1554*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_ITALIC, STATE_NOCHECK); 1555*b9e67834SAndre Fischer } 1556*b9e67834SAndre Fischer } 1557*b9e67834SAndre Fischer void TextPropertyPanel::UpdateFontUnderline() 1558*b9e67834SAndre Fischer { 1559*b9e67834SAndre Fischer if(meUnderline == UNDERLINE_NONE) 1560*b9e67834SAndre Fischer { 1561*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_UNDERLINE, STATE_NOCHECK); 1562*b9e67834SAndre Fischer } 1563*b9e67834SAndre Fischer else 1564*b9e67834SAndre Fischer { 1565*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_UNDERLINE, STATE_CHECK); 1566*b9e67834SAndre Fischer } 1567*b9e67834SAndre Fischer } 1568*b9e67834SAndre Fischer void TextPropertyPanel::UpdateFontStrikeOut() 1569*b9e67834SAndre Fischer { 1570*b9e67834SAndre Fischer if(meStrike != STRIKEOUT_NONE && meStrike != STRIKEOUT_DONTKNOW) 1571*b9e67834SAndre Fischer { 1572*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_STRIKEOUT, STATE_CHECK); 1573*b9e67834SAndre Fischer } 1574*b9e67834SAndre Fischer else 1575*b9e67834SAndre Fischer { 1576*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_STRIKEOUT, STATE_NOCHECK); 1577*b9e67834SAndre Fischer } 1578*b9e67834SAndre Fischer } 1579*b9e67834SAndre Fischer void TextPropertyPanel::UpdateFontShadowed() 1580*b9e67834SAndre Fischer { 1581*b9e67834SAndre Fischer if(mbShadow) 1582*b9e67834SAndre Fischer { 1583*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_SHADOWED, STATE_CHECK); 1584*b9e67834SAndre Fischer } 1585*b9e67834SAndre Fischer else 1586*b9e67834SAndre Fischer { 1587*b9e67834SAndre Fischer mpToolBoxFont->SetItemState(TBI_SHADOWED, STATE_NOCHECK); 1588*b9e67834SAndre Fischer } 1589*b9e67834SAndre Fischer } 1590*b9e67834SAndre Fischer void TextPropertyPanel::UpdateFontScript() 1591*b9e67834SAndre Fischer { 1592*b9e67834SAndre Fischer //script for sw 1593*b9e67834SAndre Fischer mpToolBoxScriptSw->EnableItem(TBI_SUPER,true); 1594*b9e67834SAndre Fischer mpToolBoxScriptSw->EnableItem(TBI_SUB,true); 1595*b9e67834SAndre Fischer if(meEscape == SVX_ESCAPEMENT_SUPERSCRIPT) 1596*b9e67834SAndre Fischer { 1597*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_CHECK); 1598*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK); 1599*b9e67834SAndre Fischer } 1600*b9e67834SAndre Fischer else if(meEscape == SVX_ESCAPEMENT_SUBSCRIPT) 1601*b9e67834SAndre Fischer { 1602*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK); 1603*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_CHECK); 1604*b9e67834SAndre Fischer } 1605*b9e67834SAndre Fischer else 1606*b9e67834SAndre Fischer { 1607*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK); 1608*b9e67834SAndre Fischer mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK); 1609*b9e67834SAndre Fischer } 1610*b9e67834SAndre Fischer 1611*b9e67834SAndre Fischer //script for sc sd 1612*b9e67834SAndre Fischer mpToolBoxScript->EnableItem(TBI_SUPER,true); 1613*b9e67834SAndre Fischer mpToolBoxScript->EnableItem(TBI_SUB,true); 1614*b9e67834SAndre Fischer if(mbSuper) 1615*b9e67834SAndre Fischer { 1616*b9e67834SAndre Fischer mpToolBoxScript->SetItemState(TBI_SUPER, STATE_CHECK); 1617*b9e67834SAndre Fischer mpToolBoxScript->SetItemState(TBI_SUB, STATE_NOCHECK); 1618*b9e67834SAndre Fischer } 1619*b9e67834SAndre Fischer else if(mbSub) 1620*b9e67834SAndre Fischer { 1621*b9e67834SAndre Fischer mpToolBoxScript->SetItemState(TBI_SUPER, STATE_NOCHECK); 1622*b9e67834SAndre Fischer mpToolBoxScript->SetItemState(TBI_SUB, STATE_CHECK); 1623*b9e67834SAndre Fischer } 1624*b9e67834SAndre Fischer else 1625*b9e67834SAndre Fischer { 1626*b9e67834SAndre Fischer mpToolBoxScript->SetItemState(TBI_SUPER, STATE_NOCHECK); 1627*b9e67834SAndre Fischer mpToolBoxScript->SetItemState(TBI_SUB, STATE_NOCHECK); 1628*b9e67834SAndre Fischer } 1629*b9e67834SAndre Fischer } 1630*b9e67834SAndre Fischer 1631*b9e67834SAndre Fischer /* 1632*b9e67834SAndre Fischer USHORT TextPropertyPanel::GetCurrColorType() 1633*b9e67834SAndre Fischer { 1634*b9e67834SAndre Fischer return meColorType; 1635*b9e67834SAndre Fischer } 1636*b9e67834SAndre Fischer long TextPropertyPanel::GetSelFontSize() 1637*b9e67834SAndre Fischer { 1638*b9e67834SAndre Fischer long nH = 240; 1639*b9e67834SAndre Fischer SfxMapUnit eUnit = maSpacingControl.GetCoreMetric(); 1640*b9e67834SAndre Fischer if (mpHeightItem) 1641*b9e67834SAndre Fischer nH = LogicToLogic( mpHeightItem->GetHeight(), (MapUnit)eUnit, MAP_TWIP ); 1642*b9e67834SAndre Fischer return nH; 1643*b9e67834SAndre Fischer } 1644*b9e67834SAndre Fischer SfxPropertyPageController TextPropertyPanel::GetSpaceController() 1645*b9e67834SAndre Fischer { 1646*b9e67834SAndre Fischer return maSpacingControl; 1647*b9e67834SAndre Fischer } 1648*b9e67834SAndre Fischer 1649*b9e67834SAndre Fischer //add 1650*b9e67834SAndre Fischer Color& TextPropertyPanel::GetUnderlineColor() 1651*b9e67834SAndre Fischer { 1652*b9e67834SAndre Fischer return meUnderlineColor; 1653*b9e67834SAndre Fischer } 1654*b9e67834SAndre Fischer //add end 1655*b9e67834SAndre Fischer void TextPropertyPanel::SetBackColor(Color aCol) 1656*b9e67834SAndre Fischer { 1657*b9e67834SAndre Fischer maBackColor = aCol; 1658*b9e67834SAndre Fischer } 1659*b9e67834SAndre Fischer void TextPropertyPanel::SetColor(Color aCol) 1660*b9e67834SAndre Fischer { 1661*b9e67834SAndre Fischer maColor = aCol; 1662*b9e67834SAndre Fischer } 1663*b9e67834SAndre Fischer void TextPropertyPanel::SetUnderline(FontUnderline eUnderline) 1664*b9e67834SAndre Fischer { 1665*b9e67834SAndre Fischer meUnderline = eUnderline; 1666*b9e67834SAndre Fischer } 1667*b9e67834SAndre Fischer void TextPropertyPanel::SetSpacing(long nKern) 1668*b9e67834SAndre Fischer { 1669*b9e67834SAndre Fischer mlKerning = nKern; 1670*b9e67834SAndre Fischer } 1671*b9e67834SAndre Fischer */ 1672*b9e67834SAndre Fischer } } // end of namespace svx::sidebar 1673