2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
9
#include "smwidgets.moc"
11
#include <qlineedit.h>
14
/***********************************************************************/
15
/***********************************************************************/
17
SMSpinBox::SMSpinBox(QWidget *parent, const char *name)
18
: QSpinBox(parent, name),
20
useParentValue_(false),
26
void SMSpinBox::setValue(int val)
28
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
33
QSpinBox::setValue(val);
36
void SMSpinBox::setValue(int val, bool isParentVal)
38
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
41
setFont(!isParentVal);
43
QSpinBox::setValue(val);
44
connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
47
void SMSpinBox::clear()
49
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
51
connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
54
void SMSpinBox::setParentValue(int val)
60
bool SMSpinBox::useParentValue()
62
bool ret = useParentValue_;
63
useParentValue_ = false;
67
void SMSpinBox::interpretText()
69
// QString t = text();
70
// if (hasParent_ && (t == "" || t.isEmpty() || t == QString::null))
71
if (hasParent_ && text().isEmpty())
73
useParentValue_ = true;
74
setValue(pValue_, true);
76
QSpinBox::interpretText();
79
void SMSpinBox::setFont(bool wantBold)
86
void SMSpinBox::slotValueChanged()
92
/***********************************************************************/
93
/***********************************************************************/
95
SMMSpinBox::SMMSpinBox(QWidget *pa, int s)
98
useParentValue_(false),
104
SMMSpinBox::SMMSpinBox(double minValue, double maxValue, QWidget *pa, int s)
105
: MSpinBox(minValue, maxValue, pa, s),
107
useParentValue_(false),
113
SMMSpinBox::SMMSpinBox(QWidget *parent, const char * name)
114
: MSpinBox(parent, name),
116
useParentValue_(false),
122
void SMMSpinBox::setValue(double val)
124
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
129
MSpinBox::setValue(val);
132
void SMMSpinBox::setValue(double val, bool isParentVal)
134
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
137
setFont(!isParentVal);
139
MSpinBox::setValue(val);
140
connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
143
void SMMSpinBox::clear()
145
disconnect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
147
connect(this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged()));
150
void SMMSpinBox::setParentValue(double val)
156
bool SMMSpinBox::useParentValue()
158
bool ret = useParentValue_;
159
useParentValue_ = false;
163
void SMMSpinBox::interpretText()
165
// QString t = text();
166
// if (hasParent_ && (t == "" || t.isEmpty() || t == QString::null))
167
if (hasParent_ && text().isEmpty())
169
useParentValue_ = true;
170
setValue(pValue_, true);
172
MSpinBox::interpretText();
175
void SMMSpinBox::setFont(bool wantBold)
179
MSpinBox::setFont(f);
182
void SMMSpinBox::slotValueChanged()
188
/***********************************************************************/
189
/***********************************************************************/
191
SMScComboBox::SMScComboBox(QWidget *parent, const char *name)
192
: ScComboBox(parent, name),
194
useParentValue_(false),
200
SMScComboBox::SMScComboBox(bool rw, QWidget* parent, const char* name)
201
: ScComboBox(rw, parent, name),
203
useParentValue_(false),
209
void SMScComboBox::setCurrentItem(int i)
211
disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
215
ScComboBox::setCurrentItem(i);
218
void SMScComboBox::setCurrentItem(int i, bool isParentValue)
220
disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
223
setFont(!isParentValue);
226
useParentValue_ = true;
227
insertItem( tr("Use Parent Value"));
230
ScComboBox::setCurrentItem(i);
231
connect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
234
void SMScComboBox::setParentItem(int i)
240
bool SMScComboBox::useParentValue()
244
if (useParentValue_ && hasParent_)
246
ret = currentItem() == (count() - 1);
249
removeItem(count() - 1);
251
setCurrentItem(pItem_, true);
252
useParentValue_ = false;
259
void SMScComboBox::setFont(bool wantBold)
263
ScComboBox::setFont(f);
266
void SMScComboBox::currentChanged()
268
if (hasParent_ && !useParentValue_)
271
insertItem( tr("Use Parent Value"));
272
useParentValue_ = true;
276
/***********************************************************************/
277
/***********************************************************************/
279
SMAlignSelect::SMAlignSelect(QWidget *parent)
280
: AlignSelect(parent),
282
useParentStyle_(false),
285
parentButton = new QToolButton(this, "parentButton");
286
parentButton->setMaximumSize( QSize( 22, 22 ) );
287
parentButton->setToggleButton( true );
288
parentButton->setText( tr("P", "P as in Parent"));
289
QToolTip::add(parentButton, tr("Use parent style's alignment instead of overriding it"));
290
GroupAlignLayout->addWidget( parentButton, 0, 5 );
291
resize(minimumSizeHint());
292
parentButton->hide();
295
void SMAlignSelect::setStyle(int i)
297
disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
298
disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
302
parentButton->hide();
303
AlignSelect::setStyle(i);
306
void SMAlignSelect::setStyle(int i, bool isParentValue)
308
disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
309
disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
312
setFont(!isParentValue);
314
parentButton->hide();
316
parentButton->show();
318
AlignSelect::setStyle(i);
319
connect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
320
connect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
323
void SMAlignSelect::setParentItem(int i)
329
bool SMAlignSelect::useParentValue()
331
bool ret = useParentStyle_;
332
useParentStyle_ = false;
334
setStyle(pStyle_, true);
339
void SMAlignSelect::setFont(bool wantBold)
343
parentButton->setFont(f);
346
void SMAlignSelect::styleChanged()
351
parentButton->show();
355
void SMAlignSelect::pbPressed()
357
useParentStyle_ = true;
360
/***********************************************************************/
361
/***********************************************************************/
363
SMStyleSelect::SMStyleSelect(QWidget *parent)
364
: StyleSelect(parent),
366
useParentStyle_(false),
369
parentButton = new QToolButton(this, "parentButton");
370
parentButton->setMaximumSize(QSize(22, 22));
371
parentButton->setMinimumSize(QSize(22, 22));
372
parentButton->setText( tr("P", "P as in Parent"));
373
QToolTip::add(parentButton, tr("Use parent style's effects instead of overriding them"));
374
ssLayout->addWidget(parentButton);
375
resize(minimumSizeHint());
376
parentButton->hide();
379
void SMStyleSelect::setStyle(int i)
381
disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
382
disconnect(ShadowVal->Xoffset, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
383
disconnect(ShadowVal->Yoffset, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
384
disconnect(OutlineVal->LWidth, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
385
disconnect(UnderlineVal->LPos, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
386
disconnect(UnderlineVal->LWidth, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
387
disconnect(StrikeVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
388
disconnect(StrikeVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
389
disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
393
parentButton->hide();
394
StyleSelect::setStyle(i);
397
void SMStyleSelect::setStyle(int i, bool isParentValue)
399
disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
400
disconnect(ShadowVal->Xoffset, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
401
disconnect(ShadowVal->Yoffset, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
402
disconnect(OutlineVal->LWidth, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
403
disconnect(UnderlineVal->LPos, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
404
disconnect(UnderlineVal->LWidth, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
405
disconnect(StrikeVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
406
disconnect(StrikeVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
407
disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
410
setFont(!isParentValue);
412
parentButton->hide();
414
parentButton->show();
415
parentButton->setOn(true);
416
StyleSelect::setStyle(i);
417
connect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
418
connect(ShadowVal->Xoffset, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
419
connect(ShadowVal->Yoffset, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
420
connect(OutlineVal->LWidth, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
421
connect(UnderlineVal->LPos, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
422
connect(UnderlineVal->LWidth, SIGNAL(valueChanged(int)),this, SLOT(styleChanged()));
423
connect(StrikeVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
424
connect(StrikeVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
425
connect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
428
void SMStyleSelect::setParentItem(int i)
434
bool SMStyleSelect::useParentValue()
436
bool ret = useParentStyle_;
437
useParentStyle_ = false;
439
setStyle(pStyle_, true);
444
void SMStyleSelect::setFont(bool wantBold)
448
parentButton->setFont(f);
449
ShadowVal->Xoffset->setFont(f);
450
ShadowVal->Yoffset->setFont(f);
451
OutlineVal->LWidth->setFont(f);
452
UnderlineVal->LPos->setFont(f);
453
UnderlineVal->LWidth->setFont(f);
454
StrikeVal->LPos->setFont(f);
455
StrikeVal->LWidth->setFont(f);
456
StyleSelect::setFont(f);
459
void SMStyleSelect::styleChanged()
464
parentButton->show();
468
void SMStyleSelect::pbPressed()
470
useParentStyle_ = true;
471
emit State(getStyle());
474
/***********************************************************************/
475
/***********************************************************************/
477
/***********************************************************************/
478
/***********************************************************************/
480
SMShadeButton::SMShadeButton(QWidget *parent)
481
: ShadeButton(parent),
483
useParentValue_(false),
489
void SMShadeButton::setValue(int i)
491
disconnect(this, SIGNAL(pressed()), this, SLOT(currentChanged()));
495
ShadeButton::setValue(i);
498
void SMShadeButton::setValue(int i, bool isParentValue)
500
disconnect(this, SIGNAL(pressed()), this, SLOT(currentChanged()));
503
setFont(!isParentValue);
504
ShadeButton::setValue(i);
505
connect(this, SIGNAL(pressed()), this, SLOT(currentChanged()));
508
void SMShadeButton::setParentValue(int i)
514
bool SMShadeButton::useParentValue()
516
bool ret = useParentValue_;
517
useParentValue_ = false;
521
setValue(pValue_, true);
522
FillSh->removeItemAt(FillSh->count() - 1);
529
void SMShadeButton::setFont(bool wantBold)
534
ShadeButton::setFont(f);
537
void SMShadeButton::currentChanged()
542
QString upv = tr("Use Parent Value");
543
if (FillSh->text(FillSh->idAt(FillSh->count() - 1)) != upv)
544
FillSh->insertItem(upv, this, SLOT(slotUseParent()));
548
void SMShadeButton::slotUseParent()
550
useParentValue_ = true;
551
FillSh->removeItemAt(FillSh->count() - 1);
555
/***********************************************************************/
556
/***********************************************************************/
558
/***********************************************************************/
559
/***********************************************************************/
561
SMColorCombo::SMColorCombo(QWidget *parent, const char *name)
562
: ColorCombo(parent, name),
564
useParentValue_(false),
570
SMColorCombo::SMColorCombo(bool rw, QWidget* parent, const char* name)
571
: ColorCombo(rw, parent, name),
573
useParentValue_(false),
575
pText_(QString::null)
580
void SMColorCombo::setCurrentItem(int i)
582
disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
586
pText_ = QString::null;
587
ColorCombo::setCurrentItem(i);
590
void SMColorCombo::setCurrentItem(int i, bool isParentValue)
592
disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
595
pText_ = QString::null;
596
ColorCombo::setCurrentItem(i);
597
setFont(!isParentValue);
598
connect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
601
void SMColorCombo::setCurrentText(const QString &s)
603
disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
608
ColorCombo::setCurrentText(s);
611
void SMColorCombo::setCurrentText(const QString &s, bool isParentValue)
613
disconnect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
617
ColorCombo::setCurrentText(s);
618
setFont(!isParentValue);
619
connect(this, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
622
void SMColorCombo::setParentItem(int i)
626
pText_ = QString::null;
629
void SMColorCombo::setParentText(const QString &s)
635
bool SMColorCombo::useParentValue()
639
if (useParentValue_ && hasParent_)
641
ret = currentItem() == (count() - 1);
644
removeItem(count() - 1);
646
if (!pText_.isNull())
647
setCurrentText(pText_, true);
649
setCurrentItem(pItem_, true);
650
useParentValue_ = false;
657
void SMColorCombo::setFont(bool wantBold)
661
ColorCombo::setFont(f);
664
void SMColorCombo::currentChanged()
666
if (hasParent_ && !useParentValue_)
669
insertItem( tr("Use Parent Value"));
670
useParentValue_ = true;
675
/***********************************************************************/
676
/***********************************************************************/
678
SMFontComboH::SMFontComboH(QWidget *parent)
679
: FontComboH(parent, true),
681
useParentValue_(false),
682
pFont_(QString::null),
683
usePFont_( tr("Use Parent Font"))
688
void SMFontComboH::setCurrentFont(const QString &s)
690
disconnect(fontFamily, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
691
disconnect(fontStyle, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
695
FontComboH::setCurrentFont(s);
698
void SMFontComboH::setCurrentFont(const QString &s, bool isParentValue)
700
disconnect(fontFamily, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
701
disconnect(fontStyle, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
704
FontComboH::setCurrentFont(s);
705
setFont(!isParentValue);
706
connect(fontFamily, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
707
connect(fontStyle, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
710
void SMFontComboH::setParentFont(const QString &s)
716
bool SMFontComboH::useParentFont()
720
if (useParentValue_ && hasParent_)
722
ret = fontFamily->currentItem() == (fontFamily->count() - 1) ||
723
fontStyle->currentItem() == (fontStyle->count() - 1);
727
fontFamily->removeItem(fontFamily->count() - 1);
728
fontStyle->removeItem(fontStyle->count() - 1);
730
setCurrentFont(pFont_, true);
731
useParentValue_ = false;
738
void SMFontComboH::setFont(bool wantBold)
742
fontFamily->setFont(f);
743
fontStyle->setFont(f);
746
void SMFontComboH::currentChanged()
748
if (hasParent_ && !useParentValue_)
751
fontFamily->insertItem(usePFont_);
752
fontStyle->insertItem(usePFont_);
753
useParentValue_ = true;
759
void SMFontComboH::checkStyle()
761
if (hasParent_ && useParentValue_)
763
if (fontStyle->text(fontStyle->count() - 1) != usePFont_)
764
fontStyle->insertItem(usePFont_);
768
/***********************************************************************/
769
/***********************************************************************/
771
SMTabruler::SMTabruler(QWidget* parent, bool haveFirst, int dEin,
772
QValueList<ParagraphStyle::TabRecord> Tabs, double wid)
773
: Tabruler(parent, haveFirst, dEin, Tabs, wid)
775
parentButton_ = new QToolButton(this, "parentButton_");
776
Q_CHECK_PTR(parentButton_);
777
parentButton_->setText( tr(" Parent Tabs "));
778
indentLayout->addWidget(parentButton_);
779
parentButton_->hide();
782
parentButton_->setFont(f);
783
connect(parentButton_, SIGNAL(clicked()), this, SLOT(pbClicked()));
785
tabsChanged_ = false;
786
useParentTabs_ = false;
787
first_ = new SMMSpinBox(-3000, 4000, this, 1);
789
left_ = new SMMSpinBox(0, 4000, this, 1);
791
right_ = new SMMSpinBox(0, 4000, this, 1);
794
indentLayout->remove(firstLineData);
795
firstLineData->hide();
796
indentLayout->insertWidget(1, first_);
799
layout4->remove(leftIndentData);
800
leftIndentData->hide();
801
layout4->insertWidget(1, left_);
804
indentLayout->remove(rightIndentData);
805
rightIndentData->hide();
806
indentLayout->insertWidget(3, right_);
809
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
810
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
811
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
813
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
814
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
815
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
818
void SMTabruler::setTabs(QValueList<ParagraphStyle::TabRecord> Tabs, int dEin)
820
disconnect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
821
disconnect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
823
parentButton_->hide();
824
Tabruler::setTabs(Tabs, dEin);
826
QString ein = unitGetSuffixFromIndex(dEin);
829
first_->setDecimals(10000);
830
left_->setDecimals(10000);
831
right_->setDecimals(10000);
832
tabData->setDecimals(10000);
833
} // TODO else What's the decimal for other dEins?
834
first_->setSuffix(ein);
835
left_->setSuffix(ein);
836
right_->setSuffix(ein);
837
tabData->setSuffix(ein);
840
void SMTabruler::setTabs(QValueList<ParagraphStyle::TabRecord> Tabs, int dEin, bool isParentValue)
842
disconnect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
843
disconnect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
847
parentButton_->hide();
849
parentButton_->show();
850
Tabruler::setTabs(Tabs, dEin);
852
QString ein = unitGetSuffixFromIndex(dEin);
855
first_->setDecimals(10000);
856
left_->setDecimals(10000);
857
right_->setDecimals(10000);
858
tabData->setDecimals(10000);
859
} // TODO else What's the decimal for other dEins?
860
first_->setSuffix(ein);
861
left_->setSuffix(ein);
862
right_->setSuffix(ein);
863
tabData->setSuffix(ein);
865
connect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
866
connect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
869
void SMTabruler::setParentTabs(QValueList<ParagraphStyle::TabRecord> Tabs)
875
void SMTabruler::setFirstLineValue(double t)
877
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
878
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
879
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
880
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
881
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
882
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
884
firstLineData->setValue(t);
888
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
889
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
890
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
891
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
892
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
893
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
896
void SMTabruler::setFirstLineValue(double t, bool isParentValue)
898
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
899
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
900
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
901
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
902
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
903
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
904
isSetupFirst_ = true;
905
first_->setValue(t, isParentValue);
906
firstLineData->setValue(t);
910
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
911
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
912
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
913
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
914
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
915
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
918
void SMTabruler::setParentFirstLine(double t)
920
first_->setParentValue(t);
923
void SMTabruler::setLeftIndentValue(double t)
925
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
926
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
927
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
928
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
929
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
930
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
932
leftIndentData->setValue(t);
936
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
937
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
938
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
939
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
940
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
941
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
944
void SMTabruler::setLeftIndentValue(double t, bool isParentValue)
946
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
947
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
948
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
949
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
950
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
951
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
953
left_->setValue(t, isParentValue);
954
leftIndentData->setValue(t);
958
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
959
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
960
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
961
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
962
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
963
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
966
void SMTabruler::setParentLeftIndent(double t)
968
left_->setParentValue(t);
971
void SMTabruler::setRightIndentValue(double t)
973
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
974
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
975
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
976
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
977
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
978
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
980
rightIndentData->setValue(t);
984
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
985
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
986
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
987
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
988
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
989
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
992
void SMTabruler::setRightIndentValue(double t, bool isParentValue)
994
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
995
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
996
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
997
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
998
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
999
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1000
isSetupRight_ = true;
1001
right_->setValue(t, isParentValue);
1002
rightIndentData->setValue(t);
1006
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1007
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1008
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
1009
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1010
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1011
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1014
void SMTabruler::setParentRightIndent(double t)
1016
right_->setParentValue(t);
1019
bool SMTabruler::useParentTabs()
1021
bool ret = useParentTabs_;
1022
if (ret && hasParent_)
1024
setTabs(pTabs_, pDein_, true);
1025
Tabruler::repaint();
1026
parentButton_->hide();
1028
else if (hasParent_)
1030
parentButton_->show();
1036
bool SMTabruler::useParentFirstLine()
1038
return first_->useParentValue();
1041
bool SMTabruler::useParentLeftIndent()
1043
return left_->useParentValue();
1046
bool SMTabruler::useParentRightIndent()
1048
return right_->useParentValue();
1051
void SMTabruler::slotTabsChanged()
1055
useParentTabs_ = false;
1056
tabsChanged_ = true;
1060
void SMTabruler::pbClicked()
1064
useParentTabs_ = true;
1065
emit mouseReleased();
1069
void SMTabruler::leftDataChanged()
1071
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1072
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1073
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1076
leftIndentData->getValues(&a, &b, &c, &value);
1077
if (hasParent_ && !isSetupLeft_)
1078
left_->setValue(value, false);
1079
else if (!hasParent_)
1080
left_->setValue(value);
1082
isSetupLeft_ = false;
1083
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1084
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1085
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1088
void SMTabruler::rightDataChanged()
1090
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1091
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1092
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1095
rightIndentData->getValues(&a, &b, &c, &value);
1096
if (hasParent_ && !isSetupRight_)
1097
right_->setValue(value, false);
1098
else if (!hasParent_)
1099
right_->setValue(value);
1101
isSetupRight_ = false;
1102
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1103
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1104
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1107
void SMTabruler::firstDataChanged()
1109
disconnect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1110
disconnect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1111
disconnect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1114
firstLineData->getValues(&a, &b, &c, &value);
1115
if (hasParent_ && !isSetupFirst_)
1116
first_->setValue(value, false);
1117
else if (!hasParent_)
1118
first_->setValue(value);
1120
isSetupFirst_ = false;
1121
connect(first_, SIGNAL(valueChanged(int)), this, SLOT(firstValueChanged()));
1122
connect(right_, SIGNAL(valueChanged(int)), this, SLOT(rightValueChanged()));
1123
connect(left_, SIGNAL(valueChanged(int)), this, SLOT(leftValueChanged()));
1126
void SMTabruler::firstValueChanged()
1128
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1129
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1130
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
1133
first_->getValues(&a, &b, &c, &value);
1134
setFirstLineData(value);
1138
isSetupFirst_ = true;
1139
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1140
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1141
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
1144
void SMTabruler::leftValueChanged()
1146
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1147
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1148
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
1151
left_->getValues(&a, &b, &c, &value);
1152
setLeftIndentData(value);
1156
isSetupLeft_ = true;
1157
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1158
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1159
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
1162
void SMTabruler::rightValueChanged()
1164
disconnect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1165
disconnect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1166
disconnect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));
1169
right_->getValues(&a, &b, &c, &value);
1170
setRightIndentData(value);
1174
isSetupRight_ = true;
1175
connect(firstLineData, SIGNAL(valueChanged(int)), this, SLOT(firstDataChanged()));
1176
connect(rightIndentData, SIGNAL(valueChanged(int)), this, SLOT(rightDataChanged()));
1177
connect(leftIndentData, SIGNAL(valueChanged(int)), this, SLOT(leftDataChanged()));