TextPropertyPanel.cxx (65be1ea2) TextPropertyPanel.cxx (f79579d2)
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

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

141 nH = LogicToLogic( mpHeightItem->GetHeight(), (MapUnit)eUnit, MAP_TWIP );
142 return nH;
143}
144
145
146TextPropertyPanel* TextPropertyPanel::Create (
147 Window* pParent,
148 const cssu::Reference<css::frame::XFrame>& rxFrame,
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

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

141 nH = LogicToLogic( mpHeightItem->GetHeight(), (MapUnit)eUnit, MAP_TWIP );
142 return nH;
143}
144
145
146TextPropertyPanel* TextPropertyPanel::Create (
147 Window* pParent,
148 const cssu::Reference<css::frame::XFrame>& rxFrame,
149 SfxBindings* pBindings,
150 const cssu::Reference<css::ui::XSidebar>& rxSidebar)
149 SfxBindings* pBindings)
151{
152 if (pParent == NULL)
153 throw lang::IllegalArgumentException(A2S("no parent Window given to TextPropertyPanel::Create"), NULL, 0);
154 if ( ! rxFrame.is())
155 throw lang::IllegalArgumentException(A2S("no XFrame given to TextPropertyPanel::Create"), NULL, 1);
156 if (pBindings == NULL)
157 throw lang::IllegalArgumentException(A2S("no SfxBindings given to TextPropertyPanel::Create"), NULL, 2);
158
159 return new TextPropertyPanel(
160 pParent,
161 rxFrame,
150{
151 if (pParent == NULL)
152 throw lang::IllegalArgumentException(A2S("no parent Window given to TextPropertyPanel::Create"), NULL, 0);
153 if ( ! rxFrame.is())
154 throw lang::IllegalArgumentException(A2S("no XFrame given to TextPropertyPanel::Create"), NULL, 1);
155 if (pBindings == NULL)
156 throw lang::IllegalArgumentException(A2S("no SfxBindings given to TextPropertyPanel::Create"), NULL, 2);
157
158 return new TextPropertyPanel(
159 pParent,
160 rxFrame,
162 pBindings,
163 rxSidebar);
161 pBindings);
164}
165
166
167::sfx2::sidebar::ControllerItem& TextPropertyPanel::GetSpaceController()
168{
169 return maSpacingControl;
170}
171
172TextPropertyPanel::TextPropertyPanel (
173 Window* pParent,
174 const cssu::Reference<css::frame::XFrame>& rxFrame,
162}
163
164
165::sfx2::sidebar::ControllerItem& TextPropertyPanel::GetSpaceController()
166{
167 return maSpacingControl;
168}
169
170TextPropertyPanel::TextPropertyPanel (
171 Window* pParent,
172 const cssu::Reference<css::frame::XFrame>& rxFrame,
175 SfxBindings* pBindings,
176 const cssu::Reference<css::ui::XSidebar>& rxSidebar)
173 SfxBindings* pBindings)
177 : Control(pParent, SVX_RES(RID_SIDEBAR_TEXT_PANEL)),
178 mpFontNameBox (new SvxSBFontNameBox(this, SVX_RES(CB_SBFONT_FONT))),
179 maFontSizeBox (this, SVX_RES(MB_SBFONT_FONTSIZE)),
180 mpToolBoxIncDecBackground(ControlFactory::CreateToolBoxBackground(this)),
181 mpToolBoxIncDec(ControlFactory::CreateToolBox(
182 mpToolBoxIncDecBackground.get(),
183 SVX_RES(TB_INCREASE_DECREASE))),
184 mpToolBoxFontBackground(ControlFactory::CreateToolBoxBackground(this)),

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

228 mbMustDelete (false),
229 mbFocusOnFontSizeCtrl(false),
230 maCharSpacePopup(this, ::boost::bind(&TextPropertyPanel::CreateCharacterSpacingControl, this, _1)),
231 maUnderlinePopup(this, ::boost::bind(&TextPropertyPanel::CreateUnderlinePopupControl, this, _1)),
232 maFontColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateFontColorPopupControl, this, _1)),
233 maBrushColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateBrushColorPopupControl, this, _1)),
234 mxFrame(rxFrame),
235 maContext(),
174 : Control(pParent, SVX_RES(RID_SIDEBAR_TEXT_PANEL)),
175 mpFontNameBox (new SvxSBFontNameBox(this, SVX_RES(CB_SBFONT_FONT))),
176 maFontSizeBox (this, SVX_RES(MB_SBFONT_FONTSIZE)),
177 mpToolBoxIncDecBackground(ControlFactory::CreateToolBoxBackground(this)),
178 mpToolBoxIncDec(ControlFactory::CreateToolBox(
179 mpToolBoxIncDecBackground.get(),
180 SVX_RES(TB_INCREASE_DECREASE))),
181 mpToolBoxFontBackground(ControlFactory::CreateToolBoxBackground(this)),

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

225 mbMustDelete (false),
226 mbFocusOnFontSizeCtrl(false),
227 maCharSpacePopup(this, ::boost::bind(&TextPropertyPanel::CreateCharacterSpacingControl, this, _1)),
228 maUnderlinePopup(this, ::boost::bind(&TextPropertyPanel::CreateUnderlinePopupControl, this, _1)),
229 maFontColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateFontColorPopupControl, this, _1)),
230 maBrushColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateBrushColorPopupControl, this, _1)),
231 mxFrame(rxFrame),
232 maContext(),
236 mpBindings(pBindings),
237 mxSidebar(rxSidebar)
233 mpBindings(pBindings)
238{
239 Initialize();
240 FreeResource();
241}
242
243
244
245

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

285 return;
286 }
287
288 maContext = aContext;
289 switch (maContext.GetCombinedContext_DI())
290 {
291 case CombinedEnumContext(Application_Calc, Context_Cell):
292 case CombinedEnumContext(Application_Calc, Context_Pivot):
234{
235 Initialize();
236 FreeResource();
237}
238
239
240
241

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

281 return;
282 }
283
284 maContext = aContext;
285 switch (maContext.GetCombinedContext_DI())
286 {
287 case CombinedEnumContext(Application_Calc, Context_Cell):
288 case CombinedEnumContext(Application_Calc, Context_Pivot):
293 {
294 mpToolBoxScript->Hide();
295 mpToolBoxScriptSw->Hide();
289 mpToolBoxScriptSw->Hide();
296 mpToolBoxSpacing->Hide();
297 mpToolBoxHighlight->Hide();
290 mpToolBoxHighlight->Hide();
298
299 Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT_S);
300 aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
301 aSize.setWidth(GetOutputSizePixel().Width());
302 SetSizePixel(aSize);
303 if (mxSidebar.is())
304 mxSidebar->requestLayout();
291 mpToolBoxScript->Disable();
292 mpToolBoxSpacing->Disable();
305 break;
293 break;
306 }
307
294
295 case CombinedEnumContext(Application_Calc, Context_EditCell):
296 case CombinedEnumContext(Application_Calc, Context_DrawText):
297 mpToolBoxScriptSw->Hide();
298 mpToolBoxHighlight->Hide();
299 mpToolBoxScript->Enable();
300 mpToolBoxSpacing->Enable();
301 break;
302
308 case CombinedEnumContext(Application_WriterVariants, Context_Text):
309 case CombinedEnumContext(Application_WriterVariants, Context_Table):
303 case CombinedEnumContext(Application_WriterVariants, Context_Text):
304 case CombinedEnumContext(Application_WriterVariants, Context_Table):
310 {
311 mpToolBoxScriptSw->Show();
312 mpToolBoxScript->Hide();
313 mpToolBoxHighlight->Show();
314 mpToolBoxSpacing->Show();
305 mpToolBoxScriptSw->Show();
306 mpToolBoxScript->Hide();
307 mpToolBoxHighlight->Show();
308 mpToolBoxSpacing->Show();
315
316 Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
317 aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
318 aSize.setWidth(GetOutputSizePixel().Width());
319 SetSizePixel(aSize);
320 if (mxSidebar.is())
321 mxSidebar->requestLayout();
322 break;
309 break;
323 }
324
325 case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
326 case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
310
311 case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
312 case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
327 {
328 mpToolBoxScriptSw->Show();
329 mpToolBoxScript->Hide();
330 mpToolBoxSpacing->Show();
331 mpToolBoxHighlight->Hide();
313 mpToolBoxScriptSw->Show();
314 mpToolBoxScript->Hide();
315 mpToolBoxSpacing->Show();
316 mpToolBoxHighlight->Hide();
332
333 Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT);
334 aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
335 aSize.setWidth(GetOutputSizePixel().Width());
336 SetSizePixel(aSize);
337 if (mxSidebar.is())
338 mxSidebar->requestLayout();
339 break;
317 break;
340 }
341
318
342 case CombinedEnumContext(Application_Calc, Context_EditCell):
343 case CombinedEnumContext(Application_Calc, Context_DrawText):
344 case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
345 case CombinedEnumContext(Application_DrawImpress, Context_Text):
346 case CombinedEnumContext(Application_DrawImpress, Context_Table):
347 case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
348 case CombinedEnumContext(Application_DrawImpress, Context_Draw):
349 case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
350 case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
319 case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
320 case CombinedEnumContext(Application_DrawImpress, Context_Text):
321 case CombinedEnumContext(Application_DrawImpress, Context_Table):
322 case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
323 case CombinedEnumContext(Application_DrawImpress, Context_Draw):
324 case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
325 case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
351 {
352 mpToolBoxScriptSw->Hide();
353 mpToolBoxScript->Show();
354 mpToolBoxSpacing->Show();
355 mpToolBoxHighlight->Hide();
326 mpToolBoxScriptSw->Hide();
327 mpToolBoxScript->Show();
328 mpToolBoxSpacing->Show();
329 mpToolBoxHighlight->Hide();
356
357 Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT);
358 aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) );
359 aSize.setWidth(GetOutputSizePixel().Width());
360 SetSizePixel(aSize);
361 if (mxSidebar.is())
362 mxSidebar->requestLayout();
363 break;
330 break;
364 }
365
366 default:
367 break;
368 }
369}
370
371
372

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

467 maFontSizeBox.SetModifyHdl(aLink);
468 //add
469 aLink = LINK(this, TextPropertyPanel, FontSizeSelHdl);
470 maFontSizeBox.SetSelectHdl(aLink);
471 //add end
472 aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
473 maFontSizeBox.SetLoseFocusHdl(aLink);
474
331
332 default:
333 break;
334 }
335}
336
337
338

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

433 maFontSizeBox.SetModifyHdl(aLink);
434 //add
435 aLink = LINK(this, TextPropertyPanel, FontSizeSelHdl);
436 maFontSizeBox.SetSelectHdl(aLink);
437 //add end
438 aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
439 maFontSizeBox.SetLoseFocusHdl(aLink);
440
475 // add
476 long aSizeBoxHeight = maFontSizeBox.GetSizePixel().getHeight();;
477 Point aPosFontSize = maFontSizeBox.GetPosPixel();
478 long aPosY = aPosFontSize.getY();
479 Point pTBIncDec = mpToolBoxIncDec->GetPosPixel();
480 long aIncDecHeight = mpToolBoxIncDec->GetSizePixel().getHeight();
481 pTBIncDec.setY(aPosY+aSizeBoxHeight/2-aIncDecHeight/2);
482 mpToolBoxIncDec->SetPosPixel(pTBIncDec);
483 //end
441 Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
442 aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
443 aSize.setWidth(GetOutputSizePixel().Width());
444 SetSizePixel(aSize);
484}
485
486void TextPropertyPanel::EndSpacingPopupMode (void)
487{
488 maCharSpacePopup.Hide();
489}
490
491void TextPropertyPanel::EndUnderlinePopupMode (void)

--- 907 unchanged lines hidden ---
445}
446
447void TextPropertyPanel::EndSpacingPopupMode (void)
448{
449 maCharSpacePopup.Hide();
450}
451
452void TextPropertyPanel::EndUnderlinePopupMode (void)

--- 907 unchanged lines hidden ---