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, Qt::black);
89 m_palette.setColor(TQPalette::Active, TQColorGroup::Base, Qt::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, TQT_SIGNAL(toggled(
bool)), TQT_SLOT(toggled_checkbox()));
135 familyLayout->addWidget(familyCheckbox, 0, Qt::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, Qt::AlignLeft);
148 gridLayout->addLayout(familyLayout, row, 0 );
150 TQHBoxLayout *styleLayout =
new TQHBoxLayout();
152 styleCheckbox =
new TQCheckBox(i18n(
"Font style"), page);
153 connect(styleCheckbox, TQT_SIGNAL(toggled(
bool)), TQT_SLOT(toggled_checkbox()));
154 styleLayout->addWidget(styleCheckbox, 0, Qt::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, Qt::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, TQT_SIGNAL(toggled(
bool)), TQT_SLOT(toggled_checkbox()));
174 sizeLayout->addWidget(sizeCheckbox, 0, Qt::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, Qt::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, TQT_SIGNAL(highlighted(
const TQString &)),
204 TQT_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, TQT_SIGNAL(highlighted(
const TQString &)),
234 TQT_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, Qt::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, TQT_SIGNAL( valueChanged(
int) ),
284 TQT_SLOT(size_value_slot(
int)));
286 connect( sizeListBox, TQT_SIGNAL(highlighted(
const TQString&)),
287 TQT_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(Qt::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 TQT_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")
469 .replace(
"Normal",
"Regular")
470 .replace(
"Oblique",
"Italic")
474 void TDEFontChooser::family_chosen_slot(
const TQString& family)
476 TQFontDatabase dbase;
477 TQStringList styles = dbase.styles(family);
478 styleListBox->clear();
479 currentStyles.clear();
480 for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
481 TQString style = style_name(*it);
482 if(!styleListBox->findItem(style)) {
483 styleListBox->insertItem(style);
484 currentStyles.insert(style, *it);
487 if(styleListBox->count()==0) {
488 styleListBox->insertItem(i18n(
"Regular"));
489 currentStyles.insert(i18n(
"Regular"),
"Normal");
492 styleListBox->blockSignals(
true);
493 TQListBoxItem *item = styleListBox->findItem(selectedStyle);
495 styleListBox->setSelected(styleListBox->findItem(selectedStyle),
true);
497 styleListBox->setSelected(0,
true);
498 styleListBox->blockSignals(
false);
500 style_chosen_slot(TQString::null);
503 void TDEFontChooser::size_chosen_slot(
const TQString& size){
505 selectedSize=size.toInt();
507 selFont.setPointSize(selectedSize);
511 void TDEFontChooser::size_value_slot(
int val) {
512 selFont.setPointSize(val);
516 void TDEFontChooser::style_chosen_slot(
const TQString& style)
518 TQString currentStyle;
520 currentStyle = styleListBox->currentText();
522 currentStyle = style;
526 sizeListBox->clear();
527 TQFontDatabase dbase;
528 if(dbase.isSmoothlyScalable(familyListBox->currentText(), currentStyles[currentStyle])) {
533 TQValueList<int> sizes = dbase.smoothSizes(familyListBox->currentText(), currentStyles[currentStyle]);
534 if(sizes.count() > 0) {
535 TQValueList<int>::iterator it;
537 for ( it = sizes.begin(); it != sizes.end(); ++it ) {
538 if(*it <= selectedSize || diff > *it - selectedSize) diff = selectedSize - *it;
539 sizeListBox->insertItem(TQString::number(*it));
544 sizeListBox->blockSignals(
true);
545 sizeListBox->setSelected(sizeListBox->findItem(TQString::number(selectedSize)),
true);
546 sizeListBox->blockSignals(
false);
547 sizeListBox->ensureCurrentVisible();
550 selFont = dbase.font(familyListBox->currentText(), currentStyles[currentStyle], selectedSize-diff);
552 if (!style.isEmpty())
553 selectedStyle = style;
556 void TDEFontChooser::displaySample(
const TQFont&
font)
558 sampleEdit->setFont(font);
559 sampleEdit->setCursorPosition(0);
560 xlfdEdit->setText(font.rawName());
561 xlfdEdit->setCursorPosition(0);
568 void TDEFontChooser::setupDisplay()
572 TQFontDatabase dbase;
573 TQString family = TQString(selFont.family()).lower();
574 TQString style = style_name(dbase.styleString(selFont));
575 int size = selFont.pointSize();
577 size = TQFontInfo(selFont).pointSize();
578 TQString sizeStr = TQString::number(size);
582 numEntries = familyListBox->count();
583 for (i = 0; i < numEntries; i++) {
584 if (family == familyListBox->text(i).lower()) {
585 familyListBox->setCurrentItem(i);
591 if ( (i == numEntries) )
593 if (family.contains(
'['))
595 family = family.left(family.find(
'[')).stripWhiteSpace();
596 for (i = 0; i < numEntries; i++) {
597 if (family == familyListBox->text(i).lower()) {
598 familyListBox->setCurrentItem(i);
606 if ( (i == numEntries) )
608 TQString fallback = family+
" [";
609 for (i = 0; i < numEntries; i++) {
610 if (familyListBox->text(i).lower().startsWith(fallback)) {
611 familyListBox->setCurrentItem(i);
618 if ( (i == numEntries) )
620 for (i = 0; i < numEntries; i++) {
621 if (familyListBox->text(i).lower().startsWith(family)) {
622 familyListBox->setCurrentItem(i);
629 if ( i == numEntries )
630 familyListBox->setCurrentItem( 0 );
633 for (
int i = 0; i < (int)styleListBox->count(); ++i)
635 if (styleListBox->text(i) == style)
641 styleListBox->setCurrentItem(item);
643 numEntries = sizeListBox->count();
644 for (i = 0; i < numEntries; i++){
645 if (sizeStr == sizeListBox->text(i)) {
646 sizeListBox->setCurrentItem(i);
657 TQFontDatabase dbase;
658 TQStringList lstSys(dbase.families());
661 if (fontListCriteria)
663 TQStringList lstFonts;
664 for (TQStringList::Iterator it = lstSys.begin(); it != lstSys.end(); ++it)
666 if ((fontListCriteria & FixedWidthFonts) > 0 && !dbase.isFixedPitch(*it))
continue;
667 if (((fontListCriteria & (SmoothScalableFonts | ScalableFonts)) == ScalableFonts) &&
668 !dbase.isBitmapScalable(*it))
continue;
669 if ((fontListCriteria & SmoothScalableFonts) > 0 && !dbase.isSmoothlyScalable(*it))
continue;
670 lstFonts.append(*it);
673 if((fontListCriteria & FixedWidthFonts) > 0) {
676 if (lstFonts.count() == 0)
677 lstFonts.append(
"fixed");
688 void TDEFontChooser::addFont( TQStringList &list,
const char *xfont )
690 const char *ptr = strchr( xfont,
'-' );
694 ptr = strchr( ptr + 1,
'-' );
698 TQString font = TQString::fromLatin1(ptr + 1);
701 if ( ( pos = font.find(
'-' ) ) > 0 ) {
702 font.truncate( pos );
704 if ( font.find( TQString::fromLatin1(
"open look"), 0,
false ) >= 0 )
707 TQStringList::Iterator it = list.begin();
709 for ( ; it != list.end(); ++it )
716 void TDEFontChooser::fillFamilyListBox(
bool onlyFixedFonts)
718 TQStringList fontList;
719 getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
720 familyListBox->clear();
721 familyListBox->insertStringList(fontList);
724 void TDEFontChooser::showXLFDArea(
bool show)
728 xlfdEdit->parentWidget()->show();
732 xlfdEdit->parentWidget()->hide();
739 bool onlyFixed,
bool modal,
740 const TQStringList &fontList,
bool makeFrame,
bool diff,
741 TQButton::ToggleState *sizeIsRelativeState )
742 :
KDialogBase( parent, name, modal, i18n(
"Select Font"), Ok|Cancel, Ok )
745 onlyFixed, fontList, makeFrame, 8,
746 diff, sizeIsRelativeState );
752 TQWidget *parent,
bool makeFrame,
753 TQButton::ToggleState *sizeIsRelativeState )
755 TDEFontDialog dlg( parent,
"Font Selector", onlyFixed,
true, TQStringList(),
756 makeFrame,
true, sizeIsRelativeState );
757 dlg.
setFont( theFont, onlyFixed );
759 int result = dlg.exec();
760 if( result == Accepted )
762 theFont = dlg.chooser->
font();
764 if( sizeIsRelativeState )
771 TQWidget *parent,
bool makeFrame,
772 TQButton::ToggleState *sizeIsRelativeState )
774 TDEFontDialog dlg( parent,
"Font Selector", onlyFixed,
true, TQStringList(),
775 makeFrame,
false, sizeIsRelativeState );
776 dlg.
setFont( theFont, onlyFixed );
778 int result = dlg.exec();
779 if( result == Accepted )
781 theFont = dlg.chooser->
font();
782 if( sizeIsRelativeState )
790 bool onlyFixed, TQWidget *parent,
792 TQButton::ToggleState *sizeIsRelativeState )
794 TDEFontDialog dlg( parent,
"Font and Text Selector", onlyFixed,
true,
795 TQStringList(), makeFrame,
false, sizeIsRelativeState );
796 dlg.
setFont( theFont, onlyFixed );
798 int result = dlg.exec();
799 if( result == Accepted )
801 theFont = dlg.chooser->
font();
803 if( sizeIsRelativeState )
809 void TDEFontChooser::virtual_hook(
int,
void* )
812 void TDEFontDialog::virtual_hook(
int id,
void* data )
813 { KDialogBase::virtual_hook(
id, data ); }
static int marginHint()
Return the number of pixels you shall use between a dialog edge and the outermost widget(s) according...
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...
static void getFontList(TQStringList &list, uint fontListCriteria)
Creates a list of font strings.
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.
A dialog base class with standard buttons and predefined layouts.
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the chooser.
TQButton::ToggleState sizeIsRelative() const
TQColor backgroundColor() const
void setColor(const TQColor &col)
Sets the color to use in the preview.
static int spacingHint()
Return the number of pixels you shall use between widgets inside a dialog according to the KDE standa...
void setMainWidget(TQWidget *widget)
Sets the main user definable widget.
static TQFont generalFont()
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...
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
virtual ~TDEFontChooser()
Destructs the font chooser.
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.
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...
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...
virtual TQSize sizeHint(void) const
Reimplemented for internal reasons.
TQString sampleText() const
void setBackgroundColor(const TQColor &col)
Sets the background color to use in the preview.
static TDEConfig * config()
A variant of TQListBox that honors KDE's system-wide settings.
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the dialog.
void fontSelected(const TQFont &font)
Emitted whenever the selected font changes.