LibreOffice Module sw (master)  1
pggrid.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sfx2/app.hxx>
21 
22 #include <cmdid.h>
23 #include <hintids.hxx>
24 #include <swtypes.hxx>
25 #include <globals.hrc>
26 #include <svx/colorbox.hxx>
27 #include <svx/xtable.hxx>
28 #include <svx/svxids.hrc>
29 #include <uitool.hxx>
30 #include <editeng/sizeitem.hxx>
31 #include <editeng/lrspitem.hxx>
32 #include <editeng/ulspitem.hxx>
33 #include <editeng/boxitem.hxx>
34 #include <editeng/frmdiritem.hxx>
35 #include <svx/ruler.hxx>
36 #include <pggrid.hxx>
37 #include <tgrditem.hxx>
38 
39 #include <wrtsh.hxx>
40 #include <doc.hxx>
41 #include <uiitems.hxx>
42 #include <swmodule.hxx>
43 #include <view.hxx>
44 
46  : SfxTabPage(pParent, "modules/swriter/ui/textgridpage.ui", "TextGridPage", &rSet)
47  , m_nRubyUserValue(0)
48  , m_bRubyUserValue(false)
49  , m_aPageSize(MM50, MM50)
50  , m_bVertical(false)
51  , m_bSquaredMode(false)
52  , m_bHRulerChanged(false)
53  , m_bVRulerChanged(false)
54  , m_xNoGridRB(m_xBuilder->weld_radio_button("radioRB_NOGRID"))
55  , m_xLinesGridRB(m_xBuilder->weld_radio_button("radioRB_LINESGRID"))
56  , m_xCharsGridRB(m_xBuilder->weld_radio_button("radioRB_CHARSGRID"))
57  , m_xSnapToCharsCB(m_xBuilder->weld_check_button("checkCB_SNAPTOCHARS"))
58  , m_xExampleWN(new weld::CustomWeld(*m_xBuilder, "drawingareaWN_EXAMPLE", m_aExampleWN))
59  , m_xLayoutFL(m_xBuilder->weld_widget("frameFL_LAYOUT"))
60  , m_xLinesPerPageNF(m_xBuilder->weld_spin_button("spinNF_LINESPERPAGE"))
61  , m_xLinesRangeFT(m_xBuilder->weld_label("labelFT_LINERANGE"))
62  , m_xTextSizeMF(m_xBuilder->weld_metric_spin_button("spinMF_TEXTSIZE", FieldUnit::POINT))
63  , m_xCharsPerLineFT(m_xBuilder->weld_label("labelFT_CHARSPERLINE"))
64  , m_xCharsPerLineNF(m_xBuilder->weld_spin_button("spinNF_CHARSPERLINE"))
65  , m_xCharsRangeFT(m_xBuilder->weld_label("labelFT_CHARRANGE"))
66  , m_xCharWidthFT(m_xBuilder->weld_label("labelFT_CHARWIDTH"))
67  , m_xCharWidthMF(m_xBuilder->weld_metric_spin_button("spinMF_CHARWIDTH", FieldUnit::POINT))
68  , m_xRubySizeFT(m_xBuilder->weld_label("labelFT_RUBYSIZE"))
69  , m_xRubySizeMF(m_xBuilder->weld_metric_spin_button("spinMF_RUBYSIZE", FieldUnit::POINT))
70  , m_xRubyBelowCB(m_xBuilder->weld_check_button("checkCB_RUBYBELOW"))
71  , m_xDisplayFL(m_xBuilder->weld_widget("frameFL_DISPLAY"))
72  , m_xDisplayCB(m_xBuilder->weld_check_button("checkCB_DISPLAY"))
73  , m_xPrintCB(m_xBuilder->weld_check_button("checkCB_PRINT"))
74  , m_xColorLB(new ColorListBox(m_xBuilder->weld_menu_button("listLB_COLOR"), pParent.GetFrameWeld()))
75 {
76  Link<weld::SpinButton&,void> aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
77  m_xCharsPerLineNF->connect_value_changed(aLink);
78  m_xLinesPerPageNF->connect_value_changed(aLink);
79 
80  Link<weld::MetricSpinButton&,void> aSizeLink = LINK(this, SwTextGridPage, TextSizeChangedHdl);
81  m_xTextSizeMF->connect_value_changed(aSizeLink);
82  m_xRubySizeMF->connect_value_changed(aSizeLink);
83  m_xCharWidthMF->connect_value_changed(aSizeLink);
84 
85  Link<weld::ToggleButton&,void> aGridTypeHdl = LINK(this, SwTextGridPage, GridTypeHdl);
86  m_xNoGridRB->connect_toggled(aGridTypeHdl);
87  m_xLinesGridRB->connect_toggled(aGridTypeHdl);
88  m_xCharsGridRB->connect_toggled(aGridTypeHdl);
89 
90  m_xColorLB->SetSelectHdl(LINK(this, SwTextGridPage, ColorModifyHdl));
91  m_xPrintCB->connect_toggled(LINK(this, SwTextGridPage, GridModifyClickHdl));
92  m_xRubyBelowCB->connect_toggled(LINK(this, SwTextGridPage, GridModifyClickHdl));
93 
94  m_xDisplayCB->connect_toggled(LINK(this, SwTextGridPage, DisplayGridHdl));
95 
96  //Get the default paper mode
97  SwView *pView = ::GetActiveView();
98  if( pView )
99  {
100  SwWrtShell* pSh = pView->GetWrtShellPtr();
101  if( pSh )
102  {
104  }
105  }
106  if( m_bSquaredMode )
107  {
108 
109  m_xRubySizeFT->show();
110  m_xRubySizeMF->show();
111  m_xRubyBelowCB->show();
112  m_xSnapToCharsCB->hide();
113  m_xCharWidthFT->hide();
114  m_xCharWidthMF->hide();
115  }
116  else
117  {
118  m_xRubySizeFT->hide();
119  m_xRubySizeMF->hide();
120  m_xRubyBelowCB->hide();
121  m_xSnapToCharsCB->show();
122  m_xCharWidthFT->show();
123  m_xCharWidthMF->show();
124  }
125 }
126 
128 {
129  disposeOnce();
130 }
131 
133 {
134  m_xColorLB.reset();
136 }
137 
139 {
140  return VclPtr<SwTextGridPage>::Create(pParent, *rSet);
141 }
142 
144 {
145  bool bRet = false;
146  if (m_xNoGridRB->get_state_changed_from_saved() ||
147  m_xLinesGridRB->get_state_changed_from_saved() ||
148  m_xLinesPerPageNF->get_value_changed_from_saved() ||
149  m_xTextSizeMF->get_value_changed_from_saved() ||
150  m_xCharsPerLineNF->get_value_changed_from_saved() ||
151  m_xSnapToCharsCB->get_state_changed_from_saved() ||
152  m_xRubySizeMF->get_value_changed_from_saved() ||
153  m_xCharWidthMF->get_value_changed_from_saved() ||
154  m_xRubyBelowCB->get_state_changed_from_saved() ||
155  m_xDisplayCB->get_state_changed_from_saved() ||
156  m_xPrintCB->get_state_changed_from_saved() ||
157  m_xColorLB->IsValueChangedFromSaved())
158  {
159  PutGridItem(*rSet);
160  bRet = true;
161  }
162 
163  // draw ticks of ruler
164  SwView * pView = ::GetActiveView();
165  if ( m_bHRulerChanged )
166  pView->GetHRuler().DrawTicks();
167  if ( m_bVRulerChanged )
168  pView->GetVRuler().DrawTicks();
169  return bRet;
170 }
171 
173 {
174  sal_Int32 nLinesPerPage = 0;
175 
176  if(SfxItemState::DEFAULT <= rSet->GetItemState(RES_TEXTGRID))
177  {
178  const SwTextGridItem& rGridItem = rSet->Get(RES_TEXTGRID);
179  weld::RadioButton* pButton = nullptr;
180  switch(rGridItem.GetGridType())
181  {
182  case GRID_NONE : pButton = m_xNoGridRB.get(); break;
183  case GRID_LINES_ONLY : pButton = m_xLinesGridRB.get(); break;
184  default: pButton = m_xCharsGridRB.get();
185  }
186  pButton->set_active(true);
187  m_xDisplayCB->set_active(rGridItem.IsDisplayGrid());
188  GridTypeHdl(*pButton);
189  m_xSnapToCharsCB->set_active(rGridItem.IsSnapToChars());
190  nLinesPerPage = rGridItem.GetLines();
191 
193  m_nRubyUserValue = rGridItem.GetBaseHeight();
194  m_bRubyUserValue = true;
195  m_xTextSizeMF->set_value(m_xTextSizeMF->normalize(m_nRubyUserValue), FieldUnit::TWIP);
196  m_xRubySizeMF->set_value(m_xRubySizeMF->normalize(rGridItem.GetRubyHeight()), FieldUnit::TWIP);
197  m_xCharWidthMF->set_value(m_xCharWidthMF->normalize(rGridItem.GetBaseWidth()), FieldUnit::TWIP);
198  m_xRubyBelowCB->set_active(rGridItem.IsRubyTextBelow());
199  m_xPrintCB->set_active(rGridItem.IsPrintGrid());
200  m_xColorLB->SelectEntry(rGridItem.GetColor());
201  }
202  UpdatePageSize(*rSet);
203 
204  if (nLinesPerPage > 0)
205  m_xLinesPerPageNF->set_value(nLinesPerPage);
206 
207  m_xNoGridRB->save_state();
208  m_xLinesGridRB->save_state();
209  m_xSnapToCharsCB->save_state();
210  m_xLinesPerPageNF->save_value();
211  m_xTextSizeMF->save_value();
212  m_xCharsPerLineNF->save_value();
213  m_xRubySizeMF->save_value();
214  m_xCharWidthMF->save_value();
215  m_xRubyBelowCB->save_state();
216  m_xDisplayCB->save_state();
217  m_xPrintCB->save_state();
218  m_xColorLB->SaveValue();
219 }
220 
222 {
223  m_aExampleWN.Hide();
225  UpdatePageSize(rSet);
226  m_aExampleWN.Show();
227  m_aExampleWN.Invalidate();
228 }
229 
231 {
232  return DeactivateRC::LeavePage;
233 }
234 
236 {
237  SwTextGridItem aGridItem;
238  aGridItem.SetGridType(m_xNoGridRB->get_active() ? GRID_NONE :
239  m_xLinesGridRB->get_active() ? GRID_LINES_ONLY : GRID_LINES_CHARS );
240  aGridItem.SetSnapToChars(m_xSnapToCharsCB->get_active());
241  aGridItem.SetLines( static_cast< sal_uInt16 >(m_xLinesPerPageNF->get_value()) );
242  aGridItem.SetBaseHeight( static_cast< sal_uInt16 >(
244  m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP))) );
245  aGridItem.SetRubyHeight( static_cast< sal_uInt16 >(m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))) );
246  aGridItem.SetBaseWidth( static_cast< sal_uInt16 >(m_xCharWidthMF->denormalize(m_xCharWidthMF->get_value(FieldUnit::TWIP))) );
247  aGridItem.SetRubyTextBelow(m_xRubyBelowCB->get_active());
248  aGridItem.SetSquaredMode(m_bSquaredMode);
249  aGridItem.SetDisplayGrid(m_xDisplayCB->get_active());
250  aGridItem.SetPrintGrid(m_xPrintCB->get_active());
251  aGridItem.SetColor(m_xColorLB->GetSelectEntryColor());
252  rSet.Put(aGridItem);
253 
254  SwView * pView = ::GetActiveView();
255  if ( aGridItem.GetGridType() != GRID_NONE )
256  {
257  if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
258  {
259  m_bHRulerChanged = true;
260  }
261  m_bVRulerChanged = true;
262  pView->GetHRuler().SetCharWidth(static_cast<long>(m_xCharWidthMF->get_value(FieldUnit::TWIP)/56.7));
263  pView->GetVRuler().SetLineHeight(static_cast<long>(m_xTextSizeMF->get_value(FieldUnit::TWIP)/56.7));
264  }
265 }
266 
268 {
269  if( SfxItemState::UNKNOWN != rSet.GetItemState( RES_FRAMEDIR ))
270  {
271  const SvxFrameDirectionItem& rDirItem =
272  rSet.Get(RES_FRAMEDIR);
273  m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
274  rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
275  }
276 
277  if( SfxItemState::SET != rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
278  return;
279 
280  const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
281  const SvxLRSpaceItem& rLRSpace = rSet.Get( RES_LR_SPACE );
282  const SvxULSpaceItem& rULSpace = rSet.Get( RES_UL_SPACE );
283  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
284  sal_Int32 nDistanceLR = rLRSpace.GetLeft() + rLRSpace.GetRight();
285  sal_Int32 nDistanceUL = rULSpace.GetUpper() + rULSpace.GetLower();
286 
287  sal_Int32 nValue1 = rSize.GetSize().Height() - nDistanceUL -
288  rBox.GetDistance(SvxBoxItemLine::TOP) -
289  rBox.GetDistance(SvxBoxItemLine::BOTTOM);
290  sal_Int32 nValue2 = rSize.GetSize().Width() - nDistanceLR -
291  rBox.GetDistance(SvxBoxItemLine::LEFT) -
292  rBox.GetDistance(SvxBoxItemLine::RIGHT);
293  if(m_bVertical)
294  {
295  m_aPageSize.setWidth( nValue1 );
296  m_aPageSize.setHeight( nValue2 );
297  }
298  else
299  {
300  m_aPageSize.setWidth( nValue2 );
301  m_aPageSize.setHeight( nValue1 );
302  }
303 
304  sal_Int32 nTextSize = static_cast< sal_Int32 >(m_bRubyUserValue ?
306  m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)));
307 
308  if ( m_bSquaredMode )
309  {
310  sal_Int32 nCharsPerLine = m_aPageSize.Width() / nTextSize;
311  m_xCharsPerLineNF->set_max(nCharsPerLine);
312  m_xCharsPerLineNF->set_value(nCharsPerLine);
314  ( m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)) +
315  m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))));
318  }
319  else
320  {
321  sal_Int32 nTextWidth = static_cast< sal_Int32 >(m_xCharWidthMF->denormalize(m_xCharWidthMF->get_value(FieldUnit::TWIP)));
322  m_xLinesPerPageNF->set_value(m_aPageSize.Height() / nTextSize);
323  if (nTextWidth)
324  m_xCharsPerLineNF->set_value(m_aPageSize.Width() / nTextWidth);
325  else
326  m_xCharsPerLineNF->set_value(45);
329  }
330 }
331 
332 void SwTextGridPage::SetLinesOrCharsRanges(weld::Label& rField, const sal_Int32 nValue )
333 {
334  OUString aFieldStr("( 1 -");
335  aFieldStr += OUString::number(nValue);
336  aFieldStr += " )";
337  rField.set_label(aFieldStr);
338 }
339 
340 const sal_uInt16* SwTextGridPage::GetRanges()
341 {
342  static const sal_uInt16 aPageRg[] = {
344  0};
345  return aPageRg;
346 }
347 
348 IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, weld::SpinButton&, rField, void)
349 {
350  //if in squared mode
351  if ( m_bSquaredMode )
352  {
353  if (m_xCharsPerLineNF.get() == &rField)
354  {
355  auto nValue = m_xCharsPerLineNF->get_value();
356  assert(nValue && "div-by-zero");
357  auto nWidth = m_aPageSize.Width() / nValue;
358  m_xTextSizeMF->set_value(m_xTextSizeMF->normalize(nWidth), FieldUnit::TWIP);
359  //prevent rounding errors in the MetricField by saving the used value
360  m_nRubyUserValue = nWidth;
361  m_bRubyUserValue = true;
362 
363  }
364  //set maximum line per page
365  {
366  sal_Int32 nMaxLines = static_cast< sal_Int32 >(m_aPageSize.Height() /
367  ( m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)) +
368  m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))));
369  m_xLinesPerPageNF->set_max(nMaxLines);
370  }
371  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
372  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
373  }
374  else//in normal mode
375  {
376  if (m_xLinesPerPageNF.get() == &rField)
377  {
378  auto nValue = m_xLinesPerPageNF->get_value();
379  assert(nValue && "div-by-zero");
380  auto nHeight = m_aPageSize.Height() / nValue;
381  m_xTextSizeMF->set_value(m_xTextSizeMF->normalize(nHeight), FieldUnit::TWIP);
382  m_xRubySizeMF->set_value(0, FieldUnit::TWIP);
383  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
384 
385  m_nRubyUserValue = nHeight;
386  m_bRubyUserValue = true;
387  }
388  else if (m_xCharsPerLineNF.get() == &rField)
389  {
390  auto nValue = m_xCharsPerLineNF->get_value();
391  assert(nValue && "div-by-zero");
392  auto nWidth = m_aPageSize.Width() / nValue;
393  m_xCharWidthMF->set_value(m_xCharWidthMF->normalize(nWidth), FieldUnit::TWIP);
394  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
395  }
396  }
397  GridModifyHdl();
398 }
399 
400 IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, weld::MetricSpinButton&, rField, void)
401 {
402  //if in squared mode
403  if( m_bSquaredMode )
404  {
405  if (m_xTextSizeMF.get() == &rField)
406  {
407  m_bRubyUserValue = false;
408 
409  // fdo#50941: set maximum characters per line
410  sal_Int32 nTextSize = static_cast< sal_Int32 >(m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)));
411  if (nTextSize > 0)
412  {
413  sal_Int32 nMaxChars = m_aPageSize.Width() / nTextSize;
414  m_xCharsPerLineNF->set_value(nMaxChars);
415  m_xCharsPerLineNF->set_max(nMaxChars);
416  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
417  }
418  }
419  //set maximum line per page
420  {
421  sal_Int32 nMaxLines = static_cast< sal_Int32 >(m_aPageSize.Height() /
422  ( m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)) +
423  m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))));
424  m_xLinesPerPageNF->set_max(nMaxLines);
425  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
426  }
427  }
428  else
429  {
430  if (m_xTextSizeMF.get() == &rField)
431  {
432  sal_Int32 nTextSize = static_cast< sal_Int32 >(m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)));
433  m_xLinesPerPageNF->set_value(m_aPageSize.Height() / nTextSize);
434  m_bRubyUserValue = false;
435  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
436  }
437  else if (m_xCharWidthMF.get() == &rField)
438  {
439  sal_Int32 nTextWidth = static_cast< sal_Int32 >(m_xCharWidthMF->denormalize(m_xCharWidthMF->get_value(FieldUnit::TWIP)));
440  sal_Int32 nMaxChar = 45 ;
441  if (nTextWidth)
442  nMaxChar = m_aPageSize.Width() / nTextWidth;
443  m_xCharsPerLineNF->set_value( nMaxChar );
444  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
445  }
446  //rubySize is disabled
447  }
448  GridModifyHdl();
449 }
450 
451 IMPL_LINK(SwTextGridPage, GridTypeHdl, weld::ToggleButton&, rButton, void)
452 {
453  bool bEnable = m_xNoGridRB.get() != &rButton;
454  m_xLayoutFL->set_sensitive(bEnable);
455  m_xDisplayFL->set_sensitive(bEnable);
456 
457  //one special case
458  if (bEnable)
459  DisplayGridHdl(*m_xDisplayCB);
460 
461  bEnable = m_xCharsGridRB.get() == &rButton;
462  m_xSnapToCharsCB->set_sensitive(bEnable);
463 
464  bEnable = m_xLinesGridRB.get() == &rButton;
465  if (bEnable && !m_bSquaredMode)
466  {
467  m_xCharsPerLineFT->set_sensitive(false);
468  m_xCharsPerLineNF->set_sensitive(false);
469  m_xCharsRangeFT->set_sensitive(false);
470  m_xCharWidthFT->set_sensitive(false);
471  m_xCharWidthMF->set_sensitive(false);
472  }
473 
474  GridModifyHdl();
475 }
476 
478 {
479  bool bChecked = m_xDisplayCB->get_active();
480  m_xPrintCB->set_sensitive(bChecked);
481  m_xPrintCB->set_active(bChecked);
482 }
483 
485 {
486  GridModifyHdl();
487 }
488 
490 {
491  GridModifyHdl();
492 }
493 
495 {
496  const SfxItemSet& rOldSet = GetItemSet();
497  SfxItemSet aSet(rOldSet);
498  const SfxItemSet* pExSet = GetDialogExampleSet();
499  if(pExSet)
500  aSet.Put(*pExSet);
501  PutGridItem(aSet);
503 }
504 
505 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
long Width() const
FieldUnit
void PutGridItem(SfxItemSet &rSet)
Definition: pggrid.cxx:235
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: pggrid.cxx:143
std::unique_ptr< ColorListBox > m_xColorLB
Definition: pggrid.hxx:60
sal_uInt16 GetLower() const
SwView * GetActiveView()
Definition: swmodul1.cxx:123
sal_uInt16 GetBaseWidth() const
Definition: tgrditem.hxx:97
long Height() const
virtual ~SwTextGridPage() override
Definition: pggrid.cxx:127
#define RES_FRAMEDIR
Definition: hintids.hxx:225
void SetRubyHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:79
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
std::unique_ptr< weld::RadioButton > m_xLinesGridRB
Definition: pggrid.hxx:41
void SetDisplayGrid(bool bNew)
Definition: tgrditem.hxx:94
std::unique_ptr< weld::MetricSpinButton > m_xTextSizeMF
Definition: pggrid.hxx:48
SvxRuler & GetVRuler()
Definition: view.hxx:482
std::unique_ptr< weld::Label > m_xLinesRangeFT
Definition: pggrid.hxx:47
std::unique_ptr< weld::CheckButton > m_xRubyBelowCB
Definition: pggrid.hxx:56
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
virtual void dispose() override
Definition: pggrid.cxx:132
void SetRubyTextBelow(bool bNew)
Definition: tgrditem.hxx:86
std::unique_ptr< weld::Label > m_xCharWidthFT
Definition: pggrid.hxx:52
void UpdatePageSize(const SfxItemSet &rSet)
Definition: pggrid.cxx:267
void SetBaseWidth(sal_uInt16 nNew)
Definition: tgrditem.hxx:98
IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, weld::SpinButton &, rField, void)
Definition: pggrid.cxx:348
#define RES_UL_SPACE
Definition: hintids.hxx:197
bool m_bHRulerChanged
Definition: pggrid.hxx:36
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
void SetColor(const Color &rCol)
Definition: tgrditem.hxx:70
virtual void dispose() override
bool m_bVRulerChanged
Definition: pggrid.hxx:37
virtual void set_active(bool active)=0
const SfxItemSet & GetItemSet() const
std::unique_ptr< weld::RadioButton > m_xNoGridRB
Definition: pggrid.hxx:40
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SwTextGridPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: pggrid.cxx:45
bool IsPrintGrid() const
Definition: tgrditem.hxx:88
bool IsRubyTextBelow() const
Definition: tgrditem.hxx:84
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rSet)
Definition: pggrid.cxx:138
sal_Int32 m_nRubyUserValue
Definition: pggrid.hxx:31
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:601
weld::Window * GetFrameWeld(SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
std::unique_ptr< weld::RadioButton > m_xCharsGridRB
Definition: pggrid.hxx:42
void SetBaseHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:76
IMPL_LINK_NOARG(SwTextGridPage, DisplayGridHdl, weld::ToggleButton &, void)
Definition: pggrid.cxx:477
bool m_bSquaredMode
Definition: pggrid.hxx:35
const SfxItemSet * GetDialogExampleSet() const
sal_uInt16 GetLines() const
Definition: tgrditem.hxx:72
virtual void set_label(const OUString &rText)=0
#define RES_LR_SPACE
Definition: hintids.hxx:196
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: pggrid.cxx:221
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwPageGridExample m_aExampleWN
Definition: pggrid.hxx:39
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
std::unique_ptr< weld::CheckButton > m_xPrintCB
Definition: pggrid.hxx:59
bool IsSquaredPageMode() const
Definition: docdesc.cxx:920
#define RES_TEXTGRID
Definition: hintids.hxx:220
#define MM50
Definition: swtypes.hxx:59
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: pggrid.cxx:230
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::unique_ptr< weld::Label > m_xCharsRangeFT
Definition: pggrid.hxx:51
void SetSnapToChars(bool bNew)
Definition: tgrditem.hxx:102
std::unique_ptr< weld::CheckButton > m_xSnapToCharsCB
Definition: pggrid.hxx:43
const Color & GetColor() const
Definition: tgrditem.hxx:69
void GridModifyHdl()
Definition: pggrid.cxx:494
static VclPtr< reference_type > Create(Arg &&...arg)
static const sal_uInt16 * GetRanges()
Definition: pggrid.cxx:340
bool m_bVertical
Definition: pggrid.hxx:34
SvxRuler & GetHRuler()
Definition: view.hxx:481
bool IsSnapToChars() const
Definition: tgrditem.hxx:100
long GetRight() const
std::unique_ptr< weld::Label > m_xRubySizeFT
Definition: pggrid.hxx:54
DeactivateRC
#define RES_BOX
Definition: hintids.hxx:211
bool m_bRubyUserValue
Definition: pggrid.hxx:32
std::unique_ptr< weld::CheckButton > m_xDisplayCB
Definition: pggrid.hxx:58
static void SetLinesOrCharsRanges(weld::Label &rField, const sal_Int32 nValue)
Definition: pggrid.cxx:332
bool IsDisplayGrid() const
Definition: tgrditem.hxx:92
Size m_aPageSize
Definition: pggrid.hxx:33
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
std::unique_ptr< weld::SpinButton > m_xCharsPerLineNF
Definition: pggrid.hxx:50
void SetPrintGrid(bool bNew)
Definition: tgrditem.hxx:90
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
std::unique_ptr< weld::MetricSpinButton > m_xRubySizeMF
Definition: pggrid.hxx:55
std::unique_ptr< weld::MetricSpinButton > m_xCharWidthMF
Definition: pggrid.hxx:53
void setWidth(long nWidth)
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
void SetGridType(SwTextGrid eNew)
Definition: tgrditem.hxx:82
Definition: view.hxx:146
std::unique_ptr< weld::SpinButton > m_xLinesPerPageNF
Definition: pggrid.hxx:46
const Size & GetSize() const
void SetLines(sal_uInt16 nNew)
Definition: tgrditem.hxx:73
sal_uInt16 GetUpper() const
virtual void Reset(const SfxItemSet *rSet) override
Definition: pggrid.cxx:172
void setHeight(long nHeight)