31 #include <tqcombobox.h>
32 #include <tqcheckbox.h>
35 #include <tqgroupbox.h>
38 #include <tqscrollbar.h>
39 #include <tqstringlist.h>
40 #include <tqfontdatabase.h>
41 #include <tqwhatsthis.h>
42 #include <tqtooltip.h>
44 #include <kapplication.h>
45 #include <kcharsets.h>
49 #include <kglobalsettings.h>
50 #include <tqlineedit.h>
53 #include <kstandarddirs.h>
55 #include <knuminput.h>
57 #include "kfontdialog.moc"
59 static int minimumListWidth(
const TQListBox *list )
62 for( uint i=0; i<list->count(); i++ )
64 int itemWidth = list->item(i)->width(list);
65 w = QMAX(w,itemWidth);
67 if( w == 0 ) { w = 40; }
68 w += list->frameWidth() * 2;
69 w += list->verticalScrollBar()->sizeHint().width();
73 static int minimumListHeight(
const TQListBox *list,
int numVisibleEntry )
75 int w = list->count() > 0 ? list->item(0)->height(list) :
76 list->fontMetrics().lineSpacing();
78 if( w < 0 ) { w = 10; }
79 if( numVisibleEntry <= 0 ) { numVisibleEntry = 4; }
80 return ( w * numVisibleEntry + 2 * list->frameWidth() );
83 class KFontChooser::KFontChooserPrivate
87 { m_palette.setColor(TQPalette::Active, TQColorGroup::Text, Qt::black);
88 m_palette.setColor(TQPalette::Active, TQColorGroup::Base, Qt::white); }
93 bool onlyFixed,
const TQStringList &fontList,
94 bool makeFrame,
int visibleListSize,
bool diff,
95 TQButton::ToggleState *sizeIsRelativeState )
96 : TQWidget(parent, name), usingFixed(onlyFixed)
100 TQString mainWhatsThisText =
101 i18n(
"Here you can choose the font to be used." );
102 TQWhatsThis::add(
this, mainWhatsThisText );
104 d =
new KFontChooserPrivate;
109 TQGridLayout *gridLayout;
113 page =
new TQGroupBox( i18n(
"Requested Font"),
this );
114 topLayout->addWidget(page);
116 gridLayout->addRowSpacing( 0, fontMetrics().lineSpacing() );
121 page =
new TQWidget(
this );
122 topLayout->addWidget(page);
129 TQHBoxLayout *familyLayout =
new TQHBoxLayout();
130 familyLayout->addSpacing( checkBoxGap );
132 familyCheckbox =
new TQCheckBox(i18n(
"Font"), page);
133 connect(familyCheckbox, TQT_SIGNAL(toggled(
bool)), TQT_SLOT(toggled_checkbox()));
134 familyLayout->addWidget(familyCheckbox, 0, Qt::AlignLeft);
135 TQString familyCBToolTipText =
136 i18n(
"Change font family?");
137 TQString familyCBWhatsThisText =
138 i18n(
"Enable this checkbox to change the font family settings.");
139 TQWhatsThis::add( familyCheckbox, familyCBWhatsThisText );
140 TQToolTip::add( familyCheckbox, familyCBToolTipText );
144 familyLabel =
new TQLabel( i18n(
"Font:"), page,
"familyLabel" );
145 familyLayout->addWidget(familyLabel, 1, Qt::AlignLeft);
147 gridLayout->addLayout(familyLayout, row, 0 );
149 TQHBoxLayout *styleLayout =
new TQHBoxLayout();
151 styleCheckbox =
new TQCheckBox(i18n(
"Font style"), page);
152 connect(styleCheckbox, TQT_SIGNAL(toggled(
bool)), TQT_SLOT(toggled_checkbox()));
153 styleLayout->addWidget(styleCheckbox, 0, Qt::AlignLeft);
154 TQString styleCBToolTipText =
155 i18n(
"Change font style?");
156 TQString styleCBWhatsThisText =
157 i18n(
"Enable this checkbox to change the font style settings.");
158 TQWhatsThis::add( styleCheckbox, styleCBWhatsThisText );
159 TQToolTip::add( styleCheckbox, styleCBToolTipText );
163 styleLabel =
new TQLabel( i18n(
"Font style:"), page,
"styleLabel");
164 styleLayout->addWidget(styleLabel, 1, Qt::AlignLeft);
166 styleLayout->addSpacing( checkBoxGap );
167 gridLayout->addLayout(styleLayout, row, 1 );
169 TQHBoxLayout *sizeLayout =
new TQHBoxLayout();
171 sizeCheckbox =
new TQCheckBox(i18n(
"Size"),page);
172 connect(sizeCheckbox, TQT_SIGNAL(toggled(
bool)), TQT_SLOT(toggled_checkbox()));
173 sizeLayout->addWidget(sizeCheckbox, 0, Qt::AlignLeft);
174 TQString sizeCBToolTipText =
175 i18n(
"Change font size?");
176 TQString sizeCBWhatsThisText =
177 i18n(
"Enable this checkbox to change the font size settings.");
178 TQWhatsThis::add( sizeCheckbox, sizeCBWhatsThisText );
179 TQToolTip::add( sizeCheckbox, sizeCBToolTipText );
183 sizeLabel =
new TQLabel( i18n(
"Size:"), page,
"sizeLabel");
184 sizeLayout->addWidget(sizeLabel, 1, Qt::AlignLeft);
186 sizeLayout->addSpacing( checkBoxGap );
187 sizeLayout->addSpacing( checkBoxGap );
188 gridLayout->addLayout(sizeLayout, row, 2 );
195 familyListBox =
new KListBox( page,
"familyListBox");
196 familyListBox->setEnabled( !diff );
197 gridLayout->addWidget( familyListBox, row, 0 );
198 TQString fontFamilyWhatsThisText =
199 i18n(
"Here you can choose the font family to be used." );
200 TQWhatsThis::add( familyListBox, fontFamilyWhatsThisText );
201 TQWhatsThis::add(diff?(TQWidget *) familyCheckbox:(TQWidget *) familyLabel, fontFamilyWhatsThisText );
202 connect(familyListBox, TQT_SIGNAL(highlighted(
const TQString &)),
203 TQT_SLOT(family_chosen_slot(
const TQString &)));
204 if(!fontList.isEmpty())
206 familyListBox->insertStringList(fontList);
210 fillFamilyListBox(onlyFixed);
213 familyListBox->setMinimumWidth( minimumListWidth( familyListBox ) );
214 familyListBox->setMinimumHeight(
215 minimumListHeight( familyListBox, visibleListSize ) );
217 styleListBox =
new KListBox( page,
"styleListBox");
218 styleListBox->setEnabled( !diff );
219 gridLayout->addWidget(styleListBox, row, 1);
220 TQString fontStyleWhatsThisText =
221 i18n(
"Here you can choose the font style to be used." );
222 TQWhatsThis::add( styleListBox, fontStyleWhatsThisText );
223 TQWhatsThis::add(diff?(TQWidget *)styleCheckbox:(TQWidget *)styleLabel, fontFamilyWhatsThisText );
224 styleListBox->insertItem(i18n(
"Regular"));
225 styleListBox->insertItem(i18n(
"Italic"));
226 styleListBox->insertItem(i18n(
"Bold"));
227 styleListBox->insertItem(i18n(
"Bold Italic"));
228 styleListBox->setMinimumWidth( minimumListWidth( styleListBox ) );
229 styleListBox->setMinimumHeight(
230 minimumListHeight( styleListBox, visibleListSize ) );
232 connect(styleListBox, TQT_SIGNAL(highlighted(
const TQString &)),
233 TQT_SLOT(style_chosen_slot(
const TQString &)));
236 sizeListBox =
new KListBox( page,
"sizeListBox");
240 sizeListBox->setEnabled( !diff );
241 sizeOfFont->setEnabled( !diff );
242 if( sizeIsRelativeState ) {
243 TQString sizeIsRelativeCBText =
245 TQString sizeIsRelativeCBToolTipText =
246 i18n(
"Font size<br><i>fixed</i> or <i>relative</i><br>to environment");
247 TQString sizeIsRelativeCBWhatsThisText =
248 i18n(
"Here you can switch between fixed font size and font size "
249 "to be calculated dynamically and adjusted to changing "
250 "environment (e.g. widget dimensions, paper size)." );
251 sizeIsRelativeCheckBox =
new TQCheckBox( sizeIsRelativeCBText,
253 "sizeIsRelativeCheckBox" );
254 sizeIsRelativeCheckBox->setTristate( diff );
256 gridLayout->addLayout(sizeLayout2, row, 2);
257 sizeLayout2->setColStretch( 1, 1 );
258 sizeLayout2->addMultiCellWidget( sizeOfFont, 0, 0, 0, 1);
259 sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,1);
260 sizeLayout2->addWidget(sizeIsRelativeCheckBox, 2, 0, Qt::AlignLeft);
261 TQWhatsThis::add( sizeIsRelativeCheckBox, sizeIsRelativeCBWhatsThisText );
262 TQToolTip::add( sizeIsRelativeCheckBox, sizeIsRelativeCBToolTipText );
265 sizeIsRelativeCheckBox = 0L;
267 gridLayout->addLayout(sizeLayout2, row, 2);
268 sizeLayout2->addWidget( sizeOfFont, 0, 0);
269 sizeLayout2->addMultiCellWidget(sizeListBox, 1,1, 0,0);
271 TQString fontSizeWhatsThisText =
272 i18n(
"Here you can choose the font size to be used." );
273 TQWhatsThis::add( sizeListBox, fontSizeWhatsThisText );
274 TQWhatsThis::add( diff?(TQWidget *)sizeCheckbox:(TQWidget *)sizeLabel, fontSizeWhatsThisText );
277 sizeListBox->setMinimumWidth( minimumListWidth(sizeListBox) +
278 sizeListBox->fontMetrics().maxWidth() );
279 sizeListBox->setMinimumHeight(
280 minimumListHeight( sizeListBox, visibleListSize ) );
282 connect( sizeOfFont, TQT_SIGNAL( valueChanged(
int) ),
283 TQT_SLOT(size_value_slot(
int)));
285 connect( sizeListBox, TQT_SIGNAL(highlighted(
const TQString&)),
286 TQT_SLOT(size_chosen_slot(
const TQString&)) );
287 sizeListBox->setSelected(sizeListBox->findItem(TQString::number(10)),
true);
292 sampleEdit =
new TQLineEdit( page,
"sampleEdit");
294 sampleEdit->setFont(tmpFont);
296 sampleEdit->setText(i18n(
"The Quick Brown Fox Jumps Over The Lazy Dog"));
297 sampleEdit->setMinimumHeight( sampleEdit->fontMetrics().lineSpacing() );
298 sampleEdit->setAlignment(Qt::AlignCenter);
299 gridLayout->addMultiCellWidget(sampleEdit, 4, 4, 0, 2);
300 TQString sampleEditWhatsThisText =
301 i18n(
"This sample text illustrates the current settings. "
302 "You may edit it to test special characters." );
303 TQWhatsThis::add( sampleEdit, sampleEditWhatsThisText );
305 TQT_SLOT(displaySample(
const TQFont &)));
310 page =
new TQGroupBox( i18n(
"Actual Font"),
this );
311 topLayout->addWidget(page);
313 vbox->addSpacing( fontMetrics().lineSpacing() );
317 page =
new TQWidget(
this );
318 topLayout->addWidget(page);
320 TQLabel *label =
new TQLabel( i18n(
"Actual Font"), page );
321 vbox->addWidget( label );
324 xlfdEdit =
new TQLineEdit( page,
"xlfdEdit" );
325 vbox->addWidget( xlfdEdit );
330 if( sizeIsRelativeState && sizeIsRelativeCheckBox )
335 showXLFDArea(config->
readBoolEntry(TQString::fromLatin1(
"fontSelectorShowXLFD"),
false));
343 void KFontChooser::fillSizeList() {
344 if(! sizeListBox)
return;
346 static const int c[] =
356 for(
int i = 0; c[i]; ++i)
358 sizeListBox->insertItem(TQString::number(c[i]));
364 d->m_palette.setColor( TQPalette::Active, TQColorGroup::Text, col );
365 TQPalette pal = sampleEdit->palette();
366 pal.setColor( TQPalette::Active, TQColorGroup::Text, col );
367 sampleEdit->setPalette( pal );
372 return d->m_palette.color( TQPalette::Active, TQColorGroup::Text );
377 d->m_palette.setColor( TQPalette::Active, TQColorGroup::Base, col );
378 TQPalette pal = sampleEdit->palette();
379 pal.setColor( TQPalette::Active, TQColorGroup::Base, col );
380 sampleEdit->setPalette( pal );
385 return d->m_palette.color( TQPalette::Active, TQColorGroup::Base );
391 if( sizeIsRelativeCheckBox ) {
392 if( TQButton::NoChange == relative )
393 sizeIsRelativeCheckBox->setNoChange();
395 sizeIsRelativeCheckBox->setChecked( TQButton::On == relative );
401 return sizeIsRelativeCheckBox
402 ? sizeIsRelativeCheckBox->state()
403 : TQButton::NoChange;
408 return minimumSizeHint();
414 if( column & FamilyList )
416 familyListBox->setEnabled(state);
418 if( column & StyleList )
420 styleListBox->setEnabled(state);
422 if( column & SizeList )
424 sizeListBox->setEnabled(state);
432 selectedSize=aFont.pointSize();
433 if (selectedSize == -1)
434 selectedSize = TQFontInfo(aFont).pointSize();
436 if( onlyFixed != usingFixed)
438 usingFixed = onlyFixed;
439 fillFamilyListBox(usingFixed);
442 displaySample(selFont);
448 if (familyCheckbox && styleCheckbox && sizeCheckbox) {
449 diffFlags = (int)(familyCheckbox->isChecked() ? FontDiffFamily : 0)
450 | (
int)( styleCheckbox->isChecked() ? FontDiffStyle : 0)
451 | (
int)( sizeCheckbox->isChecked() ? FontDiffSize : 0);
456 void KFontChooser::toggled_checkbox()
458 familyListBox->setEnabled( familyCheckbox->isChecked() );
459 styleListBox->setEnabled( styleCheckbox->isChecked() );
460 sizeListBox->setEnabled( sizeCheckbox->isChecked() );
461 sizeOfFont->setEnabled( sizeCheckbox->isChecked() );
464 void KFontChooser::family_chosen_slot(
const TQString& family)
466 TQFontDatabase dbase;
467 TQStringList styles = TQStringList(dbase.styles(family));
468 styleListBox->clear();
469 currentStyles.clear();
470 for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
471 TQString style = *it;
472 int pos = style.find(
"Plain");
473 if(pos >=0) style = style.replace(pos,5,i18n(
"Regular"));
474 pos = style.find(
"Normal");
475 if(pos >=0) style = style.replace(pos,6,i18n(
"Regular"));
476 pos = style.find(
"Oblique");
477 if(pos >=0) style = style.replace(pos,7,i18n(
"Italic"));
478 if(!styleListBox->findItem(style)) {
479 styleListBox->insertItem(i18n(style.utf8()));
480 currentStyles.insert(i18n(style.utf8()), *it);
483 if(styleListBox->count()==0) {
484 styleListBox->insertItem(i18n(
"Regular"));
485 currentStyles.insert(i18n(
"Regular"),
"Normal");
488 styleListBox->blockSignals(
true);
489 TQListBoxItem *item = styleListBox->findItem(selectedStyle);
491 styleListBox->setSelected(styleListBox->findItem(selectedStyle),
true);
493 styleListBox->setSelected(0,
true);
494 styleListBox->blockSignals(
false);
496 style_chosen_slot(TQString::null);
499 void KFontChooser::size_chosen_slot(
const TQString& size){
501 selectedSize=size.toInt();
503 selFont.setPointSize(selectedSize);
507 void KFontChooser::size_value_slot(
int val) {
508 selFont.setPointSize(val);
512 void KFontChooser::style_chosen_slot(
const TQString& style)
514 TQString currentStyle;
516 currentStyle = styleListBox->currentText();
518 currentStyle = style;
522 sizeListBox->clear();
523 TQFontDatabase dbase;
524 if(dbase.isSmoothlyScalable(familyListBox->currentText(), currentStyles[currentStyle])) {
529 TQValueList<int> sizes = dbase.smoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
530 if(sizes.count() > 0) {
531 TQValueList<int>::iterator it;
533 for ( it = sizes.begin(); it != sizes.end(); ++it ) {
534 if(*it <= selectedSize || diff > *it - selectedSize) diff = selectedSize - *it;
535 sizeListBox->insertItem(TQString::number(*it));
540 sizeListBox->blockSignals(
true);
541 sizeListBox->setSelected(sizeListBox->findItem(TQString::number(selectedSize)),
true);
542 sizeListBox->blockSignals(
false);
543 sizeListBox->ensureCurrentVisible();
546 selFont = dbase.font(familyListBox->currentText(), currentStyles[currentStyle], selectedSize-diff);
548 if (!style.isEmpty())
549 selectedStyle = style;
552 void KFontChooser::displaySample(
const TQFont& font)
554 sampleEdit->setFont(font);
555 sampleEdit->setCursorPosition(0);
556 xlfdEdit->setText(font.rawName());
557 xlfdEdit->setCursorPosition(0);
564 void KFontChooser::setupDisplay()
568 TQString family = TQString(selFont.family()).lower();
569 int style = (selFont.bold() ? 2 : 0) + (selFont.italic() ? 1 : 0);
570 int size = selFont.pointSize();
572 size = TQFontInfo(selFont).pointSize();
573 TQString sizeStr = TQString::number(size);
577 numEntries = familyListBox->count();
578 for (i = 0; i < numEntries; i++) {
579 if (family == familyListBox->text(i).lower()) {
580 familyListBox->setCurrentItem(i);
586 if ( (i == numEntries) )
588 if (family.contains(
'['))
590 family = family.left(family.find(
'[')).stripWhiteSpace();
591 for (i = 0; i < numEntries; i++) {
592 if (family == familyListBox->text(i).lower()) {
593 familyListBox->setCurrentItem(i);
601 if ( (i == numEntries) )
603 TQString fallback = family+
" [";
604 for (i = 0; i < numEntries; i++) {
605 if (familyListBox->text(i).lower().startsWith(fallback)) {
606 familyListBox->setCurrentItem(i);
613 if ( (i == numEntries) )
615 for (i = 0; i < numEntries; i++) {
616 if (familyListBox->text(i).lower().startsWith(family)) {
617 familyListBox->setCurrentItem(i);
624 if ( i == numEntries )
625 familyListBox->setCurrentItem( 0 );
627 styleListBox->setCurrentItem(style);
629 numEntries = sizeListBox->count();
630 for (i = 0; i < numEntries; i++){
631 if (sizeStr == sizeListBox->text(i)) {
632 sizeListBox->setCurrentItem(i);
643 TQFontDatabase dbase;
644 TQStringList lstSys(dbase.families());
647 if (fontListCriteria)
649 TQStringList lstFonts;
650 for (TQStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
652 if ((fontListCriteria & FixedWidthFonts) > 0 && !dbase.isFixedPitch(*it))
continue;
653 if (((fontListCriteria & (SmoothScalableFonts | ScalableFonts)) == ScalableFonts) &&
654 !dbase.isBitmapScalable(*it))
continue;
655 if ((fontListCriteria & SmoothScalableFonts) > 0 && !dbase.isSmoothlyScalable(*it))
continue;
656 lstFonts.append(*it);
659 if((fontListCriteria & FixedWidthFonts) > 0) {
662 if (lstFonts.count() == 0)
663 lstFonts.append(
"fixed");
674 void KFontChooser::addFont( TQStringList &list,
const char *xfont )
676 const char *ptr = strchr( xfont,
'-' );
680 ptr = strchr( ptr + 1,
'-' );
684 TQString font = TQString::fromLatin1(ptr + 1);
687 if ( ( pos = font.find(
'-' ) ) > 0 ) {
688 font.truncate( pos );
690 if ( font.find( TQString::fromLatin1(
"open look"), 0,
false ) >= 0 )
693 TQStringList::Iterator it = list.begin();
695 for ( ; it != list.end(); ++it )
702 void KFontChooser::fillFamilyListBox(
bool onlyFixedFonts)
704 TQStringList fontList;
705 getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
706 familyListBox->clear();
707 familyListBox->insertStringList(fontList);
710 void KFontChooser::showXLFDArea(
bool show)
714 xlfdEdit->parentWidget()->show();
718 xlfdEdit->parentWidget()->hide();
725 bool onlyFixed,
bool modal,
726 const TQStringList &fontList,
bool makeFrame,
bool diff,
727 TQButton::ToggleState *sizeIsRelativeState )
728 :
KDialogBase( parent, name, modal, i18n(
"Select Font"), Ok|Cancel, Ok )
731 onlyFixed, fontList, makeFrame, 8,
732 diff, sizeIsRelativeState );
738 TQWidget *parent,
bool makeFrame,
739 TQButton::ToggleState *sizeIsRelativeState )
741 KFontDialog dlg( parent,
"Font Selector", onlyFixed,
true, TQStringList(),
742 makeFrame,
true, sizeIsRelativeState );
743 dlg.
setFont( theFont, onlyFixed );
745 int result = dlg.exec();
746 if( result == Accepted )
748 theFont = dlg.chooser->font();
750 if( sizeIsRelativeState )
757 TQWidget *parent,
bool makeFrame,
758 TQButton::ToggleState *sizeIsRelativeState )
760 KFontDialog dlg( parent,
"Font Selector", onlyFixed,
true, TQStringList(),
761 makeFrame,
false, sizeIsRelativeState );
762 dlg.
setFont( theFont, onlyFixed );
764 int result = dlg.exec();
765 if( result == Accepted )
767 theFont = dlg.chooser->font();
768 if( sizeIsRelativeState )
776 bool onlyFixed, TQWidget *parent,
778 TQButton::ToggleState *sizeIsRelativeState )
780 KFontDialog dlg( parent,
"Font and Text Selector", onlyFixed,
true,
781 TQStringList(), makeFrame,
false, sizeIsRelativeState );
782 dlg.
setFont( theFont, onlyFixed );
784 int result = dlg.exec();
785 if( result == Accepted )
787 theFont = dlg.chooser->font();
789 if( sizeIsRelativeState )
795 void KFontChooser::virtual_hook(
int,
void* )
798 void KFontDialog::virtual_hook(
int id,
void* data )
799 { KDialogBase::virtual_hook(
id, data ); }
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
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...
void fontSelected(const TQFont &font)
Emitted whenever the selected font changes.
KFontChooser(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.
void setSizeIsRelative(TQButton::ToggleState relative)
Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size...
void setBackgroundColor(const TQColor &col)
Sets the background color to use in the preview.
TQString sampleText() const
TQButton::ToggleState sizeIsRelative() const
virtual ~KFontChooser()
Destructs the font chooser.
void setColor(const TQColor &col)
Sets the color to use in the preview.
TQColor backgroundColor() const
void enableColumn(int column, bool state)
Enables or disable a font column in the chooser.
virtual TQSize sizeHint(void) const
Reimplemented for internal reasons.
static void getFontList(TQStringList &list, uint fontListCriteria)
Creates a list of font strings.
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the chooser.
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 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...
KFontDialog(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 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,...
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the dialog.
static TQFont generalFont()
static KConfig * config()
A variant of TQListBox that honors KDE's system-wide settings.