32 #include <tqcombobox.h>
33 #include <tqcheckbox.h>
36 #include <tqgroupbox.h>
39 #include <tqscrollbar.h>
40 #include <tqstringlist.h>
41 #include <tqfontdatabase.h>
42 #include <tqwhatsthis.h>
43 #include <tqtooltip.h>
45 #include <tdeapplication.h>
46 #include <kcharsets.h>
47 #include <tdeconfig.h>
49 #include <tdeglobal.h>
50 #include <tdeglobalsettings.h>
51 #include <tqlineedit.h>
52 #include <tdelistbox.h>
54 #include <kstandarddirs.h>
56 #include <knuminput.h>
58 #include "tdefontdialog.moc"
60 static int minimumListWidth(
const TQListBox *list )
63 for( uint i=0; i<list->count(); i++ )
65 int itemWidth = list->item(i)->width(list);
66 w = TQMAX(w,itemWidth);
68 if( w == 0 ) { w = 40; }
69 w += list->frameWidth() * 2;
70 w += list->verticalScrollBar()->sizeHint().width();
74 static int minimumListHeight(
const TQListBox *list,
int numVisibleEntry )
76 int w = list->count() > 0 ? list->item(0)->height(list) :
77 list->fontMetrics().lineSpacing();
79 if( w < 0 ) { w = 10; }
80 if( numVisibleEntry <= 0 ) { numVisibleEntry = 4; }
81 return ( w * numVisibleEntry + 2 * list->frameWidth() );
84 class TDEFontChooser::TDEFontChooserPrivate
87 TDEFontChooserPrivate()
88 { m_palette.setColor(TQPalette::Active, TQColorGroup::Text, TQt::black);
89 m_palette.setColor(TQPalette::Active, TQColorGroup::Base, TQt::white); }
94 bool onlyFixed,
const TQStringList &fontList,
95 bool makeFrame,
int visibleListSize,
bool diff,
96 TQButton::ToggleState *sizeIsRelativeState )
97 : TQWidget(parent, name), usingFixed(onlyFixed)
101 TQString mainWhatsThisText =
102 i18n(
"Here you can choose the font to be used." );
103 TQWhatsThis::add(
this, mainWhatsThisText );
105 d =
new TDEFontChooserPrivate;
110 TQGridLayout *gridLayout;
114 page =
new TQGroupBox( i18n(
"Requested Font"),
this );
115 topLayout->addWidget(page);
117 gridLayout->addRowSpacing( 0, fontMetrics().lineSpacing() );
122 page =
new TQWidget(
this );
123 topLayout->addWidget(page);
130 TQHBoxLayout *familyLayout =
new TQHBoxLayout();
131 familyLayout->addSpacing( checkBoxGap );
133 familyCheckbox =
new TQCheckBox(i18n(
"Font"), page);
134 connect(familyCheckbox, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(toggled_checkbox()));
135 familyLayout->addWidget(familyCheckbox, 0, TQt::AlignLeft);
136 TQString familyCBToolTipText =
137 i18n(
"Change font family?");
138 TQString familyCBWhatsThisText =
139 i18n(
"Enable this checkbox to change the font family settings.");
140 TQWhatsThis::add( familyCheckbox, familyCBWhatsThisText );
141 TQToolTip::add( familyCheckbox, familyCBToolTipText );
145 familyLabel =
new TQLabel( i18n(
"Font:"), page,
"familyLabel" );
146 familyLayout->addWidget(familyLabel, 1, TQt::AlignLeft);
148 gridLayout->addLayout(familyLayout, row, 0 );
150 TQHBoxLayout *styleLayout =
new TQHBoxLayout();
152 styleCheckbox =
new TQCheckBox(i18n(
"Font style"), page);
153 connect(styleCheckbox, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(toggled_checkbox()));
154 styleLayout->addWidget(styleCheckbox, 0, TQt::AlignLeft);
155 TQString styleCBToolTipText =
156 i18n(
"Change font style?");
157 TQString styleCBWhatsThisText =
158 i18n(
"Enable this checkbox to change the font style settings.");
159 TQWhatsThis::add( styleCheckbox, styleCBWhatsThisText );
160 TQToolTip::add( styleCheckbox, styleCBToolTipText );
164 styleLabel =
new TQLabel( i18n(
"Font style:"), page,
"styleLabel");
165 styleLayout->addWidget(styleLabel, 1, TQt::AlignLeft);
167 styleLayout->addSpacing( checkBoxGap );
168 gridLayout->addLayout(styleLayout, row, 1 );
170 TQHBoxLayout *sizeLayout =
new TQHBoxLayout();
172 sizeCheckbox =
new TQCheckBox(i18n(
"Size"),page);
173 connect(sizeCheckbox, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(toggled_checkbox()));
174 sizeLayout->addWidget(sizeCheckbox, 0, TQt::AlignLeft);
175 TQString sizeCBToolTipText =
176 i18n(
"Change font size?");
177 TQString sizeCBWhatsThisText =
178 i18n(
"Enable this checkbox to change the font size settings.");
179 TQWhatsThis::add( sizeCheckbox, sizeCBWhatsThisText );
180 TQToolTip::add( sizeCheckbox, sizeCBToolTipText );
184 sizeLabel =
new TQLabel( i18n(
"Size:"), page,
"sizeLabel");
185 sizeLayout->addWidget(sizeLabel, 1, TQt::AlignLeft);
187 sizeLayout->addSpacing( checkBoxGap );
188 sizeLayout->addSpacing( checkBoxGap );
189 gridLayout->addLayout(sizeLayout, row, 2 );
196 familyListBox =
new TDEListBox( page,
"familyListBox");
197 familyListBox->setEnabled( !diff );
198 gridLayout->addWidget( familyListBox, row, 0 );
199 TQString fontFamilyWhatsThisText =
200 i18n(
"Here you can choose the font family to be used." );
201 TQWhatsThis::add( familyListBox, fontFamilyWhatsThisText );
202 TQWhatsThis::add(diff?(TQWidget *) familyCheckbox:(TQWidget *) familyLabel, fontFamilyWhatsThisText );
203 connect(familyListBox, TQ_SIGNAL(highlighted(
const TQString &)),
204 TQ_SLOT(family_chosen_slot(
const TQString &)));
205 if(!fontList.isEmpty())
207 familyListBox->insertStringList(fontList);
211 fillFamilyListBox(onlyFixed);
214 familyListBox->setMinimumWidth( minimumListWidth( familyListBox ) );
215 familyListBox->setMinimumHeight(
216 minimumListHeight( familyListBox, visibleListSize ) );
218 styleListBox =
new TDEListBox( page,
"styleListBox");
219 styleListBox->setEnabled( !diff );
220 gridLayout->addWidget(styleListBox, row, 1);
221 TQString fontStyleWhatsThisText =
222 i18n(
"Here you can choose the font style to be used." );
223 TQWhatsThis::add( styleListBox, fontStyleWhatsThisText );
224 TQWhatsThis::add(diff?(TQWidget *)styleCheckbox:(TQWidget *)styleLabel, fontFamilyWhatsThisText );
225 styleListBox->insertItem(i18n(
"Regular"));
226 styleListBox->insertItem(i18n(
"Italic"));
227 styleListBox->insertItem(i18n(
"Bold"));
228 styleListBox->insertItem(i18n(
"Bold Italic"));
229 styleListBox->setMinimumWidth( minimumListWidth( styleListBox ) );
230 styleListBox->setMinimumHeight(
231 minimumListHeight( styleListBox, visibleListSize ) );
233 connect(styleListBox, TQ_SIGNAL(highlighted(
const TQString &)),
234 TQ_SLOT(style_chosen_slot(
const TQString &)));
237 sizeListBox =
new TDEListBox( page,
"sizeListBox");
241 sizeListBox->setEnabled( !diff );
242 sizeOfFont->setEnabled( !diff );
243 if( sizeIsRelativeState ) {
244 TQString sizeIsRelativeCBText =
246 TQString sizeIsRelativeCBToolTipText =
247 i18n(
"Font size<br><i>fixed</i> or <i>relative</i><br>to environment");
248 TQString sizeIsRelativeCBWhatsThisText =
249 i18n(
"Here you can switch between fixed font size and font size "
250 "to be calculated dynamically and adjusted to changing "
251 "environment (e.g. widget dimensions, paper size)." );
252 sizeIsRelativeCheckBox =
new TQCheckBox( sizeIsRelativeCBText,
254 "sizeIsRelativeCheckBox" );
255 sizeIsRelativeCheckBox->setTristate( diff );
257 gridLayout->addLayout(sizeLayout2, row, 2);
258 sizeLayout2->setColStretch( 1, 1 );
259 sizeLayout2->addMultiCellWidget( sizeOfFont, 0, 0, 0, 1);
260 sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,1);
261 sizeLayout2->addWidget(sizeIsRelativeCheckBox, 2, 0, TQt::AlignLeft);
262 TQWhatsThis::add( sizeIsRelativeCheckBox, sizeIsRelativeCBWhatsThisText );
263 TQToolTip::add( sizeIsRelativeCheckBox, sizeIsRelativeCBToolTipText );
266 sizeIsRelativeCheckBox = 0L;
268 gridLayout->addLayout(sizeLayout2, row, 2);
269 sizeLayout2->addWidget( sizeOfFont, 0, 0);
270 sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,0);
272 TQString fontSizeWhatsThisText =
273 i18n(
"Here you can choose the font size to be used." );
274 TQWhatsThis::add( sizeListBox, fontSizeWhatsThisText );
275 TQWhatsThis::add( diff?(TQWidget *)sizeCheckbox:(TQWidget *)sizeLabel, fontSizeWhatsThisText );
278 sizeListBox->setMinimumWidth( minimumListWidth(sizeListBox) +
279 sizeListBox->fontMetrics().maxWidth() );
280 sizeListBox->setMinimumHeight(
281 minimumListHeight( sizeListBox, visibleListSize ) );
283 connect( sizeOfFont, TQ_SIGNAL( valueChanged(
int) ),
284 TQ_SLOT(size_value_slot(
int)));
286 connect( sizeListBox, TQ_SIGNAL(highlighted(
const TQString&)),
287 TQ_SLOT(size_chosen_slot(
const TQString&)) );
288 sizeListBox->setSelected(sizeListBox->findItem(TQString::number(10)),
true);
293 sampleEdit =
new TQLineEdit( page,
"sampleEdit");
295 sampleEdit->setFont(tmpFont);
297 sampleEdit->setText(i18n(
"The Quick Brown Fox Jumps Over The Lazy Dog"));
298 sampleEdit->setMinimumHeight( sampleEdit->fontMetrics().lineSpacing() );
299 sampleEdit->setAlignment(TQt::AlignCenter);
300 gridLayout->addMultiCellWidget(sampleEdit, 4, 4, 0, 2);
301 TQString sampleEditWhatsThisText =
302 i18n(
"This sample text illustrates the current settings. "
303 "You may edit it to test special characters." );
304 TQWhatsThis::add( sampleEdit, sampleEditWhatsThisText );
306 TQ_SLOT(displaySample(
const TQFont &)));
311 page =
new TQGroupBox( i18n(
"Actual Font"),
this );
312 topLayout->addWidget(page);
314 vbox->addSpacing( fontMetrics().lineSpacing() );
318 page =
new TQWidget(
this );
319 topLayout->addWidget(page);
321 TQLabel *label =
new TQLabel( i18n(
"Actual Font"), page );
322 vbox->addWidget( label );
325 xlfdEdit =
new TQLineEdit( page,
"xlfdEdit" );
326 vbox->addWidget( xlfdEdit );
331 if( sizeIsRelativeState && sizeIsRelativeCheckBox )
336 showXLFDArea(config->
readBoolEntry(TQString::fromLatin1(
"fontSelectorShowXLFD"),
false));
344 void TDEFontChooser::fillSizeList() {
345 if(! sizeListBox)
return;
347 static const int c[] =
357 for(
int i = 0; c[i]; ++i)
359 sizeListBox->insertItem(TQString::number(c[i]));
365 d->m_palette.setColor( TQPalette::Active, TQColorGroup::Text, col );
366 TQPalette pal = sampleEdit->palette();
367 pal.setColor( TQPalette::Active, TQColorGroup::Text, col );
368 sampleEdit->setPalette( pal );
373 return d->m_palette.color( TQPalette::Active, TQColorGroup::Text );
378 d->m_palette.setColor( TQPalette::Active, TQColorGroup::Base, col );
379 TQPalette pal = sampleEdit->palette();
380 pal.setColor( TQPalette::Active, TQColorGroup::Base, col );
381 sampleEdit->setPalette( pal );
386 return d->m_palette.color( TQPalette::Active, TQColorGroup::Base );
392 if( sizeIsRelativeCheckBox ) {
393 if( TQButton::NoChange == relative )
394 sizeIsRelativeCheckBox->setNoChange();
396 sizeIsRelativeCheckBox->setChecked( TQButton::On == relative );
402 return sizeIsRelativeCheckBox
403 ? sizeIsRelativeCheckBox->state()
404 : TQButton::NoChange;
409 return minimumSizeHint();
415 if( column & FamilyList )
417 familyListBox->setEnabled(state);
419 if( column & StyleList )
421 styleListBox->setEnabled(state);
423 if( column & SizeList )
425 sizeListBox->setEnabled(state);
433 selectedSize=aFont.pointSize();
434 if (selectedSize == -1)
435 selectedSize = TQFontInfo(aFont).pointSize();
437 if( onlyFixed != usingFixed)
439 usingFixed = onlyFixed;
440 fillFamilyListBox(usingFixed);
443 displaySample(selFont);
449 if (familyCheckbox && styleCheckbox && sizeCheckbox) {
450 diffFlags = (int)(familyCheckbox->isChecked() ? FontDiffFamily : 0)
451 | (
int)( styleCheckbox->isChecked() ? FontDiffStyle : 0)
452 | (
int)( sizeCheckbox->isChecked() ? FontDiffSize : 0);
457 void TDEFontChooser::toggled_checkbox()
459 familyListBox->setEnabled( familyCheckbox->isChecked() );
460 styleListBox->setEnabled( styleCheckbox->isChecked() );
461 sizeListBox->setEnabled( sizeCheckbox->isChecked() );
462 sizeOfFont->setEnabled( sizeCheckbox->isChecked() );
465 TQString TDEFontChooser::style_name(
const TQString &style)
468 TQString(style).
replace(
"Plain",
"Regular")
474 void TDEFontChooser::family_chosen_slot(
const TQString& family)
476 TQString currentFamily;
477 if (family.isEmpty())
479 currentFamily = familyListBox->currentText();
483 currentFamily = family;
486 TQFontDatabase dbase;
487 TQStringList styles = dbase.styles(currentFamily);
488 styleListBox->clear();
489 currentStyles.clear();
490 for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
491 TQString style = style_name(*it);
492 if(!styleListBox->findItem(style)) {
493 styleListBox->insertItem(style);
494 currentStyles.insert(style, *it);
497 if(styleListBox->count()==0) {
498 styleListBox->insertItem(i18n(
"Regular"));
499 currentStyles.insert(i18n(
"Regular"),
"Normal");
502 styleListBox->blockSignals(
true);
503 TQListBoxItem *item = styleListBox->findItem(selectedStyle);
506 styleListBox->setSelected(styleListBox->findItem(selectedStyle),
true);
510 styleListBox->setSelected(0,
true);
512 styleListBox->blockSignals(
false);
514 style_chosen_slot(TQString::null);
516 if (!family.isEmpty() )
518 selectedFamily = family;
522 void TDEFontChooser::size_chosen_slot(
const TQString& size){
524 selectedSize=size.toInt();
526 selFont.setPointSize(selectedSize);
530 void TDEFontChooser::size_value_slot(
int val) {
531 selFont.setPointSize(val);
535 void TDEFontChooser::style_chosen_slot(
const TQString& style)
537 TQString currentStyle;
539 currentStyle = styleListBox->currentText();
541 currentStyle = style;
545 sizeListBox->clear();
546 TQFontDatabase dbase;
547 if(dbase.isSmoothlyScalable(familyListBox->currentText(), currentStyles[currentStyle])) {
552 TQValueList<int> sizes = dbase.smoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
553 if(sizes.count() > 0) {
554 TQValueList<int>::iterator it;
556 for ( it = sizes.begin(); it != sizes.end(); ++it ) {
557 if(*it <= selectedSize || diff > *it - selectedSize) diff = selectedSize - *it;
558 sizeListBox->insertItem(TQString::number(*it));
563 sizeListBox->blockSignals(
true);
564 sizeListBox->setSelected(sizeListBox->findItem(TQString::number(selectedSize)),
true);
565 sizeListBox->blockSignals(
false);
566 sizeListBox->ensureCurrentVisible();
569 selFont = dbase.font(familyListBox->currentText(), currentStyles[currentStyle], selectedSize-diff);
571 if (!style.isEmpty())
572 selectedStyle = style;
575 void TDEFontChooser::displaySample(
const TQFont& font)
577 sampleEdit->setFont(
font);
578 sampleEdit->setCursorPosition(0);
579 xlfdEdit->setText(
font.rawName());
580 xlfdEdit->setCursorPosition(0);
587 void TDEFontChooser::setupDisplay()
591 TQFontDatabase dbase;
592 TQString family = TQString(selFont.family()).lower();
593 TQString style = style_name(dbase.styleString(selFont));
594 int size = selFont.pointSize();
596 size = TQFontInfo(selFont).pointSize();
597 TQString sizeStr = TQString::number(size);
601 numEntries = familyListBox->count();
602 for (i = 0; i < numEntries; i++) {
603 if (family == familyListBox->text(i).lower()) {
604 familyListBox->setCurrentItem(i);
610 if ( (i == numEntries) )
612 if (family.contains(
'['))
614 family = family.left(family.find(
'[')).stripWhiteSpace();
615 for (i = 0; i < numEntries; i++) {
616 if (family == familyListBox->text(i).lower()) {
617 familyListBox->setCurrentItem(i);
625 if ( (i == numEntries) )
627 TQString fallback = family+
" [";
628 for (i = 0; i < numEntries; i++) {
629 if (familyListBox->text(i).lower().startsWith(fallback)) {
630 familyListBox->setCurrentItem(i);
637 if ( (i == numEntries) )
639 for (i = 0; i < numEntries; i++) {
640 if (familyListBox->text(i).lower().startsWith(family)) {
641 familyListBox->setCurrentItem(i);
648 if ( i == numEntries )
649 familyListBox->setCurrentItem( 0 );
652 for (
int i = 0; i < (int)styleListBox->count(); ++i)
654 if (styleListBox->text(i) == style)
660 styleListBox->setCurrentItem(item);
662 numEntries = sizeListBox->count();
663 for (i = 0; i < numEntries; i++){
664 if (sizeStr == sizeListBox->text(i)) {
665 sizeListBox->setCurrentItem(i);
676 TQFontDatabase dbase;
677 TQStringList lstSys(dbase.families());
680 if (fontListCriteria)
682 TQStringList lstFonts;
683 for (TQStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
685 if ((fontListCriteria & FixedWidthFonts) > 0 && !dbase.isFixedPitch(*it))
continue;
686 if (((fontListCriteria & (SmoothScalableFonts | ScalableFonts)) == ScalableFonts) &&
687 !dbase.isBitmapScalable(*it))
continue;
688 if ((fontListCriteria & SmoothScalableFonts) > 0 && !dbase.isSmoothlyScalable(*it))
continue;
689 lstFonts.append(*it);
692 if((fontListCriteria & FixedWidthFonts) > 0) {
695 if (lstFonts.count() == 0)
696 lstFonts.append(
"fixed");
709 familyListBox->blockSignals(
true);
710 familyListBox->clear();
711 familyListBox->insertStringList(list);
713 familyListBox->blockSignals(
false);
716 void TDEFontChooser::addFont( TQStringList &list,
const char *xfont )
718 const char *ptr = strchr( xfont,
'-' );
722 ptr = strchr( ptr + 1,
'-' );
726 TQString
font = TQString::fromLatin1(ptr + 1);
729 if ( ( pos =
font.find(
'-' ) ) > 0 ) {
730 font.truncate( pos );
732 if (
font.find( TQString::fromLatin1(
"open look"), 0,
false ) >= 0 )
735 TQStringList::Iterator it = list.begin();
737 for ( ; it != list.end(); ++it )
744 void TDEFontChooser::fillFamilyListBox(
bool onlyFixedFonts)
746 TQStringList fontList;
747 getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
748 familyListBox->clear();
749 familyListBox->insertStringList(fontList);
752 void TDEFontChooser::showXLFDArea(
bool show)
756 xlfdEdit->parentWidget()->show();
760 xlfdEdit->parentWidget()->hide();
767 bool onlyFixed,
bool modal,
768 const TQStringList &fontList,
bool makeFrame,
bool diff,
769 TQButton::ToggleState *sizeIsRelativeState )
770 :
KDialogBase( parent, name, modal, i18n(
"Select Font"), Ok|Cancel, Ok )
773 onlyFixed, fontList, makeFrame, 8,
774 diff, sizeIsRelativeState );
780 TQWidget *parent,
bool makeFrame,
781 TQButton::ToggleState *sizeIsRelativeState )
783 TDEFontDialog dlg( parent,
"Font Selector", onlyFixed,
true, TQStringList(),
784 makeFrame,
true, sizeIsRelativeState );
785 dlg.
setFont( theFont, onlyFixed );
787 int result = dlg.exec();
788 if( result == Accepted )
790 theFont = dlg.chooser->
font();
792 if( sizeIsRelativeState )
799 TQWidget *parent,
bool makeFrame,
800 TQButton::ToggleState *sizeIsRelativeState )
802 TDEFontDialog dlg( parent,
"Font Selector", onlyFixed,
true, TQStringList(),
803 makeFrame,
false, sizeIsRelativeState );
804 dlg.
setFont( theFont, onlyFixed );
806 int result = dlg.exec();
807 if( result == Accepted )
809 theFont = dlg.chooser->
font();
810 if( sizeIsRelativeState )
818 bool onlyFixed, TQWidget *parent,
820 TQButton::ToggleState *sizeIsRelativeState )
822 TDEFontDialog dlg( parent,
"Font and Text Selector", onlyFixed,
true,
823 TQStringList(), makeFrame,
false, sizeIsRelativeState );
824 dlg.
setFont( theFont, onlyFixed );
826 int result = dlg.exec();
827 if( result == Accepted )
829 theFont = dlg.chooser->
font();
831 if( sizeIsRelativeState )
837 void TDEFontChooser::virtual_hook(
int,
void* )
840 void TDEFontDialog::virtual_hook(
int id,
void* data )
841 { KDialogBase::virtual_hook(
id, data ); }
A dialog base class with standard buttons and predefined layouts.
void setMainWidget(TQWidget *widget)
Sets the main user definable widget.
static int marginHint()
Return the number of pixels you shall use between a dialog edge and the outermost widget(s) according...
static int spacingHint()
Return the number of pixels you shall use between widgets inside a dialog according to the KDE standa...
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
TQColor backgroundColor() const
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the chooser.
void fontSelected(const TQFont &font)
Emitted whenever the selected font changes.
TQString sampleText() const
TQButton::ToggleState sizeIsRelative() const
TDEFontChooser(TQWidget *parent=0L, const char *name=0L, bool onlyFixed=false, const TQStringList &fontList=TQStringList(), bool makeFrame=true, int visibleListSize=8, bool diff=false, TQButton::ToggleState *sizeIsRelativeState=0L)
Constructs a font picker widget.
virtual ~TDEFontChooser()
Destructs the font chooser.
void setBackgroundColor(const TQColor &col)
Sets the background color to use in the preview.
void setColor(const TQColor &col)
Sets the color to use in the preview.
virtual TQSize sizeHint(void) const
Reimplemented for internal reasons.
void enableColumn(int column, bool state)
Enables or disable a font column in the chooser.
void setSizeIsRelative(TQButton::ToggleState relative)
Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size...
static void getFontList(TQStringList &list, uint fontListCriteria)
Creates a list of font strings.
void setFamilyList(TQStringList list)
Fill the font family list of the TDEFontChooser.
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the dialog.
static int getFontAndText(TQFont &theFont, TQString &theString, bool onlyFixed=false, TQWidget *parent=0L, bool makeFrame=true, TQButton::ToggleState *sizeIsRelativeState=0L)
When you are not only interested in the font selected, but also in the example string typed in,...
TDEFontDialog(TQWidget *parent=0L, const char *name=0, bool onlyFixed=false, bool modal=false, const TQStringList &fontlist=TQStringList(), bool makeFrame=true, bool diff=false, TQButton::ToggleState *sizeIsRelativeState=0L)
Constructs a font selection dialog.
static int getFontDiff(TQFont &theFont, int &diffFlags, bool onlyFixed=false, TQWidget *parent=0L, bool makeFrame=true, TQButton::ToggleState *sizeIsRelativeState=0L)
Creates a modal font difference dialog, lets the user choose a selection of changes that should be ma...
static int getFont(TQFont &theFont, bool onlyFixed=false, TQWidget *parent=0L, bool makeFrame=true, TQButton::ToggleState *sizeIsRelativeState=0L)
Creates a modal font dialog, lets the user choose a font, and returns when the dialog is closed.
static TQFont generalFont()
static TDEConfig * config()
A variant of TQListBox that honors KDE's system-wide settings.
const TDEShortcut & replace()