Source Code (Use browser search to find items of interest.)
Class Index
kpresenter'KEnumListDia (./koffice/kpresenter/kenumlistdia.h:44)
class KEnumListDia : public QDialog
{
Q_OBJECT
public:
static const int NUMBER = 1;
static const int ALPHABETH = 2;
// constructor - destructor
KEnumListDia( QWidget*, const char*, int, QFont, QColor, QString, QString, int, QStringList );
~KEnumListDia();
// show enum list dialog
static bool enumListDia( int&, QFont&, QColor&, QString&, QString&, int&, QStringList );
// return values
int type() {return _type; }
QFont font() {return _font; }
QColor color() {return _color; }
QString before() {return _before; }
QString after() {return _after; }
int start() {return _start; }
protected:
// dialog objects
QGridLayout *grid;
QLabel *lFont, *lSize, *lColor, *lAttrib, *lBefore, *lAfter, *lStart;
QLineEdit *eBefore, *eAfter, *eStart;
QComboBox *fontCombo, *sizeCombo;
KColorButton *colorButton;
QCheckBox *bold, *italic, *underl;
QRadioButton *number, *alphabeth;
KButtonBox *bbox;
QPushButton *bOk, *bCancel;
// values
int _type;
QFont _font;
QColor _color;
QString _before;
QString _after;
int _start;
QStringList fontList;
protected slots:
void fontSelected( const QString & );
void sizeSelected( int );
void colorChanged( const QColor& );
void boldChanged();
void italicChanged();
void underlChanged();
void beforeChanged( const QString & );
void afterChanged( const QString & );
void startChanged( const QString & );
void numChanged();
void alphaChanged();
};
kpresenter'KEnumListDia::KEnumListDia() (./koffice/kpresenter/kenumlistdia.cc:46)
KEnumListDia::KEnumListDia( QWidget* parent, const char* name, int __type, QFont __font,
QColor __color, QString __before, QString __after, int __start, QStringList _fontList )
: QDialog( parent, name, true )
{
_type = __type;
_font = __font;
_color = __color;
_before = __before;
_after = __after;
_start = __start;
setCaption( "Configure the list" );
grid = new QGridLayout( this, 8, 5, 15, 7 );
fontList = _fontList;
lFont = new QLabel( "Font:", this );
lFont->resize( lFont->sizeHint() );
grid->addWidget( lFont, 0, 0 );
fontCombo = new QComboBox( false, this );
fontCombo->insertStringList( fontList );
fontCombo->resize( fontCombo->sizeHint() );
QValueList<QString>::Iterator it = fontList.find( _font.family().lower() );
if ( it != fontList.end() )
{
int pos = 0;
QValueList<QString>::Iterator it2 = fontList.begin();
for ( ; it != it2; ++it2, ++pos );
fontCombo->setCurrentItem( pos );
}
grid->addMultiCellWidget( fontCombo, 1, 1, 0, 2 );
connect( fontCombo, SIGNAL( activated( const QString & ) ), this, SLOT( fontSelected( const QString & ) ) );
lSize = new QLabel( "Size:", this );
lSize->resize( lSize->sizeHint() );
grid->addWidget( lSize, 0, 3 );
sizeCombo = new QComboBox( false, this );
char chr[ 5 ];
for ( unsigned int i = 4; i <= 100; i++ )
{
sprintf( chr, "%d", i );
sizeCombo->insertItem( chr, -1 );
}
sizeCombo->resize( sizeCombo->sizeHint() );
grid->addWidget( sizeCombo, 1, 3 );
sizeCombo->setCurrentItem( _font.pointSize()-4 );
connect( sizeCombo, SIGNAL( activated( int ) ), this, SLOT( sizeSelected( int ) ) );
lColor = new QLabel( "Color:", this );
lColor->resize( lColor->sizeHint() );
grid->addWidget( lColor, 0, 4 );
colorButton = new KColorButton( _color, this );
colorButton->resize( colorButton->sizeHint() );
grid->addWidget( colorButton, 1, 4 );
connect( colorButton, SIGNAL( changed( const QColor& ) ), this, SLOT( colorChanged( const QColor& ) ) );
lAttrib = new QLabel( "Attributes:", this );
lAttrib->resize( lAttrib->sizeHint() );
grid->addMultiCellWidget( lAttrib, 2, 2, 0, 2 );
bold = new QCheckBox( "Bold", this );
bold->resize( bold->sizeHint() );
grid->addWidget( bold, 3, 0 );
bold->setChecked( _font.bold() );
connect( bold, SIGNAL( clicked() ), this, SLOT( boldChanged() ) );
italic= new QCheckBox( "Italic", this );
italic->resize( italic->sizeHint() );
grid->addWidget( italic, 3, 1 );
italic->setChecked( _font.italic() );
connect( italic, SIGNAL( clicked() ), this, SLOT( italicChanged() ) );
underl = new QCheckBox( "Underlined", this );
underl->resize( underl->sizeHint() );
grid->addWidget( underl, 3, 2 );
underl->setChecked( _font.underline() );
connect( underl, SIGNAL( clicked() ), this, SLOT( underlChanged() ) );
lBefore = new QLabel( "Before:", this );
lBefore->resize( lBefore->sizeHint() );
grid->addWidget( lBefore, 4, 0 );
eBefore = new QLineEdit( this );
eBefore->resize( lBefore->width(), eBefore->sizeHint().height() );
eBefore->setMaxLength( 4 );
eBefore->setText( _before.data() );
grid->addWidget( eBefore, 5, 0 );
connect( eBefore, SIGNAL( textChanged( const QString & ) ), this, SLOT( beforeChanged( const QString & ) ) );
lAfter = new QLabel( "After:", this );
lAfter->resize( lAfter->sizeHint() );
grid->addWidget( lAfter, 4, 1 );
eAfter = new QLineEdit( this );
eAfter->resize( lAfter->width(), eAfter->sizeHint().height() );
eAfter->setMaxLength( 4 );
eAfter->setText( _after.data() );
grid->addWidget( eAfter, 5, 1 );
connect( eAfter, SIGNAL( textChanged( const QString & ) ), this, SLOT( afterChanged( const QString & ) ) );
lStart = new QLabel( "Start:", this );
lStart->resize( lStart->sizeHint() );
grid->addWidget( lStart, 4, 2 );
eStart = new QLineEdit( this );
eStart->resize( lStart->width(), eStart->sizeHint().height() );
eStart->setMaxLength( 1 );
if ( _type == 1 )
sprintf( chr, "%d", _start );
else
sprintf( chr, "%c", _start );
eStart->setText( chr );
grid->addWidget( eStart, 5, 2 );
connect( eStart, SIGNAL( textChanged( const QString & ) ), this, SLOT( startChanged( const QString & ) ) );
_start = QChar( eStart->text()[ 0 ] );
number = new QRadioButton( "Numeric", this );
number->resize( number->sizeHint() );
grid->addWidget( number, 4, 4 );
connect( number, SIGNAL( clicked() ), this, SLOT( numChanged() ) );
alphabeth = new QRadioButton( "Alphabethic", this );
alphabeth->resize( alphabeth->sizeHint() );
grid->addWidget( alphabeth, 5, 4 );
connect( alphabeth, SIGNAL( clicked() ), this, SLOT( alphaChanged() ) );
if ( _type == NUMBER )
number->setChecked( true );
else
alphabeth->setChecked( true );
bbox = new KButtonBox( this, KButtonBox::HORIZONTAL, 7 );
bbox->addStretch( 20 );
bOk = bbox->addButton( "OK" );
bOk->setAutoRepeat( false );
bOk->setAutoResize( false );
bOk->setAutoDefault( true );
bOk->setDefault( true );
connect( bOk, SIGNAL( clicked() ), SLOT( accept() ) );
bCancel = bbox->addButton( "Cancel" );
connect( bCancel, SIGNAL( clicked() ), SLOT( reject() ) );
bbox->layout();
grid->addWidget( bbox, 7, 4 );
}
/*========================= destructor ===========================*/
kpresenter'KEnumListDia::~KEnumListDia() (./koffice/kpresenter/kenumlistdia.cc:196)
KEnumListDia::~KEnumListDia()
{
}
/*====================== show enum list dialog ===================*/
kpresenter'KEnumListDia::enumListDia() (./koffice/kpresenter/kenumlistdia.cc:201)
bool KEnumListDia::enumListDia( int& __type, QFont& __font, QColor& __color,
QString& __before, QString& __after, int& __start, QStringList _fontList )
{
bool res = false;
KEnumListDia *dlg = new KEnumListDia( 0, "EnumListDia", __type, __font, __color,
__before, __after, __start, _fontList );
if ( dlg->exec() == QDialog::Accepted )
{
__type = dlg->type();
__font = dlg->font();
__color = dlg->color();
__before = dlg->before();
__after = dlg->after();
__start = dlg->start();
if ( __type == 1 ) __start -= 48;
res = true;
}
delete dlg;
return res;
}
/*=========================== Font selected =====================*/
kpresenter'KEnumListDia::fontSelected() (./koffice/kpresenter/kenumlistdia.cc:227)
void KEnumListDia::fontSelected( const QString &_family )
{
_font.setFamily( _family.lower() );
}
/*===================== size selected ===========================*/
kpresenter'KEnumListDia::sizeSelected() (./koffice/kpresenter/kenumlistdia.cc:233)
void KEnumListDia::sizeSelected( int i )
{
_font.setPointSize( i+4 );
}
/*===================== color selected ==========================*/
kpresenter'KEnumListDia::colorChanged() (./koffice/kpresenter/kenumlistdia.cc:239)
void KEnumListDia::colorChanged( const QColor& __color )
{
_color = __color;
}
/*====================== bold clicked ===========================*/
kpresenter'KEnumListDia::boldChanged() (./koffice/kpresenter/kenumlistdia.cc:245)
void KEnumListDia::boldChanged()
{
_font.setBold( bold->isChecked() );
}
/*====================== italic clicked =========================*/
kpresenter'KEnumListDia::italicChanged() (./koffice/kpresenter/kenumlistdia.cc:251)
void KEnumListDia::italicChanged()
{
_font.setItalic( italic->isChecked() );
}
/*====================== underline clicked ======================*/
kpresenter'KEnumListDia::underlChanged() (./koffice/kpresenter/kenumlistdia.cc:257)
void KEnumListDia::underlChanged()
{
_font.setUnderline( underl->isChecked() );
}
/*======================= before changed ========================*/
kpresenter'KEnumListDia::beforeChanged() (./koffice/kpresenter/kenumlistdia.cc:263)
void KEnumListDia::beforeChanged( const QString & str )
{
_before = str;
}
/*======================= after changed =========================*/
kpresenter'KEnumListDia::afterChanged() (./koffice/kpresenter/kenumlistdia.cc:269)
void KEnumListDia::afterChanged( const QString & str )
{
_after = str;
}
/*======================= start changed =========================*/
kpresenter'KEnumListDia::startChanged() (./koffice/kpresenter/kenumlistdia.cc:276)
void KEnumListDia::startChanged( const QString & str )
{
_start = str[ 0 ];
}
/*======================== rb number changed ====================*/
kpresenter'KEnumListDia::numChanged() (./koffice/kpresenter/kenumlistdia.cc:282)
void KEnumListDia::numChanged()
{
_type = 1;
alphabeth->setChecked( false );
}
/*======================== rb alphabeth changed =================*/
kpresenter'KEnumListDia::alphaChanged() (./koffice/kpresenter/kenumlistdia.cc:289)
void KEnumListDia::alphaChanged()
{
_type = 2;
number->setChecked( false );
}