TextUnderlineControl.cxx (d29c2fc2) | TextUnderlineControl.cxx (8ce66e53) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 71 unchanged lines hidden (view full) --- 80 81{ 82 initial(); 83 FreeResource(); 84} 85 86void TextUnderlineControl::initial() 87{ | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 71 unchanged lines hidden (view full) --- 80 81{ 82 initial(); 83 FreeResource(); 84} 85 86void TextUnderlineControl::initial() 87{ |
88 /*maPBOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetHighContrastMode()? 89 GetSettings().GetStyleSettings().GetMenuColor(): 90 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_DropDownBackground ));//Color(244,245,249)//for high contract 91 maPBOptions.SetHoverBkColor(GetSettings().GetStyleSettings().GetHighContrastMode()? 92 GetSettings().GetStyleSettings().GetMenuColor(): 93 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ) );//Color( 93, 120, 163 ) 94 maPBOptions.SetHoverTxtColor( sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Color_PanelTitleFont ) );//Color( 255, 255, 255 ) 95 maPBOptions.SetIcoPosX( 2);*/ | |
96 maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()? 97 GetSettings().GetStyleSettings().GetMenuColor(): 98 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground )); 99 maVSUnderline.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()? 100 GetSettings().GetStyleSettings().GetMenuColor(): 101 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground )); 102 103 Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ; --- 51 unchanged lines hidden (view full) --- 155 maVSUnderline.SetItemImage(3, GetDisplayBackground().GetColor().IsDark()? maIMGBoldH : maIMGBold); 156 maVSUnderline.SetItemImage(4, GetDisplayBackground().GetColor().IsDark()? maIMGDotH : maIMGDot); 157 maVSUnderline.SetItemImage(5, GetDisplayBackground().GetColor().IsDark()? maIMGDotBoldH :maIMGDotBold); 158 maVSUnderline.SetItemImage(6, GetDisplayBackground().GetColor().IsDark()? maIMGDashH :maIMGDash); 159 maVSUnderline.SetItemImage(7, GetDisplayBackground().GetColor().IsDark()? maIMGDashLongH : maIMGDashLong); 160 maVSUnderline.SetItemImage(8, GetDisplayBackground().GetColor().IsDark()? maIMGDashDotH : maIMGDashDot); 161 maVSUnderline.SetItemImage(9, GetDisplayBackground().GetColor().IsDark()? maIMGDashDotDotH : maIMGDashDotDot); 162 maVSUnderline.SetItemImage(10, GetDisplayBackground().GetColor().IsDark()? maIMGWaveH : maIMGWave); | 88 maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()? 89 GetSettings().GetStyleSettings().GetMenuColor(): 90 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground )); 91 maVSUnderline.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()? 92 GetSettings().GetStyleSettings().GetMenuColor(): 93 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground )); 94 95 Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ; --- 51 unchanged lines hidden (view full) --- 147 maVSUnderline.SetItemImage(3, GetDisplayBackground().GetColor().IsDark()? maIMGBoldH : maIMGBold); 148 maVSUnderline.SetItemImage(4, GetDisplayBackground().GetColor().IsDark()? maIMGDotH : maIMGDot); 149 maVSUnderline.SetItemImage(5, GetDisplayBackground().GetColor().IsDark()? maIMGDotBoldH :maIMGDotBold); 150 maVSUnderline.SetItemImage(6, GetDisplayBackground().GetColor().IsDark()? maIMGDashH :maIMGDash); 151 maVSUnderline.SetItemImage(7, GetDisplayBackground().GetColor().IsDark()? maIMGDashLongH : maIMGDashLong); 152 maVSUnderline.SetItemImage(8, GetDisplayBackground().GetColor().IsDark()? maIMGDashDotH : maIMGDashDot); 153 maVSUnderline.SetItemImage(9, GetDisplayBackground().GetColor().IsDark()? maIMGDashDotDotH : maIMGDashDotDot); 154 maVSUnderline.SetItemImage(10, GetDisplayBackground().GetColor().IsDark()? maIMGWaveH : maIMGWave); |
163// maVSUnderline.SelectItem(0); //delete 164// maVSUnderline.SetNoSelection(); | |
165 166 switch(eLine) 167 { 168 case UNDERLINE_SINGLE: 169 maVSUnderline.SetItemImage(1, maIMGSingleSel); | 155 156 switch(eLine) 157 { 158 case UNDERLINE_SINGLE: 159 maVSUnderline.SetItemImage(1, maIMGSingleSel); |
170 maVSUnderline.SelectItem(1); //add | 160 maVSUnderline.SelectItem(1); |
171 maVSUnderline.GrabFocus(); 172 break; 173 case UNDERLINE_DOUBLE: 174 maVSUnderline.SetItemImage(2, maIMGDoubleSel); | 161 maVSUnderline.GrabFocus(); 162 break; 163 case UNDERLINE_DOUBLE: 164 maVSUnderline.SetItemImage(2, maIMGDoubleSel); |
175 maVSUnderline.SelectItem(2); //add | 165 maVSUnderline.SelectItem(2); |
176 maVSUnderline.GrabFocus(); 177 break; 178 case UNDERLINE_BOLD: 179 maVSUnderline.SetItemImage(3, maIMGBoldSel); | 166 maVSUnderline.GrabFocus(); 167 break; 168 case UNDERLINE_BOLD: 169 maVSUnderline.SetItemImage(3, maIMGBoldSel); |
180 maVSUnderline.SelectItem(3); //add | 170 maVSUnderline.SelectItem(3); |
181 maVSUnderline.GrabFocus(); 182 break; 183 case UNDERLINE_DOTTED: 184 maVSUnderline.SetItemImage(4, maIMGDotSel); | 171 maVSUnderline.GrabFocus(); 172 break; 173 case UNDERLINE_DOTTED: 174 maVSUnderline.SetItemImage(4, maIMGDotSel); |
185 maVSUnderline.SelectItem(4); //add | 175 maVSUnderline.SelectItem(4); |
186 maVSUnderline.GrabFocus(); 187 break; 188 case UNDERLINE_BOLDDOTTED: 189 maVSUnderline.SetItemImage(5, maIMGDotBoldSel); | 176 maVSUnderline.GrabFocus(); 177 break; 178 case UNDERLINE_BOLDDOTTED: 179 maVSUnderline.SetItemImage(5, maIMGDotBoldSel); |
190 maVSUnderline.SelectItem(5); //add | 180 maVSUnderline.SelectItem(5); |
191 maVSUnderline.GrabFocus(); 192 break; 193 case UNDERLINE_DASH: 194 maVSUnderline.SetItemImage(6, maIMGDashSel); | 181 maVSUnderline.GrabFocus(); 182 break; 183 case UNDERLINE_DASH: 184 maVSUnderline.SetItemImage(6, maIMGDashSel); |
195 maVSUnderline.SelectItem(6); //add | 185 maVSUnderline.SelectItem(6); |
196 maVSUnderline.GrabFocus(); 197 break; 198 case UNDERLINE_LONGDASH: 199 maVSUnderline.SetItemImage(7, maIMGDashLongSel); | 186 maVSUnderline.GrabFocus(); 187 break; 188 case UNDERLINE_LONGDASH: 189 maVSUnderline.SetItemImage(7, maIMGDashLongSel); |
200 maVSUnderline.SelectItem(7); //add | 190 maVSUnderline.SelectItem(7); |
201 maVSUnderline.GrabFocus(); 202 break; 203 case UNDERLINE_DASHDOT: 204 maVSUnderline.SetItemImage(8, maIMGDashDotSel); | 191 maVSUnderline.GrabFocus(); 192 break; 193 case UNDERLINE_DASHDOT: 194 maVSUnderline.SetItemImage(8, maIMGDashDotSel); |
205 maVSUnderline.SelectItem(8); //add | 195 maVSUnderline.SelectItem(8); |
206 maVSUnderline.GrabFocus(); 207 break; 208 case UNDERLINE_DASHDOTDOT: 209 maVSUnderline.SetItemImage(9, maIMGDashDotDotSel); | 196 maVSUnderline.GrabFocus(); 197 break; 198 case UNDERLINE_DASHDOTDOT: 199 maVSUnderline.SetItemImage(9, maIMGDashDotDotSel); |
210 maVSUnderline.SelectItem(9); //add | 200 maVSUnderline.SelectItem(9); |
211 maVSUnderline.GrabFocus(); 212 break; 213 case UNDERLINE_WAVE: 214 maVSUnderline.SetItemImage(10, maIMGWaveSel); | 201 maVSUnderline.GrabFocus(); 202 break; 203 case UNDERLINE_WAVE: 204 maVSUnderline.SetItemImage(10, maIMGWaveSel); |
215 maVSUnderline.SelectItem(10); //add | 205 maVSUnderline.SelectItem(10); |
216 maVSUnderline.GrabFocus(); 217 break; 218 case UNDERLINE_NONE: 219 default: 220 maVSUnderline.SelectItem(1); | 206 maVSUnderline.GrabFocus(); 207 break; 208 case UNDERLINE_NONE: 209 default: 210 maVSUnderline.SelectItem(1); |
221 maVSUnderline.SetNoSelection();//add | 211 maVSUnderline.SetNoSelection(); |
222 maPBOptions.GrabFocus(); 223 } 224 maVSUnderline.StartSelection(); | 212 maPBOptions.GrabFocus(); 213 } 214 maVSUnderline.StartSelection(); |
225 //removed 226 //if(mpPage->meContextType == PROPERTY_CONTEXT_SC_CELL) 227 // maPBOptions.Disable(); 228 //else 229 // maPBOptions.Enable(); 230 //removed end | |
231} 232ValueSet& TextUnderlineControl::GetValueSet() 233{ 234 return maVSUnderline; 235} 236Control& TextUnderlineControl::GetPB() 237{ 238 return maPBOptions; 239} 240IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl) 241{ 242 if(pControl == &maVSUnderline) 243 { 244 sal_uInt16 iPos = maVSUnderline.GetSelectItemId(); 245 FontUnderline eUnderline = (FontUnderline)(sal_uInt64)maVSUnderline.GetItemData( iPos ); 246 | 215} 216ValueSet& TextUnderlineControl::GetValueSet() 217{ 218 return maVSUnderline; 219} 220Control& TextUnderlineControl::GetPB() 221{ 222 return maPBOptions; 223} 224IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl) 225{ 226 if(pControl == &maVSUnderline) 227 { 228 sal_uInt16 iPos = maVSUnderline.GetSelectItemId(); 229 FontUnderline eUnderline = (FontUnderline)(sal_uInt64)maVSUnderline.GetItemData( iPos ); 230 |
247 //<<modified 248 //SvxTextLineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE); | |
249 SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE); | 231 SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE); |
250 //modify end>> | |
251 | 232 |
252 //<<add , this line of code will keep the new underline use pre-color 253 aLineItem.SetColor(mrTextPropertyPanel.GetUnderlineColor()); 254 //add end>> | 233 aLineItem.SetColor(mrTextPropertyPanel.GetUnderlineColor()); |
255 mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L); 256 | 234 mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L); 235 |
257 //add , for the popup page not update immediately | |
258 mrTextPropertyPanel.SetUnderline(eUnderline); | 236 mrTextPropertyPanel.SetUnderline(eUnderline); |
259 //add end 260 //mrTextPropertyPanel.SetDefaultUnderline(eUnderline); | |
261 262 mrTextPropertyPanel.EndUnderlinePopupMode(); 263 } 264 return( 0L ); 265} 266 267IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn) 268{ 269 if(pPBtn == &maPBOptions) 270 { 271 if (mpBindings) 272 { 273 SfxDispatcher* pDisp = mpBindings->GetDispatcher(); 274 pDisp->Execute( SID_CHAR_DLG_EFFECT, SFX_CALLMODE_ASYNCHRON ); 275 } | 237 238 mrTextPropertyPanel.EndUnderlinePopupMode(); 239 } 240 return( 0L ); 241} 242 243IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn) 244{ 245 if(pPBtn == &maPBOptions) 246 { 247 if (mpBindings) 248 { 249 SfxDispatcher* pDisp = mpBindings->GetDispatcher(); 250 pDisp->Execute( SID_CHAR_DLG_EFFECT, SFX_CALLMODE_ASYNCHRON ); 251 } |
276 //add | |
277 mrTextPropertyPanel.EndUnderlinePopupMode(); | 252 mrTextPropertyPanel.EndUnderlinePopupMode(); |
278 //add end | |
279 } 280 return 0; 281} 282 283}} | 253 } 254 return 0; 255} 256 257}} |