Source Code (Use browser search to find items of interest.)

Class Index

kpresenter'ConfPieDia (./koffice/kpresenter/confpiedia.h:77)

class ConfPieDia : public QDialog
{
    Q_OBJECT

public:
    ConfPieDia( QWidget* parent, const char* );
    ~ConfPieDia();

    void setAngle( int _angle )
    { angle = _angle; QString str; str.sprintf( "%d", _angle ); eAngle->setText( str ); piePreview->setAngle( angle ); }
    void setLength( int _len )
    { len = _len; QString str; str.sprintf( "%d", _len ); eLen->setText( str ); piePreview->setLength( len ); }
    void setType( PieType _type )
    { type = _type; cType->setCurrentItem( _type ); piePreview->setType( type ); }
    void setPenBrush( QPen _pen, QBrush _brush )
    { pen = _pen; brush = _brush; piePreview->setPenBrush( pen, brush );  }

    int getAngle()
    { return angle; }
    int getLength()
    { return len; }
    PieType getType()
    { return type; }

protected:
    QLabel *lType, *lAngle, *lLen;
    QLineEdit *eAngle, *eLen;
    QGroupBox *gSettings, *gPreview;
    PiePreview *piePreview;
    QPushButton *okBut, *applyBut, *cancelBut;
    QComboBox *cType;

    int angle, len;
    PieType type;
    QPen pen;
    QBrush brush;

protected slots:
    void lengthChanged( const QString & );
    void angleChanged( const QString & );
    void typeChanged( int );
    void Apply() { emit confPieDiaOk(); }

signals:
    void confPieDiaOk();

};

kpresenter'ConfPieDia::ConfPieDia() (./koffice/kpresenter/confpiedia.cc:84)

ConfPieDia::ConfPieDia( QWidget* parent, const char* name )
    : QDialog( parent, name, true )
{
    gSettings = new QGroupBox( i18n( "Settings" ), this );
    gSettings->move( 20, 20 );

    lType = new QLabel( i18n( "Type:" ), gSettings );
    lType->resize( lType->sizeHint() );
    lType->move( 20, 25 );

    cType = new QComboBox( false, gSettings );
    cType->insertItem( i18n( "Pie" ), -1 );
    cType->insertItem( i18n( "Arc" ), -1 );
    cType->insertItem( i18n( "Chord" ), -1 );
    cType->resize( cType->sizeHint() );
    cType->move( lType->x() + lType->width() + 10, lType->y() );
    connect( cType, SIGNAL( activated( int ) ), this, SLOT( typeChanged( int ) ) );

    lType->move( lType->x(), lType->y() + ( cType->height() - lType->height() ) / 2 );

    lAngle = new QLabel( i18n( "Angle ( 0 .. 5760 = ( 0 * 16 ) .. ( 360 * 16 ) ):" ), gSettings );
    lAngle->resize( lAngle->sizeHint() );
    lAngle->move( lType->x(), cType->y() + cType->height() + 20 );

    eAngle = new QLineEdit( gSettings );
    eAngle->setValidator( new QIntValidator( eAngle ) );
    eAngle->resize( eAngle->sizeHint() );
    eAngle->move( lAngle->x(), lAngle->y() + lAngle->height() + 5 );
    connect( eAngle, SIGNAL( textChanged( const QString & ) ), this, SLOT( angleChanged( const QString & ) ) );

    lLen = new QLabel( i18n( "Length ( 0 .. 5760 = ( 0 * 16 ) .. ( 360 * 16 ) ):" ), gSettings );
    lLen->resize( lLen->sizeHint() );
    lLen->move( eAngle->x(), eAngle->y() + eAngle->height() + 20 );

    eLen = new QLineEdit( gSettings );
    eLen->setValidator( new QIntValidator( eLen ) );
    eLen->resize( eLen->sizeHint() );
    eLen->move( lLen->x(), lLen->y() + lLen->height() + 5 );
    connect( eLen, SIGNAL( textChanged( const QString & ) ), this, SLOT( lengthChanged( const QString & ) ) );

    gSettings->resize(max(max(max(max(cType->x() + cType->width(),lAngle->x() + lAngle->width()),eAngle->x() + eAngle->width()),
                              lLen->x() + lLen->width() ), eLen->x() + eLen->width() ) + 20,
                      eLen->y() + eLen->height() + 20 );

    gPreview = new QGroupBox( i18n( "Preview" ), this );
    gPreview->move( gSettings->x() + gSettings->width() + 20, 20 );
    gPreview->resize( gSettings->size() );

    piePreview = new PiePreview( gPreview, "preview" );
    piePreview->setGeometry( 10, 20, gPreview->width() - 20, gPreview->height() - 30 );

    cancelBut = new QPushButton( this, "BCancel" );
    cancelBut->setText( i18n( "Cancel" ) );

    applyBut = new QPushButton( this, "BApply" );
    applyBut->setText( i18n( "Apply" ) );

    okBut = new QPushButton( this, "BOK" );
    okBut->setText( i18n( "OK" ) );
    okBut->setAutoRepeat( false );
    okBut->setAutoResize( false );
    okBut->setAutoDefault( true );
    okBut->setDefault( true );

    int butW = max(cancelBut->sizeHint().width(),
                   max(applyBut->sizeHint().width(),okBut->sizeHint().width()));
    int butH = cancelBut->sizeHint().height();

    cancelBut->resize( butW, butH );
    applyBut->resize( butW, butH );
    okBut->resize( butW, butH );

    cancelBut->move( gPreview->x() + gPreview->width() - butW, gPreview->y() + gPreview->height() + 25 );
    applyBut->move( cancelBut->x() - 5 - applyBut->width(), cancelBut->y() );
    okBut->move( applyBut->x() - 10 - okBut->width(), cancelBut->y() );

    connect( okBut, SIGNAL( clicked() ), this, SLOT( Apply() ) );
    connect( applyBut, SIGNAL( clicked() ), this, SLOT( Apply() ) );
    connect( cancelBut, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( okBut, SIGNAL( clicked() ), this, SLOT( accept() ) );

    resize( gPreview->x() + gPreview->width() + 20, gPreview->y() + gPreview->height() + 20 + butH + 20 );
}

/*===================== destructor ===============================*/

kpresenter'ConfPieDia::~ConfPieDia() (./koffice/kpresenter/confpiedia.cc:169)

ConfPieDia::~ConfPieDia()
{
}

/*================================================================*/

kpresenter'ConfPieDia::lengthChanged() (./koffice/kpresenter/confpiedia.cc:174)

void ConfPieDia::lengthChanged( const QString & _len )
{
    len = atoi( _len );
    piePreview->setLength( len );
}

/*================================================================*/

kpresenter'ConfPieDia::angleChanged() (./koffice/kpresenter/confpiedia.cc:181)

void ConfPieDia::angleChanged( const QString & _angle )
{
    angle = atoi( _angle );
    piePreview->setAngle( angle );
}

/*================================================================*/

kpresenter'ConfPieDia::typeChanged() (./koffice/kpresenter/confpiedia.cc:188)

void ConfPieDia::typeChanged( int _type )
{
    type = static_cast<PieType>( _type );
    piePreview->setType( type );
}