20#include "KoCharSelectDia.h"
21#include "KoCharSelectDia.moc"
26#include <kcharselect.h>
32KoCharSelectDia::KoCharSelectDia( TQWidget *parent,
const char *name,
const TQChar &_chr,
const TQString &_font,
bool _enableFont ,
bool _modal)
33 :
KDialogBase( Plain, i18n(
"Select Character"), Ok | Cancel, Ok , parent,
name, _modal )
35 initDialog(_chr,_font,_enableFont);
38 okItem.setText( i18n(
"&Insert") );
39 okItem.setWhatsThis( i18n(
"Insert the selected character in the text") );
40 setButtonOK( okItem );
43KoCharSelectDia::KoCharSelectDia( TQWidget *parent,
const char *name,
const TQString &_font,
const TQChar &_chr,
bool _modal )
44 :
KDialogBase( Plain, i18n(
"Select Character"), User1 | Close, User1 , parent,
name, _modal )
46 initDialog(_chr,_font,
true);
48 setButtonText( User1, i18n(
"&Insert") );
49 setButtonTip( User1, i18n(
"Insert the selected character in the text") );
53void KoCharSelectDia::initDialog(
const TQChar &_chr,
const TQString &_font,
bool )
55 TQWidget *page = plainPage();
59 charSelect =
new KCharSelect( page,
"", _font, _chr );
60 connect(charSelect, TQ_SIGNAL(doubleClicked()),
this, TQ_SLOT(slotDoubleClicked()));
61 charSelect->resize( charSelect->sizeHint() );
62 charSelect->enableFontCombo(
true );
63 grid->addWidget( charSelect, 0, 0 );
65 grid->addColSpacing( 0, charSelect->width() );
66 grid->addRowSpacing( 0, charSelect->height() );
67 grid->setRowStretch( 0, 0 );
68 charSelect->setFocus();
71KoCharSelectDia::~KoCharSelectDia()
75void KoCharSelectDia::closeDialog()
80bool KoCharSelectDia::selectChar( TQString &_font, TQChar &_chr,
bool _enableFont, TQWidget* parent,
const char* name )
84 KoCharSelectDia *dlg =
new KoCharSelectDia( parent, name, _chr, _font, _enableFont );
86 if ( dlg->exec() == Accepted )
98TQChar KoCharSelectDia::chr()
const
100 return charSelect->chr();
103TQString KoCharSelectDia::font()
const
105 return charSelect->font();
108void KoCharSelectDia::slotUser1()
110 emit insertChar(chr(),font());
113void KoCharSelectDia::slotDoubleClicked()
115 emit insertChar(chr(),font());
const char * name(StdAction id)